Return-Path: X-Original-To: apmail-hawq-dev-archive@minotaur.apache.org Delivered-To: apmail-hawq-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1195C18DBA for ; Fri, 26 Feb 2016 08:46:53 +0000 (UTC) Received: (qmail 69341 invoked by uid 500); 26 Feb 2016 08:46:53 -0000 Delivered-To: apmail-hawq-dev-archive@hawq.apache.org Received: (qmail 69286 invoked by uid 500); 26 Feb 2016 08:46:53 -0000 Mailing-List: contact dev-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list dev@hawq.incubator.apache.org Received: (qmail 69274 invoked by uid 99); 26 Feb 2016 08:46:52 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2016 08:46:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3479FC093B for ; Fri, 26 Feb 2016 08:46:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.279 X-Spam-Level: * X-Spam-Status: No, score=1.279 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=pivotal-io.20150623.gappssmtp.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 8icEDOkW4i-F for ; Fri, 26 Feb 2016 08:46:50 +0000 (UTC) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 645535F1E3 for ; Fri, 26 Feb 2016 08:46:49 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id w80so1317791oiw.2 for ; Fri, 26 Feb 2016 00:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pivotal-io.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=4AB/AkROfYpZUEp+v1wddxFTRRBd856xf+0qROCyxBk=; b=sTqH1be5yoGFUSVRT3C3Wk4W4opFLXjVsw8Rv4Wh0EsP/wmZAMaaxDRCwW6cArQ1Ji tlt7A55Q8lMVHrDtl2ZX1ftPHRmYCEhmMKxojuo7LmnmMGY697uUwUuLGATgeQsUAePB 44PU7gIa9pTuHSV9mtMmuZs9UeCDpfDSL7LN84nZaKhGvVIlSvF5q3Za4kxr2GXe9ZR3 Mw4hCMeBT7yVgTF3IKpokPUegVvpwF12n9mjans5Gv20qvmAe/t8gwmsbAf1Pj3pqwYG hKsS4TU8S+h/XRrfxIF7tgWOnaa9CRBMy/ZlAAaIcc19DIaxQ1DggOzbZqCYv4nt/jvk mcfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=4AB/AkROfYpZUEp+v1wddxFTRRBd856xf+0qROCyxBk=; b=Z2vVPtdEOR8bPhc/5DewzI9Q9G0CoygMC0mAqWbbMSb8nEpj4XXcvkOnd8fQ9eE55j czyqlDMVZdRRYHO36Sa1Pn+naz93Vahnl0kvb+2Y5v8p5U8xK4MbQLvXITDC5Apj1LzK pHqb3OyRuVzWMAr5z8OGeSeIPwOFbLkJ7JK3ILXPw6FMFpe+6Yz9cEcA3znZ3DxGUHHm J6lY+LN7m6azGX3Pv9jG/Ie/vauKdngbnrrisRmkp2eNl51Fb6D0sHL8BvhPGrdDlBOD XK8wG0yJBYuR/MxCsOd4hfF8scEbKFMQ/QhBQyG4ljMWojaAMRgEjw69Q+VgYPofmI/q owMQ== X-Gm-Message-State: AD7BkJJQE1ar9Ch4YzzMSWM3uR6jCHGr49O6LtM7CJb3Mr6gizWVuIMEqQyRVZz8d1VZ/Yjd00+Q3eBujAJhBCF+ MIME-Version: 1.0 X-Received: by 10.202.241.87 with SMTP id p84mr229572oih.48.1456476402532; Fri, 26 Feb 2016 00:46:42 -0800 (PST) Received: by 10.202.243.195 with HTTP; Fri, 26 Feb 2016 00:46:42 -0800 (PST) In-Reply-To: References: Date: Fri, 26 Feb 2016 16:46:42 +0800 Message-ID: Subject: Re: how to debug hawq segment From: Hubert Zhang To: dev@hawq.incubator.apache.org Content-Type: multipart/alternative; boundary=94eb2c09254a98de81052ca856c7 --94eb2c09254a98de81052ca856c7 Content-Type: text/plain; charset=UTF-8 Hi Jin Tao, In hawq, QE(query executor) will be reused, so that after running the first query, you can debug QE in the following queries. Your method works on debugging QE as well. Thanks Huan Zhang On Fri, Feb 26, 2016 at 3:27 PM, jin tao wrote: > hi folks, > > I'm now reading the source code and tried to review and debug some issues. > > I chose issue HAWQ-442 ,and > using gdb to debug the code. > my procedure is : > 1.open a psql and using select pg_backend_pid() to get the pid, > 2.open another terminal and using gdb postgres #pid# to debug the program. > I could use backtrace to know the process of function exected,like: > (gdb) bt > #0 0x00007fa8623ab5bb in recv () from /lib64/libpthread.so.0 > #1 0x00000000006a8473 in secure_read () > #2 0x00000000006b06d6 in pq_recvbuf () > #3 0x00000000006b12c5 in pq_getbyte () > #4 0x00000000007d350c in SocketBackend () > #5 0x00000000007d9425 in PostgresMain () > #6 0x000000000078bf65 in ServerLoop () > #7 0x000000000078ec59 in PostmasterMain () > #8 0x00000000004a16bf in main () > > It seems only waht happened in the master.How could I trace and debug each > segement and konw the process of function called? > > Many thanks! > > Best regards! > jin tao > --94eb2c09254a98de81052ca856c7--