From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18770 invoked by alias); 12 Aug 2008 21:32:59 -0000 Received: (qmail 18761 invoked by uid 22791); 12 Aug 2008 21:32:58 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Aug 2008 21:32:09 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 3830A98100; Tue, 12 Aug 2008 21:32:08 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 07B5198015; Tue, 12 Aug 2008 21:32:07 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KT1TL-00080Z-DO; Tue, 12 Aug 2008 17:32:07 -0400 Date: Tue, 12 Aug 2008 21:32:00 -0000 From: Daniel Jacobowitz To: Aleksandar Ristovski Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] nto target: fix null pointer dereference Message-ID: <20080812213207.GA30766@caradoc.them.org> Mail-Followup-To: Aleksandar Ristovski , gdb-patches@sources.redhat.com References: <200808121832.m7CIWcIw018392@d12av02.megacenter.de.ibm.com> <48A1FFD4.1080109@qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A1FFD4.1080109@qnx.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00333.txt.bz2 On Tue, Aug 12, 2008 at 05:25:40PM -0400, Aleksandar Ristovski wrote: > in procfs_create_inferior we call solib_create_inferior_hook, which will end up trying to determine loader base by reading inferior's memory at DT_DEBUG pointer. In our case, before the executable actually started executing, it will successfully read 0s, because dynamic loader has not been invoked yet, and the pointer to r_debug structure is not initialized. It should already detect that zero is invalid, since that's the same value used initially; see e.g. calls to locate_base. Where's the read come from? -- Daniel Jacobowitz CodeSourcery