473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

java crashes in python thread

I use os.system invoking java VM, when running in python thread,
the java application crashes. But it works properly when thread is
not used.

Has any body come across with this problem?

Python 2.3.3
J2SDK 1.4.2_05
SuSE Linux Enterprise Server 9

The following is source file:
#!/usr/bin/env python

import os, sys, threading

class ThreadTask(threading.Thread) :

def __init__(self, shellcmd) :
threading.Thread.__init__(self)
self.command = shellcmd

def isStopped(self) :
self.join(0.01)
return not self.isAlive()

def run(self) :
os.system(self.command)

def test() :
commands = [
"/usr/lib/java/bin/javac",
"/usr/lib/java/bin/java",
]
tasks = []
for a in commands :
tasks.append(ThreadTask(a))

for a in tasks :
a.start()

endcnt = 0
while endcnt < len(tasks) :
endcnt = 0
for a in tasks :
if a.isStopped() : endcnt += 1
print("DONE")

test()

Jul 18 '05 #1
2 1260
Easeway wrote:
I use os.system invoking java VM, when running in python thread,
the java application crashes.


Can you define "crash" more precisely? Isn't there any
kind of error message/traceback that would reveal more
information about the problem?

Also, how quickly do you get this crash? Instantly,
shortly after starting, a long time after starting,
at completion of the Java processes (maybe check to
see whether the entire javac has executed, or some
other sign of completion), or ?

-Peter
Jul 18 '05 #2
Easeway wrote:
I use os.system invoking java VM, when running in python thread, the
java application crashes.


Andreas Jung has reported similar behaviour.

He suggested that Java 1.4 and the threads of Linux 2.6
do not work reliably together.
He tried Java 1.5 and this combination crashes only occationally.
But this, it is not yet reliable...

Dieter
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Morgan | last post by:
I'm trying to get php to run on my webserver as a Java Servlet, it works the first time but fails the second time and crashes the JVM with the following error: I have tried the latest versions...
1
by: Adi | last post by:
A java program we have written crashes with IBM JDK 1.3.1 on linux. It works fine on other platforms(Solaris,HPUx). It gets a SIGSERV Signal 11 and crashes just after few minutes after starting up....
2
by: Dan | last post by:
Hello. I have recently tried upgrading the MySql connector for my servlet from 2.0.4 to 3.0.9. I have found a minor limitation in 2.0.4 and was hoping that 3.0.9 would fix it. However, now I...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
2
by: robert | last post by:
When employing complex UI libs (wx, win32ui, ..) and other extension libs, nice "only Python stack traces" remain a myth. Currently I'm hunting again a rare C-level crash bug of a Python based...
6
by: robert | last post by:
I get python crashes and (in better cases) strange Python exceptions when (in most cases) importing and using cookielib lazy on demand in a thread. It is mainly with cookielib, but remember the...
0
by: nadeemabdulhamid | last post by:
Hello, I'm trying to write some Java code that will launch a python interpreter shell and pipe input/output back and forth from the interpreter's i/o streams and the Java program. The code posted...
6
by: Pete Crite | last post by:
Hello, I've been trying to install Gnumeric via MacPorts recently, but I can't get past the installation of py25-numpy. It appears that python crashes consistently during installation. I'm...
0
by: John [H2O] | last post by:
There's a lot of greek for me here ... should I post to numpy-discussions as well??? The backtrace is at the bottom.... Thanks! GNU gdb Fedora (6.8-21.fc9) Copyright (C) 2008 Free...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.