Missing stack traces after C1 code replaced with C2 code
ivan at ludios.org
Fri Mar 21 06:28:21 UTC 2014
Thanks Kris, I hadn't. With -XX:-OmitStackTraceInFastThrow, I always
see stack traces.
Is this expected behavior? It's a little surprising to see it only
when code goes from C1->C2.
Should Clojure be doing something so that users can see stack traces
even without -XX:-OmitStackTraceInFastThrow?
On Fri, Mar 21, 2014 at 5:56 AM, Krystal Mok <rednaxelafx at gmail.com> wrote:
> Hi Ivan,
> Looks like a OmitStackTraceInFastThrow kind of behavior. Have you tried
> -XX:-OmitStackTraceInFastThrow to turn off that behavior and see what
> On Thu, Mar 20, 2014 at 10:46 PM, Ivan Kozik <ivan at ludios.org> wrote:
>> There is a long-standing HotSpot bug in tiered compilation when it
>> upgrades code from tier 3 to tier 4. After this code upgrade happens,
>> stack traces are repeatedly thrown away, at least in Clojure programs.
>> Repro steps are:
>> rlwrap java -jar clojure-1.6.0-RC1.jar
>> (inc nil) (pst)
>> keep repeating (inc nil) (pst) until you see:
>> NullPointerException [trace missing]
>> or, to avoid having to hit Up/Enter as much:
>> (dotimes [_ 1000] (try (inc nil) (catch Throwable e (.printStackTrace
>> which will usually require just 2 invocations, but sometimes up to 5.
>> I see this bug in both IcedTea and Oracle Java 7 and 8, on all of
>> Ubuntu, Windows 7, and Mountain Lion. I don't see the bug when
>> TieredCompilation is turned off, or when it is limited to tier 3.
>> This was originally discovered in
>> https://github.com/technomancy/leiningen/issues/1025 and the
>> workaround (for leiningen users) was to limit the compilation tier. I
>> expect that Clojure users will be running into this problem more
>> frequently now that tiered compilation is on by default.
>> Unfortunately, I am not familiar with the internals of
>> to know if Clojure might be doing something peculiar with JVM
>> bytecode. It wouldn't be something new; Clojure 1.0, 1.1, 1.2.1, 1.3,
>> 1.4, 1.5.1, and 1.6.0-RC1 are affected.
>> I originally reported this to bugs.sun.com in February 2013 and it was
>> assigned internal review ID 2456988. AFAIK, the bug did not make it
>> into bugs.sun.com or bugs.openjdk.java.net. I later asked #openjdk
>> about it and was told to report it here.
More information about the hotspot-compiler-dev