RFR: JDK-8157141 & JDK-8166454: Solaris getisax(2) and meminfo(2) cleanup

David Holmes david.holmes at oracle.com
Mon Sep 26 20:49:57 UTC 2016


Hi Alan,

On 27/09/2016 2:39 AM, Alan Burlison wrote:
> I'm redoing this to include the feedback so far, but:
>
> On 23/09/2016 02:11, David Holmes wrote:
>
>> One nit/favour ...
>>
>> src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
>>
>>  364   log_info(os, cpu)("getisax(2) returned: ");
>>  365   for (int i = 0; i < avn; i++) {
>>  366     log_info(os, cpu)(" " PTR32_FORMAT, avs[i]);
>>  367   }
>>
>> For compound logging statements it is better to put them in a
>> conditional checking the logging is enabled - the original if statement
>> escaped (my) notice, the use of a loop here makes this more obvious. You
>> can then use the more direct logging form rather than the high-level
>> log_info "macro"
>>
>>  if (log_is_enabled(Info, os, cpu)) {
>>     outputStream* log = Log(os, cpu)::info_stream();
>>     log->print("getisax(2) returned:");
>>     for (int i = 0; i < avn; i++) {
>>       log->print(" " PTR32_FORMAT, avs[i]);
>>     }
>>     log->cr();
>>  }
>
> If I make that change I get a coredump. I believe that's because the
> code in question is run at JVM startup and outside of a JVM thread, so
> the following assert is failing:
>
> #  Internal Error
> (/opt/jprt/T/P1/093524.alanbur/s/hotspot/src/share/vm/runtime/thread.hpp:662),
> pid=51406, tid=2
> #  assert(current != 0L) failed: Thread::current() called on detached
> thread

Can you send me the stacktrace please. Both forms of the code should be 
using the same underlying UL code, so both should either fail or work.

> Is there a variant of this block of logging code that will work under
> those circumstances?

If we try to use UL too early we simply have to not use UL for that logging.

Thanks,
David

> Thanks,
>


More information about the hotspot-runtime-dev mailing list