develooper Front page | perl.perl5.porters | Postings from September 2012

[perl #40595] out of memory message should not require memory allocation

Thread Next
From:
James E Keenan via RT
Date:
September 1, 2012 16:33
Subject:
[perl #40595] out of memory message should not require memory allocation
Message ID:
rt-3.6.HEAD-11172-1346542372-1588.40595-15-0@perl.org
On Wed Oct 25 02:26:58 2006, schmorp@schmorp.de wrote:
> 
> This is a bug report for perl from schmorp@schmorp.de,
> generated with the help of perlbug 1.35 running under perl v5.8.8.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> When running into out of memory situations, I regularly get segfaults.
>    The
> backtrace always looks the same:
> 
>    #9026 0x000000000042500e in Perl_malloc (nbytes=4104) at
>    malloc.c:1479
>    #9027 0x0000000000514b55 in PerlIOBuf_get_base (f=<value optimized
>    out>) at perlio.c:3890
>    #9028 0x0000000000515b3a in PerlIOBuf_write (f=0x41180c8,
>    vbuf=0x546e28, count=33) at perlio.c:3755
>    #9029 0x0000000000517c9e in PerlIO_puts (f=0x412b828, s=0x546e28
>    "Out of memory during request for ") at perlio.c:1593
>    #9030 0x000000000042500e in Perl_malloc (nbytes=4104) at
>    malloc.c:1479
>    #9031 0x0000000000514b55 in PerlIOBuf_get_base (f=<value optimized
>    out>) at perlio.c:3890
>    #9032 0x0000000000515b3a in PerlIOBuf_write (f=0x41180c8,
>    vbuf=0x546e28, count=33) at perlio.c:3755
>    #9033 0x0000000000517c9e in PerlIO_puts (f=0x412b828, s=0x546e28
>    "Out of memory during request for ") at perlio.c:1593
>    #9034 0x000000000042500e in Perl_malloc (nbytes=4104) at
>    malloc.c:1479
>    #9035 0x0000000000514b55 in PerlIOBuf_get_base (f=<value optimized
>    out>) at perlio.c:3890
>    #9036 0x0000000000515b3a in PerlIOBuf_write (f=0x41180c8,
>    vbuf=0x546e28, count=33) at perlio.c:3755
>    #9037 0x0000000000517c9e in PerlIO_puts (f=0x412b828, s=0x546e28
>    "Out of memory during request for ") at perlio.c:1593
>    #9038 0x000000000042500e in Perl_malloc (nbytes=4104) at
>    malloc.c:1479
>    #9039 0x0000000000514b55 in PerlIOBuf_get_base (f=<value optimized
>    out>) at perlio.c:3890
> 
> etc.
> 
> I never actually see the out of memory message because even printing
>    it to
> the screen requires memory allocation.
> 
> There are likely ways around this, but I think it would be more
>    worthwhile
> to just write the error message to stderr or "something like that". It
>    is
> an emergency, and going through all perlio layers makes little sense,
>    if,
> in the end, the kernel kills it anyways due to stack growth.
> 
> Note that this isn't a bug, it's just a wish for saner error reporting
>    :)
> 

Is the "Out of memory" message coming from the kernel or from Perl?  If
the former, is there any way for Perl to detect that situation first so
that Perl can cut through all those layers itself?

Thank you very much.
Jim Keenan

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=40595

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About