From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14509 invoked by alias); 11 May 2009 02:35:01 -0000 Received: (qmail 14499 invoked by uid 22791); 11 May 2009 02:34:59 -0000 X-SWARE-Spam-Status: Yes, hits=6.3 required=5.0 tests=BAYES_50,CHARSET_FARAWAY_HEADER,MIME_CHARSET_FARAWAY,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from yw-out-1718.google.com (HELO yw-out-1718.google.com) (74.125.46.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 May 2009 02:34:55 +0000 Received: by yw-out-1718.google.com with SMTP id 9so1585771ywk.48 for ; Sun, 10 May 2009 19:34:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.89.18 with SMTP id m18mr5483208agb.38.1242009292655; Sun, 10 May 2009 19:34:52 -0700 (PDT) Date: Mon, 11 May 2009 02:35:00 -0000 Message-ID: <6a8fced30905101934j2aa94d27i210484a99a523ce5@mail.gmail.com> Subject: how to debug this error by gdb? From: =?ISO-2022-JP?B?GyRCTEBrNBsoQg==?= To: gdb@sourceware.org Content-Type: text/plain; charset=Big5 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00058.txt.bz2 I'm debugging a application, for it crashes at line 660 of file glxcmds.c, which is a file of mesa-7.4.1 here is the source code at which it crashes: ---------------------------------------------------------------------------= ------------ PUBLIC void glXWaitX(void) { ...... if (psc->driScreen->waitX !=3D NULL) [line 660] (*psc->driScreen->waitX)(pdraw); ..... } ---------------------------------------------------------------------------= ------------ and here is the gdb info: ---------------------------------------------------------------------------= ------------ (gdb) break glxcmds.c:660 Breakpoint 1 (glxcmds.c:660) pending. (gdb) run Breakpoint 1, glXWaitX () at glxcmds.c:660 (gdb) print psc->driScreen->waitX $3 =3D (void (*)(__GLXDRIdrawable *)) 0x47206769666e6f63 (gdb) print *psc->driScreen->waitX Cannot access memory at address (gdb) step Program received signal SIGSEGV, Segmentation fault. ---------------------------------------------------------------------------= ------------ I think there are 2 possibilities: (1) linking error, maybe psc->driScreen->waitX is linked to the wrong address, then I'm wondering how could I further find the real memory address of psc->driScreen->waitX? or, (2) memory protection error, maybe 0x47206769666e6f63 is the correct address of psc->driScreen->waitX, but it's cannot be accessed, then what might be the cause? could you help how to tell which is the correct possibility? and how to solve it? thanks --=20 =A7=DA=AA=BA=BE=DE=A7@=A8t=B2=CE=ACOGnu/Linux Debian-sid-amd64/gNewSense Gn= ome Mozilla Gmail/Evolution Gtkmm/Clutter/Anjuta Scim Totem Pidgin.