Simple threaded server crashes on Windows XP/7 and native Perl #13123
Comments
From dexter@cpan.orgCreated by dexter@cpan.orgThe server is: #!/usr/bin/perl use strict; use threads; use IO::Socket; sub process_connection { $sock->setsockopt(IPPROTO_TCP, TCP_NODELAY, 1) while (my $line = <$sock>) { my $server = IO::Socket::INET->new( LocalPort => 5000, Type => warn $server; sub worker { for my $n (1..20) { foreach my $thr (threads->list) { The client is: ab -c 1 -n 1000 http://localhost:5000/ The test fail on Windows XP/7 (MSWin32). It handles a few requests and Thread 4 terminated abnormally: setsockopt(TCP_NODELAY) failed:An operation was The test passed on Windows 2003/8 (MSWin32) or ealier (cygwin). Perl Info
|
From @jdheddenIO::Socket is not threads-safe. See the 'BUGS AND LIMITATIONS' of the On Wed, Jul 24, 2013 at 6:31 AM, Piotr Roszatycki <perlbug-followup@perl.org
|
The RT System itself - Status changed from 'new' to 'open' |
From @nwc10On Wed, Jul 24, 2013 at 12:56:58PM -0400, Jerry D. Hedden wrote:
Neither the section in threads.pm nor IO::Socket itself say that it is not 1) How is anyone supposed to know this? Nicholas Clark |
From @jdheddenOn Wed, Jul 24, 2013 at 12:56:58PM -0400, Jerry D. Hedden wrote:
On Wed, Jul 24, 2013 at 3:30 PM, Nicholas Clark <nick@ccl4.org> wrote:
A tough question. There's a section on thread-safety in
It seems I am mistaken in this. I was too hasty in my What is needed is more information. Modifying the example sub process_connection { would provide insight into the error stating that $sock is |
From dexter@cpan.org2013/7/25 Jerry D. Hedden <jdhedden@gmail.com>:
It is not about module. It is about Perl itself without modules. The #!/usr/bin/perl use strict; sub process_connection { setsockopt $sock, Socket::IPPROTO_TCP(), Socket::TCP_NODELAY(), 1 while (my $line = <$sock>) { socket my $server, Socket::AF_INET(), Socket::SOCK_STREAM(), 0 or die warn $server; sub worker { for my $n (1..20) { -- |
From @jdheddenPiotr, If you run the script with this line added: sub process_connection { What is the output from this print statement? On Thu, Jul 25, 2013 at 6:08 AM, Piotr Roszatycki <dexter@cpan.org> wrote:
|
From dexter@cpan.org2013/7/25 Jerry D. Hedden <jdhedden@gmail.com>:
GLOB(0x3f7d8c) at H:\src\server-pre-threads.pl line 31. |
From @wchristianOn Windows 7, with ActivePerl 5.12.4 the following works for me: |
From @jdheddenI strongly suspect this is the same as bug # 119897 which has been resolved. On Thu, Aug 8, 2013 at 9:20 AM, Christian Walde via RT
|
From dexter@cpan.orgOn Pon 30 Wrz 2013, 08:36:13, jdhedden@gmail.com wrote:
I tested this script with Perl 5.19.6 compiled for Windows XP and it worked correctly. |
From @jkeenanOn Wed Dec 11 09:24:11 2013, dexter@cpan.org wrote:
Marking this ticket resolved. Thank you very much. |
@jkeenan - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#119003 (status was 'resolved')
Searchable as RT119003$
The text was updated successfully, but these errors were encountered: