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 1438514 - on ppc64, ppc64le, and s390x, the jstack systemtap tapset file is causing a parse error
Summary: on ppc64, ppc64le, and s390x, the jstack systemtap tapset file is causing a p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: java-1.8.0-openjdk
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Andrew John Hughes
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-03 15:34 UTC by David Smith
Modified: 2017-08-01 08:46 UTC (History)
5 users (show)

Fixed In Version: java-1.8.0-openjdk-1.8.0.131-2.b11.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 08:46:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Icedtea Bugzilla 3348 0 None None None 2019-04-15 19:50:48 UTC
Red Hat Product Errata RHBA-2017:1831 0 normal SHIPPED_LIVE java-1.8.0-openjdk bug fix and enhancement update 2017-08-01 12:39:07 UTC

Description David Smith 2017-04-03 15:34:33 UTC
Description of problem:

On ppc64, ppc64le, and s390x, the jstack systemtap tapset file is causing a parse error on every use of systemtap.

Version-Release number of selected component (if applicable):

java-1.8.0-openjdk-devel-1.8.0.121-9.b14.el7.ppc64
systemtap-3.1-2.el7.ppc64

How reproducible:

100%

Steps to Reproduce:
1. Try to compile a systemtap script:

====
# stap -e 'probe begin { exit() }'
parse error: expected literal string or number
        saw: operator '*' at /usr/share/systemtap/tapset/powerpc/jstack-1.8.0.121-9.b14.el7.ppc64.stp:109:6
     source:   %: **ERROR** unknown architecture
                  ^

1 parse error.
WARNING: tapset "/usr/share/systemtap/tapset/powerpc/jstack-1.8.0.121-9.b14.el7.ppc64.stp" has errors, and will be skipped
====

Actual results:

Parse error.

Expected results:

No parse errors.

Additional info:

Systemtap parses the entire tapset library for correctness when compiling a script. Since the jstack-1.8.0.121-9.b14.el7.ppc64.stp doesn't parse correctly (unless you are on i686/x86_64/arm64), we get a parse error on every script.

The following patch fixes this problem (by turning the compile-time parse error into a runtime error):

====
--- jstack-1.8.0.121-9.b14.el7.ppc64.stp-orig	2017-04-03 10:18:33.416347690 -0400
+++ /usr/share/systemtap/tapset/powerpc/jstack-1.8.0.121-9.b14.el7.ppc64.stp	2017-04-03 11:28:58.681169806 -0400
@@ -106,7 +106,13 @@
      pc_register = "pc";
      ptr_size = 8; // XXX - might be probing 32-on-64 jvm.
      ptr_mask = 0xFFFFFFFFFFFFFFFF;
-  %: **ERROR** unknown architecture
+  %:
+     sp_register = "";
+     fp_register = "";
+     pc_register = "";
+     ptr_size = 8;
+     ptr_mask = 0xFFFFFFFFFFFFFFFF;
+     error("unknown architecture")
   %) %) %)
 
   // Pretend we have an array at address zero and take address of second
====

This new code will cause a runtime error, which looks like the following:

====
# stap -e 'probe java("multiparams").class("multiparams").method("printMessage10(Object, String, short, char, boolean, byte, float, double, long, int)") { print_jstack() }' -c "java -Djava.library.path=/usr/libexec/systemtap -classpath /usr/libexec/systemtap/HelperSDT.jar:. multiparams"
ERROR: unknown architecture
multiparams test started, waiting
Setting org.jboss.byteman.transform.all=true
WARNING: Number of errors: 1, skipped probes: 0
WARNING: /usr/bin/staprun exited with status: 1
====

Comment 2 Andrew John Hughes 2017-04-04 00:44:33 UTC
This is an improvement on the status before bug 1373848, because the tapsets are now actually installed correctly.

Should be easy enough to apply this fix.

Comment 3 Mark Wielaard 2017-04-07 15:28:35 UTC
The easiest fix would be to just assign "unknown" strings to the registers instead. e.g. replace %: **ERROR** with:
 
  %: sp_register = "unknown";
     fp_register = "unknown";
     pc_register = "unknown";
  %) %) %)
 
That way it turns into a "normal" runtime issue instead of a parse/syntax issue.

There are nicer ways to fix it, with an arch specific helper function to fetch the registers. But the above seems the quickest.

Comment 7 errata-xmlrpc 2017-08-01 08:46:49 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://access.redhat.com/errata/RHBA-2017:1831


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