Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [omr-dev] Help needed - what is wrong with this IL?

Andrew asked:
> Mark are there any other traces specific to JITBuilder or the other technologies Dibyendu is using that we should turn on to help debug this issue?

traceIlGen probably won't do anything in this context; I don't believe Dibyendu is using the JitBuilder API to generate IL, but is mimicking some of the things it does in order to build TR IL directly.

From Dibyendu's description, I would have suspected a node address being used in two different basic blocks, as Andrew did. It's odd, though, that Charlie is also seeing this verification error, since JitBuilder is *supposed* to properly store nodes into locals whenever they are used outside of the block where the node is first computed. JitBuilder is designed to protect you from getting into that kind of mischief, but it's always possible there's a bug in there somewhere.

Dibyendu or Charlie: I think we need to see a JIT log from both of these situations, if you would be so kind to produce them for us?

Quick primer on log generation for JitBuilder (I think Leonardo covered some / maybe all of this, so apologies if I'm repeating information). You need to set an environment variable called TR_Options for the run in order to pass logging options into JitBuilder. The basic form is:
        export TR_Options='{file:line:name}(log=log.dmp,traceIlGen,traceFull)'

Note single quotes are handy to make sure the shell doesn't escape anything, which otherwise will present high temptation.

The value for file, line, and name are those you passed to DefineFile(), DefineLine(), and DefineName(), respectively, for the MethodBuilder object you want to trace. You can use wildcards (* will match any character is the most commonly used one). Dibyendu, you'll have to translate that to the name you used to construct the signature for the ResolvedMethod in your compiled functions: the string inside the curly braces is used to match against the resolved method's signature string. file:line:nameis a format specific to JitBuilder: that's how JitBuilder constructs the method signature. The string inside the parentheses are options that will only be applied to the matching methods. We have historically called this kind of thing an "option set".

If you are using a debug build of JitBuilder, then the log file will be spit out to the precise file name you provide in the log= option (e.g. log.dmp in the example above). If you're using a non-debug build, then the compiler will automatically append process ID, date, and time into the file name to make it easier to distinguish/overwrite logs inadvertently. If you don't want that, you can also add 'disableSuffixLogs' into the TR_Options string like this:
        export TR_Options=';disableSuffixLogs,{file:line:name}(log=log.dmp,traceIlGen,traceFull)'

For the record, these options should work for any project based on the OMR compiler, including OpenJ9 and any JitBuilder project. There are tons of more detailed tracing options and diagnostic options available but I won't bore you with them here (look around in compiler/control/OMROptions.cpp and you'll see all kinds of interesting things you can produce in our log files).

--mark

Back to the top