Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] Clarify shared library warning
@ 2006-10-10 14:52 Daniel Jacobowitz
  2006-10-10 21:28 ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2006-10-10 14:52 UTC (permalink / raw)
  To: gdb-patches

This function, added recently by Alex, just saved me hours.  I was looking
back at an old bug report, and some inexplicable symbols that seemed to
start in the middle of functions.  And right there was a message from GDB,
not present last time I looked at the testcase:

warning: .dynamic section for "/lib/libc.so.6" is not at the expected
address

The tarball that went with the core dump had the wrong libraries in it.
No wonder it didn't work.

But this warning isn't very self-explanatory.  I was thinking something
like the below, in addition.  How does this sound?

warning: .dynamic section for "/lib/libc.so.6" is not at the expected
address
warning: the wrong version of the shared library may have been found

-- 
Daniel Jacobowitz
CodeSourcery

2006-10-10  Daniel Jacobowitz  <dan@codesourcery.com>

	* solib-svr4.c (LM_ADDR_CHECK): Suggest shared library mismatch.

Index: solib-svr4.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v
retrieving revision 1.58
diff -u -p -r1.58 solib-svr4.c
--- solib-svr4.c	18 May 2006 20:38:56 -0000	1.58
+++ solib-svr4.c	10 Oct 2006 14:47:59 -0000
@@ -221,6 +221,11 @@ LM_ADDR_CHECK (struct so_list *so, bfd *
 	      warning (_("difference appears to be caused by prelink, "
 			 "adjusting expectations"));
 	    }
+	  else
+	    {
+	      warning (_("the wrong version of the shared library may "
+			 "have been found"));
+	    }
 	}
 
     set_addr:


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-10 14:52 [rfc] Clarify shared library warning Daniel Jacobowitz
@ 2006-10-10 21:28 ` Eli Zaretskii
  2006-10-10 21:34   ` Joel Brobecker
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2006-10-10 21:28 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> Date: Tue, 10 Oct 2006 10:52:13 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> But this warning isn't very self-explanatory.  I was thinking something
> like the below, in addition.  How does this sound?
> 
> warning: .dynamic section for "/lib/libc.so.6" is not at the expected
> address
> warning: the wrong version of the shared library may have been found

Such a change is a good idea, I think.

We could make it shorter, though:

  warning: .dynamic section for "/lib/libc.so.6" is not at the expected
           address (wrong version of the shared library?)


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-10 21:28 ` Eli Zaretskii
@ 2006-10-10 21:34   ` Joel Brobecker
  2006-10-11 13:38     ` Daniel Jacobowitz
  0 siblings, 1 reply; 17+ messages in thread
From: Joel Brobecker @ 2006-10-10 21:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Daniel Jacobowitz, gdb-patches

> > warning: .dynamic section for "/lib/libc.so.6" is not at the expected
> > address
> > warning: the wrong version of the shared library may have been found
> 
> Such a change is a good idea, I think.
> 
> We could make it shorter, though:
> 
>   warning: .dynamic section for "/lib/libc.so.6" is not at the expected
>            address (wrong version of the shared library?)

I like the change too, but I prefer Daniel's version. I find it much
clearer.

-- 
Joel


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-10 21:34   ` Joel Brobecker
@ 2006-10-11 13:38     ` Daniel Jacobowitz
  2006-10-11 16:09       ` Joel Brobecker
  2006-10-11 20:32       ` Mark Kettenis
  0 siblings, 2 replies; 17+ messages in thread
From: Daniel Jacobowitz @ 2006-10-11 13:38 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Eli Zaretskii, gdb-patches

On Tue, Oct 10, 2006 at 02:34:38PM -0700, Joel Brobecker wrote:
> > > warning: .dynamic section for "/lib/libc.so.6" is not at the expected
> > > address
> > > warning: the wrong version of the shared library may have been found
> > 
> > Such a change is a good idea, I think.
> > 
> > We could make it shorter, though:
> > 
> >   warning: .dynamic section for "/lib/libc.so.6" is not at the expected
> >            address (wrong version of the shared library?)
> 
> I like the change too, but I prefer Daniel's version. I find it much
> clearer.

Actually, I like Eli's version better, myself.  If you find the longer
one clearer, could you try to explain why?

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-11 13:38     ` Daniel Jacobowitz
@ 2006-10-11 16:09       ` Joel Brobecker
  2006-10-11 20:32       ` Mark Kettenis
  1 sibling, 0 replies; 17+ messages in thread
