public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/11015] New: Support shared library reloading (in different processes)
@ 2009-11-24 20:28 mjw at redhat dot com
  2009-12-14 14:13 ` [Bug runtime/11015] " mjw at redhat dot com
  2009-12-21 14:47 ` mjw at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: mjw at redhat dot com @ 2009-11-24 20:28 UTC (permalink / raw)
  To: systemtap

runtime/sym.c (_stp_tf_mmap_cb) has the following comment:

        // cheat...
        // We are abusing the "first" section address
        // here to indicate where the module (actually
        // first segment) is loaded (which is why we
        // are ignoring the offset). It would be good
        // to redesign the stp_module/stp_section
        // data structures to better align with the
        // actual memory mappings we are interested
        // in (especially the "section" naming is
        // slightly confusing since what we really
        // seem to mean are elf segments (which can
        // contain multiple elf sections).
        if (strcmp(".dynamic",
                   module->sections[0].name) == 0)
          {
            if (module->sections[0].addr == 0)
              module->sections[0].addr = addr;
            else if (module->sections[0].addr != addr)
              _stp_error ("Reloaded module '%s'"
                          " at 0x%lx, was 0x%lx\n",
                          path, addr,
                          module->sections[0].addr);
          }

It uses _stp_modules[...]->sections[0].addr as "the" (systemwide) shared library
load address.  However this is wrong: there
can be distinct load addresses for each process that maps in the widget
So the address would need to be looked up in the appropriate
__stp_tf_vma_entry record.

-- 
           Summary: Support shared library reloading (in different
                    processes)
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: mjw at redhat dot com


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

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug runtime/11015] Support shared library reloading (in different processes)
  2009-11-24 20:28 [Bug runtime/11015] New: Support shared library reloading (in different processes) mjw at redhat dot com
@ 2009-12-14 14:13 ` mjw at redhat dot com
  2009-12-21 14:47 ` mjw at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: mjw at redhat dot com @ 2009-12-14 14:13 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mjw at redhat dot com  2009-12-14 14:13 -------
This was observed to trigger by multiple people last week. Even though it could
be worked around, it is pretty confusing when first encountered.

Haven't been able to trigger it myself though.

-- 


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

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug runtime/11015] Support shared library reloading (in different processes)
  2009-11-24 20:28 [Bug runtime/11015] New: Support shared library reloading (in different processes) mjw at redhat dot com
  2009-12-14 14:13 ` [Bug runtime/11015] " mjw at redhat dot com
@ 2009-12-21 14:47 ` mjw at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: mjw at redhat dot com @ 2009-12-21 14:47 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mjw at redhat dot com  2009-12-21 14:47 -------
commit ea549ffc2915aa58861637472b12196222673fa2
Author: Mark Wielaard <mjw@redhat.com>
Date:   Mon Dec 21 13:02:19 2009 +0100

  PR11015 Support shared library reloading (in different processes)
  
  * runtime/task_finder_vma.c (stap_remove_vma_map_info): Return negative
    status on failure.
    (stap_find_vma_map_info): Likewise.
    (stap_find_vma_map_info_user): New function.
    (stap_drop_vma_maps): New function.
  * runtime/sym.h (addr): Renamed to static_addr, to store addresses for
    sections which are always mapped at the same address.
    (_stp_module_relocate): Add extra struct task_struct *tsk argument.
  * runtime/sym.c (_stp_tf_exec_cb): New callback, calls stap_drop_vma_maps.
    (_stp_tf_mmap_cb): Don't store address in module.section, but call
    stap_add_vma_map_info() per tsk->group_leader for matched module.
    Don't register empty/null modules.
    (_stp_module_relocate): Take extra struct task_struct *tsk argument,
    cache last tsk used. Only use section->static_addr for none dynamic
    modules. Use stap_find_vma_map_info_user() to locate dynamic modules.
    (_stp_mod_sec_lookup): Add extra argument unsigned long *rel_addr to
    optionally store relative address when module/section found.
    (_stp_kallsyms_lookup): Use _stp_mod_sec_lookup to find relative address.
    (_stp_sym_init): Register _stp_tf_exec_cb in stap_task_finder_target.
    Add error check to see if task finder could be initialized.
  * dwflpp.cxx (emit_address): Pass NULL for kernel/modules and current for
    user tasks to _stp_module_relocate.
  * runtime/transport/symbols.c (_stp_do_relocation): Set new static_addr
    _stp_section field.
  * runtime/unwind.c (adjustStartLoc): Take new struct task_struct *tsk
    argument and pass to stap_find_vma_map_info_user and _stp_module_relocate
    to find adjusted addr.
    (_stp_search_unwind_hdr): Pass through struct task_struct *tsk.
    (unwind_frame): Likewise.
  * tapset/context-symbols.stp (probemod): Add NULL to _stp_mod_sec_lookup
    call to indicate we aren't interested in relative address.
  * tapsets.cxx (dwarf_derived_probe_group::emit_module_init): Pass NULL to
    _stp_module_relocate to indicate kernel/module address.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

end of thread, other threads:[~2009-12-21 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-24 20:28 [Bug runtime/11015] New: Support shared library reloading (in different processes) mjw at redhat dot com
2009-12-14 14:13 ` [Bug runtime/11015] " mjw at redhat dot com
2009-12-21 14:47 ` mjw at redhat dot com

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).