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

8332825: ubsan: guardedMemory.cpp:35:11: runtime error: null pointer passed as argument 2, which is declared to never be null #19382

Closed
wants to merge 1 commit into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented May 24, 2024

When running :tier1 hs tests, the following issue has been reported with ubsan enabled (configure flag --enable-ubsan) the following issue is reported .
Reason is that gtest forces a call void* no_data_copy = GuardedMemory::wrap_copy(no_data, 0); with 0 length . This leads to a special case for memcpy .

gtest/GTestWrapper.jtr

/jdk/src/hotspot/share/memory/guardedMemory.cpp:35:11: runtime error: null pointer passed as argument 2, which is declared to never be null
#0 0x7f174d684227 in GuardedMemory::wrap_copy(void const*, unsigned long, void const*) /jdk/src/hotspot/share/memory/guardedMemory.cpp:35
#1 0x7f174dd210c3 in GuardedMemory_wrap_Test::TestBody() /jdk/test/hotspot/gtest/memory/test_guardedMemory.cpp:146
#2 0x7f17526f8d63 in testing::Test::Run() /tools/gtest/googletest-1.14.0/googletest/src/gtest.cc:2687
#3 0x7f17526f8d63 in testing::Test::Run() /tools/gtest/googletest-1.14.0/googletest/src/gtest.cc:2677
#4 0x7f17526f946d in testing::TestInfo::Run() /tools/gtest/googletest-1.14.0/googletest/src/gtest.cc:2836
#5 0x7f1752729ef8 in testing::TestSuite::Run() /tools/gtest/googletest-1.14.0/googletest/src/gtest.cc:3015
#6 0x7f1752729ef8 in testing::TestSuite::Run() /tools/gtest/googletest-1.14.0/googletest/src/gtest.cc:2968
#7 0x7f175272aec5 in testing::internal::UnitTestImpl::RunAllTests() /tools/gtest/googletest-1.14.0/googletest/src/gtest.cc:5920
#8 0x7f17526f0fcf in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::)(), char const) /tools/gtest/googletest-1.14.0/googletest/src/gtest.cc:2670
#9 0x7f17526f0fcf in testing::UnitTest::Run() /tools/gtest/googletest-1.14.0/googletest/src/gtest.cc:5484
#10 0x7f174d8c84d7 in RUN_ALL_TESTS() /tools/gtest/googletest-1.14.0/googletest/include/gtest/gtest.h:2317
#11 0x7f174d8c84d7 in runUnitTestsInner /jdk/test/hotspot/gtest/gtestMain.cpp:290
#12 0x558be83647d8 in main /jdk/test/hotspot/gtest/gtestLauncher.cpp:40
#13 0x7f174734c24c in __libc_start_main (/lib64/libc.so.6+0x3524c) (BuildId: f732026552f6adff988b338e92d466bc81a01c37)


Progress

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

Warning

 ⚠️ Found leading lowercase letter in issue title for 8332825: ubsan: guardedMemory.cpp:35:11: runtime error: null pointer passed as argument 2, which is declared to never be null

Issue

  • JDK-8332825: ubsan: guardedMemory.cpp:35:11: runtime error: null pointer passed as argument 2, which is declared to never be null (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19382/head:pull/19382
$ git checkout pull/19382

Update a local copy of the PR:
$ git checkout pull/19382
$ git pull https://git.openjdk.org/jdk.git pull/19382/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19382

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19382.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 24, 2024

👋 Welcome back mbaesken! 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
Copy link

openjdk bot commented May 24, 2024

@MBaesken This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8332825: ubsan: guardedMemory.cpp:35:11: runtime error: null pointer passed as argument 2, which is declared to never be null

Reviewed-by: clanger, mdoerr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 37 new commits pushed to the master branch:

  • ed81a47: 8327964: Simplify BigInteger.implMultiplyToLen intrinsic
  • 08face8: 8332890: Module imports don't work inside the same module
  • 793fd72: 8332956: Problem list CodeCacheFullCountTest.java until JDK-8332954 is fixed
  • 891d5ae: 8332683: G1: G1CardSetArray::EntryDataType [2] triggers ubsan runtime errors
  • f3d6fbf: 8330847: G1 accesses uninitialized memory when predicting eden copy time
  • 1b8dea4: 8332894: ubsan: vmError.cpp:2090:26: runtime error: division by zero
  • 0e7ea39: 8332678: Serial: Remove use of should_clear_all_soft_refs in serial folder
  • 72fbfe1: 8330577: G1 sometimes sends jdk.G1HeapRegionTypeChange for non-changes
  • 0889155: 8332885: Clarify failure_handler self-tests
  • 7f0ad51: 8332898: failure_handler: log directory of commands
  • ... and 27 more: https://git.openjdk.org/jdk/compare/9b61a7608efff13fc3685488f3f54a810ec0ac22...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title JDK-8332825: ubsan: guardedMemory.cpp:35:11: runtime error: null pointer passed as argument 2, which is declared to never be null 8332825: ubsan: guardedMemory.cpp:35:11: runtime error: null pointer passed as argument 2, which is declared to never be null May 24, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label May 24, 2024
@openjdk
Copy link

openjdk bot commented May 24, 2024

@MBaesken The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label May 24, 2024
@mlbridge
Copy link

mlbridge bot commented May 24, 2024

Webrevs

Copy link
Contributor

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

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

Looks correct.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 27, 2024
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

LGTM.

@MBaesken
Copy link
Member Author

Hi Christoph and Martin, thanks for the reviews !

/integrate

@openjdk
Copy link

openjdk bot commented May 27, 2024

Going to push as commit be1d374.
Since your change was applied there have been 37 commits pushed to the master branch:

  • ed81a47: 8327964: Simplify BigInteger.implMultiplyToLen intrinsic
  • 08face8: 8332890: Module imports don't work inside the same module
  • 793fd72: 8332956: Problem list CodeCacheFullCountTest.java until JDK-8332954 is fixed
  • 891d5ae: 8332683: G1: G1CardSetArray::EntryDataType [2] triggers ubsan runtime errors
  • f3d6fbf: 8330847: G1 accesses uninitialized memory when predicting eden copy time
  • 1b8dea4: 8332894: ubsan: vmError.cpp:2090:26: runtime error: division by zero
  • 0e7ea39: 8332678: Serial: Remove use of should_clear_all_soft_refs in serial folder
  • 72fbfe1: 8330577: G1 sometimes sends jdk.G1HeapRegionTypeChange for non-changes
  • 0889155: 8332885: Clarify failure_handler self-tests
  • 7f0ad51: 8332898: failure_handler: log directory of commands
  • ... and 27 more: https://git.openjdk.org/jdk/compare/9b61a7608efff13fc3685488f3f54a810ec0ac22...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 27, 2024
@openjdk openjdk bot closed this May 27, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 27, 2024
@openjdk
Copy link

openjdk bot commented May 27, 2024

@MBaesken Pushed as commit be1d374.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants