Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8242181: [Linux] Show source information when printing native stack traces in hs_err files #2021

Closed
wants to merge 3 commits into from

Conversation

ashu-mehra
Copy link

@ashu-mehra ashu-mehra commented Dec 6, 2023

Mostly a clean backport other than copyright year changes.

Tested with tier1 and tier2.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • JDK-8242181 needs maintainer approval
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8242181: [Linux] Show source information when printing native stack traces in hs_err files (Enhancement - P4 - Rejected)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/2021/head:pull/2021
$ git checkout pull/2021

Update a local copy of the PR:
$ git checkout pull/2021
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/2021/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2021

View PR using the GUI difftool:
$ git pr show -t 2021

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/2021.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 6, 2023

👋 Welcome back asmehra! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot changed the title Backport 13c03696463cb3ba77663edfd2dfb78d3f45cbaa 8242181: [Linux] Show source information when printing native stack traces in hs_err files Dec 6, 2023
@openjdk
Copy link

openjdk bot commented Dec 6, 2023

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Dec 6, 2023
@mlbridge
Copy link

mlbridge bot commented Dec 6, 2023

Webrevs

Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright dates should be the same as in the original commit, so please revert the change from 2022 to 2023. I'd expect the result to be a clean backport.

Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
@ashu-mehra
Copy link
Author

The copyright dates should be the same as in the original commit,

I didn't know copyright needs to be preserved. I have reverted those changes.

@openjdk openjdk bot added the clean label Dec 7, 2023
@openjdk
Copy link

openjdk bot commented Dec 7, 2023

⚠️ @ashu-mehra This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it's clean now. :)

…disable-precompiled-headers

Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
@openjdk openjdk bot removed the clean label Dec 8, 2023
@ashu-mehra
Copy link
Author

ashu-mehra commented Dec 8, 2023

Compilation of linux-x64-hs-zero and linux-x64-hs-minimal fails with following error:

/home/asmehra/data/ashu-mehra/jdk17u-dev/src/hotspot/share/utilities/decoder_elf.cpp: In member function 'virtual bool ElfDecoder::get_source_info(address, char*, size_t, int*, bool)':
/home/asmehra/data/ashu-mehra/jdk17u-dev/src/hotspot/share/utilities/elfFile.hpp:84:9: error: 'TraceDwarfLevel' was not declared in this scope
   84 |     if (TraceDwarfLevel >= level) {    

These configurations are run with --disable-precompiled-headers.

I have to include runtime/globals.hpp (that defines TraceDwarfLevel) in elfFile.hpp to fix the compilation.

@ashu-mehra
Copy link
Author

hmm the new test runtime/ErrorHandling/TestDwarf.java added by this patch is failing on linux-x86

[dwarf] ##### Find filename and line number for offset 0x00086071 in library /lib32/libc.so.6 #####
[dwarf] Failed to load DWARF file for library /lib32/libc.so.6 or find DWARF sections directly inside it.
#
# Compiler replay data is saved as:
# /home/runner/work/jdk17u-dev/jdk17u-dev/build/run-test-prebuilt/test-support/jtreg_test_hotspot_jtreg_tier1_runtime/scratch/0/replay_pid4875.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

hs_err_file: hs_err_pid4875.log
STDERR:
java.lang.RuntimeException: Must find library in "C  [libc.so.6+0x86071]": expected true, was false
	at jdk.test.lib.Asserts.fail(Asserts.java:594)
	at jdk.test.lib.Asserts.assertTrue(Asserts.java:486)
	at TestDwarf.checkNoSourceLine(TestDwarf.java:181)
	at TestDwarf.runAndCheck(TestDwarf.java:153)
	at TestDwarf.test(TestDwarf.java:101)
	at TestDwarf.main(TestDwarf.java:91)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:[568](https://github.com/ashu-mehra/jdk17u-dev/actions/runs/7133685893/job/19427620333#step:9:569))
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:840)

This is same as https://bugs.openjdk.org/browse/JDK-8293201 which would also need to be backported.

@phohensee
Copy link
Member

Then it would be good if you could backport JDK-8293201.

@ashu-mehra
Copy link
Author

Then it would be good if you could backport JDK-8293201

Yup, that's the plan. Along with this, there are other bugs associated with 8242181 which also need to be backported.

@openjdk
Copy link

openjdk bot commented Dec 22, 2023

@ashu-mehra this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout backport-jdk-8242181
git fetch https://git.openjdk.org/jdk17u-dev.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed approval labels Dec 22, 2023
@bridgekeeper
Copy link

bridgekeeper bot commented Jan 19, 2024

@ashu-mehra This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@ashu-mehra
Copy link
Author

Closing this as it is not worth the risk considering the number of follow-up issues and testing required (see the JBS comment)

@ashu-mehra ashu-mehra closed this Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport merge-conflict Pull request has merge conflict with target branch rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants