Change 22169 by [EMAIL PROTECTED] on 2004/01/17 18:02:31

        Subject:  Perl core dumps when running out of memory [PATCH]
        From:  Gisle Aas <[EMAIL PROTECTED]>
        Date:  17 Jan 2004 06:18:13 -0800
        Message-Id:  <[EMAIL PROTECTED]>
        
        Display 'out of memeory' errors using low-level I/O to avoid
        recursive failure and so coredumps.

Affected files ...

... //depot/perl/util.c#409 edit

Differences ...

==== //depot/perl/util.c#409 (text) ====
Index: perl/util.c
--- perl/util.c#408~21917~      Mon Dec 15 01:13:49 2003
+++ perl/util.c Sat Jan 17 10:02:31 2004
@@ -72,7 +72,9 @@
     else if (PL_nomemok)
        return Nullch;
     else {
-       PerlIO_puts(Perl_error_log,PL_no_mem) FLUSH;
+       /* Can't use PerlIO to write as it allocates memory */
+       PerlLIO_write(PerlIO_fileno(Perl_error_log),
+                     PL_no_mem, strlen(PL_no_mem));
        my_exit(1);
        return Nullch;
     }
@@ -119,7 +121,9 @@
     else if (PL_nomemok)
        return Nullch;
     else {
-       PerlIO_puts(Perl_error_log,PL_no_mem) FLUSH;
+       /* Can't use PerlIO to write as it allocates memory */
+       PerlLIO_write(PerlIO_fileno(Perl_error_log),
+                     PL_no_mem, strlen(PL_no_mem));
        my_exit(1);
        return Nullch;
     }
@@ -171,7 +175,9 @@
     else if (PL_nomemok)
        return Nullch;
     else {
-       PerlIO_puts(Perl_error_log,PL_no_mem) FLUSH;
+       /* Can't use PerlIO to write as it allocates memory */
+       PerlLIO_write(PerlIO_fileno(Perl_error_log),
+                     PL_no_mem, strlen(PL_no_mem));
        my_exit(1);
        return Nullch;
     }
End of Patch.

Reply via email to