List Info

Thread: Perl 5.8 crashes while syntax-checking six-lines of code -- Windows only




Perl 5.8 crashes while syntax-checking six-lines of code -- Windows only
user name
2007-02-28 14:36:27
# New Ticket Created by  Eric Promislow 
# Please include the string:  [perl #41647]
# in the subject line of all future correspondence about
this issue. 
# <URL: h
ttp://rt.perl.org/rt3/Ticket/Display.html?id=41647 >


This is a bug report for perl from ericpactivestate.com,
generated with the help of perlbug 1.35 running under perl
v5.8.8.


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

Running `{w,}perl -c[wT]*' on this six-line file crashes
Perl on Windows:

sub getStuff {
   my $str = $nodelist->{'att'}->{'type'};
   if (1) {
     use Devel: or
die;
   }
}


You can enter this code interactively at the dos prompt --
once you type the line containing the first "}"
Perl will
crash at that point.  I need both the 'sub' and the
assignment -- pulling either out prevents the crash.
Also changing "getStuff" to "f"
prevented the crash.

Expected behavior:
Perl runs this with -c on, and possibly '-w' and '-T'
as well.  It should given an error message reporting
that it can't load the module Devel:.  It
should give
an error message if strict is on, and $nodelist isn't
defined.

The crash happens with Active Perl 819, but not
Active Perl 5.6.1 638, nor perl build 522.


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

Configured by SYSTEM at Tue Aug 29 12:39:43 2006.

Summary of my perl5 (revision 5 version 8 subversion 8)
configuration:
   Platform:
     osname=MSWin32, osvers=5.0,
archname=MSWin32-x86-multi-thread
     uname=''
     config_args='undef'
     hint=recommended, useposix=true, d_sigaction=undef
     usethreads=define use5005threads=undef
useithreads=define usemultiplicity=define
     useperlio=define d_sfio=undef uselargefiles=define
usesocks=undef
     use64bitint=undef use64bitall=undef
uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1
-DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT
-DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
     optimize='-MD -Zi -DNDEBUG -O1',
     cppflags='-DWIN32'
     ccversion='12.00.8804', 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='__int64', lseeksize=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='link', ldflags ='-nologo -nodefaultlib -debug
-opt:ref,icf  -libpath:"C:PerllibCORE" 
-machine86'
     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 ws2_32.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
ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib
odbccp32.lib msvcrt.lib
     libc=msvcrt.lib, so=dll, useshrplib=yes,
libperl=perl58.lib
     gnulibc_version=''
   Dynamic Linking:
     dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef,
ccdlflags=' '
     cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib
-debug -opt:ref,icf  -libpath:"C:PerllibCORE" 
-machine86'

Locally applied patches:
     ACTIVEPERL_LOCAL_PATCHES_ENTRY
     Iin_load_module moved for compatibility with build 806
     Avoid signal flag SA_RESTART for older versions of
HP-UX
     PerlEx support in CGI::Carp
     Less verbose ExtUtils::Install and Pod::Find
     Patch for CAN-2005-0448 from Debian with modifications
     Rearrange INC so that 'site' is searched before
'perl'
     Partly reverted 24733 to preserve binary compatibility
     28671 Define PERL_NO_DEV_RANDOM on Windows
     28376 Add error checks after execing PL_cshname or
PL_sh_path
     28305 Pod::Html should not convert "foo"
into ``foo''
     27736 Make perl_fini() run with Sun WorkShop compiler
     27619 Bug in Term::ReadKey being triggered by a bug in
Term::ReadLine
     27549 Move DynaLoader.o into libperl.so
     27528 win32_pclose() error exit doesn't unlock mutex
     27527 win32_async_check() can loop indefinitely
     27515 ignore directories when searching INC
     27359 Fix -d:Foo=bar syntax
     27210 Fix quote typo in c2ph
     27203 Allow compiling swigged C++ code
     27200 Make stat() on Windows handle trailing slashes
correctly
     27194 Get perl_fini() running on HP-UX again
     27133 Initialise lastparen in the regexp structure
     27034 Avoid "Prototype mismatch" warnings
with autouse
     26970 Make Passive mode the default for Net::FTP
     26921 Avoid getprotobyname/number calls in
IO::Socket::INET
     26897,26903 Make common IPPROTO_* constants always
available
     26670 Make '-s' on the shebang line parse -foo=bar
switches
     26536 INSTALLSCRIPT versus INSTALLDIRS
     26379 Fix alarm() for Windows 2003
     26087 Storable 0.1 compatibility
     25861 IO::File performace issue
     25084 long groups entry could cause memory exhaustion
     24699 ICMP_UNREACHABLE handling in Net::Ping

---
INC
for perl v5.8.8:
     C:Program FilesActiveState Perl Dev Kit 6.0lib
     C:/Perl/site/lib
     C:/Perl/lib
     .

---
Environment for perl v5.8.8:
     HOME=c:homeericp
     LANG (unset)
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
    
PATH=C:PROGRA~1MICROS~3Commonmsdev98BIN;C:PROGRA~1MIC
ROS~3VC98BIN;C:PROGRA~1MICROS~3CommonTOOLSWINNT;C:PR
OGRA~1MICROS~3CommonTOOLS;C:Program FilesActiveState
Komodo IDE 4.0;C:Python24.;C:Program FilesActiveState
Komodo
3.5;C:Python24;c:homeericpmainAppsKomodo-develutilb
lack;c:rubybin;C:Perlbin;C:Program FilesActiveState
Perl Dev Kit
6.0bin;C:Tclbin;C:homeericpmainAppsmoz_toolsbin;c:
cygwinbin;c:bin;C:php;C:WINDOWSsystem32;C:WINDOWS;C:
WINDOWSSystem32Wbem;C:Program FilesPerforce;C:Program
FilesMicrosoft SQL
Server80ToolsBinn;C:appsATTGraphvizbin;C:appsATTG
raphvizbintools;C:Python23;C:Python22;C:Program
FilesQuickTimeQTSystem
     PERL5LIB=C:Program FilesActiveState Perl Dev Kit
6.0lib
    
PERLDB_OPTS=RemotePort=127.0.0.1:2000;RemotePort=127.0.0.1:2
999
     PERL_BADLANG (unset)
     SHELL (unset)


Re: Perl 5.8 crashes while syntax-checking six-lines of code -- Windows only
user name
2007-02-28 18:55:54
Eric Promislow (via RT) wrote:
> Running `{w,}perl -c[wT]*' on this six-line file
crashes
> Perl on Windows:
> 
> sub getStuff {
>    my $str = $nodelist->{'att'}->{'type'};
>    if (1) {
>      use Devel: or
die;
>    }
> }
> 
> 
> You can enter this code interactively at the dos prompt
--
> once you type the line containing the first
"}" Perl will
> crash at that point.  I need both the 'sub' and the
> assignment -- pulling either out prevents the crash.
> Also changing "getStuff" to "f"
prevented the crash.

We need more information about what you mean by
"crash".  Do you mean causes
a general protection fault?  Do you mean doesn't compile? 
Do you get a
syntax error?  Can you show us the exact error?

Here's the error I get on OS X:

$ perl -cw
 sub getStuff {
    my $str = $nodelist->{'att'}->{'type'};
    if (1) {
      use Devel: or
die;
    }
 }
syntax error at - line 4, near "use Devel:
or"
syntax error at - line 6, near "}"
- had compilation errors.

Note that "use Module or something()" is not legal
syntax.  Also note that
"use" happens at compile time, it happens as the
code is being parsed, not
when the subroutine is run.  Putting it inside an if
statement or even
inside a subroutine has no effect.  To get the effect you
want would be
something more like:

    eval { require Devel:; 
Devel:->imp
ort } or die;

Or just:

    require Devel:; 
Devel:->imp
ort;


> Expected behavior:
> Perl runs this with -c on, and possibly '-w' and '-T'
> as well.  It should given an error message reporting
> that it can't load the module Devel:.  It
should give
> an error message if strict is on, and $nodelist isn't
> defined.
> 
> The crash happens with Active Perl 819, but not
> Active Perl 5.6.1 638, nor perl build 522.



[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )