To dump core or not to dump core 
Author Message
 To dump core or not to dump core

When fatal errors occur in (Unix) python, it dumps core. This is OK
when debugging, but is a drag in general.  

I propose that, by default, the Unix version of python should not dump
core on fatal errors.  (An appropriate call to setrlimit() can be used
to prevent core dumps.)  A command-line flag could be provided to
allow core dumps on demand, or a module interface to setrlimit (and
getrlimit) could be provided.
--

                   U.S. Geological Survey, Reston VA  22092
This message is being posted to obtain or provide technical information
relating to my duties at the U.S. Geological Survey.



Sat, 17 May 1997 04:25:56 GMT  
 To dump core or not to dump core
Excerpts from ext.python: 28-Nov-94 To dump core or not to dump.. Jim

Quote:
> When fatal errors occur in (Unix) python, it dumps core. This is OK
> when debugging, but is a drag in general.  
> I propose that, by default, the Unix version of Python should not dump
> core on fatal errors.  (An appropriate call to setrlimit() can be used
> to prevent core dumps.)  A command-line flag could be provided to
> allow core dumps on demand, or a module interface to setrlimit (and
> getrlimit) could be provided.

We went through this recently with ILU.  When ILU detects a kernel bug,
it used to SEGFAULT, because it assumed that either you were running
under gdb, or if not, would like a core dump.  It still does this.  We
prevent core dumps, if necessary, by setting the coredumpsize shell
variable.

On the other hand, we have changed the way ILU behaves for memory
allocation failures, and are considering making this the default fatal
error case.  We reasoned that a running program is more useful than a
dead program, for debugging purposes.  So the default behavior, if
malloc() fails, is now to go into an endless loop.  This provides the
user with a number of alternatives:  they can kill the process, or they
can attach to it with a de{*filter*} and inspect it.  Since the process is
still live, ephemeral state such as open file descriptors is preserved.
Better than a coredump.

The endless loop is actually

        while (1)
                sleep(10);

so few actual CPU cycles are consumed.

It seems to me this would be a reasonable thing to do for Python, as well.

Bill



Sat, 17 May 1997 07:21:19 GMT  
 To dump core or not to dump core

Quote:
> I propose that, by default, the Unix version of Python should not dump
> core on fatal errors.  (An appropriate call to setrlimit() can be used
> to prevent core dumps.)  A command-line flag could be provided to
> allow core dumps on demand, or a module interface to setrlimit (and
> getrlimit) could be provided.
> --

>                    U.S. Geological Survey, Reston VA  22092

Or you could exec the Python program from a csh script, setting
limit beforehand.

#!/bin/csh
#
limit coredumpsize 0
exec myPythonProgram



Sat, 17 May 1997 22:13:00 GMT  
 To dump core or not to dump core

Does ILU indicate to the user that a fatal error has occured though?  If they
miss a msg is it possible that the user will just think that some necessary
file system/machine/etc. is 'down' and will wait for the program to continue?
--
:s Great net resources sought...

:s <URL:http://www.mps.ohio-state.edu/cgi-bin/hpp?lvirden_sig.html>
The task of an educator should be to irrigate the desert not clear the forest.



Sun, 18 May 1997 04:07:42 GMT  
 To dump core or not to dump core

Quote:
>I propose that, by default, the Unix version of Python should not dump
>core on fatal errors.  (An appropriate call to setrlimit() can be used

I (additionally) propose that you can use one of the following 2
solutions to set up your environment to prevent core files if you don't
like them:

1) If you have the 'limit' command, use 'limit core 0' to prevent core
   files.
2) If you don't have the 'limit' (or similar) command, create an empty
   core file with no access permissions in the working directory where
   you're running the program that dumps core.

$0.02

        -Jaap-
--
Jaap Vermeulen                      .   Sequent Computer Systems, Inc
        Telephone: (503) 578-4404   |   Management Frameworks, M/S RHE2-705
        Fax      : (503) 578-7569   |   15450 SW Koll Parkway



Mon, 19 May 1997 01:31:30 GMT  
 To dump core or not to dump core
Quote:
Jaap Vermeulen writes:


|
| >I propose that, by default, the Unix version of Python should not dump
| >core on fatal errors.  (An appropriate call to setrlimit() can be used
|
| I (additionally) propose that you can use one of the following 2
| solutions to set up your environment to prevent core files if you don't
| like them:
|
| 1) If you have the 'limit' command, use 'limit core 0' to prevent core
|    files.
| 2) If you don't have the 'limit' (or similar) command, create an empty
|    core file with no access permissions in the working directory where
|    you're running the program that dumps core.
|

        You can also make a soft link from core -> /dev/null.

| $0.02
|
|       -Jaap-
| --
| Jaap Vermeulen                      .   Sequent Computer Systems, Inc
|         Telephone: (503) 578-4404   |   Management Frameworks, M/S RHE2-705
|         Fax      : (503) 578-7569   |   15450 SW Koll Parkway

                        "I assume I need no introduction..."
                                                        -- Lestat



Sun, 18 May 1997 16:52:33 GMT  
 To dump core or not to dump core
Yep, it tries to indicate errors.  With memory allocation failures, it's
not really safe to even attempt to print, though.

Bill



Mon, 19 May 1997 12:35:31 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. _tkinter makes core dump (Re: python links with Tk in OS/2 - but core dumps)

2. core or core dump file ?

3. core dump help

4. Macro to dump a piece of core and the registers MVS/XA

5. Jun386 with VW5i.4 on Linux SuSE 7.2 causes core dumps

6. gsub means "core dump"?

7. [VW} Out of Memory core dump

8. Core Dump, large image, help?

9. VW-Envy-Smalltalk Broker Core Dump with type any

10. Envy 1.43->Envy 3.01 core dumps

11. Forwarded Re: INVALID ARRAY SUBSCRIPT leads to Pop core dump (PC linux + Windows 2000)

12. INVALID ARRAY SUBSCRIPT leads to Pop core dump

 

 
Powered by phpBB® Forum Software