This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes HELP... thread.join() crashes JBuilder 4 Pro Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "HELP... thread.join() crashes JBuilder 4 Pro" Watch "HELP... thread.join() crashes JBuilder 4 Pro" New topic
Author

HELP... thread.join() crashes JBuilder 4 Pro

Warren Rosenau
Greenhorn

Joined: Feb 12, 2001
Posts: 5
Hello All,
I am having a problem where thread.join will crash javaw.exe while debugging under JBuilder 4 pro under NT4. I have searched everywhere I can think and can find nothing on this problem.
public class JoinTester extends Thread
{
public void run()
{
System.out.println(" started");
for(int counter=0; counter<5; ++counter)
{
System.out.println(" Loop " + counter);
try{
sleep(500);
}
catch(InterruptedException e)
{
System.out.println(" interrupted");
}
}
System.out.println(" Done");
}
public static void main(String[] args)
{
JoinTester jt = new JoinTester();
System.out.println("Start JT");
jt.start();
try
{
System.out.println("Join");
jt.join();
}
catch(InterruptedException e)
{}
System.out.println("Thread returned");
}
If I run this without the debugger, everything works great.
Running this program under the debugger will result in a system error popup as follows:
javaw.exe - Application Error
The instruction at "0x50420a2a" referenced memory at "0x00000090". The memory could not be "read".
Click on OK to terminate the application
Click on CANCEL to debug the application
CANCEL takes me to MSVC where the call stack is:
JVM! 50420a2a()
JDWP! 502ab3ff()
JDWP! 502a7dfd()
JDWP! 502a7d80()
JDWP! 502a7c29()
JVM! 50447ba3()
JVM! 50447b74()
MSVCRT! 7800265a()
KERNEL32! BaseThreadStart@8 + 81 bytes
I would appreciate any feedback if some one could try this on their machines. It is consistent accross my team members machines, but we are all on the same NT & JBuilder.
If I put even a Sleep(1) after the join, sometimes the problem goes away... This is less often the case in 0ur real code rather than this concise test.
Thoughts???
Thanks,
Warren
[This message has been edited by Warren Rosenau (edited February 12, 2001).]
Jim Baiter
Ranch Hand

Joined: Jan 05, 2001
Posts: 532
I ran it on Win 2000 Professional with JDK 1.3. It works
ok outside of debugger and also ok in jdb. I don't have
JBuilder so I didn't try that. Maybe you should report this
to them.
Warren Rosenau
Greenhorn

Joined: Feb 12, 2001
Posts: 5
The solution here is to not use Sun's hotspot debugger!
I was looking into another problem where the "javaw"s were staying around after debug sessions and I found a reference to the following on borland's news server: http://community.borland.com/article/0,1410,26592,00.html
It instructs you to insert the -classic option in the VM parameters. This turns off the Sun Hot Spot Debugger.
Earlier today, I tried the Forte IDE and debugger and did not have this problem. When I looked back, I noticed that in Sun's own Forte product, they are using the -classic switch.
Hmmmmm Hotspot =
Later,
Warren
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: HELP... thread.join() crashes JBuilder 4 Pro
 
Similar Threads
join()
Thread - join method
Thread problem
JVM process memory never comes down
HELP... thread.join() crashes JBuilder 4 Pro debugger