(this question was originally posted on stackoverflow: http://stackoverflow.com/questions/5560866/perl-5-10-0-signal-handler-issue)

Interrupting the program below with Ctrl + C causes a "Segmentation fault" with perl 5.10.0. It works correctly with perl 5.8.8. Any idea why?

#!/usr/bin/perl # just changing the shebang line to use perl 5.10.0 causes # it to seg fault when interrupted with Ctrl + C use strict; use warnings; $SIG{INT}=\&clean; sub clean { print 'caught'; } sleep 10;

The perl 5.10 version is:

$ perl5.10.0 -v This is perl, v5.10.0 built for i686-linux-thread-multi (with 3 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 1002 [283697] provided by ActiveState http://www.ActiveSt +ate.com Built Jan 10 2008 07:35:18 ...

The linux distribution:

$ cat /proc/version Linux version 2.6.18-128.7.1.el5 (mockbuild@hs20-bc2-3.build.redhat.co +m) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) #1 SMP Wed Aug 19 04: +00:49 EDT 2009

Thanks


In reply to Signal Handler Issue with Perl 5.10.0? by beluchin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.