Bug 771257

Summary: perl5: open/die triggers 'die' in subsequent system/die
Product: Red Hat Enterprise Linux 6 Reporter: starlight
Component: perlAssignee: perl-maint-list
Status: CLOSED NOTABUG QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: ppisar, psabata
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-03 07:08:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
test case
none
strace showing details of issue none

Description starlight 2012-01-02 23:52:50 UTC
Created attachment 550331 [details]
test case

Description of problem:

If in a 'perl' script, a successful open/die/close
sequence is followed by a system/die sequence,
an expected perl internal error triggers the
die clause in the system/die call even when
the call to system is successful.

The call to open issues an ioctl(TCGETS) to test
if the newly opened file is a tty device and
receives an errno ENOTTY 25 (Inappropriate ioctl for device).
This error persists somehow such that it incorrectly
triggers the die clause later on.

Version-Release number of selected component (if applicable):

Several version of 'perl' including 5.8.8
(RHEL5) and 5.8.10 (RHEL6).

How reproducible:

Run the attached test case.

Actual results:

test fails with "error executing date Inappropriate ioctl for device"

Expected results:

test should succeed

Comment 1 starlight 2012-01-02 23:53:33 UTC
Created attachment 550332 [details]
strace showing details of issue

Comment 3 starlight 2012-01-03 00:33:50 UTC
Reported upstream:

https://rt.perl.org/rt3/Public/Bug/Display.html?id=107420

Comment 4 starlight 2012-01-03 02:04:55 UTC
Bad script rather than perl bug.  Sorry for the erroneous report.

Comment 5 Marcela Mašláňová 2012-01-03 07:08:26 UTC
Thanks for clearing this issue with upstream. I'm closing it as NOTABUG - Successful system calls do not (necessarily) reset $!, so your script is
just printing out the existing value of $! after a successful system().