RFR: 8302073: Specifying OnError handler prevents WatcherThread to break a deadlock in report_and_die()

Thomas Stuefe stuefe at openjdk.org
Tue Mar 14 14:05:14 UTC 2023


On Tue, 14 Mar 2023 09:04:51 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> > Decoder, in particular, should not use malloc. Therefore I also opened https://bugs.openjdk.org/browse/JDK-8303862 to track that. I won't have time to work on that. I have the hope that maybe @chhagedorn can :-) ?
> 
> Does any of our current allocation strategies allow the usage of a custom scratch buffer (i.e. the error reporting scratch buffer) as memory location? If not, it could get more complicated. I could still try to tackle that but I'm not sure if I have the necessary knowledge in that area.

What we usually do for these kind of problems is to pass the scratch buffer via argument to the processing functions. And make that use either it or, if NULL was passes, allocate its own thing.

Another way to do this would be to add a scratch buffer pointer to Thread.

A third way to do this (I had been experimenting with it) would be to pre-allocate a scratch buffer, and once error handling began, to use that inside os::malloc. That is the most involved solution, though, and I'm not particularly fond of it. I know many reviewers would hate it, too :-)

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

PR: https://git.openjdk.org/jdk/pull/12925


More information about the hotspot-dev mailing list