LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   why my program crashes as a background application? (http://www.linuxquestions.org/questions/programming-9/why-my-program-crashes-as-a-background-application-279544/)

iclinux 01-18-2005 09:54 PM

why my program crashes as a background application?
 
hi there,
my program runs well as a foreground application, but it crashes when running as a background one.
have ever met this problem?
Regards.

cythrawll 01-18-2005 09:57 PM

I have had similar happen once with a java program I wrote. It seems it would run perpetually in foreground, but after running a day or so in background it would crash. I need to learn how to do more file io stuff so i can create an error catching log for it while it's in the background. But right now it's 200 on my TODO list.

jlliagre 01-19-2005 01:38 AM

How are the java program launched ?
With what JVM ?
On what O/S ?
Any log file, message, core file generated ?

Hko 01-19-2005 06:17 AM

Is it in java?
Code?

iclinux 01-19-2005 06:52 AM

Not Java, but C++.There's so much code that it's not suitable to post it here.

But I have a question:

What's the essential difference between a backgroud application and a foreground one? do they use the same shared library when running?


My program needs this shared library-"/lib/i686/libpthread.so.0", I use a shell-script to run my program as a background application.
is the follow correct?

/////////////////////////////////
#!/bin/bash
# Startup script for Test EXAMPLE
# description: Test EXAMPLE
# processname: Test

. /etc/rc.d/init.d/functions
TYPE=`uname -m`
if [ $TYPE=='i686' ]
then
export LD_LIBRARY_PATH=.:/lib/i686:$LD_LIBRARY_PATH
else
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
fi
...........

jlliagre 01-19-2005 11:11 AM

You could at least tell how it crashes ...
immediatly or after a while ?
leaving logs ? a core file ?


All times are GMT -5. The time now is 12:58 AM.