develooper Front page | perl.perl5.porters | Postings from September 2000

[PATCH] DLL not restartabke with threaded perl

From:
Dave Hartnoll
Date:
September 28, 2000 01:22
Subject:
[PATCH] DLL not restartabke with threaded perl
Message ID:
002101c02925$00aa8d80$7e0aa8c0@3b2.com
[ I sent this to perlbug@perl.com but it hasn't appeared here,
  so here it is, sent direct ]


This is a bug report for perl from dave_hartnoll@3b2.com,
generated with the help of perlbug 1.28 running under perl v5.6.0.


-----------------------------------------------------------------
[Please enter your report here]

We use threaded perl in an embedded environment where our own
ActiveX application, and hence PERL56.DLL, can be stopped and
started (loaded and unloaded) at will. The second unloading
causes destruct_perl() to wait for a non-existant thread to
terminate. I've tracked it down to the global variable
PL_nthreads which is incremented when the main thread is
initialised, but not decremented at the end.

Here's a patch against 5.6.0 (the bug also exists in 5.7.0).

--- old/perl.c Fri Mar 17 22:35:16 2000
+++ perl.c Wed Sep 27 13:53:13 2000
@@ -371,4 +371,5 @@
     MUTEX_DESTROY(&PL_threads_mutex);
     COND_DESTROY(&PL_nthreads_cond);
+    PL_nthreads--;
 #endif /* !defined(FAKE_THREADS) */
 #endif /* USE_THREADS */


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.6.0:

Configured by Dave at Wed Sep 27 10:00:34 2000.

Summary of my perl5 (revision 5 version 6 subversion 0) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=define use5005threads=define useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cl', optimize='-O1 -MD -DNDEBUG', gccversion=
    cppflags='-DWIN32'
    ccflags ='-O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT   -DPERL_IMPLICIT_CONTEXT -DPERL_MSVCRT_READFIX'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release  -libpath:"c:\perl\lib\CORE"  -machine:x86'
    libpth=\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
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release  -libpath:"c:\perl\lib\CORE"  -machine:x86'

Locally applied patches:


---
@INC for perl v5.6.0:
    C:/perl/lib
    C:/perl/site/lib
    .

---
Environment for perl v5.6.0:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;c:\bat;c:\bin;c:\usr\bin;c:\perl\bin;c:\msdos7;c:\watcom\binnt;c:\watcom\binw
;c:\tools;c:\util;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual
Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin
    PERL_BADLANG (unset)
    SHELL (unset)





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About