Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
This occurs when:
1) dyninst is running in static mode
- does not effect stapdyn which only runs in dynamic mode
2) a dyninst probe adds a call to a routine that can be called directly, i.e. not in a shared library, it mistakenly adds the called function to the dynamic symbol table.
- works okay if added call is to a routine in a shared object
3) I have a partial fix but it does not (yet) work for pic.
- not yet fixed in upstream
This gets static test to pass and has no dyninst testsuite regressions: (if call is local and does not need pic then call using displacement otherwise load address)
@@ -651,13 +653,15 @@ Register EmitterAARCH64::emitCall(opCode op,
assert(gen.rs());
- //Address of function to call in scratch register
+ // Address of function to call in scratch register
Register scratch = gen.rs()->getScratchRegister(gen);
assert(scratch != REG_NULL && "cannot get a scratch register");
gen.markRegDefined(scratch);
- if (gen.addrSpace()->edit() != NULL) {
- // gen.as.edit() checks if we are in rewriter mode
+ if (gen.addrSpace()->edit() != NULL
+ && (gen.func()->obj() != callee->obj()
+ || gen.addrSpace()->needsPIC())) {
+ // gen.as.edit() checks if we are in rewriter mode
Address dest = getInterModuleFuncAddr(callee, gen);
// emit ADR instruction
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 (new packages: dyninst), 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://access.redhat.com/errata/RHBA-2022:2493
With static instrumentation on aarch64, the mutated binary reports an unresolved symbol and fails to run. The actual error is at the bottom of the following log. This is with dyninst-11.0.0-4.el9.aarch64 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Setup :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ 02:38:07 ] :: [ BEGIN ] :: Creating tmp directory :: actually running 'TmpDir=$(mktemp -d)' :: [ 02:38:07 ] :: [ PASS ] :: Creating tmp directory (Expected 0, got 0) :: [ 02:38:08 ] :: [ BEGIN ] :: Running 'cp -r dynamic dynamic-double static /tmp/tmp.tbKSFp4FFp/' :: [ 02:38:08 ] :: [ PASS ] :: Command 'cp -r dynamic dynamic-double static /tmp/tmp.tbKSFp4FFp/' (Expected 0, got 0) :: [ 02:38:08 ] :: [ BEGIN ] :: Running 'pushd /tmp/tmp.tbKSFp4FFp' /tmp/tmp.tbKSFp4FFp /tmp/tmp.Ye3Qqi1GtZ :: [ 02:38:08 ] :: [ PASS ] :: Command 'pushd /tmp/tmp.tbKSFp4FFp' (Expected 0, got 0) :: [ 02:38:08 ] :: [ LOG ] :: DevToolset DISABLED. dyninst-11.0.0-4.el9.aarch64 :: [ 02:38:08 ] :: [ PASS ] :: Checking for the presence of dyninst rpm :: [ 02:38:08 ] :: [ LOG ] :: Package versions: :: [ 02:38:08 ] :: [ LOG ] :: dyninst-11.0.0-4.el9.aarch64 :: [ 02:38:08 ] :: [ LOG ] :: Variable LINK == -L/usr/lib64/dyninst -L/usr/lib64/dyninst/lib :: [ 02:38:08 ] :: [ LOG ] :: Variable INCLUDE == -I/usr/include/dyninst :: [ 02:38:08 ] :: [ LOG ] :: Variable DYNINST_ROOT == /usr/lib64/dyninst :: [ 02:38:08 ] :: [ LOG ] :: Variable BITS == 64 :: [ 02:38:08 ] :: [ LOG ] :: Variable DYNINSTAPI_RT_LIB == /usr/lib64/dyninst/libdyninstAPI_RT.so.11.0.0 :: [ 02:38:08 ] :: [ LOG ] :: Variable LD_LIBRARY_PATH == :/usr/lib64/dyninst :: [ 02:38:08 ] :: [ BEGIN ] :: Compiling static dyninst example. :: actually running 'make BITS="64" DYNINST_ROOT="/usr/lib64/dyninst" INCLUDE="-I/usr/include/dyninst" LINK="-L/usr/lib64/dyninst -L/usr/lib64/dyninst/lib"' make[1]: Entering directory '/tmp/tmp.tbKSFp4FFp/static' g++ -g -o mutatee mutatee.cpp g++ -g -o mutator -I/usr/include/dyninst -L/usr/lib64/dyninst -L/usr/lib64/dyninst/lib -ldyninstAPI -ldl -lboost_system mutator.cpp make[1]: Leaving directory '/tmp/tmp.tbKSFp4FFp/static' :: [ 02:38:20 ] :: [ PASS ] :: Compiling static dyninst example. (Expected 0, got 0) :: [ 02:38:20 ] :: [ BEGIN ] :: Compiling dynamic dyninst example. :: actually running 'make BITS="64" DYNINST_ROOT="/usr/lib64/dyninst" INCLUDE="-I/usr/include/dyninst" LINK="-L/usr/lib64/dyninst -L/usr/lib64/dyninst/lib"' make[1]: Entering directory '/tmp/tmp.tbKSFp4FFp/dynamic' g++ -g -o mutatee mutatee.cpp mutatee.cpp: In function ‘int function_name()’: mutatee.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type] 17 | } | ^ g++ -g -o mutator -I/usr/include/dyninst -L/usr/lib64/dyninst -L/usr/lib64/dyninst/lib -ldyninstAPI -ldl -lboost_system mutator.cpp make[1]: Leaving directory '/tmp/tmp.tbKSFp4FFp/dynamic' :: [ 02:38:30 ] :: [ PASS ] :: Compiling dynamic dyninst example. (Expected 0, got 0) :: [ 02:38:30 ] :: [ BEGIN ] :: Compiling dynamic-double dyninst example. :: actually running 'make BITS="64" DYNINST_ROOT="/usr/lib64/dyninst" INCLUDE="-I/usr/include/dyninst" LINK="-L/usr/lib64/dyninst -L/usr/lib64/dyninst/lib"' make[1]: Entering directory '/tmp/tmp.tbKSFp4FFp/dynamic-double' g++ -g -o mutatee mutatee.cpp mutatee.cpp: In function ‘int function_name()’: mutatee.cpp:22:1: warning: no return statement in function returning non-void [-Wreturn-type] 22 | } | ^ g++ -g -o mutator -I/usr/include/dyninst -L/usr/lib64/dyninst -L/usr/lib64/dyninst/lib -ldyninstAPI -ldl -lboost_system mutator.cpp make[1]: Leaving directory '/tmp/tmp.tbKSFp4FFp/dynamic-double' :: [ 02:38:40 ] :: [ PASS ] :: Compiling dynamic-double dyninst example. (Expected 0, got 0) :: [ 02:38:40 ] :: [ LOG ] :: SELINUX IS ENABLED. :: [ 02:38:40 ] :: [ LOG ] :: SELINUX: selinuxuser_execmod --> on -- already OK. :: [ 02:38:40 ] :: [ LOG ] :: SELINUX: selinuxuser_execstack --> on -- already OK. :: [ 02:38:40 ] :: [ LOG ] :: SELINUX: deny_ptrace --> off -- already OK. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Duration: 33s :: Assertions: 7 good, 0 bad :: RESULT: PASS (Setup) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Testing static instrumentation :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ 02:38:40 ] :: [ BEGIN ] :: Running 'coredumpctl list > /tmp/tmp.C1pGsISMwY' No coredumps found. :: [ 02:38:40 ] :: [ PASS ] :: Command 'coredumpctl list > /tmp/tmp.C1pGsISMwY' (Expected 0,1, got 1) :: [ 02:38:40 ] :: [ BEGIN ] :: Running './mutator' Downloading \ MUTATION DONE. MUTATOR IS GOING... :: [ 02:38:41 ] :: [ PASS ] :: Command './mutator' (Expected 0, got 0) :: [ 02:38:41 ] :: [ PASS ] :: File mutated should exist ./mutated: symbol lookup error: ./mutated: undefined symbol: _Z4incrv :: [ 02:38:41 ] :: [ BEGIN ] :: Running 'coredumpctl list > /tmp/tmp.QULZneFLlx' No coredumps found. :: [ 02:38:41 ] :: [ PASS ] :: Command 'coredumpctl list > /tmp/tmp.QULZneFLlx' (Expected 0,1, got 1) :: [ 02:38:41 ] :: [ FAIL ] :: Instrumentation FAILed. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Duration: 1s :: Assertions: 4 good, 1 bad :: RESULT: FAIL (Testing static instrumentation)