Operating System - HP-UX
1838087 Members
3925 Online
110124 Solutions
New Discussion

Running Application in Background under Korn Shell results in CoreDump (SIGBUS)

 
Joshua Clark
Occasional Contributor

Running Application in Background under Korn Shell results in CoreDump (SIGBUS)

I'm having a strange problem and I'm hoping someone can point me in the right direction.. I'm attempting to run an application which executes successfully in bash,sh,csh, etc. This application also runs successfully under ksh, but only in the foreground. If I attempt to start the app in the background, I immediately get a Bus error(coredump). Running "file core" indicates that the app received a SIGBUS.

I'm not looking for a solution (I realize that's impossible given the relative lack of details,) rather for someone to point me in the right direction. Are there any major differences with background apps that I don't relize? Perhaps something to do with stack size or thread stack size for background apps?

Thanks in advance,
-Josh-
5 REPLIES 5
Sridhar Bhaskarla
Honored Contributor

Re: Running Application in Background under Korn Shell results in CoreDump (SIGBUS)

Joshua,

This is not a solution but may give you a direction. How about running the program with tusc/trace both in background and foreground to compare the outputs?.

Usually the background jobs suspend if they expect any inputs. But you can find it out with tusc outputs.

-Sridhar
You may be disappointed if you fail, but you are doomed if you don't try
Santosh Nair_1
Honored Contributor

Re: Running Application in Background under Korn Shell results in CoreDump (SIGBUS)

At what point does the script dump core, i.e. which command? You can try running the script with the set -x option...i.e. make this command the first command that you run in your script...that way, you can see which command is actually causing the core dump.

-Santosh
Life is what's happening while you're busy making other plans
Joshua Clark
Occasional Contributor

Re: Running Application in Background under Korn Shell results in CoreDump (SIGBUS)

Hi Folks,
Thanks for the answers so far. To clarify and elaborate:

This is an application, not a shell script. HOWEVER, I can reproduce the crash by launching the application from a Korn shell script. i.e.

#!/bin/ksh
app_name.sh

will crash.. while

#!/bin/sh
app_name.sh

runs as expected.


I've tried to run the application through tusc both in the foreground and background, but the results were inconclusive. In fact, when I run the application with tusc in the background, it works.
Is there a major difference in shell behavior and environment between foreground and background apps that I'm forgetting here?

Thanks again for the help!
-Josh-
Santosh Nair_1
Honored Contributor

Re: Running Application in Background under Korn Shell results in CoreDump (SIGBUS)

Is this an interactive application? I just ask because I know some interactive applications have problems when put in the background. But to my knowledge, they usually don't core.

Can you post the tusc output when you run the application in background?

-Santosh
Life is what's happening while you're busy making other plans
Frank Slootweg
Honored Contributor

Re: Running Application in Background under Korn Shell results in CoreDump (SIGBUS)

Long shot: It may be terminal-affiliation or/and job-control related.

May be you can fiddle a bit with the job-control settings (see "Jobs" in ksh(1)), I/O redirection ("/dev/null 2>&1"), nohup(1), etc..