RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1237098 - systemtap-2.8-1.el7.ppc64le doesn't see C++ class methods
Summary: systemtap-2.8-1.el7.ppc64le doesn't see C++ class methods
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemtap
Version: 7.2
Hardware: ppc64le
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Josh Stone
QA Contact: Martin Cermak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-30 11:12 UTC by Martin Cermak
Modified: 2015-11-19 11:47 UTC (History)
6 users (show)

Fixed In Version: systemtap-2.8-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 11:47:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
eu-readelf -winfo classes output (for both be and le) (9.85 KB, application/x-xz)
2015-07-01 06:15 UTC, Martin Cermak
no flags Details
proposed fixes (5.56 KB, patch)
2015-07-01 20:43 UTC, Josh Stone
no flags Details | Diff
test results (33.98 KB, application/x-xz)
2015-07-02 11:30 UTC, Martin Cermak
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2015:2124 0 normal SHIPPED_LIVE systemtap bug fix and enhancement update 2015-11-19 10:31:06 UTC
Sourceware 18555 0 None None None 2019-05-30 07:57:20 UTC

Description Martin Cermak 2015-06-30 11:12:59 UTC
systemtap-2.8-1.el7.ppc64 can see C++ class methods:

=======
 7.2 S ppc64 # cat classes.cpp 
#include <iostream>

class A
{
  public:
  void blah(){ std::cout << "blah" << std::endl; }
};

int main() {
  A a;
  a.blah();

  return 0;
}
 7.2 S ppc64 # g++ classes.cpp -o classes -g
 7.2 S ppc64 # stap -L 'process("classes").function("A::*")'
process("/root/work/tmp.8Y489MZbSU/classes").function("A::blah@/root/work/tmp.8Y489MZbSU/classes.cpp:6") $this:class A* const
 7.2 S ppc64 #
=======

This doesn't work on ppc64. Stap can see *something*, but not the above A::blah():

=======
 7.2 S ppc64le # g++ classes.cpp -o classes -g
 7.2 S ppc64le # stap -L 'process("classes").function("*")'
process("/root/work/tmp.r6LMvuQlHG/classes").function("_GLOBAL__sub_I_main@/root/work/tmp.r6LMvuQlHG/classes.cpp:14")
process("/root/work/tmp.r6LMvuQlHG/classes").function("_Z41__static_initialization_and_destruction_0ii")
process("/root/work/tmp.r6LMvuQlHG/classes").function("_ZN1A4blahEv")
process("/root/work/tmp.r6LMvuQlHG/classes").function("__do_global_dtors_aux")
process("/root/work/tmp.r6LMvuQlHG/classes").function("__libc_csu_fini")
process("/root/work/tmp.r6LMvuQlHG/classes").function("__libc_csu_init")
process("/root/work/tmp.r6LMvuQlHG/classes").function("_fini")
process("/root/work/tmp.r6LMvuQlHG/classes").function("_init")
process("/root/work/tmp.r6LMvuQlHG/classes").function("_start")
process("/root/work/tmp.r6LMvuQlHG/classes").function("deregister_tm_clones")
process("/root/work/tmp.r6LMvuQlHG/classes").function("frame_dummy")
process("/root/work/tmp.r6LMvuQlHG/classes").function("main@/root/work/tmp.r6LMvuQlHG/classes.cpp:9")
process("/root/work/tmp.r6LMvuQlHG/classes").function("register_tm_clones")
 7.2 S ppc64le # stap -L 'process("classes").function("A::*")'
 7.2 S ppc64le #
=======

Comment 2 Josh Stone 2015-06-30 16:48:58 UTC
Only functions with @file:line were picked up from debuginfo, just main and _GLOBAL__sub_I_main.  The rest must have been from the symbol table, including the mangled "_ZN1A4blahEv".  We do allow probing by that, but debuginfo only knows this by a linkage_name attribute.  When C++ symbols are in debuginfo, DW_AT_name is usually unadorned, just "blah".  We recreate its hierarchy from the nesting of namespace/class/struct when faced with a pattern like "A::*".

Can you attach "eu-readelf -winfo classes"?

Comment 3 Martin Cermak 2015-07-01 06:15:15 UTC
Created attachment 1044906 [details]
eu-readelf -winfo classes output (for both be and le)

