Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Testing for readdir failure (perlbug errno test without localizing)

by Anonymous Monk
on May 26, 2013 at 00:20 UTC ( [id://1035281]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Testing for readdir failure (Perl-bug)
in thread Testing for readdir failure

As you can see $! needs to be reset in advance "to be meaningful".

Yup, logic bug is logic bug :)

Compare Perl_do_close (called by pp_close ie close ) to pp_readdir

pp_readdir test errno without localizing, do_close doesn't test errno at all

closedir has this issue, and probably many others, maybe 40 others

I wouldn't be surprised if other functions testing errno have this issue too -- this needs explicit testing / reviewing / patching

  • Comment on Re^4: Testing for readdir failure (perlbug errno test without localizing)

Replies are listed 'Best First'.
Re^5: Testing for readdir failure (perlbug errno test without localizing)
by LanX (Saint) on May 26, 2013 at 00:56 UTC
    > closedir has this issue, and probably many others, maybe 40 others

    well at least readline, but now setting to undef doesn't help here.

    Additionally I couldn't figure out why readdir sometimes throws warnings and sometimes not.

    I already prepared a bug report and will send it tomorrow.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Re^5: Testing for readdir failure (perlbug errno test without localizing)
by Bob Cook (Acolyte) on May 30, 2013 at 20:38 UTC
    I have practically no knowledge of C nor Perl's C code, so could you describe the effect(s) of this logic bug at the Perl level?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1035281]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-20 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found