From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E9A48385782B; Tue, 18 May 2021 03:12:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9A48385782B From: "zhuizhuhaomeng at gmail dot com" To: systemtap@sourceware.org Subject: [Bug runtime/27881] New: failed to extend vma mapped entry when the address is adjacent Date: Tue, 18 May 2021 03:12:57 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhuizhuhaomeng at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2021 03:12:58 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27881 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=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 /usr/local/openresty-plus/nginx/sbin/nginx 5579ad067000-5579ad180000 r-xp 00037000 fd:00 54825380=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 /usr/local/openresty-plus/nginx/sbin/nginx 5579ad180000-5579ad1ce000 r--p 00150000 fd:00 54825380=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 /usr/local/openresty-plus/nginx/sbin/nginx 5579ad1cf000-5579ad1d1000 r--p 0019e000 fd:00 54825380=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 /usr/local/openresty-plus/nginx/sbin/nginx 5579ad1d1000-5579ad1ef000 rw-p 001a0000 fd:00 54825380=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 /usr/local/openresty-plus/nginx/sbin/nginx the first two segments are adjacent but stap did not extend the second to t= he first. Instead, stap add two entries. entry_2, entry_1 in the list with hlist_add_head_rcu. the third=EF=BC=8Cfourth =EF=BC=8Cfifth segments were not added because the= y can not match the if condition below.=20 if (res =3D=3D -ESRCH || vm_start + offset =3D=3D= addr) res =3D stap_add_vma_map_info(tsk->group_leader, addr, addr + length, offset, path, modul= e); else if (res =3D=3D 0 && vm_end + 1 =3D=3D addr) res =3D stap_extend_vma_map_info(tsk->group_lea= der, vm_start, addr + length); when access a global variable=EF=BC=8C_stp_umodule_relocate will use the en= try_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) =3D=3D 0) { offset +=3D vm_start; dbug_sym(1, "address=3D%lx\n", offset); return offset; }=20 when get the relative address in _stp_kallsyms_lookup, we should also use t= he first entry's vm_start as the base address. --=20 You are receiving this mail because: You are the assignee for the bug.=