Hello,

Great work here on the new threads.

A couple of points from my use.

1) When I run queue.tx on Linux 2.4.3 I'm getting an intermittent core
  dump.  I'm including several backtraces below.

2) It appears that the third thread in the queue.txt sometimes never
   runs.

3) In threads 0.03 test.pl there is this error when it is run with -w:
"my" variable $thread masks earlier declaration in same scope at test.pl
line 31

diff -ru ../threads-0.03/test.pl ./test.pl
--- ../threads-0.03/test.pl     Thu Aug  2 21:19:03 2001
+++ ./test.pl   Mon Jul  2 03:58:07 2001
@@ -28,7 +28,7 @@
 
 #test passing of complex argument
 
-$thread = threads->create(sub { ok('bar',$_[0]->[0]->{foo})},[{foo =>
'bar'}]);
+my $thread = threads->create(sub { ok('bar',$_[0]->[0]->{foo})},[{foo
=> 'bar'}]);
 
 $thread->join();
 skip('Ignore','Ignore');

4) Warnings in threads-shared:

diff -ru ../threads-shared-0.02/test.pl ./test.pl
--- ../threads-shared-0.02/test.pl      Fri Jul 27 03:11:51 2001
+++ ./test.pl   Thu Aug  2 21:33:43 2001
@@ -40,7 +40,7 @@
 share(\$foo);
 
 
-my @threads;
+@threads = ();
 for my $i (1..5) {
     push @threads, threads->create(sub { for ( 1..10000) { $foo = $_
}});
 }
@@ -55,7 +55,7 @@
 my @foo;
 share(\@foo);
 
-my @threads;
+@threads = ();
 for my $i (1..5) {
     push @threads, threads->create(sub { for ( 1..10000) { $foo[$i] =
$_ }});
 }




perl -w queue.tx
Unquoted string "threads" may clash with future reserved word at
queue.tx line 8.
Unquoted string "threads" may clash with future reserved word at
queue.tx line 27.
reader (tid 1): waiting for element 1...
reader (tid 2): waiting for element 1...
reader (tid 3): waiting for element 1...
writer: enqueuing value 54
reader (tid 1): dequeued element 1: value 54
reader (tid 1): waiting for element 2...
writer: enqueuing value 93
reader (tid 2): dequeued element 1: value 93
reader (tid 2): waiting for element 2...
writer: enqueuing value 12
reader (tid 1): dequeued element 2: value 12
reader (tid 1): waiting for element 3...
writer: enqueuing value 20
reader (tid 2): dequeued element 2: value 20
writer: enqueuing value 37
reader (tid 1): dequeued element 3: value 37
reader (tid 2): waiting for element 3...
writer: enqueuing value 73
reader (tid 2): dequeued element 3: value 73
reader (tid 1): waiting for element 4...
writer: enqueuing value 90
reader (tid 1): dequeued element 4: value 90
reader (tid 2): waiting for element 4...
writer: enqueuing value 42
reader (tid 2): dequeued element 4: value 42
reader (tid 1): waiting for element 5...
reader (tid 2): waiting for element 5...
writer: enqueuing value 12
reader (tid 1): dequeued element 5: value 12
reader (tid 1): waiting for element 6...
writer: enqueuing value 25
reader (tid 2): dequeued element 5: value 25
reader (tid 1): dequeued element 6: value -1
Use of uninitialized value in null operation at
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/threads/queue.pm
line 23.
Segmentation fault (core dumped)



Here are several backtraces:

gdb /opt/i386-linux/installed/perl-5.7.2a-g/bin/perl core
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `perl -w queue.tx'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/i686/libpthread.so.0...done.

warning: Unable to set global thread event mask: generic error
[New Thread 1024 (LWP 17313)]
Error while reading shared library symbols:
Cannot enable thread event reporting for Thread 1024 (LWP 17313):
generic error
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/i686/libm.so.6...done.
Loaded symbols for /lib/i686/libm.so.6
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libutil.so.1...done.
Loaded symbols for /lib/libutil.so.1
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/i386-linux-thread-multi-stdio/auto/threads/threads.so...done.
Loaded symbols for
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/i386-linux-thread-multi-stdio/auto/threads/threads.so
Reading symbols from
/opt/i386-linux/installed/perl-5.7.2a-g/lib/5.7.2/i386-linux-thread-multi-stdio/auto/List/Util/Util.so...done.
Loaded symbols for
/opt/i386-linux/installed/perl-5.7.2a-g/lib/5.7.2/i386-linux-thread-multi-stdio/auto/List/Util/Util.so
Reading symbols from
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/i386-linux-thread-multi-stdio/auto/threads/shared/shared.so...done.
Loaded symbols for
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/i386-linux-thread-multi-stdio/auto/threads/shared/shared.so
---Type <return> to continue, or q <return> to quit---
#0  0x400f8dd1 in chunk_free (ar_ptr=0x401a1f00, p=0x81bfb98) at
malloc.c:3080
3080    malloc.c: No such file or directory.
        in malloc.c
(gdb) bt
#0  0x400f8dd1 in chunk_free (ar_ptr=0x401a1f00, p=0x81bfb98) at
malloc.c:3080
#1  0x400f8d59 in __libc_free (mem=0x81bfba0) at malloc.c:3054
#2  0x080b3e81 in Perl_safesysfree (where=0x81bfba0) at util.c:145
#3  0x080dda60 in Perl_sv_clear (my_perl=0x816be08, sv=0x81be2fc) at
sv.c:4955
#4  0x080ddec2 in Perl_sv_free (my_perl=0x816be08, sv=0x81be2fc) at
sv.c:5098
#5  0x080c5bf8 in Perl_av_undef (my_perl=0x816be08, av=0x81be260) at
av.c:451
#6  0x080dd972 in Perl_sv_clear (my_perl=0x816be08, sv=0x81be260) at
sv.c:4926
#7  0x080ddec2 in Perl_sv_free (my_perl=0x816be08, sv=0x81be260) at
sv.c:5098
#8  0x08097b83 in Perl_cv_undef (my_perl=0x0, cv=0x81be254) at op.c:4254
#9  0x080dd946 in Perl_sv_clear (my_perl=0x816be08, sv=0x81be254) at
sv.c:4920
#10 0x080ddec2 in Perl_sv_free (my_perl=0x816be08, sv=0x81be254) at
sv.c:5098
#11 0x080d400e in do_clean_all (my_perl=0x816be08, sv=0x81be254) at
sv.c:393
#12 0x080d3cb5 in S_visit (my_perl=0x816be08, f=0x80d3fb8
<do_clean_all>)
    at sv.c:290
#13 0x080d4034 in Perl_sv_clean_all (my_perl=0x816be08) at sv.c:411
#14 0x0805e32b in perl_destruct (my_perl=0x816be08) at perl.c:682
#15 0x0805c005 in main (argc=3, argv=0xbffff6c4, env=0xbffff6d4)
    at perlmain.c:79
#16 0x40095177 in __libc_start_main (main=0x805bf50 <main>, argc=3, 
    ubp_av=0xbffff6c4, init=0x805afac <_init>, fini=0x814c800 <_fini>, 
    rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff6bc)
    at ../sysdeps/generic/libc-start.c:129
(gdb) 




gdb /opt/i386-linux/installed/perl-5.7.2a-g/bin/perl core
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `perl -w queue.tx'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/i686/libpthread.so.0...done.

warning: Unable to set global thread event mask: generic error
[New Thread 1024 (LWP 17681)]
Error while reading shared library symbols:
Cannot enable thread event reporting for Thread 1024 (LWP 17681):
generic error
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/i686/libm.so.6...done.
Loaded symbols for /lib/i686/libm.so.6
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libutil.so.1...done.
Loaded symbols for /lib/libutil.so.1
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/i386-linux-thread-multi-stdio/auto/threads/threads.so...done.
Loaded symbols for
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/i386-linux-thread-multi-stdio/auto/threads/threads.so
Reading symbols from
/opt/i386-linux/installed/perl-5.7.2a-g/lib/5.7.2/i386-linux-thread-multi-stdio/auto/List/Util/Util.so...done.
Loaded symbols for
/opt/i386-linux/installed/perl-5.7.2a-g/lib/5.7.2/i386-linux-thread-multi-stdio/auto/List/Util/Util.so
Reading symbols from
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/i386-linux-thread-multi-stdio/auto/threads/shared/shared.so...done.
Loaded symbols for
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/i386-linux-thread-multi-stdio/auto/threads/shared/shared.so
---Type <return> to continue, or q <return> to quit---
#0  __pthread_mutex_lock (mutex=0x401a2310) at mutex.c:121
121     mutex.c: No such file or directory.
        in mutex.c
(gdb) bt
#0  __pthread_mutex_lock (mutex=0x401a2310) at mutex.c:121
#1  0x400f8d4d in __libc_free (mem=0x81b5440) at malloc.c:3052
#2  0x080b3e81 in Perl_safesysfree (where=0x81b5440) at util.c:145
#3  0x080ba4ad in Perl_mg_free (my_perl=0x816be08, sv=0x81b4e28) at
mg.c:327
#4  0x080dd81c in Perl_sv_clear (my_perl=0x816be08, sv=0x81b4e28) at
sv.c:4895
#5  0x080ddec2 in Perl_sv_free (my_perl=0x816be08, sv=0x81b4e28) at
sv.c:5098
#6  0x080d400e in do_clean_all (my_perl=0x816be08, sv=0x81b4e28) at
sv.c:393
#7  0x080d3cb5 in S_visit (my_perl=0x816be08, f=0x80d3fb8
<do_clean_all>)
    at sv.c:290
#8  0x080d4034 in Perl_sv_clean_all (my_perl=0x816be08) at sv.c:411
#9  0x0805e32b in perl_destruct (my_perl=0x816be08) at perl.c:682
#10 0x0805c005 in main (argc=3, argv=0xbffff6c4, env=0xbffff6d4)
    at perlmain.c:79
#11 0x40095177 in __libc_start_main (main=0x805bf50 <main>, argc=3, 
    ubp_av=0xbffff6c4, init=0x805afac <_init>, fini=0x814c800 <_fini>, 
    rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff6bc)
    at ../sysdeps/generic/libc-start.c:129
(gdb) 





perl -V
Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 11545)
configuration:
  Platform:
    osname=linux, osvers=2.4.3-12,
archname=i386-linux-thread-multi-stdio
    uname='linux lovenest-fw 2.4.3-12 #1 fri jun 8 15:05:56 edt 2001
i686 unknown '
    config_args='-Dusedevel -Dusereentrant -Dusethreads -Duseithreads'
    hint=previous, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-DDEBUGGING -D_REENTRANT -fno-strict-aliasing
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-g',
    cppflags='-DDEBUGGING -D_REENTRANT -fno-strict-aliasing -DDEBUGGING
-D_REENTRANT -fno-strict-aliasing -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.1
2.96-85)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/lib /usr/lib
    libs=-lpthread -lnsl -lndbm -lgdbm -ldl -lm -lc -lcrypt -lutil
    perllibs=-lpthread -lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.2.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Locally applied patches:
        DEVEL11545
  Built under linux
  Compiled at Aug  2 2001 20:20:22
  @INC:
   
/opt/i386-linux/installed/perl-5.7.2a-g/lib/5.7.2/i386-linux-thread-multi-stdio
    /opt/i386-linux/installed/perl-5.7.2a-g/lib/5.7.2
   
/opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2/i386-linux-thread-multi-stdio
    /opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl/5.7.2
    /opt/i386-linux/installed/perl-5.7.2a-g/lib/site_perl
    .

Reply via email to