NO 'core' file when C program seg faults???

NO 'core' file when C program seg faults???

Post by f.. » Sun, 11 Jul 1999 04:00:00



Hi

I would like to know if other people have had a similar experience such
that when my C/C++ programs seg faults and dies, there is NO core file
generated.  The msg at my shell prompt after my program has died is
simply:
    Segmentaion Fault

when I'm sure it should read a little more like:
    core dumped
    Segmentation Fault

I am currently running linux-2.0.37 with gcc-2.7.2.3 and libc.5.4.46

Can someone please tell me whether there is an option to stop a core
dump being produced, and where it can be set if it exists.  Otherwise,
any suggestions on ensure core file generation on seg faults would be
greately appreciated.

Thanks

fraf


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

NO 'core' file when C program seg faults???

Post by Paul Kimo » Sun, 11 Jul 1999 04:00:00


[posted and e-mailed]


> I would like to know if other people have had a similar experience such
> that when my C/C++ programs seg faults and dies, there is NO core file
> generated.  The msg at my shell prompt after my program has died is
> simply:
>    Segmentaion Fault

> when I'm sure it should read a little more like:
>    core dumped
>    Segmentation Fault

Perhaps your shell (or system) is set up to prevent core dumps.
See your shell's documentation to find out what to try (perhaps
search for "limit".)

--


 
 
 

NO 'core' file when C program seg faults???

Post by Leonard Even » Sun, 11 Jul 1999 04:00:00



> Hi

> I would like to know if other people have had a similar experience such
> that when my C/C++ programs seg faults and dies, there is NO core file
> generated.  The msg at my shell prompt after my program has died is
> simply:
>     Segmentaion Fault

> when I'm sure it should read a little more like:
>     core dumped
>     Segmentation Fault

> I am currently running linux-2.0.37 with gcc-2.7.2.3 and libc.5.4.46

> Can someone please tell me whether there is an option to stop a core
> dump being produced, and where it can be set if it exists.  Otherwise,
> any suggestions on ensure core file generation on seg faults would be
> greately appreciated.

> Thanks

> fraf


> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

The usual reason no core dump is produced is that the owner of the
program does not have permission to write in the current directory.

You can set the maximum size of a core dump with the shell
command ulimit.    See the bash man page or use info to explore
bash commands.   If you set the limit very low, say 1K, then
no core dump will ever be produced.

--


Dept. of Mathematics, Northwestern Univ., Evanston, IL 60208

 
 
 

NO 'core' file when C program seg faults???

Post by Bob Nelso » Sun, 11 Jul 1999 04:00:00



> Can someone please tell me whether there is an option to stop a core
> dump being produced, and where it can be set if it exists.  Otherwise,
> any suggestions on ensure core file generation on seg faults would be
> greately appreciated.

Presuming bash as the shell, ``help ulimit''. Pay special attention to
the ``-c'' option.
--
========================================================================

      http://www.oldradio.com/archives/nelson/open-computing.html
``Those who don't understand UNIX are condemned to reinvent it, poorly.''
 
 
 

1. Challenge : What's causing a SEG Fault in this C program?


From info for gcc.

Incompatibilities of GNU CC
===========================

   There are several noteworthy incompatibilities between GNU C and most
existing (non-ANSI) versions of C.  The `-traditional' option
eliminates many of these incompatibilities, *but not all*, by telling
GNU C to behave like the other C compilers.

   * GNU CC normally makes string constants read-only.  If several
     identical-looking string constants are used, GNU CC stores only one
     copy of the string.
 ....
     The best solution to these problems is to change the program to use
     `char'-array variables with initialization strings for these
     purposes instead of string constants.  But if this is not possible,
     you can use the `-fwritable-strings' flag, which directs GNU CC to
     handle string constants the same way most C compilers do.
     `-traditional' also has this effect, among others.


                        And God fulfills himself in many ways
                        Lest one good custom should corrupt the world.
                        -- Tennyson

2. CD-ROM Sony CDU-541 rev 2.6a

3. Does 'ps -xjag' make your Sun seg fault?

4. Anyone expert with INN ?

5. Seg Fault when running 'more'

6. RAID

7. seg. fault on slackware 'a' set

8. keyboard interrupts

9. elm still seg faults on 'send'

10. seg fault running 'locate'

11. Core files when a seg. fault occurs.

12. My Solaris 2.6 app doesn't create core file on faults

13. segmentation fault w/core dump using 'who' cmd