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.

Bug 1111106

Summary: setjmp-longjmp tracing regression (s390x)
Product: Red Hat Enterprise Linux 6 Reporter: Martin Cermak <mcermak>
Component: systemtapAssignee: Frank Ch. Eigler <fche>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: low Docs Contact:
Priority: low    
Version: 6.6CC: emajorsi, mbenitez, mjw, scox
Target Milestone: rc   
Target Release: ---   
Hardware: s390x   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemtap-2.7-2.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 06:44:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
stap-report output none

Description Martin Cermak 2014-06-19 09:17:27 UTC
Created attachment 910307 [details]
stap-report output

Looks like systemtap.base/bz5274.exp regresed:

=======

# cat systemtap.base/./bz5274.c
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>

void funcd(int i, jmp_buf env)
{
        printf("In %s: %s :%d : i=%d.  Calling longjmp\n", "bz5274.c",__func__,__LINE__,i);
        longjmp(env, i);
}

void funcc(int i, jmp_buf env)
{
        printf("In %s: %s :%d : i=%d.  Calling funcd\n", "bz5274.c",__func__,__LINE__,i);
        funcd(i,env);
}


void funcb(int i, jmp_buf env)
{
        printf("In %s: %s :%d : i=%d.  Calling funcc\n", "bz5274.c",__func__,__LINE__,i);
        funcc(i,env);
}


void funca(char *s, jmp_buf env)
{
        int i;

        printf("IN funca, before setjmp\n");
        i = setjmp(env);
        printf("IN funca, after setjmp\n");
        if (i == 4)
                return;
        funcb(++i, env);
        return;
}



int main(int argc, char **argv)
{
        jmp_buf env;

        funca("Hello World", env);
        exit(0);
}

=======

# gcc -o ./bz5274 -g ./systemtap.base/./bz5274.c   # ppc64 needs -m64
# ./bz5274
In bz5274.c: funcb :20 : i=1.  Calling funcc
In bz5274.c: funcc :13 : i=1.  Calling funcd
In bz5274.c: funcd :7 : i=1.  Calling longjmp
In bz5274.c: funcb :20 : i=2.  Calling funcc
In bz5274.c: funcc :13 : i=2.  Calling funcd
In bz5274.c: funcd :7 : i=2.  Calling longjmp
In bz5274.c: funcb :20 : i=3.  Calling funcc
In bz5274.c: funcc :13 : i=3.  Calling funcd
In bz5274.c: funcd :7 : i=3.  Calling longjmp
In bz5274.c: funcb :20 : i=4.  Calling funcc
In bz5274.c: funcc :13 : i=4.  Calling funcd
In bz5274.c: funcd :7 : i=4.  Calling longjmp


Now "old" systemtap-2.3-3.el6.s390x gives:

=======

# stap ./systemtap.base/./bz5274.stp -c "./systemtap.base/./bz5274.sh"
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("main@./systemtap.base/./bz5274.c:40").call Entering      0 bz5274(21400):
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funca@./systemtap.base/./bz5274.c:25").call Entering      6 bz5274(21400): 
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcb@./systemtap.base/./bz5274.c:18").call Entering     19 bz5274(21400):  
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcc@./systemtap.base/./bz5274.c:11").call Entering     29 bz5274(21400):   
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcd@./systemtap.base/./bz5274.c:5").call Entering     33 bz5274(21400):    
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcb@./systemtap.base/./bz5274.c:18").call Entering     37 bz5274(21400):     
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcc@./systemtap.base/./bz5274.c:11").call Entering     40 bz5274(21400):      
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcd@./systemtap.base/./bz5274.c:5").call Entering     43 bz5274(21400):       
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcb@./systemtap.base/./bz5274.c:18").call Entering     47 bz5274(21400):        
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcc@./systemtap.base/./bz5274.c:11").call Entering     50 bz5274(21400):         
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcd@./systemtap.base/./bz5274.c:5").call Entering     53 bz5274(21400):          
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcb@./systemtap.base/./bz5274.c:18").call Entering     57 bz5274(21400):           
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcc@./systemtap.base/./bz5274.c:11").call Entering     60 bz5274(21400):            
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funcd@./systemtap.base/./bz5274.c:5").call Entering     63 bz5274(21400):             
process("/tmp/tmp.JHL3iB5LLF/testsuite/bz5274").function("funca@./systemtap.base/./bz5274.c:25").return     67 bz5274(21400):              returns 0x17

=======

Whereas new systemtap-2.5-3.el6.s390x gives:

=======

# stap ./systemtap.base/./bz5274.stp -c "./systemtap.base/./bz5274.sh"
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("_start").call Entering      0 bz5274(20514):
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("__libc_start_main@@GLIBC_2.2").call Entering      6 bz5274(20514): 
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("__libc_csu_init").call Entering     14 bz5274(20514):  
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("_init").call Entering     18 bz5274(20514):   
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("frame_dummy").call Entering     21 bz5274(20514):    
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("frame_dummy").return     25 bz5274(20514):     returns 0x0
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("__do_global_ctors_aux").call Entering     27 bz5274(20514):    
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("__do_global_ctors_aux").return     31 bz5274(20514):     returns 0x0
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("_init").return     33 bz5274(20514):    returns 0x0
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("__libc_csu_init").return     35 bz5274(20514):   returns 0x0
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("main@./systemtap.base/./bz5274.c:38").call Entering     40 bz5274(20514):  
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("funca@./systemtap.base/./bz5274.c:25").call Entering     46 bz5274(20514):   
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("_setjmp@@GLIBC_2.2").call Entering     49 bz5274(20514):    
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("_setjmp@@GLIBC_2.2").return     52 bz5274(20514):     returns 0x0
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("funcb@./systemtap.base/./bz5274.c:18").call Entering     57 bz5274(20514):    
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("printf@@GLIBC_2.4").call Entering     60 bz5274(20514):     
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("printf@@GLIBC_2.4").return     76 bz5274(20514):      returns 0x2d
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("funcc@./systemtap.base/./bz5274.c:11").call Entering     81 bz5274(20514):     
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("printf@@GLIBC_2.4").call Entering     84 bz5274(20514):      
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("printf@@GLIBC_2.4").return     87 bz5274(20514):       returns 0x2d
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("funcd@./systemtap.base/./bz5274.c:5").call Entering     92 bz5274(20514):      
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("printf@@GLIBC_2.4").call Entering     95 bz5274(20514):       
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("printf@@GLIBC_2.4").return     98 bz5274(20514):        returns 0x2e
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("longjmp@@GLIBC_2.2").call Entering    101 bz5274(20514):       
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("funcb@./systemtap.base/./bz5274.c:18").return    105 bz5274(20514):        returns 0x1
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("funca@./systemtap.base/./bz5274.c:25").return    107 bz5274(20514):       returns 0x1
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("exit@@GLIBC_2.2").call Entering    109 bz5274(20514):      
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("_fini").call Entering    114 bz5274(20514):       
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("__do_global_dtors_aux").call Entering    117 bz5274(20514):        
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("__do_global_dtors_aux").return    120 bz5274(20514):         returns 0x0
process("/tmp/tmp.jSp8OEGYs4/testsuite/bz5274").function("_fini").return    122 bz5274(20514):        returns 0x0


=======

IOW stap gives up at the first longjmp(). For both of the above runs, bitwise identical unstripped binary was used. So it looks like a stap regression.

Comment 5 Martin Cermak 2015-04-15 10:39:26 UTC
Verified using systemtap.base/bz5274.exp. There is a small issue in the testcase though: Due to updates in blacklist stap now reports a warning to stderr:

=======
 # stap systemtap.base/bz5274.stp -c ./systemtap.base/bz5274 > /dev/null
WARNING: function _start return probe is blacklisted: keyword at systemtap.base/bz5274.stp:5:1
 source: probe process.function("*").return {
         ^
=======

This warning is being caught() and makes the testcase "untested". Hiding warnings using -w fixes the testcase for me.

Comment 6 Martin Cermak 2015-04-15 10:44:46 UTC
Hmm, actually there is one more ppc64 specific thing that makes the testcase untested: Using 2.6.32-551.el6.ppc64 the testcase ends up on uretprobes_p check. Looking closer I suspect utrace_orig_p() in lib/systemtap.exp not to work well.

=======
# Test for kernel built-in utrace (CONFIG_UTRACE).
# Only original rhel5/6-era utrace need apply.
proc utrace_orig_p {} {
    # We want utrace_attach (rhel5) or utrace_attach_task (rhel6), but don't
    # get confused by the private module version of any active stap module.
    return [grep_kallsyms "T utrace_attach"]
}
=======

On mentioned kernel we have:

=======
 6.7 S ppc64 # cat /proc/kallsyms | grep "T utrace_attach"
 6.7 S ppc64 # 
 6.7 S ppc64 # cat /proc/kallsyms | grep "utrace_attach"
c0000000001032a0 T .utrace_attach_task
c000000000103610 T .utrace_attach_pid
c000000000843508 d __ksymtab_utrace_attach_pid
c000000000843518 d __ksymtab_utrace_attach_task
c000000000850f60 d __kcrctab_utrace_attach_pid
c000000000850f68 d __kcrctab_utrace_attach_task
c000000000857ab7 r __kstrtab_utrace_attach_pid
c000000000857ac9 r __kstrtab_utrace_attach_task
c000000000f44830 D utrace_attach_task
c000000000f44840 D utrace_attach_pid
 6.7 S ppc64 #
=======

Comment 7 Martin Cermak 2015-04-15 10:52:34 UTC
Verified the original bugreport against systemtap-2.7-2.el6.

Comment 8 Martin Cermak 2015-04-15 11:46:23 UTC
Comments 5 and 6 addressed in upstream commit e5de04ab.

Comment 10 errata-xmlrpc 2015-07-22 06:44:52 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/RHBA-2015-1333.html