Re: Thread bug in 5.8RC1 Win32

2002-06-15 Thread Jarkko Hietaniemi

In UNIX platforms your test made Perl enter a 100% CPU loop consisting
of SEGVs on top of SEGVs on top of SEGVS...  the below hopefully fixes:

Change 17250 by jhi@alpha on 2002/06/15 15:34:51

Possible cure for

Subject: Re: Thread bug in 5.8RC1 Win32
From: Alessandro Forghieri [EMAIL PROTECTED]
Date: Sat, 15 Jun 2002 12:56:35 +0200
Message-ID: [EMAIL PROTECTED]

Affected files ...

... //depot/perl/perl.c#441 edit

Differences ...

 //depot/perl/perl.c#441 (text) 
Index: perl/perl.c
--- perl/perl.c#440~17194~  Wed Jun 12 04:35:57 2002
+++ perl/perl.c Sat Jun 15 18:34:51 2002
@@ -442,7 +442,8 @@
 
 /* Destroy the main CV and syntax tree */
 if (PL_main_root) {
-   PL_curpad = AvARRAY(PL_comppad);
+/* If running under -d may not have PL_comppad. */
+PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : NULL;
op_free(PL_main_root);
PL_main_root = Nullop;
 }
End of Patch.


-- 
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen



Re: SEGV in bleadperl@17165 under mod_perl

2002-06-13 Thread Jarkko Hietaniemi

On Thu, Jun 13, 2002 at 06:52:13PM +0200, Andreas J. Koenig wrote:
  On Wed, 12 Jun 2002 23:45:41 +0200, [EMAIL PROTECTED] (Andreas J. 
Koenig) said:
 
