in reply to Socket hang. (Windows or Perl? Solutions?) (Updated)

Segfaulted on 5.12.2 on linux

$ perl a.pl -port=12347 Using minimum thread stack size of 16384 at /home/eric/usr/perlbrew/pe +rls/perl-5.12.2t/lib/5.12.2/i686-linux-thread-multi/threads.pm line 4 +9. Segmentation fault
#0 __res_vinit (statp=0xb7ab2df4, preinit=0) at res_init.c:176 #1 0xb7ec12c5 in *__GI___res_ninit (statp=0xb7ab2df4) at res_init.c:1 +42 #2 0xb7ec2330 in *__GI___res_maybe_init (resp=0xb7ab2df4, preinit=0) +at res_libc.c:125 #3 0xb7ec4243 in *__GI___nss_hostname_digits_dots (name=0x8477d60 "lo +calhost", resbuf=0xb7f2ada8, buffer=0xb7f289ec, buffer_size=0xb7f2adb +c, buflen=0, result=0xb7ab2098, status=0x0, af=2, h_errnop=0xb7ab2094) at digit +s_dots.c:46 #4 0xb7ec897a in gethostbyname (name=0x8477d60 "localhost") at ../nss +/getXXbyYY.c:109 #5 0xb7fc364c in XS_Socket_inet_aton () from /home/eric/usr/perlbrew/ +perls/perl-5.12.2t/lib/5.12.2/i686-linux-thread-multi/auto/Socket/Soc +ket.so #6 0x080e0122 in Perl_pp_entersub () #7 0x080de559 in Perl_runops_standard () #8 0x0807a588 in Perl_call_sv () #9 0xb7ac413a in S_ithread_run () from /home/eric/usr/perlbrew/perls/ +perl-5.12.2t/lib/5.12.2/i686-linux-thread-multi/auto/threads/threads. +so #10 0xb7f31955 in start_thread (arg=0xb7ab2b70) at pthread_create.c:30 +0 #11 0xb7eb1e7e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S: +130

Got no time for more now.

Replies are listed 'Best First'.
Re^2: Socket hang. (Windows or Perl? Solutions?)
by OverlordQ (Hermit) on Apr 05, 2011 at 22:21 UTC
    Ditto on 5.10.1 on debian sid x64.
    (gdb) run /tmp/blah.pl Starting program: /usr/bin/debugperl /tmp/blah.pl [Thread debugging using libthread_db enabled] Using minimum thread stack size of 16384 at /usr/lib/perl/5.10/threads +.pm line 49. [New Thread 0xb7c84b70 (LWP 10226)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb7c84b70 (LWP 10226)] Perl_sv_gets (my_perl=0x83efb18, sv=0x84f6bac, fp=0x840afcc, append=0) + at sv.c:6620 6620 sv.c: No such file or directory. in sv.c (gdb) bt #0 Perl_sv_gets (my_perl=0x83efb18, sv=0x84f6bac, fp=0x840afcc, appen +d=0) at sv.c:6620 #1 0x080949d0 in Perl_filter_read (my_perl=0x83efb18, idx=0, buf_sv=0 +x84f6bac, maxlen=0) at toke.c:2955 #2 0x08094dcd in S_filter_gets (my_perl=<value optimized out>, sv=0x8 +4f6bac, fp=<value optimized out>, append=0) at toke.c:2997 #3 0x080a34ec in Perl_yylex (my_perl=0x83efb18) at toke.c:3757 #4 0x080b6d36 in Perl_yyparse (my_perl=0x83efb18) at perly.c:409 #5 0x08179991 in S_doeval (my_perl=0x83efb18, gimme=0, startop=0x0, o +utside=0x0, seq=886) at pp_ctl.c:2981 #6 0x0819030c in Perl_pp_require (my_perl=0x83efb18) at pp_ctl.c:3573 #7 0x080e91a8 in Perl_runops_debug (my_perl=0x83efb18) at dump.c:1968 #8 0x0807fde2 in Perl_call_sv (my_perl=0x83efb18, sv=0x84f676c, flags +=4) at perl.c:2717 #9 0xb7ca26aa in S_ithread_run (arg=0x82c0220) at threads.xs:440 #10 0xb7f9c7b0 in start_thread () from /lib/libpthread.so.0 #11 0xb7f1c8fe in clone () from /lib/libc.so.6
    Edit: Taking out the stack_size option to use lets the script run:
    cthulhu:/tmp# ./blah.pl server:278652 client:278652 cycles: 1774.854/sec

      Thanks guys. I've removed the stack_size option and the windows dependency in the OP code.

      Any chance you could try it again?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.