RFR: 8333326: Linux Alpine build fails after 8302744

Thomas Stuefe stuefe at openjdk.org
Mon Jun 3 09:39:01 UTC 2024


On Fri, 31 May 2024 10:29:29 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> we run into a basename related build issue on Alpine Linux
> 
> basename related issue :
> /priv/jenkins/client-home/workspace/openjdk-jdk-dev-linux_alpine_x86_64-opt/jdk/test/hotspot/gtest/runtime/test_cgroupSubsystem_linux.cpp: In member function 'virtual void cgroupTest_read_numerical_key_value_success_cases_Test::TestBody()':
> /priv/jenkins/client-home/workspace/openjdk-jdk-dev-linux_alpine_x86_64-opt/jdk/test/hotspot/gtest/runtime/test_cgroupSubsystem_linux.cpp:139:19: error: 'basename' was not declared in this scope; did you mean 'rename'?
>   139 | const char* b = basename(test_file);
>       | ^~~~~~~~
>       | rename
> 
> 
> Additionally giving a 'const char*'  to basename results in a warning as error because basename interface gets a char* .

I think this is fine as a fix, but please add a comment somewhere (best before temp_file) that we rely on temp_file returning *modifiable memory* in *resource area*. 

I was confused as to why we don't need ResourceMarks. Does the gtest launcher create ResourceMarks before invoking the TEST functions? May be better to add them to the TEST functions.

Alternatively, we could also modify temp_file to return c heap memory, and then explicitly free that at the end of each test function. Both changes are simple, but the latter may be less brittle (e.g. we can test this stuff even if RA are broken) and easier to immediately grasp.

-------------

PR Review: https://git.openjdk.org/jdk/pull/19497#pullrequestreview-2093322611


More information about the hotspot-runtime-dev mailing list