Currently I have a testcase that is still 7300 lines of perl code for
the server (after all these are in one file) but only 50 lines for the
client. I hope to cut that down to a reasonable size tomorrow.
 
 I fear I have to give up on this, I cannot cut the test case below
 2800 lines. I cannot make it database-independent either. Whatever I
 cut out, the SEGV goes away.  :-(
 
 I have switched to blead@17207 (apache is 1.3.24, mod_perl is 1.27)
 and this is the stack trace today. The line numbers are again wrong
 and I have no idea why. Please take another *sharp* look. If this bug
 cannot be fixed, I cannot upgrade PAUSE to 5.8.0 (unless I rename it
 to PAUSEGV :-)
 
 Program received signal SIGSEGV, Segmentation fault.
 0x400ed761 in _IO_fflush (fp=0x877f1e0) at iofflush.c:43
 43 iofflush.c: No such file or directory.
 (gdb) bt
 #0  0x400ed761 in _IO_fflush (fp=0x877f1e0) at iofflush.c:43
 #1  0x8205fea in PerlIOStdio_flush (my_perl=0x82f4258, f=0x82fb298)
 at perlio.c:2738

I'm grasping at straws, and I really don't know much about
PerlIO... but try this:

 //depot/perl/perlio.c#179 - /u/vieraat/vieraat/jhi/pp4/perl/perlio.c 
Index: perl/perlio.c
--- perl/perlio.c.~1~   Thu Jun 13 20:05:05 2002
+++ perl/perlio.c   Thu Jun 13 20:05:05 2002
@@ -2734,7 +2734,7 @@
 PerlIOStdio_flush(pTHX_ PerlIO *f)
 {
 FILE *stdio = PerlIOSelf(f, PerlIOStdio)-stdio;
-if (PerlIOBase(f)-flags  PERLIO_F_CANWRITE) {
+if (stdio  PerlIOBase(f)-flags  PERLIO_F_CANWRITE) {
return PerlSIO_fflush(stdio);
 }
 else {
End of Patch.


NI-S will probably find this patch very wrong :-)

 #2  0x8203fde in Perl_PerlIO_flush (my_perl=0x82f4258, f=0x82fb298)
 at perlio.c:1459
 #3  0x82040a8 in Perl_PerlIO_flush (my_perl=0x82f4258, f=0x82fb298)
 at perlio.c:1487
 #4  0x8173e8f in Perl_my_popen (my_perl=0x82f4258, cmd=0x88b8fc1 -, 
 mode=0xb524 w) at util.c:2080
 #5  0x81e3297 in Perl_do_openn (my_perl=0x82f4258, gv=0x88c5f34, 
 name=0x88b8fc1 -, len=1, as_raw=0, rawmode=0, rawperm=0, 
 supplied_fp=0x0, svp=0x84f7098, num_svs=0) at doio.c:282
 #6  0x81cbda3 in Perl_pp_open (my_perl=0x82f4258) at pp_sys.c:542
 #7  0x816eb43 in Perl_runops_debug (my_perl=0x82f4258) at dump.c:1398
 #8  0x81174a3 in S_call_body (my_perl=0x82f4258, myop=0xb758, is_eval=0)
 at perl.c:2044
 #9  0x8117003 in Perl_call_sv (my_perl=0x82f4258, sv=0x8387470, flags=4)
 at perl.c:1962
 #10 0x809da38 in perl_call_handler (sv=0x8387470, r=0x87869ac, args=0x0)
 at mod_perl.c:1658
 #11 0x809cbc4 in perl_run_stacked_handlers (hook=0x828e399 PerlHandler, 
 r=0x87869ac, handlers=0x83873ec) at mod_perl.c:1371
 #12 0x809a637 in perl_handler (r=0x87869ac) at mod_perl.c:897
 #13 0x80e6379 in ap_invoke_handler () at eval.c:88
 #14 0x80fbbdf in process_request_internal () at eval.c:88
 #15 0x80fbc4a in ap_process_request () at eval.c:88
 #16 0x80f2897 in child_main () at eval.c:88
 #17 0x80f2a55 in make_child () at eval.c:88
 #18 0x80f2bd6 in startup_children () at eval.c:88
 #19 0x80f326d in standalone_main () at eval.c:88
 #20 0x80f3acc in main () at eval.c:88
 #21 0x400a475d in __libc_start_main (main=0x80f3738 main, argc=4, 
 ubp_av=0xbae4, init=0x807a628 _init, fini=0x8286704 _fini, 
 rtld_fini=0x4000b8f4 _dl_fini, stack_end=0xbadc)
 at ../sysdeps/generic/libc-start.c:129
 
 Loaded modules of the application are quite a lot:
 
   Apache Apache::Connection Apache::Constants Apache::Constants::Exports
   Apache::HeavyCGI Apache::HeavyCGI::Date Apache::HeavyCGI::Exception
   Apache::HeavyCGI::ExePlan Apache::HeavyCGI::Layout Apache::Request
   Apache::Server Apache::Status Apache::Symbol Apache::Table Apache::URI
   AutoLoader B Carp Class::Singleton Compress::Zlib Config Cwd
   DBD::mysql DBI Data::Dumper Devel::Symdump DirHandle DynaLoader Encode
   Encode::Alias Encode::Config Encode::Encoding Exporter Exporter::Heavy
   ExtUtils::Manifest Fcntl File::Basename File::Copy File::Find
   File::Spec File::Spec::Unix HTML::Entities HTML::Parser HTTP::Date IO
   IO::File IO::Handle IO::Seekable List::Util Mail::Mailer
   Mail::Mailer::rfc822 Mail::Mailer::sendmail Mail::Send Scalar::Util
   SelectSaver String::Random Symbol Text::Tabs Text::Wrap Time::HiRes
   Time::Local URI URI::Escape URI::URL URI::WithBase URI::_generic
   URI::_query URI::_server URI::_userpass URI::ftp Unicode::String
   XML::Parser XML::Parser::Expat XSLoader base bytes constant fields
   integer lib mod_perl overload pause_1999::authensegv
   pause_1999::configsegv re strict utf8 vars warnings warnings::register
 
 Most of the modules are not involved in any action, most of the
 testscript is unused code. The test script only does the following:
 
 1. Authentication via DBI (mysql)
 2. Receive an uploaded file via Apache::Request
 3. Send mail 

Re: SEGV in bleadperl@17165 under mod_perl

2002-06-13 Thread Jarkko Hietaniemi

On Thu, Jun 13, 2002 at 08:26:30PM +0200, Andreas J. Koenig wrote:
  On Thu, 13 Jun 2002 10:32:01 -0700 (PDT), Doug MacEachern [EMAIL PROTECTED] 
said:
 
On Thu, 13 Jun 2002, Andreas J. Koenig wrote:
   Program received signal SIGSEGV, Segmentation fault.
   0x400ed761 in _IO_fflush (fp=0x877f1e0) at iofflush.c:43
   43 iofflush.c: No such file or directory.
   (gdb) bt
   #0  0x400ed761 in _IO_fflush (fp=0x877f1e0) at iofflush.c:43
 
also, if possible could you:
(gdb) p *fp
 
 (gdb) p *fp

 
 I'll try the other suggestions next.

