Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #17202] [PATCH] Avoid SIGBUS/coredump in Configure alignment tests

1 view
Skip to first unread message

Andy Dougherty

unread,
Sep 12, 2002, 3:13:29 PM9/12/02
to bugs-bi...@rt.perl.org
# New Ticket Created by Andy Dougherty
# Please include the string: [perl #17202]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=17202 >


The following patch installs a signal handler to try to catch the core
dumps that can follow from Configure's attempts to perform unaligned
access.

diff -r -u parrot-orig/config/auto/alignptrs/test_c.in parrot-andy/config/auto/alignptrs/test_c.in
--- parrot-orig/config/auto/alignptrs/test_c.in Thu Jul 18 19:58:02 2002
+++ parrot-andy/config/auto/alignptrs/test_c.in Thu Sep 12 12:06:04 2002
@@ -6,6 +6,12 @@
*/

#include <stdio.h>
+#include <sys/types.h>
+#include <signal.h>
+/* Try to catch bus errors */
+#ifdef SIGBUS
+void bletch(s) int s; { exit(1); }
+#endif

int main(int argc, char **argv) {

@@ -16,6 +22,9 @@
void **ptr;

int align = 0;
+#ifdef SIGBUS
+ signal(SIGBUS, bletch);
+#endif

for (i = 0; i < 32; i ++) space[i] = 0;

--
Andy Dougherty doug...@lafayette.edu

Dan Sugalski

unread,
Sep 13, 2002, 6:55:04 AM9/13/02
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com
At 7:13 PM +0000 9/12/02, Andy Dougherty (via RT) wrote:
>The following patch installs a signal handler to try to catch the core
>dumps that can follow from Configure's attempts to perform unaligned
>access.

Applied, thanks.
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

0 new messages