develooper Front page | perl.perl5.porters | Postings from April 2007

[perl #42648] [PATCH] crash in win32/VMem.h when out of memory

Thread Next
From:
Devin Heitmueller
Date:
April 20, 2007 19:09
Subject:
[perl #42648] [PATCH] crash in win32/VMem.h when out of memory
Message ID:
rt-3.6.HEAD-30201-1177105747-239.42648-75-0@perl.org
# New Ticket Created by  "Devin Heitmueller" 
# Please include the string:  [perl #42648]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42648 >


This is a bug report for perl from dheitmueller@devinxp.gridapp.com,
generated with the help of perlbug 1.35 running under perl 5.9.4.


-----------------------------------------------------------------
There is an condition in the VMem::Realloc and VMem::Malloc when
_USE_LINKED_LIST is enabled and the system is out of memory.

In cases where m_pmalloc/m_prealloc return a NULL pointer, the next line
of code calls LinkBlock(ptr) and will dereference the NULL pointer.

The attached patch handles the allocation failure and returns a NULL pointer
as expected to the caller.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.9.4:

Configured by dheitmueller at Mon Jan 22 17:18:02 2007.

Summary of my perl5 (revision 5 version 9 subversion 4) configuration:
  Platform:
    osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=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  -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
    optimize='-MD -Zi -DNDEBUG -O1',
    cppflags='-DWIN32'
    ccversion='13.10.6030', 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:\perl594\lib\CORE"  -machine:x86'
    libpth="C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\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=perl59.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:\perl594\lib\CORE"  -machine:x86'

Locally applied patches:


---
@INC for perl 5.9.4:
    C:/perl594/lib
    C:/perl594/site/lib
    .

---
Environment for perl 5.9.4:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\IDE;C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\BIN;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools\bin\prerelease;C:\Program Files\Microsoft Visual
Studio .NET 2003\Common7\Tools\bin;C:\Program Files\Microsoft Visual
Studio .NET 2003\SDK\v1.1\bin;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;C:\Program
Files\ActiveState Komodo IDE 4.0\;C:\Program Files\ActiveState Komodo
3.5\;C:\activeperl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
Files\Intel\DMIX;C:\Program Files\Subversion\bin;C:\Program
Files\Common Files\Compuware;C:\Program Files\Microsoft SQL
Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\90\Tools\binn\;C:\Program Files\Microsoft SQL
Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL
Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft
Visual Studio 8\Common7\IDE\PrivateAssemblies\;c:\perl\bin;C:\Program
Files\QuickTime\QTSystem\;
    PERL_BADLANG (unset)
    SHELL (unset)


-- 
Devin J. Heitmueller
http://www.devinheitmueller.com
AIM: devinheitmueller

Thread Next


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