public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug shlibs/15507] New: .dynamic section is not at the expected address
@ 2013-05-21  0:16 bccheng at android dot com
  2013-05-22 15:15 ` [Bug shlibs/15507] " tromey at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bccheng at android dot com @ 2013-05-21  0:16 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15507

             Bug #: 15507
           Summary: .dynamic section is not at the expected address
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: shlibs
        AssignedTo: unassigned@sourceware.org
        ReportedBy: bccheng@android.com
    Classification: Unclassified


Currently Android is using gdbserver from 7.1 and gdb from 7.3. I tried to
upgrade Android gdb to 7.6 but I found it complained with the following
message: 

(gdb) b main
Breakpoint 1 at 0xb6fc2448: file <test_program>/main.c, line 10.
(gdb) c
Continuing.
warning: .dynamic section for "<test_program>" is not at the expected address
(wrong library or version mismatch?)
Error in re-setting breakpoint 1: Cannot access memory at address 0xffffe570
Error in re-setting breakpoint 1: Cannot access memory at address 0xffffe570
Error in re-setting breakpoint 1: Cannot access memory at address 0xffffe570
Error in re-setting breakpoint 1: Cannot access memory at address 0xffffe570

After digging into the problem a bit more, I think the problem is in
solib-svr4.c/svr4_current_sos() where if gdbserver responds to the
svr4_current_sos_via_xfer_libraries call, it is not skipping the first entry in
the link map:


  if (svr4_current_sos_via_xfer_libraries (&library_list))
    {
      if (library_list.main_lm)
        {
          info = get_svr4_info ();
          info->main_lm_addr = library_list.main_lm;
        }

      return library_list.head ? library_list.head : svr4_default_sos ();
    }

And here is the xml string:

<library-list-svr4 version="1.0"><library name="<test_program>" lm="0xb6fed108"
l_addr="0x0" l_ld="0x0"/><library name="/system/bin/linker" lm="0xb6ffe75c"
l_addr="0xb6fee000" l_ld="0xb6ffded8"/></library-list-svr4>

In the same function it has the following code to deal with older gdbserver
where it can ignore the first entry in the link map:


  /* Assume that everything is a library if the dynamic loader was loaded
     late by a static executable.  */
  if (exec_bfd && bfd_get_section_by_name (exec_bfd, ".dynamic") == NULL)
    ignore_first = 0;
  else
    ignore_first = 1;

  back_to = make_cleanup (svr4_free_library_list, &head);

  /* Walk the inferior's link map list, and build our list of
     `struct so_list' nodes.  */
  lm = solib_svr4_r_map (info);
  if (lm)
    svr4_read_so_list (lm, &link_ptr, ignore_first);

I tried a simple hack and gdb 7.6 starts to work for Android with gdbserver
7.6:

-      return library_list.head ? library_list.head : svr4_default_sos ();
+      if (exec_bfd && bfd_get_section_by_name (exec_bfd, ".dynamic") == NULL)
+       return library_list.head ? library_list.head : svr4_default_sos ();
+      else
+       return library_list.head ? library_list.head : svr4_default_sos ();

Not sure if there is a better patch fix the problem.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug shlibs/15507] .dynamic section is not at the expected address
  2013-05-21  0:16 [Bug shlibs/15507] New: .dynamic section is not at the expected address bccheng at android dot com
@ 2013-05-22 15:15 ` tromey at redhat dot com
  2013-05-28 17:25 ` bccheng at android dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at redhat dot com @ 2013-05-22 15:15 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15507

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com

--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2013-05-22 15:15:15 UTC ---
The two branches of that 'if' look the same to me.
Did you paste the wrong patch?