From: Joel Brobecker @ 2006-10-11 16:09 UTC (permalink / raw)
  To: Eli Zaretskii, gdb-patches

> > > > warning: .dynamic section for "/lib/libc.so.6" is not at the expected
> > > > address
> > > > warning: the wrong version of the shared library may have been found
> > > 
> > > Such a change is a good idea, I think.
> > > 
> > > We could make it shorter, though:
> > > 
> > >   warning: .dynamic section for "/lib/libc.so.6" is not at the expected
> > >            address (wrong version of the shared library?)
> > 
> > I like the change too, but I prefer Daniel's version. I find it much
> > clearer.
> 
> Actually, I like Eli's version better, myself.  If you find the longer
> one clearer, could you try to explain why?

I find yours clearer because it tells the user that it is GDB that
finds the shared library, so there should be a way to tell GDB how
to find the correct one.

Perhaps "wrong version of the shared library found?", or perhaps
"wrong shared library found?" ?

-- 
Joel


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-11 13:38     ` Daniel Jacobowitz
  2006-10-11 16:09       ` Joel Brobecker
@ 2006-10-11 20:32       ` Mark Kettenis
  2006-10-11 20:39         ` Daniel Jacobowitz
  1 sibling, 1 reply; 17+ messages in thread
From: Mark Kettenis @ 2006-10-11 20:32 UTC (permalink / raw)
  To: Joel Brobecker, Eli Zaretskii, gdb-patches

>  On Tue, Oct 10, 2006 at 02:34:38PM -0700, Joel Brobecker wrote:
> > > > warning: .dynamic section for "/lib/libc.so.6" is not at the
> > expected
> > > > address
> > > > warning: the wrong version of the shared library may have been found
> > >
> > > Such a change is a good idea, I think.
> > >
> > > We could make it shorter, though:
> > >
> > >   warning: .dynamic section for "/lib/libc.so.6" is not at the
> > expected
> > >            address (wrong version of the shared library?)
> >
> > I like the change too, but I prefer Daniel's version. I find it much
> > clearer.
>
>  Actually, I like Eli's version better, myself.  If you find the longer
>  one clearer, could you try to explain why?

I prefer Eli's version.  I also think that if further explanation
beyond Eli's version is required the proper place really is the manual.

Mark



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-11 20:32       ` Mark Kettenis
@ 2006-10-11 20:39         ` Daniel Jacobowitz
  2006-10-11 20:49           ` Mark Kettenis
  2006-10-12  4:29           ` Eli Zaretskii
  0 siblings, 2 replies; 17+ messages in thread
From: Daniel Jacobowitz @ 2006-10-11 20:39 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: Joel Brobecker, Eli Zaretskii, gdb-patches

On Wed, Oct 11, 2006 at 10:32:25PM +0200, Mark Kettenis wrote:
> >  On Tue, Oct 10, 2006 at 02:34:38PM -0700, Joel Brobecker wrote:
> > > > > warning: .dynamic section for "/lib/libc.so.6" is not at the
> > > expected
> > > > > address
> > > > > warning: the wrong version of the shared library may have been found
> > > >
> > > > Such a change is a good idea, I think.
> > > >
> > > > We could make it shorter, though:
> > > >
> > > >   warning: .dynamic section for "/lib/libc.so.6" is not at the
> > > expected
> > > >            address (wrong version of the shared library?)
> > >
> > > I like the change too, but I prefer Daniel's version. I find it much
> > > clearer.
> >
> >  Actually, I like Eli's version better, myself.  If you find the longer
> >  one clearer, could you try to explain why?
> 
> I prefer Eli's version.  I also think that if further explanation
> beyond Eli's version is required the proper place really is the manual.

Would you all be happy with this compromise?

