Re: Thread bug in 5.8RC1 Win32

2002-06-15 Thread Alessandro Forghieri

Greetings.

On Fri, Jun 14, 2002 at 12:44:50PM +0200, Alessandro Forghieri wrote:
 Running NT4SP6, 5.8RC1 compiled debug.
 
 The following session:
 
 D:\Apache2perl -d -e 42
   DB1 ;{use threads;my $var=1;threads-create(sub{$var++})-join();}
 
 Crashes the intepreter, in perl.c:
[...]

Sorry to followup to myself, but I forgot to mention that the creash happens 
*only* from within the debugger (perl -d). The mentioned code runs fine 
otherwise - for instance, from within a file script.

Cheers,
alf




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



Thread bug in 5.8RC1 Win32

2002-06-14 Thread Alessandro Forghieri

Greetings.
Running NT4SP6, 5.8RC1 compiled debug.

The following session:

D:\Apache2perl -d -e 42

Loading DB routines from perl5db.pl version 1.19
Editor support available.

Enter h or `h h' for help, or `perldoc perldebug' for more help.

main::(-e:1):   42
  DB1 ;{use threads;my $var=1;threads-create(sub{$var++})-join();}

Crashes the intepreter, in perl.c:


/* Destroy the main CV and syntax tree */
if (PL_main_root) {
PL_curpad = AvARRAY(PL_comppad);   =BLAM!
op_free(PL_main_root);
PL_main_root = Nullop;
}

Stack trace:

perl_destruct(interpreter * 0x01cf138c) line 445 + 9 bytes
Perl_ithread_destruct(interpreter * 0x015d6d7c, ithread_s * 0x01e9c6cc,
const char * 0x1000650c `string') line 130 + 12 bytes
ithread_mg_free(interpreter * 0x015d6d7c, sv * 0x01ce6098, magic *
0x02029e7c) line 200 + 18 bytes
Perl_sv_unmagic(interpreter * 0x015d6d7c, sv * 0x01ce6098, int 110) line
4687 + 18 bytes
Perl_ithread_join(interpreter * 0x015d6d7c, sv * 0x01ce6080) line 519 + 19
bytes
XS_threads_join(interpreter * 0x015d6d7c, cv * 0x01ce5f90) line 592 + 13
bytes
Perl_pp_entersub(interpreter * 0x015d6d7c) line 2758 + 16 bytes
Perl_runops_debug(interpreter * 0x015d6d7c) line 1398 + 13 bytes
S_run_body(interpreter * 0x015d6d7c, long 1) line 1670 + 13 bytes
perl_run(interpreter * 0x015d6d7c) line 1594 + 13 bytes
RunPerl(int 4, char * * 0x015e0210, char * * 0x015e0c70) line 202 + 12 bytes
main(int 4, char * * 0x015e0210, char * * 0x015e0c70) line 18 + 18 bytes
PERL! mainCRTStartup + 227 bytes
KERNEL32! 77f1b9ea()

Output of perl -V:

Summary of my perl5 (revision 5 version 8 subversion 0) configuration:
  Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cl', ccflags ='-nologo -Gf -W3 -Od -MD -Zi -DDEBUGGING -DWIN32
-D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
optimize='-Od -MD -Zi -DDEBUGGING',
cppflags='-DWIN32'
ccversion='', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=4
alignbytes=8, prototype=define
  Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug
-libpath:D:\perl58\lib\CORE  -machine:x86'
libpth=MSVCDir=C:\PROGRA~1\MICROS~4\VC98\lib
libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
msvcrt.lib
perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
  Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-libpath:D:\perl58\lib\CORE  -machine:x86'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
  Built under MSWin32
  Compiled at Jun  4 2002 09:08:01
  INC:
D:/perl58/lib
D:/perl58/site/lib
.