1833132 Members
3313 Online
110051 Solutions
New Discussion

SIGILL after return 0;

 
Andrew Dienger
New Member

SIGILL after return 0;

Hi,

I am having a problem with a core file being generated by a SIGILL after a return 0;. The program terminates without problems but once it issues the return 0; a core file is produced. If I load the core file into the gdb debugger this is the stack dump it gives me.

Wildebeest was built for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
..
Core was generated by `startbpv'.
Program terminated with signal 4, Illegal instruction.

warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program.

#0 0x7f70f8e4 in ?? ()
(gdb) where
#0 0x7f70f8e4 in ?? ()
#1 0xc09c52d8 in __callInitFuncFromHandle () from /usr/lib/libCsup_v2.2
#2 0x3c9772ac in ?? ()
#3 0xc09c52d8 in __callInitFuncFromHandle () from /usr/lib/libCsup_v2.2
#4 0xebe00008 in ?? ()
#5 0xc09c52d8 in __callInitFuncFromHandle () from /usr/lib/libCsup_v2.2
Cannot access memory at address 0x2a0100d.

If I run the executable that gives this error on a HPUX 11.11 box I still recieve the core file but when loaded into the gdb debugger I get a slightly different back trace.


HP gdb 3.0.01 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 3.0.01 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `startbpv'.
Program terminated with signal 4, Illegal instruction.

warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program.

#0 0x7afb5948 in ?? ()
(gdb) where
#0 0x7afb5948 in ?? ()
warning: Attempting to unwind past bad PC 0x7afb5948
#1 0xc38552d8 in __callInitFuncFromHandle () from /usr/lib/libCsup_v2.2
#2 0xc3857334 in _niam () from /usr/lib/libCsup_v2.2
#3 0xc0186dc0 in exit () from /usr/lib/libc.2

If anyone has any comments or assistance they can add I would appreciate it.

Thanks,

Andy Dienger
1 REPLY 1
Deepak Extross
Honored Contributor

Re: SIGILL after return 0;

Off the top of my head, here are a couple of things to check:
1. Does the function prototype specify that an integer will be returned?
2. Does the calling function expect a return value?

It will help if you can post the code snippet.