Comment 4 Josh Stone 2015-07-01 16:50:05 UTC
(In reply to Martin Cermak from comment #3)
> Created attachment 1044906 [details]
> eu-readelf -winfo classes output (for both be and le)

Hmm, I don't see any significant difference there.

I'll have to step through it to see why the dwarf version of A::blah() isn't used.

Comment 5 Josh Stone 2015-07-01 18:33:14 UTC
It is because of this code in tapsets.cxx, starting from commit b4c6a4b1cd00f:

 /* Giving priority to sym_table for ppc64*/
 if ((em->e_machine == EM_PPC64) && ((em->e_flags & EF_PPC64_ABI) == 2)
     && (q->dw.mod_info->sym_table))
   {
     set<func_info *> fis = q->dw.mod_info->sym_table->lookup_symbol(func.name);
     for (set<func_info*>::iterator it=fis.begin(); it!=fis.end() ; ++it)
       {
         func.entrypc = (*it)->addr;
         if (is_filtered_func_exists(q->filtered_functions, &func))
           continue;
         q->filtered_functions.push_back(func);
       }
   }
 else if (!func.entrypc && q->dw.function_entrypc (&entrypc))
   {
     func.entrypc = entrypc;
     q->filtered_functions.push_back (func);
   }

We use the first branch for ppc64le (abi==2).  The func.name from debuginfo is simply "blah", but the symbol table only knows "_ZN1A4blahEv", so there's no match.  Actually, func.name may even be decorated like "A::blah" if the pattern was "A::*".

The debuginfo does have a DW_AT_linkage_name though, which is more appropriate for comparing to the symbol table when available.  Plain DW_AT_name is ok otherwise.

Comment 6 Josh Stone 2015-07-01 20:43:09 UTC
Created attachment 1045252 [details]
proposed fixes

- separate the basic symtab addr and its entrypc (maybe ppc64le adjusted)
- use linkage names for looking up DIEs in the symtab
- fallback to the dwarf address when ppc64le symtab doesn't match

This passes manual testing of this bug for me.  Now stap -L function("*") does include "blah" with its "this" parameter.  The address dupes also work to avoid repeating "_ZN1A4blahEv" from the symbol table.  It also works to probe function("_Z*") and function("A::*").

I'll do a full installcheck, and I invite your testing too.

Comment 7 Josh Stone 2015-07-02 04:22:33 UTC
My installcheck comparison looks good -- several ppc64le FAILs now PASS.

Comment 8 Martin Cermak 2015-07-02 11:30:40 UTC
Created attachment 1045478 [details]
test results

Looks pretty good. Reference results:

# of expected passes		5147
# of unexpected failures	391
# of unexpected successes	3
# of expected failures		318
# of unknown successes		2
# of known failures		106
# of untested testcases		187
# of unsupported tests		30

Patch results: 

# of expected passes		5158
# of unexpected failures	383
# of unexpected successes	3
# of expected failures		318
# of unknown successes		2
# of known failures		106
# of untested testcases		185
# of unsupported tests		30

Details attached. The only regression appears to be the gtod (PR3916 - improve timing monotony) testcase whose 3-rd subtest started to FAIL: gtod (100ms interval) (27)

=======
... stuff deleted ...
spawn ./systemtap.base/gtod.sh ./systemtap.base/gtod.stp /root/mcermak-systemtap/systemtap/testsuite/gtod 100000
:00 1435829264366960 appl
:00 1435829264366970 kern
:00 1435829264367007 prog
:01 1435829264467094 appl
:01 1435829264467096 kern
:01 1435829264467097 prog
:02 1435829264567177 appl
:02 1435829264567180 prog
:02 1435829264567199 kern
:03 1435829264667258 appl
:03 1435829264667260 prog
:03 1435829264667299 kern
:04 1435829264767339 appl
:04 1435829264767342 prog
:04 1435829264767400 kern
:05 1435829264867423 appl
:05 1435829264867426 prog
:05 1435829264867504 kern
:06 1435829264967505 appl
:06 1435829264967508 prog
:06 1435829264967605 kern
:07 1435829265067589 appl
:07 1435829265067591 prog
:07 1435829265067708 kern
:08 1435829265167672 appl
:08 1435829265167676 prog
:08 1435829265167812 kern
:09 1435829265267757 appl
:09 1435829265267761 prog
:09 1435829265267916 kern
:10 1435829265367841 appl
:10 1435829265367845 prog
:10 1435829265368020 kern
:11 1435829265467925 appl
:11 1435829265467927 prog
:11 1435829265468123 kern
:12 1435829265568007 appl
:12 1435829265568010 prog
:12 1435829265568225 kern
:13 1435829265668091 appl
:13 1435829265668093 prog
:13 1435829265668328 kern
:14 1435829265768173 appl
:14 1435829265768175 prog
:14 1435829265768429 kern
:15 1435829265868254 appl
:15 1435829265868257 prog
:15 1435829265868530 kern
:16 1435829265968335 appl
:16 1435829265968338 prog
:16 1435829265968631 kern
:17 1435829266068416 appl
:17 1435829266068419 prog
:17 1435829266068732 kern
:18 1435829266168497 appl
:18 1435829266168500 prog
:18 1435829266168832 kern
:19 1435829266268578 appl
:19 1435829266268581 prog
:19 1435829266268933 kern
:20 1435829266368659 appl
:20 1435829266368661 prog
:20 1435829266369033 kern
:21 1435829266468743 appl
:21 1435829266468746 prog
:21 1435829266469137 kern
:22 1435829266568824 appl
:22 1435829266568827 prog
:22 1435829266569237 kern
:23 1435829266668905 appl
:23 1435829266668907 prog
:23 1435829266669338 kern
:24 1435829266768985 appl
:24 1435829266768988 prog
:24 1435829266769438 kern
:25 1435829266869066 appl
:25 1435829266869069 prog
:25 1435829266869539 kern
:26 1435829266969151 appl
:26 1435829266969154 prog
:26 1435829266969643 kern
:27 1435829267069233 appl
:27 1435829267069235 prog
:27 1435829267069744 kern
:28 1435829267169314 appl
:28 1435829267169317 prog
:28 1435829267169845 kern
:29 1435829267269395 appl
:29 1435829267269398 prog
:29 1435829267269946 kern
:30 1435829267369478 appl
:30 1435829267369482 prog
:30 1435829267370049 kern
:31 1435829267469561 appl
:31 1435829267469563 prog
:31 1435829267470151 kern
:32 1435829267569648 appl
:32 1435829267569652 prog
:32 1435829267570258 kern
:33 1435829267669730 appl
:33 1435829267669732 prog
:33 1435829267670359 kern
:34 1435829267769812 appl
:34 1435829267769815 prog
:34 1435829267770462 kern
:35 1435829267869895 appl
:35 1435829267869898 prog
:35 1435829267870564 kern
:36 1435829267969978 appl
:36 1435829267969981 prog
:36 1435829267970666 kern
:37 1435829268070063 appl
:37 1435829268070066 prog
:37 1435829268070771 kern
:38 1435829268170146 appl
:38 1435829268170150 prog
:38 1435829268170875 kern
:39 1435829268270229 appl
:39 1435829268270234 prog
:39 1435829268270977 kern
:40 1435829268370326 appl
:40 1435829268370329 prog
:40 1435829268371093 kern
:41 1435829268470411 appl
:41 1435829268470416 prog
:41 1435829268471198 kern
:42 1435829268570499 appl
:42 1435829268570502 prog
:42 1435829268571305 kern
:43 1435829268670582 appl
:43 1435829268670586 prog
:43 1435829268671408 kern
:44 1435829268770668 appl
:44 1435829268770671 prog
:44 1435829268771513 kern
:45 1435829268870751 appl
:45 1435829268870754 prog
:45 1435829268871616 kern
:46 1435829268970835 appl
:46 1435829268970838 prog
:46 1435829268971720 kern
:47 1435829269070918 appl
:47 1435829269070921 prog
:47 1435829269071822 kern
:48 1435829269171000 appl
:48 1435829269171003 prog
:48 1435829269171924 kern
:49 1435829269271085 appl
:49 1435829269271088 prog
:49 1435829269272029 kern
:50 1435829269371169 appl
:50 14358292693711difference of (511, 509) for iteration 27 is too large
difference of (531, 528) for iteration 28 is too large
difference of (551, 548) for iteration 29 is too large
difference of (571, 567) for iteration 30 is too large
difference of (590, 588) for iteration 31 is too large
difference of (610, 606) for iteration 32 is too large
difference of (629, 627) for iteration 33 is too large
difference of (650, 647) for iteration 34 is too large
difference of (669, 666) for iteration 35 is too large
difference of (688, 685) for iteration 36 is too large
difference of (708, 705) for iteration 37 is too large
difference of (729, 725) for iteration 38 is too large
difference of (748, 743) for iteration 39 is too large
difference of (767, 764) for iteration 40 is too large
difference of (787, 782) for iteration 41 is too large
difference of (806, 803) for iteration 42 is too large
difference of (826, 822) for iteration 43 is too large
difference of (845, 842) for iteration 44 is too large
difference of (865, 862) for iteration 45 is too large
difference of (885, 882) for iteration 46 is too large
difference of (904, 901) for iteration 47 is too large
difference of (924, 921) for iteration 48 is too large
difference of (944, 941) for iteration 49 is too large
72 prog
:50 1435829269372132 kern
:51 1435829269471252 appl
:51 1435829269471254 prog
:51 1435829269472234 kern
:52 1435829269571333 appl
:52 1435829269571337 prog
:52 1435829269572336 kern
:53 1435829269671412 appl
:53 1435829269671415 prog
:53 1435829269672434 kern
:54 1435829269771494 appl
:54 1435829269771496 prog
:54 1435829269772535 kern
:55 1435829269871584 appl
:55 1435829269871587 prog
:55 1435829269872645 kern
:56 1435829269971666 appl
:56 1435829269971672 prog
:56 1435829269972748 kern
:57 1435829270071750 appl
:57 1435829270071753 prog
:57 1435829270072851 kern
:58 1435829270171832 appl
:58 1435829270171840 prog
:58 1435829270172955 kern
:59 1435829270271921 appl
:59 1435829270271930 prog
:59 1435829270273064 kern
:60 1435829270372007 appl
:60 1435829270372010 prog
:60 1435829270373166 kern
:61 1435829270472088 appl
:61 1435829270472091 prog
:61 1435829270473267 kern
:62 1435829270572168 appl
:62 1435829270572171 prog
:62 1435829270573367 kern
:63 1435829270672247 appl
:63 1435829270672250 prog
:63 1435829270673465 kern
:64 1435829270772327 appl
:64 1435829270772330 prog
:64 1435829270773565 kern
:65 1435829270872408 appl
:65 1435829270872411 prog
:65 1435829270873666 kern
:66 1435829270972490 appl
:66 1435829270972493 prog
:66 1435829270973767 kern
:67 1435829271072579 appl
:67 1435829271072590 prog
:67 1435829271073880 kern
:68 1435829271172671 appl
:68 1435829271172674 prog
:68 1435829271173987 kern
:69 1435829271272752 appl
:69 1435829271272755 prog
:69 1435829271274088 kern
:70 1435829271372833 appl
:70 1435829271372836 prog
:70 1435829271374188 kern
:71 1435829271472915 appl
:71 1435829271472918 prog
:71 1435829271474290 kern
:72 1435829271572996 appl
:72 1435829271572999 prog
:72 1435829271574391 kern
:73 1435829271673077 appl
:73 1435829271673080 prog
:73 1435829271674491 kern
:74 1435829271773157 appl
:74 1435829271773159 prog
:74 1435829271774591 kern
:75 1435829271873237 appl
:75 1435829271873240 prog
:75 1435829271874691 kern
:76 1435829271973317 appl
:76 1435829271973319 prog
:76 1435829271974790 kern
:77 1435829272073396 appl
:77 1435829272073398 prog
:77 1435829272074888 kern
:78 1435829272173476 appl
:78 1435829272173479 prog
:78 1435829272174989 kern
:79 1435829272273556 appl
:79 1435829272273559 prog
:79 1435829272275088 kern
:80 1435829272373639 appl
:80 1435829272373641 prog
:80 1435829272375190 kern
:81 1435829272473719 appl
:81 1435829272473721 prog
:81 1435829272475290 kern
:82 1435829272573799 appl
:82 1435829272573802 prog
:82 1435829272575390 kern
:83 1435829272673879 appl
:83 1435829272673882 prog
:83 1435829272675489 kern
:84 1435829272773961 appl
:84 1435829272773963 prog
:84 1435829272775591 kern
:85 1435829272874040 appl
:85 1435829272874042 prog
:85 1435829272875689 kern
:86 1435829272974120 appl
:86 1435829272974122 prog
:86 1435829272975789 kern
:87 1435829273074200 appl
:87 1435829273074203 prog
:87 1435829273075889 kern
:88 1435829273174280 appl
:88 1435829273174283 prog
:88 1435829273175989 kern
:89 1435829273274361 appl
:89 1435829273274364 prog
:89 1435829273276089 kern
:90 1435829273374444 appl
:90 1435829273374446 prog
:90 1435829273376191 kern
:91 1435829273474523 appl
:91 1435829273474526 prog
:91 1435829273476290 kern
:92 1435829273574606 appl
:92 1435829273574609 prog
:92 1435829273576393 kern
:93 1435829273674689 appl
:93 1435829273674692 prog
:93 1435829273676495 kern
:94 1435829273774772 appl
:94 1435829273774774 prog
:94 1435829273776598 kern
:95 1435829273874902 appl
:95 1435829273874905 prog
:95 1435829273876748 kern
:96 1435829273974986 appl
:96 1435829273974989 prog
:96 1435829273976851 kern
:97 1435829274075068 appl
:97 1435829274075070 prog
:97 1435829274076952 kern
:98 1435829274175150 appl
:98 1435829274175153 prog
:98 1435829274177055 kern
:99 1435829274275232 appl
:99 1435829274275234 prog
:99 1435829274277156 kern
difference of (963, 960) for iteration 50 is too large
difference of (982, 980) for iteration 51 is too large
difference of (1003, 999) for iteration 52 is too large
difference of (1022, 1019) for iteration 53 is too large
difference of (1041, 1039) for iteration 54 is too large
difference of (1061, 1058) for iteration 55 is too large
difference of (1082, 1076) for iteration 56 is too large
difference of (1101, 1098) for iteration 57 is too large
difference of (1123, 1115) for iteration 58 is too large
difference of (1143, 1134) for iteration 59 is too large
difference of (1159, 1156) for iteration 60 is too large
difference of (1179, 1176) for iteration 61 is too large
difference of (1199, 1196) for iteration 62 is too large
difference of (1218, 1215) for iteration 63 is too large
difference of (1238, 1235) for iteration 64 is too large
difference of (1258, 1255) for iteration 65 is too large
difference of (1277, 1274) for iteration 66 is too large
difference of (1301, 1290) for iteration 67 is too large
difference of (1316, 1313) for iteration 68 is too large
difference of (1336, 1333) for iteration 69 is too large
difference of (1355, 1352) for iteration 70 is too large
difference of (1375, 1372) for iteration 71 is too large
difference of (1395, 1392) for iteration 72 is too large
difference of (1414, 1411) for iteration 73 is too large
difference of (1434, 1432) for iteration 74 is too large
difference of (1454, 1451) for iteration 75 is too large
difference of (1473, 1471) for iteration 76 is too large
difference of (1492, 1490) for iteration 77 is too large
difference of (1513, 1510) for iteration 78 is too large
difference of (1532, 1529) for iteration 79 is too large
difference of (1551, 1549) for iteration 80 is too large
difference of (1571, 1569) for iteration 81 is too large
difference of (1591, 1588) for iteration 82 is too large
difference of (1610, 1607) for iteration 83 is too large
difference of (1630, 1628) for iteration 84 is too large
difference of (1649, 1647) for iteration 85 is too large
difference of (1669, 1667) for iteration 86 is too large
difference of (1689, 1686) for iteration 87 is too large
difference of (1709, 1706) for iteration 88 is too large
difference of (1728, 1725) for iteration 89 is too large
difference of (1747, 1745) for iteration 90 is too large
difference of (1767, 1764) for iteration 91 is too large
difference of (1787, 1784) for iteration 92 is too large
difference of (1806, 1803) for iteration 93 is too large
difference of (1826, 1824) for iteration 94 is too large
difference of (1846, 1843) for iteration 95 is too large
difference of (1865, 1862) for iteration 96 is too large
difference of (1884, 1882) for iteration 97 is too large
difference of (1905, 1902) for iteration 98 is too large
difference of (1924, 1922) for iteration 99 is too large
maximum time difference was 1924 us
FAIL: gtod (100ms interval) (27)
testcase ./systemtap.base/gtod.exp completed in 19 seconds

		=== systemtap Summary ===

# of expected passes		2
# of unexpected failures	1
runtest completed at Thu Jul  2 05:27:55 2015
=======


So far I only tested on ppc64le. What is the anticipated impact on other arches?

Comment 11 Josh Stone 2015-07-02 18:31:46 UTC
(In reply to Martin Cermak from comment #8)
> So far I only tested on ppc64le. What is the anticipated impact on other arches?

I expect minimal impact on other arches.

If anything, the update_symtab change might improve dupe filtering, by matching mangled dwarf subprograms in the symbol table.  But those should get filtered anyway for having a duplicate address.

Comment 12 Martin Cermak 2015-07-03 10:37:17 UTC
Tested on rhel[567] all arches. Test logs temporarily at [1]. There is some noise, some tests didn't finish. But in general I'd say this is good to go for respin.


[1] https://url.corp.redhat.com/c7729aa

Comment 15 errata-xmlrpc 2015-11-19 11:47:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-2124.html


Note You need to log in before you can comment on or make changes to this bug.