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 1623579 - systemtap: java-1.8.0-openjdk: failing reproducer for 804632
Summary: systemtap: java-1.8.0-openjdk: failing reproducer for 804632
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemtap
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Serguei Makarov
QA Contact: Martin Cermak
URL:
Whiteboard:
Depends On:
Blocks: 1643040
TreeView+ depends on / blocked
 
Reported: 2018-08-29 16:35 UTC by zzambers
Modified: 2019-08-06 13:01 UTC (History)
8 users (show)

Fixed In Version: systemtap-4.0-8.el7
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 13:01:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
reproducer-804632.tar.xz (10.00 KB, application/x-tar)
2018-08-29 16:41 UTC, zzambers
no flags Details
rhel-7.5-pkgs-beaker-broken.txt (22.76 KB, text/plain)
2018-08-29 16:44 UTC, zzambers
no flags Details
rhel-7.6-pkgs-beaker-working.txt (21.90 KB, text/plain)
2018-08-29 16:45 UTC, zzambers
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Icedtea Bugzilla 3625 0 None None None 2019-07-29 17:01:24 UTC
Red Hat Product Errata RHBA-2019:2172 0 None None None 2019-08-06 13:01:14 UTC

Description zzambers 2018-08-29 16:35:31 UTC
When I was trying to run on reproducer for 804632 it failed with following output on rhel-7.5 distro in beaker:

Pass 1: parsed user script and 475 library scripts using 242828virt/44592res/3452shr/41360data kb, in 500usr/20sys/532real ms.
stap: stapregex-dfa.cxx:152: stapregex::arc_priority stapregex::refine_lower(const arc_priority&): Assertion `a.first <= (9223372036854775807LL * 2ULL + 1)/4' failed. 

systemtap pkgs:
systemtap-3.2-8.el7_5.x86_64
systemtap-client-3.2-8.el7_5.x86_64
systemtap-devel-3.2-8.el7_5.x86_64
systemtap-runtime-3.2-8.el7_5.x86_64
systemtap-runtime-java-3.2-8.el7_5.x86_64
systemtap-sdt-devel-3.2-8.el7_5.x86_64

java pkgs:
java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
java-1.8.0-openjdk-debuginfo-1.8.0.181-3.b13.el7_5.x86_64
java-1.8.0-openjdk-devel-1.8.0.181-3.b13.el7_5.x86_64
java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64

kernel release:
3.10.0-862.11.6.el7.x86_64




I also tried to run the same reproducer on latest rhel-7.6 distro in beaker, but it passed there. Packages were following:

systemtap pkgs:
systemtap-3.3-2.el7.x86_64
systemtap-runtime-3.3-2.el7.x86_64
systemtap-sdt-devel-3.3-2.el7.x86_64
systemtap-runtime-java-3.3-2.el7.x86_64
systemtap-devel-3.3-2.el7.x86_64
systemtap-client-3.3-2.el7.x86_64

java pkgs:
java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64
java-1.8.0-openjdk-debuginfo-1.8.0.181-7.b13.el7.x86_64
java-1.8.0-openjdk-devel-1.8.0.181-7.b13.el7.x86_64
java-1.8.0-openjdk-headless-1.8.0.181-7.b13.el7.x86_64

kernel release:
3.10.0-938.el7.x86_64

Comment 2 zzambers 2018-08-29 16:41:04 UTC
Created attachment 1479539 [details]
reproducer-804632.tar.xz

Comment 3 zzambers 2018-08-29 16:44:54 UTC
Created attachment 1479540 [details]
rhel-7.5-pkgs-beaker-broken.txt

Comment 4 zzambers 2018-08-29 16:45:27 UTC
Created attachment 1479541 [details]
rhel-7.6-pkgs-beaker-working.txt

Comment 6 Severin Gehwolf 2018-08-29 17:03:29 UTC
(In reply to zzambers from comment #0)
> When I was trying to run on reproducer for 804632 it failed with following
> output on rhel-7.5 distro in beaker:

Thant's bug 804632. The reproducer is:

$ cat Hello.java
public class Hello {
	public static void main(String[] args) {
		System.out.println("Hello World");
	}
}
$ javac Hello.java
$ sudo stap -e 'probe hotspot.jni.GetStringUTFChars { print_jstack_full(); }' -c 'java Hello'

Comment 9 Severin Gehwolf 2018-08-29 17:21:20 UTC
print_jstack_full() comes from this file part of java-1.8.0-openjdk-devel:
/usr/share/systemtap/tapset/x86_64/jstack-1.8.0.181-3.b13.el7_5.x86_64.stp

$ rpm -qf /usr/share/systemtap/tapset/x86_64/jstack-1.8.0.181-3.b13.el7_5.x86_64.stp
java-1.8.0-openjdk-devel-1.8.0.181-3.b13.el7_5.x86_64

Comment 12 Serguei Makarov 2018-09-05 19:13:57 UTC
Solving the underlying problem doesn't look like a trivial fix, and may require rethinking the arc_priority representation in stapregex. Filed upstream as PR23608.

Documenting potential workarounds until the underlying bug is fixed:

- use a shorter regex (e.g. drop prefix "/usr/" in the 7.5 tapset)
- use a non-regex matching method to match the exact string (e.g. strpos() != -1 -- available as of SystemTap 3.2)

Comment 14 Serguei Makarov 2018-09-07 17:53:36 UTC
I've written a fix upstream as commit 3c18de01ef8.

https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=commit;h=3c18de01ef8cb267f8947c5572d3c140540dc591

Comment 15 Frank Ch. Eigler 2018-09-07 18:04:10 UTC
Severin, a java-side workaround would be top stop using the regex operator in that context in your tapset script.  (Sorry if that was my suggestion in the first place.)  Instead of 

@define _check_match %(
  %( systemtap_v >= "3.0" %? if (pp() !~ "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/") next %)
%)

you could emit

@define _check_match %(
  %( systemtap_v >= "3.0" %? if (strpos(pp(),"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/") < 0) next %)
%)

Comment 16 Severin Gehwolf 2018-09-10 08:48:09 UTC
(In reply to Frank Ch. Eigler from comment #15)
> Severin, a java-side workaround would be top stop using the regex operator
> in that context in your tapset script.  (Sorry if that was my suggestion in
> the first place.)  Instead of 
> 
> @define _check_match %(
>   %( systemtap_v >= "3.0" %? if (pp() !~
> "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/") next %)
> %)
> 
> you could emit
> 
> @define _check_match %(
>   %( systemtap_v >= "3.0" %? if
> (strpos(pp(),"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/")
> < 0) next %)
> %)

Thanks. Serguei said that strpos() is available from 3.2+. If so, shouldn't this be guarded by 3.2, like so?

@define _check_match %(
   %( systemtap_v >= "3.2" %? if
 (strpos(pp(),"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/")
 < 0) next %)

I'll proceed with getting an upstream IcedTea bug filed for the work-around. IcedTea maintains the tapsets for OpenJDK. We only consume it from there.

Comment 17 Severin Gehwolf 2018-09-10 09:06:23 UTC
(In reply to Severin Gehwolf from comment #16)
> I'll proceed with getting an upstream IcedTea bug filed for the work-around.

https://icedtea.classpath.org/bugzilla/show_bug.cgi?id=3625

Comment 18 Frank Ch. Eigler 2018-09-10 11:03:53 UTC
Yes, that conditional would work.
For operation on older systemtap, one can add a little more script code and make it work there too, if that is desirable.

Comment 20 Serguei Makarov 2018-12-04 20:17:25 UTC
The following upstream commits are relevant if doing a respin of systemtap:

- 3c18de01ef8cb267f8947c5572d3c140540dc591 PR23608: rebalance arc_priorities to avoid overflow.
- 64e5e3cc638d86614969a320657ce4250f06722f PR23608 refine_*: replace assertion failure with regex_error

Comment 21 Mark Wielaard 2019-01-25 17:17:51 UTC
Note that the jstack.stp fix did make it upstream, but is currently not in the java-1.8.0-openjdk-devel package for RHEL 7.6.

Comment 22 Andrew John Hughes 2019-01-28 18:25:37 UTC
Should this bug not be moved to java-1.8.0-openjdk if that's where the fix is needed?

Comment 24 Frank Ch. Eigler 2019-01-28 19:31:53 UTC
This bug will be used to drive a backport of the original systemtap-side regexp processing bug.  On the openjdk side, I know of two separate issues: a workaround for the this systemtap bug, and a porting-to-ppc64 one.

Comment 25 Andrew John Hughes 2019-01-29 16:55:35 UTC
Yes, it wasn't clear if this bug was being used for the OpenJDK workaround or a SystemTap fix.
As it's the latter, I'll use the ppc64 bug to update the tapsets from upstream IcedTea, bringing in both fixes.

Comment 26 Frank Ch. Eigler 2019-03-19 21:19:29 UTC
automatically included in 4.0 rebase

Comment 30 errata-xmlrpc 2019-08-06 13:01:09 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-2019:2172


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