Hi  ,   recently I  did    https://bugs.openjdk.org/browse/JDK-8375311

to prevent  elimination of the  “debug helpers”  provided by debug.cpp   (can 
happen on Linux with LTO or other “aggressive” linking  ) .

But now I noticed this older change  :

https://bugs.openjdk.org/browse/JDK-8327049
Only export debug.cpp functions on Windows

   ... where in the review
https://github.com/openjdk/jdk/pull/18062

it was stated :

“We spotted a problem with an Oracle-internal testing tool that exported a 
function named debug, which ended up calling the exported debug function from 
Hotspot instead. But the problem could theoretically apply to any code out 
there that links with libjvm.so and has conflicting symbols defined. Normally, 
the symbols exported from Hotspot are named JVM_<foo> to minimize the risk of 
this theoretical conflict becoming real, but the functions in debug.cpp has 
much shorter and more common names (for simple usage in the debugger), so the 
risk of actual conflicts are much higher.”


So I wonder – is this issue still there with  this  “internal testing tool”   ?

On the other hand ,  renaming the debug helpers  (e.g. with a prefix) might 
solve such clashes  also on Windows   (where we export them for some time 
already)  -  but developers would probably not like long names there, I guess  ?

So what do you think about it ?
How to deal with such   exported symbols  (or symbols that are needed for 
special purposes but are seen as “dead”  by linkers) .

Best regards, Matthias

Reply via email to