warning: .dynamic section for "/lib/libc.so.6" is not at the expected
address (wrong shared library found?)

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-11 20:39         ` Daniel Jacobowitz
@ 2006-10-11 20:49           ` Mark Kettenis
  2006-10-11 20:51             ` Daniel Jacobowitz
  2006-10-12  4:29           ` Eli Zaretskii
  1 sibling, 1 reply; 17+ messages in thread
From: Mark Kettenis @ 2006-10-11 20:49 UTC (permalink / raw)
  To: Mark Kettenis, Joel Brobecker, Eli Zaretskii, gdb-patches

>  On Wed, Oct 11, 2006 at 10:32:25PM +0200, Mark Kettenis wrote:
> > I prefer Eli's version.  I also think that if further explanation
> > beyond Eli's version is required the proper place really is the manual.
>
>  Would you all be happy with this compromise?
>
>  warning: .dynamic section for "/lib/libc.so.6" is not at the expected
>  address (wrong shared library found?)

Ah, I must have been unclear.  This message is fine with me.  It's just
messages that are significantly longer than that, that I want to ban
to the manual.

Mark


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-11 20:49           ` Mark Kettenis
@ 2006-10-11 20:51             ` Daniel Jacobowitz
  0 siblings, 0 replies; 17+ messages in thread
From: Daniel Jacobowitz @ 2006-10-11 20:51 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: Joel Brobecker, Eli Zaretskii, gdb-patches

On Wed, Oct 11, 2006 at 10:49:17PM +0200, Mark Kettenis wrote:
> >  On Wed, Oct 11, 2006 at 10:32:25PM +0200, Mark Kettenis wrote:
> > > I prefer Eli's version.  I also think that if further explanation
> > > beyond Eli's version is required the proper place really is the manual.
> >
> >  Would you all be happy with this compromise?
> >
> >  warning: .dynamic section for "/lib/libc.so.6" is not at the expected
> >  address (wrong shared library found?)
> 
> Ah, I must have been unclear.  This message is fine with me.  It's just
> messages that are significantly longer than that, that I want to ban
> to the manual.

I agree; my original version was too wordy.  I'll have to move the
warnings around to get this, but it will be easy, and I agree that the
concise warning is more useful.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-11 20:39         ` Daniel Jacobowitz
  2006-10-11 20:49           ` Mark Kettenis
@ 2006-10-12  4:29           ` Eli Zaretskii
  2006-10-12  5:52             ` Joel Brobecker
  1 sibling, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2006-10-12  4:29 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: mark.kettenis, brobecker, gdb-patches

> Date: Wed, 11 Oct 2006 16:39:28 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Joel Brobecker <brobecker@adacore.com>, Eli Zaretskii <eliz@gnu.org>,
> 	gdb-patches@sourceware.org
> 
> Would you all be happy with this compromise?
> 
> warning: .dynamic section for "/lib/libc.so.6" is not at the expected
> address (wrong shared library found?)

This doesn't mention the problem with the library version, which to me
is a very important clue.  I think version mismatch is a much more
likely problem than a library mismatch.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-12  4:29           ` Eli Zaretskii
@ 2006-10-12  5:52             ` Joel Brobecker
  2006-10-12  6:55               ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Joel Brobecker @ 2006-10-12  5:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Daniel Jacobowitz, mark.kettenis, gdb-patches

> This doesn't mention the problem with the library version, which to me
> is a very important clue.  I think version mismatch is a much more
> likely problem than a library mismatch.

But two libraries with the exact same version number may not necessarily
be the same. The last time I've had this problem was a few weeks ago
when a customer of ours sent us a core file. Same system version number
(HP/UX), same shared library version number, and yet different code.
That's why I think it's important to say "wrong shared library".
I actually read "version" in the original proposal as "instance" more
than "number". Isn't that interesting?

In any case, I agree with Mark that an addition to the manual is
more important than trying to cover every possible sources for this
discrepency in a highly skilfully crafted short message. I am very
happy with the warning, no matter how it tries to say it.


