public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/27881] New: failed to extend vma mapped entry when the address is adjacent
@ 2021-05-18  3:12 zhuizhuhaomeng at gmail dot com
  2021-05-19  1:58 ` [Bug runtime/27881] " zhuizhuhaomeng at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zhuizhuhaomeng at gmail dot com @ 2021-05-18  3:12 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 27881
           Summary: failed to extend vma mapped entry when the address is
                    adjacent
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: zhuizhuhaomeng at gmail dot com
  Target Milestone: ---

[root@centos7-cube agentzh]# cat /proc/7877/maps | grep nginx
5579ad030000-5579ad067000 r--p 00000000 fd:00 54825380                  
/usr/local/openresty-plus/nginx/sbin/nginx
5579ad067000-5579ad180000 r-xp 00037000 fd:00 54825380                  
/usr/local/openresty-plus/nginx/sbin/nginx
5579ad180000-5579ad1ce000 r--p 00150000 fd:00 54825380                  
/usr/local/openresty-plus/nginx/sbin/nginx
5579ad1cf000-5579ad1d1000 r--p 0019e000 fd:00 54825380                  
/usr/local/openresty-plus/nginx/sbin/nginx
5579ad1d1000-5579ad1ef000 rw-p 001a0000 fd:00 54825380                  
/usr/local/openresty-plus/nginx/sbin/nginx



the first two segments are adjacent but stap did not extend the second to the
first. Instead, stap add two entries.  entry_2, entry_1 in the list with
hlist_add_head_rcu.

the third,fourth ,fifth segments were not added because they can not match the
if condition below. 




                          if (res == -ESRCH || vm_start + offset == addr)
                            res = stap_add_vma_map_info(tsk->group_leader,
                                                        addr, addr + length,
                                                        offset, path, module);
                          else if (res == 0 && vm_end + 1 == addr)
                            res = stap_extend_vma_map_info(tsk->group_leader,
                                                           vm_start,
                                                           addr + length);


when access a global variable,_stp_umodule_relocate will use the entry_2's
vm_start as base address. actually, should use the first entry's vm_start as
the base address.


    if (stap_find_vma_map_info_user(tsk->group_leader, m,
                                    &vm_start, NULL, NULL) == 0) {
      offset += vm_start;
      dbug_sym(1, "address=%lx\n", offset);
      return offset;
    } 


when get the relative address in _stp_kallsyms_lookup, we should also use the
first entry's vm_start as the base address.

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

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

end of thread, other threads:[~2021-05-27 20:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18  3:12 [Bug runtime/27881] New: failed to extend vma mapped entry when the address is adjacent zhuizhuhaomeng at gmail dot com
2021-05-19  1:58 ` [Bug runtime/27881] " zhuizhuhaomeng at gmail dot com
2021-05-19  1:59 ` zhuizhuhaomeng at gmail dot com
2021-05-22  0:26 ` zhuizhuhaomeng at gmail dot com
2021-05-22  0:26 ` zhuizhuhaomeng at gmail dot com
2021-05-27 20:18 ` scox at redhat dot com
2021-05-27 20:19 ` scox 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).