RFR: 8369631: Assess and remedy any unsafe usage of the sr_semaphore Semaphore in the Posix signal code [v2]

David Holmes dholmes at openjdk.org
Wed Oct 15 12:23:53 UTC 2025


On Wed, 15 Oct 2025 01:27:37 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Replace the statically allocated "semaphore" with a pointer and lazily initialize it. I chose this approach as we already have a second Semaphore declared that way.
>> 
>> Testing:
>> - tiers 1-3 sanity
>> 
>> Thanks.
>
> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Switch to DeferredStatic per Kim's request

> > > I don't understand how those semaphore were guaranteed to be correctly initialized before
> > 
> > 
> > It was statically initialized as part of loading libjvm.
> 
> I understand that part. I still don't understand how it was _correctly_ initialized with a proper call to the C++ constructor. Maybe I'll see if I can catch that in the debugger.

I assumed the constructor was automagically called the same way the destructor gets called at process exit.

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

PR Comment: https://git.openjdk.org/jdk/pull/27762#issuecomment-3406134459


More information about the hotspot-runtime-dev mailing list