On Mon, 29 May 2006 15:21:36 +0100, Matthew Toseland wrote:

> Immediate priorities:
> 
> 1a. Do not do any (synchronous) DNS lookups on PacketSender. 1b. If:
> - We are on a Sun/Blackdown JVM (prior to 1.6??) - We are on Linux
> - LD_ASSUME_KERNEL isn't set
> Then we are vulnerable to the EvilJVMBug, and we must firstly, institute a
> critical priority UserAlert explaining the situation, and secondly, refuse
> all requests and refuse to send any requestsd.

Before doing anything so drastic, there is one more thing you might want
to try.

I examined PacketSender and noticed that it constructs the sender thread
inside the object constructor, giving it a pointer to the object under
construction, and then starts it later in the start() method. Now, suppose
that some thread-related resources are allocated at the construct phase
and not in the start phase ? That might lead to some confusion inside the
JVM.

I'm suggesting this because in the past I've observed very strange
behavior on programs that did any violations of Java Memory Model (like
NullPointerExceptions being thrown just because I switched to an
incremental garbage collector).

So, try creating the thread object inside the start() method, and not in
the object constructor. It *shouldn't* make any difference, but it's worth
the try before trying any more drastic solutions.

Also, did you have any native libraries loaded when the bug occurred -
and if yes, could it possibly be caused by some kind of buffer overrun
there ?

And yes, Java is quite buggy - I especially love how the documentation
states that Graphics.drawImage() method "returns immediately in all
cases," when in reality that "immediately" may be up to several seconds
long (not a garbage collection pause, since the other threads keep on
running) :(.

Maybe you should consider reimplementing Freenet in pure ANSI C ?-)


Reply via email to