Mine probably doesn't help much since the pointer seems to be non-NULL...

 $1 = {_flags = 1075460144, 
   _IO_read_ptr = 0x401a3830 
0ã\210\b0ã\210\bØñw\bØñw\b88\032@88\032@@8\032@@8\032@H8\032@H8\032@P8\032@P8\032@X8\032@X8\032@`8\032@`8\032@h8\032@h8\032@p8\032@p8\032@x8\032@x8\032@\2008\032@\2008\032@\2108\032@\2108\032@\2208\032@\2208\032@\2308\032@\2308\032@ 8\032@ 8\032@¨8\032@¨8\032@°8\032@°8\032@¸8\032@¸8\032@À8\032@À8\032@È8\032@È8\032@0ð\213\b0ð\213\bØ8\032@Ø8\032@à8\032@à8\032@è8\032@è8\032@...,

This doesn't look good...

   _IO_read_end = 0x646e4128 Address 0x646e4128 out of bounds, 
   _IO_read_base = 0x73616572 Address 0x73616572 out of bounds, 
   _IO_write_base = 0x202e4a20 Address 0x202e4a20 out of bounds, 
   _IO_write_ptr = 0x6eb6c34b Address 0x6eb6c34b out of bounds, 
   _IO_write_end = 0x20296769 Address 0x20296769 out of bounds, 
   _IO_buf_base = 0x69736976 Address 0x69736976 out of bounds, 
   _IO_buf_end = 0x20646574 Address 0x20646574 out of bounds, 
   _IO_save_base = 0x20656874 Address 0x20656874 out of bounds, 
   _IO_backup_base = 0x53554150 Address 0x53554150 out of bounds, 
   _IO_save_end = 0x20200a45 Address 0x20200a45 out of bounds, 

These look fishy...

   _markers = 0x20646e61, _chain = 0x75716572, _fileno = 1702130533, 
   _blksize = 1851859044, _old_offset = 1819309344, _cur_column = 24943, 
   _vtable_offset = 100 'd', _shortbuf =  , _lock = 0x6f746e69, 
   _offset = 8243109245980600352, _codecvt = 0x72696420, 
   _wide_data = 0x6f746365, _mode = 170817906, 
   _unused2 = The request used the following parameters\n\n  SUBMIT_}

If this is an unused field why does it contain a very readable string :-)
In my Linux stdio.h unused2 is int _unused2[16], but off-hand I don't
even think it should be part of a FILE, so I really don't know what to say.

-- 
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen



Re: SEGV in bleadperl@17165 under mod_perl

2002-06-13 Thread Jarkko Hietaniemi

 _IO_read_end = 0x646e4128 Address 0x646e4128 out of bounds, 
 _IO_read_base = 0x73616572 Address 0x73616572 out of bounds, 
 _IO_write_base = 0x202e4a20 Address 0x202e4a20 out of bounds, 
 _IO_write_ptr = 0x6eb6c34b Address 0x6eb6c34b out of bounds, 
 _IO_write_end = 0x20296769 Address 0x20296769 out of bounds, 
 _IO_buf_base = 0x69736976 Address 0x69736976 out of bounds, 
 _IO_buf_end = 0x20646574 Address 0x20646574 out of bounds, 
 _IO_save_base = 0x20656874 Address 0x20656874 out of bounds, 
 _IO_backup_base = 0x53554150 Address 0x53554150 out of bounds, 
 _IO_save_end = 0x20200a45 Address 0x20200a45 out of bounds, 
  
  These look fishy...
 
 $ perl -le 'print pack i, hex $_ foreach ARGV' 0x646e4128 0x73616572 0x202e4a20 
0x6eb6c34b 0x20296769 0x69736976 0x20646574 0x20656874 0x53554150 0x20200a45 
0x20646e61 
 (And
 reas
  J. 
 Kön
 ig) 
 visi
 ted 
 the 
 PAUS
 E

Ouch.  How did you even start to suspect this?  Because the hexdigitsq
looked like fitting well into the ASCII range?

 08\cZ
 08\cZ
 (Andreas J. König) visited the PAUSE and reqested an upload into his/her 
directory.\n .
 The request used the following parameters\n\n  SUBMIT_
 
 I think. (that's König in utf8, isn't it?)

Yes.

 I don't think we're in FILE* any longer, Toto.
 
 (and I didn't get the misquote quite correct, did I?)
 
 What's a good memory leak checker for running PAUSE under? valgrind with

Dunno about memory *leaks* but definitely looks like fandango on core...

 showleaks turned on?

-- 
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen