Help with Signals

Hi All,

The problem statement is as below:

Problem: A process (exe) is getting executed in background. The output of this process is getting logged in a file. After successfully running for some time the process gets terminated. In the log file following is present:

^M[7m Interrupt ^M[27m

Please note that this does not happen all the time and can be taken as once in a blue moon scenario.

if 7 and 27 are signals then 7 is for abort and 27 is for sigttin (used kill -l).

It would be good if some pointers can be given around the same. Need to know how these signals are getting generated and why they do not appear all the time. Any reference material would also help. Thank you

Just a guess here...

Normally ^M is equal to CR, (0x0D), usually part of Windows Carriage Return - Newline combination.

[ can be a test of some part of a script, OR, a pseudo-escape character.

If a pseudo-escape character, then Xm, where X is a number, is to do with a *NIX style terminal display setup...

I could be wrong however...

man console_codes :

1 Like

Hi RudiC...

Thanks for the man page, I didn't know that existed.

I do know the escape codes however...

The requestor's log file entry has nothing to do with signals; it's just setting "display" to reverse video, outputs "interrupt", and resets to normal video (given that ^M stands for "Escape", which, I admit, may be a wild assumption).

Interrupt is interesting here. SIGINT will generate that response as it is the name most systems "give" to that signal number (note: actual number may vary)

/usr/include/cygwin/signal.h:#define    SIGINT  2       /* interrupt */

from the cygwin install on this PC.

This is different from a driver interrupt - where a thread's current registers are pushed onto an interrupt stack. This appears to be a signal. And signals do cause asynchronous interrupts and process termination if they are not handled as part of the process signal mask.

IMO: The problem is the code being executed. The point is something appears to be generating a SIGINT that goes unhandled in the process.

Since you state nothing about what is running....

Add a diagnostic signal handler to the code java, C, perl, etc., ( or a trap statement in shell) to tell when/where it happens. Also note - a process can call raise() in code or kill in shell to send a signal to itself, which is another avenue to explore.

hey wisecracker, RudiC and jim.....thanks for the help...I m currently looking into the issue....would update if i am able to crack it.... :slight_smile:

To be precise I m using SunOS 5.8...I couldn't fine man cosole_codes.. Also..I have missed to quote the exact error above...apologies for that...the error is as below:

^M^[[7m Interrupt ^[[27m

That has answered it:-

^M == <CR>, 0x0D...
^[ == Esc, 0x1B...
[7m == Reverse Video...

" Interrupt " == Purely a warning print to the window/screen in reverse video including spaces.

^[ == Esc, 0x1B...
[27m == Normal video...

Perfectly normal piece of *NIX shell scripting I would have thought, except it looks as though it is generated on a Windows machine because of the ^M part.

Look up ANSI escape codes and video modes...