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

[perl #116082] print builtin is broken

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
December 14, 2012 14:09
Subject:
[perl #116082] print builtin is broken
Message ID:
rt-3.6.HEAD-17500-1355494148-120.116082-15-0@perl.org
On Thu Dec 13 09:18:15 2012, salva wrote:
> 
> This is a bug report for perl from sfandino@yahoo.com,
> generated with the help of perlbug 1.39 running under perl 5.14.2.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> Run
> 
> � strace -o /tmp/out perl -e '$SIG{INT} = sub {1}; while (1) { print
>    STDERR "foo ", ("b ") x (rand 80), "foo ", "\n"}'
> 
> and press Ctrl+C at the keyboard repeatly.
> 
> Eventually print will start to malfunction printing only its first
>    argument.
> 
> The strace output shows that the failure happens after the signal
>    causes the underlaying write call to fail with a ERESTARTSYS error.
> 
> write(2, "b ", 2)���������������������� = 2
> write(2, "b ", 2)���������������������� = 2
> write(2, "b ", 2)���������������������� = 2
> write(2, "b ", 2)���������������������� = 2
> write(2, "b ", 2)���������������������� = 2
> write(2, "foo ", 4)�������������������� = ? ERESTARTSYS (To be
>    restarted)
> --- SIGINT (Interrupt) @ 0 (0) ---
> sigreturn()���������������������������� = ? (mask now [])
> rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
> rt_sigaction(SIGINT, NULL, {0x80cb5a0, [], 0}, 8) = 0
> rt_sigprocmask(SIG_UNBLOCK, [INT], NULL, 8) = 0
> write(2, "foo ", 4)�������������������� = 4
> write(2, "foo ", 4)�������������������� = 4
> write(2, "foo ", 4)�������������������� = 4
> write(2, "foo ", 4)�������������������� = 4
> write(2, "foo ", 4)�������������������� = 4
> write(2, "foo ", 4)�������������������� = 4
> write(2, "foo ", 4)�������������������� = 4
> write(2, "foo ", 4)�������������������� = 4
> write(2, "foo ", 4)�������������������� = 4
> 
> Note that this is the easier way I have found to reproduce the bug but
>    using signals is not required at all. In the real life application
>    where I found it, it was caused by an spurious EAGAIN error
>    generated by the OS (Linux) by no particular reason.

I think this may be the same as #111352.

(Please excuse the replacement characters.  RT doesn’t like Latin-1.)

-- 

Father Chrysostomos


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

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