From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24352 invoked by alias); 17 May 2011 01:07:01 -0000 Received: (qmail 24343 invoked by uid 22791); 17 May 2011 01:07:00 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,TW_CP,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 May 2011 01:06:45 +0000 Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id p4H16gIB001323 for ; Mon, 16 May 2011 18:06:43 -0700 Received: from ywi6 (ywi6.prod.google.com [10.192.9.6]) by wpaz5.hot.corp.google.com with ESMTP id p4H16fE6003912 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 16 May 2011 18:06:41 -0700 Received: by ywi6 with SMTP id 6so8273ywi.31 for ; Mon, 16 May 2011 18:06:41 -0700 (PDT) Received: by 10.151.105.10 with SMTP id h10mr56140ybm.316.1305594401270; Mon, 16 May 2011 18:06:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.11.17 with HTTP; Mon, 16 May 2011 18:06:11 -0700 (PDT) In-Reply-To: <20091006214556.GA12955@host0.dyn.jankratochvil.net> References: <20091006214556.GA12955@host0.dyn.jankratochvil.net> From: Paul Pluzhnikov Date: Tue, 17 May 2011 01:07:00 -0000 Message-ID: Subject: Re: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. To: Jan Kratochvil Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2011-05/txt/msg00372.txt.bz2 Ping? I see this all the time, and it causes end-user confusion. On Tue, Oct 6, 2009 at 2:45 PM, Jan Kratochvil wrote: > Hi, > > GDB currently always prints on loading a core file: > =A0 =A0 =A0 =A0warning: Can't read pathname for load map: Input/output er= ror. > > The patch is not nice but it was WONTFIXed on the glibc side in: > =A0 =A0 =A0 =A0http://sourceware.org/ml/libc-alpha/2009-10/msg00001.html > > The same message in GDB PR 8882 and glibc PR 387 was for ld-linux.so.2 l_= name > but that one is now ignored thanks to IGNORE_FIRST_LINK_MAP_ENTRY. > > This fix is intended for Linux system vDSO l_name which is a second entry= in > the DSO list. I believe the statement above is incorrect: the string comes from read-only mapping of ld.so (as the comment in the patch correctly says), and has nothing to do with vDSO. > > Regression tested on {x86_86,x86_64-m32,i686}-fedora11-linux-gnu. > > > Thanks, > Jan > > > gdb/ > 2009-10-06 =A0Jan Kratochvil =A0 > > =A0 =A0 =A0 =A0Do not print false warning on reading core file with vDSO = on GNU/Linux. vDSO mention again ... > =A0 =A0 =A0 =A0* solib-svr4.c (svr4_current_sos): Suppress the warning if > =A0 =A0 =A0 =A0MASTER_SO_LIST is still NULL. > =A0 =A0 =A0 =A0* solib.c (update_solib_list): New variable saved_so_list_= head. > =A0 =A0 =A0 =A0Conditionally restart the function. > > --- a/gdb/solib-svr4.c > +++ b/gdb/solib-svr4.c > @@ -1097,8 +1097,18 @@ svr4_current_sos (void) > =A0 =A0 =A0 =A0 =A0target_read_string (LM_NAME (new), &buffer, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SO_NAME_MAX_PA= TH_SIZE - 1, &errcode); > =A0 =A0 =A0 =A0 =A0if (errcode !=3D 0) > - =A0 =A0 =A0 =A0 =A0 warning (_("Can't read pathname for load map: %s."), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0safe_strerror (errcode)); > + =A0 =A0 =A0 =A0 =A0 { > + =A0 =A0 =A0 =A0 =A0 =A0 /* During the first ever DSO list reading some = strings may be > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0unreadable as residing in the ld.so read= only memory not being > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0present in a dumped core file. =A0Delay = the error check after > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0the first pass of DSO list scanning when= ld.so should be > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0already mapped in and all the DSO list l= _name memory gets > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0readable. =A0*/ > + > + =A0 =A0 =A0 =A0 =A0 =A0 if (master_so_list () !=3D NULL) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 warning (_("Can't read pathname for load ma= p: %s."), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0safe_strerror (errcode)); > + =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0else > =A0 =A0 =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0strncpy (new->so_name, buffer, SO_NAME_MAX_PAT= H_SIZE - 1); > --- a/gdb/solib.c > +++ b/gdb/solib.c > @@ -538,6 +538,7 @@ update_solib_list (int from_tty, struct target_ops *t= arget) > =A0 struct target_so_ops *ops =3D solib_ops (target_gdbarch); > =A0 struct so_list *inferior =3D ops->current_sos(); > =A0 struct so_list *gdb, **gdb_link; > + =A0struct so_list *saved_so_list_head =3D so_list_head; > > =A0 /* We can reach here due to changing solib-search-path or the > =A0 =A0 =A0sysroot, before having any inferior. =A0*/ > @@ -668,6 +669,12 @@ update_solib_list (int from_tty, struct target_ops *= target) > =A0 =A0 =A0 =A0 =A0observer_notify_solib_loaded (i); > =A0 =A0 =A0 =A0} > =A0 =A0 } > + > + =A0/* If this was the very first DSO list scan and we possibly read in = ld.so > + =A0 =A0 recheck all the formerly unreadable DSO names strings. =A0*/ > + > + =A0if (saved_so_list_head =3D=3D NULL && so_list_head !=3D NULL) > + =A0 =A0update_solib_list (from_tty, target); > =A0} > > > --=20 Paul Pluzhnikov