-- 
Joel


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-12  5:52             ` Joel Brobecker
@ 2006-10-12  6:55               ` Eli Zaretskii
  2006-10-12 14:39                 ` Joel Brobecker
  2006-10-12 14:46                 ` Andreas Schwab
  0 siblings, 2 replies; 17+ messages in thread
From: Eli Zaretskii @ 2006-10-12  6:55 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: drow, mark.kettenis, gdb-patches

> Date: Wed, 11 Oct 2006 22:52:31 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Daniel Jacobowitz <drow@false.org>, mark.kettenis@xs4all.nl, 	gdb-patches@sourceware.org
> 
> > This doesn't mention the problem with the library version, which to me
> > is a very important clue.  I think version mismatch is a much more
> > likely problem than a library mismatch.
> 
> But two libraries with the exact same version number may not necessarily
> be the same.

How about this, then:

warning: .dynamic section for "/lib/libc.so.6" is not at the expected address
         (wrong library or library version mismatch?)

> In any case, I agree with Mark that an addition to the manual is
> more important than trying to cover every possible sources for this
> discrepency in a highly skilfully crafted short message.

I agree, but many users don't bother to look up the message in the
manual, so I think we should make it as clear as possible.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-12  6:55               ` Eli Zaretskii
@ 2006-10-12 14:39                 ` Joel Brobecker
  2006-10-12 14:46                 ` Andreas Schwab
  1 sibling, 0 replies; 17+ messages in thread
From: Joel Brobecker @ 2006-10-12 14:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: drow, mark.kettenis, gdb-patches

> How about this, then:
> 
> warning: .dynamic section for "/lib/libc.so.6" is not at the expected address
>          (wrong library or library version mismatch?)

Sure, I think that works.

> I agree, but many users don't bother to look up the message in the
> manual, so I think we should make it as clear as possible.

That's true.

-- 
Joel


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-12  6:55               ` Eli Zaretskii
  2006-10-12 14:39                 ` Joel Brobecker
@ 2006-10-12 14:46                 ` Andreas Schwab
  2006-10-13 15:10                   ` Eli Zaretskii
  1 sibling, 1 reply; 17+ messages in thread
From: Andreas Schwab @ 2006-10-12 14:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Joel Brobecker, drow, mark.kettenis, gdb-patches

Eli Zaretskii <eliz@gnu.org> writes:

> How about this, then:
>
> warning: .dynamic section for "/lib/libc.so.6" is not at the expected address
>          (wrong library or library version mismatch?)

Isn't "wrong library" a superset of "library version mismatch"?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-12 14:46                 ` Andreas Schwab
@ 2006-10-13 15:10                   ` Eli Zaretskii
  2006-10-13 15:18                     ` Daniel Jacobowitz
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2006-10-13 15:10 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: brobecker, drow, mark.kettenis, gdb-patches

> From: Andreas Schwab <schwab@suse.de>
> Cc: Joel Brobecker <brobecker@adacore.com>, drow@false.org,
> 	mark.kettenis@xs4all.nl, gdb-patches@sourceware.org
> Date: Thu, 12 Oct 2006 16:46:02 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > How about this, then:
> >
> > warning: .dynamic section for "/lib/libc.so.6" is not at the expected address
> >          (wrong library or library version mismatch?)
> 
> Isn't "wrong library" a superset of "library version mismatch"?

It is, but messages to users don't need such mathematical rigour.  I
imagine some users won't immediately realize that ``wrong library''
might mean libc.so.6 instead of libc.so.7; ``version mismatch'' goes a
long way towards spelling out that possibility, IMO.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-13 15:10                   ` Eli Zaretskii
@ 2006-10-13 15:18                     ` Daniel Jacobowitz
  2006-10-17 20:53                       ` Daniel Jacobowitz
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2006-10-13 15:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Andreas Schwab, brobecker, mark.kettenis, gdb-patches

On Fri, Oct 13, 2006 at 05:10:48PM +0200, Eli Zaretskii wrote:
> It is, but messages to users don't need such mathematical rigour.  I
> imagine some users won't immediately realize that ``wrong library''
> might mean libc.so.6 instead of libc.so.7; ``version mismatch'' goes a
> long way towards spelling out that possibility, IMO.

That's not the problem here anyway; it's one copy of libc.so.6 versus
another copy of libc.so.6 from somewhere else.  If they were actually
different SONAMEs, we wouldn't ever have loaded it.

This has definitely become a bikeshed discussion, however.  I wish we
could spend less time editing one-line patches.

Does anyone dislike this version?  If not, I will commit it, and
someone can expand on it in the manual if necessary (probably with a
reference to solib-absolute-prefix).

warning: .dynamic section for "/lib/libc.so.6" is not at the expected
address (wrong library or version mismatch?)

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [rfc] Clarify shared library warning
  2006-10-13 15:18                     ` Daniel Jacobowitz
