Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threaded perl dies in regmatch #461

Closed
p5pRT opened this issue Aug 31, 1999 · 6 comments
Closed

Threaded perl dies in regmatch #461

p5pRT opened this issue Aug 31, 1999 · 6 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Aug 31, 1999

Migrated from rt.perl.org#1302 (status was 'rejected')

Searchable as RT1302$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Aug 31, 1999

From rkc@ll.mit.edu


Threaded perl dies in regmatch code. I don't know enough about perl's
internals to trace this down further, but would be willing to help
if others don't know about it. Can someone comment?

Here's the gdb backtrace​:

GNU gdb 4.17
Copyright 1998 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 "sparc-sun-solaris2.6"...
(gdb) core core
warning​: core file may not match specified executable file.
Core was generated by `/usr/local/bin/perl -w ./rtbv.pl'.
Program terminated with signal 9, Killed.
Reading symbols from /usr/lib/libsocket.so.1...done.
Reading symbols from /usr/lib/libnsl.so.1...done.
Reading symbols from /usr/lib/libdl.so.1...done.
Reading symbols from /usr/lib/libm.so.1...done.
Reading symbols from /usr/lib/libposix4.so.1...done.
Reading symbols from /usr/lib/libpthread.so.1...done.
Reading symbols from /usr/lib/libc.so.1...done.
Reading symbols from /usr/lib/libmp.so.2...done.
Reading symbols from /usr/lib/libaio.so.1...done.
Reading symbols from /usr/platform/SUNW,Ultra-30/lib/libc_psr.so.1...done.
Reading symbols from /usr/lib/libthread.so.1...done.
Reading symbols from
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread/auto/DBI/DBI.so...done.

Reading symbols from
/usr/local/lib/perl5/5.00503/sun4-solaris-thread/auto/attrs/attrs.so...done.

Reading symbols from
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread/auto/DBD/mysql/mysql.so...done.

Reading symbols from
/usr/local/lib/perl5/5.00503/sun4-solaris-thread/auto/Thread/Thread.so...done.

Reading symbols from
/usr/local/lib/perl5/5.00503/sun4-solaris-thread/auto/IO/IO.so...done.
Reading symbols from
/usr/local/lib/perl5/5.00503/sun4-solaris-thread/auto/Fcntl/Fcntl.so...done.

Reading symbols from
/usr/local/lib/perl5/5.00503/sun4-solaris-thread/auto/Socket/Socket.so...done.

Reading symbols from
/usr/local/lib/perl5/5.00503/sun4-solaris-thread/auto/IPC/SysV/SysV.so...done.

Reading symbols from /usr/lib/nss_files.so.1...done.
#0 0x9aa88 in regmatch ()
(gdb) T
Please specify a thread ID. Use the "info threads" command to
see the IDs of currently known threads.
(gdb) info threads
  17 Thread 11 (LWP 1) 0x9aa88 in regmatch ()
  16 Thread 10 0xef5b96f4 in _lwp_sema_wait ()
  15 Thread 9 (LWP 9) 0x5d55c in Perl_pp_padsv ()
  14 Thread 7 0xef5b96f4 in _lwp_sema_wait ()
  13 Thread 3 0xef5b96f4 in _lwp_sema_wait ()
  12 Thread 2 (LWP 2) 0xef5b983c in _signotifywait ()
  11 Thread 1 0xef5b96f4 in _lwp_sema_wait ()
  10 LWP 10 0xef5b6908 in door_restart ()
  9 LWP 9 0x5d55c in Perl_pp_padsv ()
  8 LWP 8 0xef5b96f4 in _lwp_sema_wait ()
  7 LWP 7 0xef5b96a8 in ___lwp_cond_wait ()
  6 LWP 6 0xef5b96f4 in _lwp_sema_wait ()
  5 LWP 5 0xef5b96f4 in _lwp_sema_wait ()
  4 LWP 4 0xef5b96a8 in ___lwp_cond_wait ()
  3 LWP 3 0xef5b96f4 in _lwp_sema_wait ()
  2 LWP 2 0xef5b983c in _signotifywait ()
* 1 LWP 1 0x9aa88 in regmatch ()
(gdb) b
Breakpoint 1 at 0x9aa88
(gdb) bt
#0 0x9aa88 in regmatch ()
#1 0x99a5c in regtry ()
#2 0x99770 in Perl_regexec_flags ()
#3 0x5f318 in Perl_pp_match ()
#4 0x9cadc in Perl_runops_standard ()
#5 0x21b94 in perl_call_sv ()
#6 0xef4721d0 in threadstart ()
(gdb)



Site configuration information for perl 5.00503​:

Configured by rkc at Fri Jun 11 14​:28​:51 EDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration​:
  Platform​:
  osname=solaris, osvers=2.6, archname=sun4-solaris-thread
  uname='sunos bruno 5.6 generic_105181-03 sun4u sparc sunw,ultra-30 '
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=define useperlio=undef d_sfio=undef
  Compiler​:
  cc='gcc', optimize='-O', gccversion=2.8.1
  cppflags='-D_REENTRANT -I/usr/local/include -I/opt/local/include
-I/opt/gnu/include'
  ccflags ='-D_REENTRANT -I/usr/local/include -I/opt/local/include
-I/opt/gnu/include'
  stdchar='unsigned char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries​:
  ld='gcc', ldflags =' -L/usr/local/lib -L/opt/local/lib -L/opt/gnu/lib'
  libpth=/usr/local/lib /opt/local/lib /opt/gnu/lib /lib /usr/lib
/usr/ccs/lib
  libs=-lsocket -lnsl -ldb -ldl -lm -lposix4 -lpthread -lc -lcrypt
  libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib -L/opt/local/lib
-L/opt/gnu/lib'

Locally applied patches​:
 


@​INC for perl 5.00503​:
  /usr/local/lib/perl5/5.00503/sun4-solaris-thread
  /usr/local/lib/perl5/5.00503
  /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread
  /usr/local/lib/perl5/site_perl/5.005
  .


Environment for perl 5.00503​:
  HOME=/export/home/rkc
  LANG=C
  LANGUAGE (unset)
  LD_LIBRARY_PATH=/opt/SUNWspro/lib​:/usr/openwin/lib​:/usr/local/lib
  LOGDIR (unset)
 
PATH=/opt/local/bin​:/usr/local/jdk1.1.2/bin​:/opt/SUNWspro/bin​:/export/home/rkc​:/opt/local/tcpdump​:/data/se4/mcclung/audit_tools​:/data/se4/mcclung/tcpdumpfiles/scripts​:/usr/openwin/bin/xview​:/usr/openwin/bin​:/1/security/bin​:/bin​:/usr/local/bin​:/usr/ucb​:/usr/bin​:/usr/etc​:/data/se0/gnu/bin​:/opt/local/SunOS4/bin​:/opt/local/bin​:/data/se0/rpl/lnknet/bin​:/data/se0/rpl/stat/bin​:/usr/ccs/bin​:/opt/local/SunOS4/bin​:/export/home/rkc/bin​:/.sim/bin​:/usr/local/mysql/bin
 
PERL_BADLANG (unset)
  SHELL=/bin/tcsh

--
Dr. Robert K. Cunningham Information System Technology Group
  rkc@​ll.mit.edu MIT Lincoln Laboratory
*** My comments, my opinions​: my responsibility.
PGP key available from http​://pgpkeys.mit.edu​:11371

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Aug 31, 1999

From [Unknown Contact. See original ticket]

On Tue, 31 Aug 1999, Rob Cunningham wrote​:

-----------------------------------------------------------------
Threaded perl dies in regmatch code. I don't know enough about perl's
internals to trace this down further, but would be willing to help
if others don't know about it. Can someone comment?

Threaded perl still has some issues with regex match variables, so that
might've been the problem. (Basically if two threads are in the same piece
of code they can stomp on one another's match variables)

Unfortunately if you don't synchronize access to shared data with lock()
you can also whack bits of perl's internals, which'll show up later as odd
or random crashes.

Likely you're seeing the first case and, if so, try making sure any code
that uses regexes and is shared between threads is protected with locks.
If that's not it then the next step is looking for access to shared data
in multiple threads simultaneously that's not protected by locks.

After that, we get to dig in perl's guts. :-)

  Dan

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jul 16, 2003

From @schwern

Note (from Configure)

The 5005threads version is effectively unmaintained and will probably be
removed in Perl 5.10, so there should be no need to build a Perl using it
unless needed for backwards compatibility with some existing 5.005threads
code.

When 5005threads are removed, this bug should be closed.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jul 13, 2005

From @schwern

5.005 threads are deprecated and due to be removed in perl 5.10. Please
consider using interpreter threads (ithreads) instead.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jul 13, 2005

@schwern - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this Jul 14, 2005
@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jul 14, 2005

@schwern - Status changed from 'resolved' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant