Closed GoogleCodeExporter closed 9 years ago
Oh, a quick fix is to make the monitor explicit (move from method flag to
synchronized (this) { super.handleEvent(event); }.
This isn't going to fix the JVM but will make guava users (on IBM JVMs) happier.
Original comment by dawid.weiss@gmail.com
on 8 May 2013 at 8:27
Sounds like a very low-cost fix. (Explicit locks are kinda just better anyway.)
Any chance you can spot if we have this problem anywhere else?
Original comment by kevinb@google.com
on 9 May 2013 at 8:25
We're waiting for a confirmation from J9 folks. Once we hear from them I'll
know if this indeed is the right workaround or if it just happens to work for
this particular test case/ code. I tried to reproduce this issue on a smaller
example but couldn't so it's probably a particular mix of things that causes
this frame to be eliminated.
Once I know what this is I'll review the code and try to spot other places
where this is the case (this should also be possible by applying an aspectj
aspect, we will see).
Original comment by dawid.weiss@gmail.com
on 9 May 2013 at 8:46
From a naive search for 'synchronized [^{]*{[^{]*(return )?super[.]', I see no
other instances of the problem in Guava, though I do see a few internal to
Google in our stats code.
Original comment by cpov...@google.com
on 13 May 2013 at 3:09
I'm still waiting for the feedback from IBM, thanks for doing the search.
Original comment by dawid.weiss@gmail.com
on 13 May 2013 at 4:13
I still haven't heard from J9 folks. Anyway, checked guava's sources on git's
master and this seems to be the only place that uses this pattern (there are
others that call super methods from under synchronized blocks but they contain
other code so I assume this cannot be optimized away).
Original comment by dawid.weiss@gmail.com
on 14 May 2013 at 1:21
Changed to a synchronized (this) block.
Original comment by cgdec...@gmail.com
on 14 May 2013 at 7:47
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
@Override public synchronized void handleEvent(Object event) throws InvocationTargetException { super.handleEvent(event); }
Original issue reported on code.google.com by
dawid.weiss@gmail.com
on 8 May 2013 at 6:25