[comp.lang.perl] perl 3.0 PL 28 segmentation faults on too large pattern

jbw@bucsf.bu.edu (Joe Wells) (10/03/90)

Version info:

    $Header: perly.c,v 3.0.1.7 90/08/13 22:22:22 lwall Locked $
    Patch level: 28

Platform:

    Encore Multimax running UMAX 4.2

Perl segmentation faults with no output on this input (input broken into
lines for news, there aren't actually any spaces or newlines):

    /jfw|jkrieger|joshua5|jsol|jwang|kareng|katf|kfoury|kgamble|kid|kjm|
    lan|levine|lina|lisa|lnd|lorii|loukas|lynch|macta|madd|madoka|malave|
    marcus|marton|mas|math|mcginnis|mer|mh|mike|miranda|mont|nagendra|
    nagy|nate|nessa|new|ngeow|nils|nique|nm|ohara|oper2|operator|pam|
    petrina|pick|pinsky|pkumar|pravin|prince|quack|quark|raf|raj|ramdas|
    rbnstein|rmb|robertl|ronbo|root|rsin|rwd|salveter|sam|sandman|sas|sb|
    scc|sciore|seamus|snyder|sorvats|spike|squier|stirpe|suef|susannal|ta|
    tina|tower|trung|uma|ven|vs|w|wangwh|wbates|weeze|who|willy|winterer|
    wtm|wwang|yates|york|zomana/

Yes, I know this isn't a legal perl program.

Removing "jfw|" from the input makes perl produce this message:

    Out of memory!

A longer input, more than double the size of the one above produces this
output from perl on file descriptor 2 prior to death by segmentation
fault:

    Next token is 311 (PATTERN)
    Reducing 0 values via rule 39 (line 310), state stack now 0 1 2
    Entering state 9
    Next token is 311 (PATTERN)
    Shifting token 311 (PATTERN), Entering state 60
    Reducing 1 value via rule 107 (line 525), state stack now 0 1 2 9
    Entering state 80
    Reading a token: 

Ok, so maybe I'll write my program some other way, but perl shouldn't core
dump on this, especially since it originally happened to me inside an
eval.  Errors inside an eval should be recoverable ... Oh well.

Enjoy,

-- 
Joe Wells <jbw@bu.edu>