develooper Front page | perl.perl6.internals | Postings from October 2008

[perl #59968] [BUG] Calling Test::More sub after catching a div by zero exception segfaults

From:
Mark Grimes
Date:
October 18, 2008 06:10
Subject:
[perl #59968] [BUG] Calling Test::More sub after catching a div by zero exception segfaults
Message ID:
rt-3.6.HEAD-29762-1224285040-528.59968-72-0@perl.org
# New Ticket Created by  Mark Grimes 
# Please include the string:  [perl #59968]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=59968 >


The following code results in a segfault:

.sub main :main
    .include 'include/test_more.pir'

    new P0, 'Integer'
    new P2, 'Integer'
    new P1, 'Integer'

    set P0, 1
    set P2, 0

    ok( 1, 'ready...' )

    push_eh handler
        P1 = P0 / P2
        ok( 0, "not caught" )
        end
    pop_eh
handler:
    ok( 1, 'caught' )       # segfaults
    # say "ok"              # no problem with this
.end

The ok() line will segfault, but if it is replaced by the "say" line,
all is well. If we use I0, I1, I2 instead of the Integer PMC's, it
works find, as well.

Thanks,
Mark



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