You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under -Xjit:verbose={JITServer} the client prints its UUID in the verbose log, but it appears truncated: #JITServer: Identifier for current client JVM: 3663742628
while it should have been like this: #JITServer: Identifier for current client JVM: 9388384503642212004
The line that prints the UUID is like this:
TR_VerboseLog::writeLineLocked(TR_Vlog_JITServer, "Identifier for current client JVM: %" OMR_PRIu64 "\n",
compInfo->getPersistentInfo()->getClientUID());
It seems that OMR_PRIu64 does not play nice with the verbose log. I replaced that with PRIu64 and got the same bad result. "%llu" on the other hand prints the correct value.
Note that if I use fprintf instead of TR_VerboseLog::writeLineLocked then everything is fine, so it's just the combination of verbose log and OMR_PRIu64 that misbehaves.
The text was updated successfully, but these errors were encountered:
The reason it doesn't work correctly is due to verbose log using a custom print function implemented in OMR and it not being compatible with PRI format specifiers. OMR_PRIu64 is equivalent to PRIu64 macro, which converts to %lu on a Ubuntu 64-bit machine.
The standard library print functions handle this format specifier correctly, i.e. given a 64-bit value, print out all the bits.
However, the OMR implementation (in omrstr.c) only considers the value to be 64-bit, if the %llu specifier is used, as can be seen here: https://github.com/eclipse/omr/blob/465d74a8668dd1ec3a726944a6ffd53d3548cf23/port/common/omrstr.c#L660-L667
I verified that if we change line 665 to always assign J9FTYPE_U64 type, then the correct client id is printed.
Fixing how printing works in OMR, for all platforms, seems like a pretty difficult task. For now, I'll just explicitly use %llu specifier instead of OMR_PRIu64.
On the client-side, the uuid appeared truncated
to 32 bits, as described in eclipse-openj9#9962.
This is due to custom OMR print function and `PRI`
format specifiers not interacting correctly.
Fix it by using `%llu` specifier instead of `%OMR_PRIu64`.
Signed-off-by: Dmitry Ten <Dmitry.Ten@ibm.com>
Under
-Xjit:verbose={JITServer}
the client prints its UUID in the verbose log, but it appears truncated:#JITServer: Identifier for current client JVM: 3663742628
while it should have been like this:
#JITServer: Identifier for current client JVM: 9388384503642212004
The line that prints the UUID is like this:
It seems that
OMR_PRIu64
does not play nice with the verbose log. I replaced that withPRIu64
and got the same bad result. "%llu" on the other hand prints the correct value.Note that if I use fprintf instead of
TR_VerboseLog::writeLineLocked
then everything is fine, so it's just the combination of verbose log andOMR_PRIu64
that misbehaves.The text was updated successfully, but these errors were encountered: