LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 01-18-2005, 10:54 PM   #1
iclinux
Member
 
Registered: Dec 2004
Posts: 69

Rep: Reputation: 15
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.
 
Old 01-18-2005, 10:57 PM   #2
cythrawll
Member
 
Registered: Nov 2004
Location: IL, USA
Distribution: Slackware 10
Posts: 167

Rep: Reputation: 31
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.
 
Old 01-19-2005, 02:38 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
How are the java program launched ?
With what JVM ?
On what O/S ?
Any log file, message, core file generated ?
 
Old 01-19-2005, 07:17 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Is it in java?
Code?
 
Old 01-19-2005, 07:52 AM   #5
iclinux
Member
 
Registered: Dec 2004
Posts: 69

Original Poster
Rep: Reputation: 15
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
...........
 
Old 01-19-2005, 12:11 PM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gnome Application Crashes markus79 Linux - Newbie 2 09-05-2005 11:05 PM
Wine crashes running in-house application Knisa Linux - Software 4 04-06-2005 01:56 PM
occasional kdm log-out and application closure crashes dizzi Slackware 4 07-15-2004 06:10 AM
Gtk-Warnings, and multiple application crashes nullcreation Arch 1 10-19-2003 01:23 AM
Program In background frankprogramer Linux - Software 1 10-30-2002 03:56 PM


All times are GMT -5. The time now is 11:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration