Your message dated Wed, 17 Dec 2008 22:21:12 +0200
with message-id <20081217202112.ga1...@rebekka>
has caused the   report #509041,
regarding perl: $? & 128 not set when dumping core
to be marked as having been forwarded to the upstream software
author(s) [email protected]

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
509041: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509041
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
On Tue, Dec 16, 2008 at 02:34:03PM +0200, Niko Tyni wrote:

> I see <sys/wait.h> defines WCOREDUMP only with __USE_BSD here
> (Debian testing and unstable, glibc 2.7).

Further digging shows the problem is that <sys/wait.h> doesn't get
included at all. We do build with -D_GNU_SOURCE, which implies __USE_BSD.

Proposed patch attached, this fixes it for me on both 5.10.0 and blead.

% ./miniperl -le 'system($^X, "-e", q/kill 6,$$; sleep 1/); print "version=$] 
\$?=$? native=${^CHILD_ERROR_NATIVE}"'
version=5.011000 $?=134 native=134

(This is now also http://bugs.debian.org/509041 [Cc'd])
-- 
Niko Tyni   [email protected]
>From 82d5a5d6eb1dfe8775d62de2f04ff659035bce3c Mon Sep 17 00:00:00 2001
From: Niko Tyni <[email protected]>
Date: Wed, 17 Dec 2008 22:02:51 +0200
Subject: [PATCH] WCOREDUMP is in <sys/wait.h>

Without this, $? & 128 doesn't get set properly on some (glibc) systems
when dumping core.
---
 perl.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/perl.h b/perl.h
index 7d22338..c6008bb 100644
--- a/perl.h
+++ b/perl.h
@@ -677,6 +677,11 @@ register struct op *Perl_op asm(stringify(OP_IN_REGISTER));
 #   include <unistd.h>
 #endif
 
+/* for WCOREDUMP */
+#ifdef I_SYS_WAIT
+#   include <sys/wait.h>
+#endif
+
 #ifdef __SYMBIAN32__
 #   undef _SC_ARG_MAX /* Symbian has _SC_ARG_MAX but no sysconf() */
 #endif
-- 
1.5.6.5


--- End Message ---

Reply via email to