@ 2006-10-17 20:53                       ` Daniel Jacobowitz
  0 siblings, 0 replies; 17+ messages in thread
From: Daniel Jacobowitz @ 2006-10-17 20:53 UTC (permalink / raw)
  To: gdb-patches; +Cc: Eli Zaretskii, Andreas Schwab, brobecker, mark.kettenis

On Fri, Oct 13, 2006 at 11:18:28AM -0400, Daniel Jacobowitz wrote:
> Does anyone dislike this version?  If not, I will commit it, and
> someone can expand on it in the manual if necessary (probably with a
> reference to solib-absolute-prefix).
> 
> warning: .dynamic section for "/lib/libc.so.6" is not at the expected
> address (wrong library or version mismatch?)

I've checked in this patch; feel free to improve it by further patches
:-)

-- 
Daniel Jacobowitz
CodeSourcery

2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>

	* solib-svr4.c (LM_ADDR_CHECK): Suggest shared library mismatch.

Index: solib-svr4.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v
retrieving revision 1.58
diff -u -p -r1.58 solib-svr4.c
--- solib-svr4.c	18 May 2006 20:38:56 -0000	1.58
+++ solib-svr4.c	17 Oct 2006 20:51:56 -0000
@@ -187,9 +187,6 @@ LM_ADDR_CHECK (struct so_list *so, bfd *
 
       if (dynaddr + l_addr != l_dynaddr)
 	{
-	  warning (_(".dynamic section for \"%s\" "
-		     "is not at the expected address"), so->so_name);
-
 	  if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
 	    {
 	      Elf_Internal_Ehdr *ehdr = elf_tdata (abfd)->elf_header;
@@ -218,9 +215,16 @@ LM_ADDR_CHECK (struct so_list *so, bfd *
 	  if ((l_addr & align) == 0 && ((dynaddr - l_dynaddr) & align) == 0)
 	    {
 	      l_addr = l_dynaddr - dynaddr;
+
+	      warning (_(".dynamic section for \"%s\" "
+		     "is not at the expected address"), so->so_name);
 	      warning (_("difference appears to be caused by prelink, "
 			 "adjusting expectations"));
 	    }
+	  else
+	    warning (_(".dynamic section for \"%s\" "
+		       "is not at the expected address "
+		       "(wrong library or version mismatch?)"), so->so_name);
 	}
 
     set_addr:


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2006-10-17 20:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-10 14:52 [rfc] Clarify shared library warning Daniel Jacobowitz
2006-10-10 21:28 ` Eli Zaretskii
2006-10-10 21:34   ` Joel Brobecker
2006-10-11 13:38     ` Daniel Jacobowitz
2006-10-11 16:09       ` Joel Brobecker
2006-10-11 20:32       ` Mark Kettenis
2006-10-11 20:39         ` Daniel Jacobowitz
2006-10-11 20:49           ` Mark Kettenis
2006-10-11 20:51             ` Daniel Jacobowitz
2006-10-12  4:29           ` Eli Zaretskii
2006-10-12  5:52             ` Joel Brobecker
2006-10-12  6:55               ` Eli Zaretskii
2006-10-12 14:39                 ` Joel Brobecker
2006-10-12 14:46                 ` Andreas Schwab
2006-10-13 15:10                   ` Eli Zaretskii
2006-10-13 15:18                     ` Daniel Jacobowitz
2006-10-17 20:53                       ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox