develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #115934] Crash in Strawberry Perl 64 5.16

Thread Previous | Thread Next
From:
Mikko Noromaa via RT
Date:
August 11, 2013 04:20
Subject:
[perl #115934] Crash in Strawberry Perl 64 5.16
Message ID:
rt-3.6.HEAD-2552-1375981233-1064.115934-15-0@perl.org
Hello!

I found this bug report because my Perl script keeps crashing
occasionally. I've had the crashes for years, but they are so infrequent
that I haven't gotten around to doing anything about them. Sometimes the
crashes occur once per week, sometimes several times per day. My script
is running 24/7.

I can confirm that rschaber's test script crashes on my machine with
ActiveState perl v5.14.2 and v5.16.3 on two different computers, both
running Windows 7.

Building perl 5.18.0 from source with Microsoft Visual Studio 2005 (full
version) creates an executable experiencing the same crash.

To fix:

Comment out line 476 in win32/win32sck.c (ActiveState 5.16.3
AP1603_source) or line 476 in 5.18.0:

err = closesocket(osf);
if (err == 0) {
//  (void)close(fd);	/* handle already closed, ignore error */
    return 0;
}

This fixes rschaber's test script on both 5.16.3 and 5.18.0. I haven't
tested this with my real-world script yet.

I have no idea if this is the right way to fix this, and if the
double-close is needed in certain scenarios. At least my fix should
confirm that the double-close may in fact cause problems.

To me, the biggest mystery regarding this bug is why Windows is
reporting 0xC0000008 (Invalid handle) as an exception. This exception
should be raised only when run under a debugger, or when some special
NtGlobalFlag is set. This isn't the case, and if it were, Perl should
crash in the very first close() call, not randomly.

Related report: Perl crash when run under AppVerifier
(https://rt.perl.org/rt3//Public/Bug/Display.html?id=118127)

Thanks to rschaber for creating a simple test script! It would have
taken ages to do the same from my script.

- Mikko


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

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