develooper Front page | perl.perl5.porters | Postings from April 2012

[perl #112608] panic: sv_setpvn called with negative strlen -1

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
April 26, 2012 08:35
Subject:
[perl #112608] panic: sv_setpvn called with negative strlen -1
Message ID:
rt-3.6.HEAD-4610-1335454507-1001.112608-15-0@perl.org
On Thu Apr 26 01:20:30 2012, Steve.Hay@verosoftware.com wrote:
> Father Chrysostomos via RT wrote on 2012-04-26:
> > I get the same result on a Mac, both
>    threaded and unthreaded.

I should have read Leon Timmerman’s message more closely.  If I use
:crlf:encoding(...) I get the panic, but not with :crlf after.

> > 
> > A C backtrace would help.
> >
>    Those messages are, of course, expected given what the program is
>    being asked to do. I get them first too, but then followed by a
>    crash (panic).
> 
> Is it an EOL issue? (I'm running on Windows
>    here.) Leon mentioned it only happening when :crlf was combined
>    with :encoding. I still see the crash with
> 
> open my $rh,
>    '<:encoding(UTF-8):crlf', 'utf8.txt' or die $!;
> open my $wh,
>    '>:encoding(ISO-8859-1):crlf', 'iso88591.txt' or die $!;
> 
> but not
>    with
> 
> open my $rh, '<:raw:encoding(UTF-8)', 'utf8.txt' or die $!;
>    open my $wh, '>:raw:encoding(ISO-8859-1)', 'iso88591.txt' or die
>    $!;
> 
> Also, when I download the utf8.txt attachment I find that it
>    has got mangled somehow from what I uploaded: the line endings are
>    now \r\r\n rather than the \r\n original which I uploaded.
>    Furthermore, the program doesn't crash for me if I leave it like
>    that -- I have to convert it back to \r\n before I see the crash
>    again.

I think your browser is trying to convert \n to \r\n when you download
it.  I downloaded the file and it has \r\n line breaks in it.

> 
> I will try to get a backtrace.

I see your backtrace has Encode’s XS code in it.  I will try to dig deeper.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=112608

Thread Previous | Thread Next


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