Anyway, see the contribution checklist for details on
how to submit a patch:
http://sourceware.org/gdb/wiki/ContributionChecklist

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug shlibs/15507] .dynamic section is not at the expected address
  2013-05-21  0:16 [Bug shlibs/15507] New: .dynamic section is not at the expected address bccheng at android dot com
  2013-05-22 15:15 ` [Bug shlibs/15507] " tromey at redhat dot com
@ 2013-05-28 17:25 ` bccheng at android dot com
  2013-05-29 10:19 ` gbenson at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bccheng at android dot com @ 2013-05-28 17:25 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15507

--- Comment #2 from Ben Cheng <bccheng at android dot com> ---
Oops I pasted the wrong code. It should be:

      if (exec_bfd && bfd_get_section_by_name (exec_bfd, ".dynamic") == NULL)
        return library_list.head ? library_list.head : svr4_default_sos ();
      else
        return library_list.head && library_list.head->next ?
            library_list.head->next : svr4_default_sos ();

Thanks for pointer to the contribution checklist and will follow up there.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug shlibs/15507] .dynamic section is not at the expected address
  2013-05-21  0:16 [Bug shlibs/15507] New: .dynamic section is not at the expected address bccheng at android dot com
  2013-05-22 15:15 ` [Bug shlibs/15507] " tromey at redhat dot com
  2013-05-28 17:25 ` bccheng at android dot com
@ 2013-05-29 10:19 ` gbenson at redhat dot com
  2013-06-04 18:08 ` jan.kratochvil at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gbenson at redhat dot com @ 2013-05-29 10:19 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15507

Gary Benson <gbenson at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gbenson at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug shlibs/15507] .dynamic section is not at the expected address
  2013-05-21  0:16 [Bug shlibs/15507] New: .dynamic section is not at the expected address bccheng at android dot com
                   ` (2 preceding siblings ...)
  2013-05-29 10:19 ` gbenson at redhat dot com
@ 2013-06-04 18:08 ` jan.kratochvil at redhat dot com
  2014-02-16 17:45 ` jackie.rosen at hushmail dot com
  2014-05-28 19:42 ` schwab at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jan.kratochvil at redhat dot com @ 2013-06-04 18:08 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15507

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jan.kratochvil at redhat dot com
         Resolution|---                         |INVALID

--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
Bug is in Android gdbserver:

http://sourceware.org/ml/gdb-patches/2013-06/msg00054.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug shlibs/15507] .dynamic section is not at the expected address
  2013-05-21  0:16 [Bug shlibs/15507] New: .dynamic section is not at the expected address bccheng at android dot com
                   ` (3 preceding siblings ...)
  2013-06-04 18:08 ` jan.kratochvil at redhat dot com
@ 2014-02-16 17:45 ` jackie.rosen at hushmail dot com
  2014-05-28 19:42 ` schwab at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jackie.rosen at hushmail dot com @ 2014-02-16 17:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15507

Jackie Rosen <jackie.rosen at hushmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jackie.rosen at hushmail dot com

--- Comment #4 from Jackie Rosen <jackie.rosen at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug shlibs/15507] .dynamic section is not at the expected address
  2013-05-21  0:16 [Bug shlibs/15507] New: .dynamic section is not at the expected address bccheng at android dot com
                   ` (4 preceding siblings ...)
  2014-02-16 17:45 ` jackie.rosen at hushmail dot com
@ 2014-05-28 19:42 ` schwab at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: schwab at sourceware dot org @ 2014-05-28 19:42 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15507

Andreas Schwab <schwab at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|jackie.rosen at hushmail dot com   |

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2014-05-28 19:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21  0:16 [Bug shlibs/15507] New: .dynamic section is not at the expected address bccheng at android dot com
2013-05-22 15:15 ` [Bug shlibs/15507] " tromey at redhat dot com
2013-05-28 17:25 ` bccheng at android dot com
2013-05-29 10:19 ` gbenson at redhat dot com
2013-06-04 18:08 ` jan.kratochvil at redhat dot com
2014-02-16 17:45 ` jackie.rosen at hushmail dot com
2014-05-28 19:42 ` schwab at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).