Bugs item #3294808, was opened at 2011-04-29 03:43
Message generated for change (Comment added) made by lambd
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100612&aid=3294808&group_id=612

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Derek Lamb (lambd)
Assigned to: Nobody/Anonymous (nobody)
Summary: sever on empty piddle causes segfault

Initial Comment:
On my Mac and also on a Linux system, with the current git (2.4.9_001), calling 
sever  on an empty piddle results in a segfault:

pdl> $img = zeroes(100,100)                                                     
                           
pdl> $coords = which($img!=0)                                                   
                           
pdl> $vals = $img->indexND($coords)->sever;                                     
                           
Segmentation fault

I do not get the error when running PDL 2.4.7 or 2.4.8 (in those cases the null 
piddle is returned).  I also do not get a segfault when I do not include the 
sever().  Without the sever, $img->indexND($coords) is PDL->null (when doing 
pdl>?vars).  But for reasons I don't understand, I don't get the segfault if I 
try to trip the error more directly:

pdl> $a = PDL->null
pdl> $b = $a->sever;
pdl> $c = PDL->null->sever
pdl>

----------------------------------------------------------------------

>Comment By: Derek Lamb (lambd)
Date: 2011-04-29 17:37

Message:
good to know, I guess.  I don't get a core dump, so there's no core to
examine with gdb.  Running under the perl debugger shows that at the call
to rangeb some functions in the Carp module get called.  Will provide more
info later.

I'm not sure of the difference between an empty piddle and a null piddle. 
The piddles in my example that print 'Empty' show up as PDL->null when I do
a '?vars'.

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2011-04-29 16:40

Message:
I can also reproduce on cygwin now.  I guess I was just "lucky" before.

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2011-04-29 10:49

Message:
I do get the problem with an ActiveState install of PDL-2.4.9:

asperl> perldl -V
perlDL shell v1.354
 PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
 'COPYING' in the PDL distribution. This is free software and you
 are welcome to redistribute it under certain conditions, see
 the same file for details.
Set up gcc environment - 3.4.5 (mingw-vista special r3)

Summary of my PDL configuration

VERSION: PDL v2.4.9 (supports bad values)

$%PDL::Config = {
                  'BADVAL_PER_PDL' => '0',
                  'WITH_PROJ' => '1',
                  'FFTW_TYPE' => 'double',
                  'FFTW_LIBS' => [
                                   'C:/_32/msys/1.0/local/lib'
                                 ],
                  'WITH_FFTW' => '1',
                  'GSL_LIBS' => undef,
                  'GL_BUILD' => '1',
                  'WITH_IO_BROWSER' => '0',
                  'PROJ_INC' => [
                                  'C:/_32/msys/1.0/local/include'
                                ],
                  'WHERE_PLPLOT_INCLUDE' =>
'C:/_32/msys/1.0/local/include/plplot',
                  'HTML_DOCS' => '1',
                  'SKIP_KNOWN_PROBLEMS' => '1',
                  'WHERE_PLPLOT_LIBS' => 'C:/_32/msys/1.0/local/lib',
                  'WITH_3D' => '1',
                  'WITH_POSIX_THREADS' => '0',
                  'POGL_VERSION' => '0.63',
                  'FFTW_INC' => [
                                  'C:/_32/msys/1.0/local/include'
                                ],
                  'HIDE_TRYLINK' => '1',
                  'WITH_HDF' => '0',
                  'HDF_INC' => undef,
                  'POGL_WINDOW_TYPE' => 'glut',
                  'WITH_BADVAL' => '1',
                  'WITH_GD' => '1',
                  'FITS_LEGACY' => '1',
                  'WITH_SLATEC' => '1',
                  'BADVAL_USENAN' => '0',
                  'WITH_DEVEL_REPL' => '1',
                  'TEMPDIR' => 'C:\\Local\\Temp',
                  'PROJ_LIBS' => [
                                   'C:/_32/msys/1.0/local/lib'
                                 ],
                  'USE_POGL' => '1',
                  'GD_LIBS' => [
                                 'C:/_32/msys/1.0/local/lib'
                               ],
                  'GSL_INC' => undef,
                  'GD_INC' => [
                                'C:/_32/msys/1.0/local/include'
                              ],
                  'WITH_GSL' => '1',
                  'OPTIMIZE' => undef,
                  'HDF_LIBS' => undef,
                  'MALLOCDBG' => {},
                  'WITH_MINUIT' => '1',
                  'WITH_PLPLOT' => '1',
                  'MINUIT_LIB' => undef
                };

Summary of my perl5 (revision 5 version 12 subversion 3) configuration:

  Platform:
    osname=MSWin32, osvers=5.2, 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='C:/asperl/site/bin/gcc.exe', ccflags ='-DNDEBUG -DWIN32 -D_CONSOLE
-DNO_STRICT -DHAVE_DES_FCRYPT
-DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DUSE_PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX -DHASATTRIB
UTE -fno-strict-aliasing -mms-bitfields',
    optimize='-O2',
    cppflags='-DWIN32'
    ccversion='', gccversion='3.4.5 (mingw-vista special r3)',
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='C:\asperl\site\bin\g++.exe', ldflags ='-L"C:\asperl\lib\CORE"'
    libpth=\lib
    libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32
-lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmp
r -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lmsvcrt
    perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32
-lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32
-lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lmsvcrt
    libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl512.lib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll -L"C:\asperl\lib\CORE"'

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2011-04-29 10:34

Message:
I don't get the same problem on cygwin but that is not OS X
or a 64bit OS (you don't include the perldl -V or perl -V output
so I'm guessing here).

I can point out that the problem is for Empty piddles and
not Null piddles.  Those were added/fixed for more edge
cases with the recent fixes to the PDL constructor.  It is possible
that this is a symptom of the same problem relating to the
other OS X segfaults being reported.  What do you get when
you look at the core with gdb?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100612&aid=3294808&group_id=612

_______________________________________________
PDL-porters mailing list
PDL-porters@jach.hawaii.edu
http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters

Reply via email to