[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libc 2.3.5 and heap corruption checking?



My system did everything I thought to ask of it under libc 2.3.2.
However, Matlab (for me the Killer App) breaks under libc 2.3.5.
Almost certainly this is a bug in Matlab, but breaking large, popular
commercial apps could be considered bad policy.  Especially now that
2.3.5 is moving into Testing, there really needs to be some
workaround.  Or is this just something funky about _my_ system?
Latest unstable, kernel.org kernel 2.6.13 (but same problem with 2.6.9
and others since installing libc 2.3.5).

I'm running Matlab Version 7.0.4.352 (R14) Service Pack 2.  It seems
to work fine until I take an outer product, at which point it says
something like

*** glibc detected *** malloc(): memory corruption: 0x083ba0e8 ***
zsh: abort (core dumped)  matlab -nosplash -nojvm

Just for completeness I've run it with MALLOC_CHECK_ unset and then
set to [0, 3], although I suspect it's already obvious to y'all what
the problem is.  Since the output is rather long I've attached it as a
separate file.  I'm happy to make available corefiles if they would be
useful.

I guess this is related in some sense to #304604 / #322746 / #323849?

I installed an old libc6_2.3.2.ds1-22_i386.deb that I had lying around
on my Testing system, and of course this broke most executables, but
it fixed Matlab.

Is it possible to keep libc 2.3.2 in a special directory just for
Matlab (I used to keep libc5 around for Matlab R5)?  I extracted it to
/usr/local/foo and set LD_PRELOAD, but I get a bunch of

ERROR: ld.so: object '/usr/local/foo/lib' from LD_PRELOAD cannot be preloaded: ignored.

...and Matlab still chokes as before.  I assume my preload-fu is weak
and there's a correct way of doing this?

Many thanks for reading!
-Ben

--
Ben Pearre          http://hebb.mit.edu/~ben       PGP: CFDA6CDA
         Free music at http://hebb.mit.edu/FreeMusic
Don't let Bush read your email!             http://www.gnupg.org
(0)% matlab

                              < M A T L A B >
                  Copyright 1984-2005 The MathWorks, Inc.
                   Version 7.0.4.352 (R14) Service Pack 2
                              January 29, 2005

 
  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.
 
>> [1;2]*[3 4]
*** glibc detected *** malloc(): memory corruption: 0x083ba0e8 ***
zsh: abort (core dumped)  matlab -nosplash -nojvm
(134)% export MALLOC_CHECK_=0
(0)% matlab

                              < M A T L A B >
                  Copyright 1984-2005 The MathWorks, Inc.
                   Version 7.0.4.352 (R14) Service Pack 2
                              January 29, 2005

 
  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.
 
>> [1;2]*[3 4]


Segmentation violation occurred within signal handler.
Unable to complete stack trace (stack was probably corrupted)

Please follow these steps in reporting this problem to The MathWorks so
that we have the best chance of correcting it:

  1. Send this crash report to segv@mathworks.com for automated analysis.


  2. Also, if the problem is reproducible, send the crash report to
     support@mathworks.com along with:
       - A specific list of steps that will reproduce the problem
       - Any M, MEX, MDL or other files required to reproduce the problem
       - Any error messages displayed to the command window
     A technical support engineer will contact you with further information.

Thank you for your assistance.  Please save your workspace and restart
MATLAB before continuing your work.

[ note: here Matlab hung, so I had to go to another window and kill it
  remotely ]

zsh: terminated  matlab -nosplash -nojvm
(143)% export MALLOC_CHECK_=1
(0)% matlab
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks

                              < M A T L A B >
                  Copyright 1984-2005 The MathWorks, Inc.
                   Version 7.0.4.352 (R14) Service Pack 2
                              January 29, 2005

 
  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.
 
>> [1;2]*[3 4]

------------------------------------------------------------------------
       Segmentation violation detected at Wed Sep  7 00:55:16 2005
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   7.0.4.352 (R14) Service Pack 2
  MATLAB License:   12345678
  Operating System: Linux 2.6.13 #2 Tue Sep 6 08:02:28 MDT 2005 i686
  Window System:    The X.Org Foundation (60802000), display :0.0
  Current Visual:   0x23 (class 4, depth 24)
  Processor ID:     x86 Family 6 Model 9 Stepping 5, GenuineIntel
  Virtual Machine:  Java is not enabled
  Default Charset:  UTF-8

Register State:
  eax = 00000000   ebx = b77faff4
  ecx = 2fedcc1e   edx = bfb7a020
  esi = bfb7a058   edi = bfb81000
  ebp = bfb79ff4   esp = bfb79fe8
  eip = b774e478   flg = 00010202

Stack Trace:
  [0] libc.so.6:memset~(0xbfb7a058, 0, 0xbfb7a020, 0xb637a900) + 56 bytes
  [1] libc.so.6:sched_getaffinity~(0, 0xbfb7a024, 0xbfb7a054, 0xb78daab4) + 93 bytes
  [2] libguide.so:__kmp_affinity_determine_capable~(0, 0, 0, 0) + 83 bytes


Segmentation violation occurred within signal handler.
Unable to complete stack trace (stack was probably corrupted)
zsh: segmentation fault (core dumped)  matlab -nosplash -nojvm
(139)% export MALLOC_CHECK_=2
(0)% matlab

                              < M A T L A B >
                  Copyright 1984-2005 The MathWorks, Inc.
                   Version 7.0.4.352 (R14) Service Pack 2
                              January 29, 2005

 
  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.
 
>> [1;2]*[3 4]

------------------------------------------------------------------------
       Segmentation violation detected at Wed Sep  7 00:55:29 2005
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   7.0.4.352 (R14) Service Pack 2
  MATLAB License:   12345678
  Operating System: Linux 2.6.13 #2 Tue Sep 6 08:02:28 MDT 2005 i686
  Window System:    The X.Org Foundation (60802000), display :0.0
  Current Visual:   0x23 (class 4, depth 24)
  Processor ID:     x86 Family 6 Model 9 Stepping 5, GenuineIntel
  Virtual Machine:  Java is not enabled
  Default Charset:  UTF-8

Register State:
  eax = 00000000   ebx = b77cfff4
  ecx = 2ff12cce   edx = bfc50980
  esi = bfc509b8   edi = bfc56000
  ebp = bfc50954   esp = bfc50948
  eip = b7723478   flg = 00010206

Stack Trace:
  [0] libc.so.6:memset~(0xbfc509b8, 0, 0xbfc50980, 0xb634f900) + 56 bytes
  [1] libc.so.6:sched_getaffinity~(0, 0xbfc50984, 0xbfc509b4, 0xb78afab4) + 93 bytes
  [2] libguide.so:__kmp_affinity_determine_capable~(0, 0, 0, 0) + 83 bytes


Segmentation violation occurred within signal handler.
Unable to complete stack trace (stack was probably corrupted)
zsh: segmentation fault (core dumped)  matlab -nosplash -nojvm
(139)% export MALLOC_CHECK_=3
(0)% matlab
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks
malloc: using debugging hooks

                              < M A T L A B >
                  Copyright 1984-2005 The MathWorks, Inc.
                   Version 7.0.4.352 (R14) Service Pack 2
                              January 29, 2005

 
  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.
 
>> [1;2]*[3 4]

------------------------------------------------------------------------
       Segmentation violation detected at Wed Sep  7 00:55:42 2005
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   7.0.4.352 (R14) Service Pack 2
  MATLAB License:   12345678
  Operating System: Linux 2.6.13 #2 Tue Sep 6 08:02:28 MDT 2005 i686
  Window System:    The X.Org Foundation (60802000), display :0.0
  Current Visual:   0x23 (class 4, depth 24)
  Processor ID:     x86 Family 6 Model 9 Stepping 5, GenuineIntel
  Virtual Machine:  Java is not enabled
  Default Charset:  UTF-8

Register State:
  eax = 00000000   ebx = b77edff4
  ecx = 2ff9ab6e   edx = bfe6f6c0
  esi = bfe6f6f8   edi = bfe74000
  ebp = bfe6f694   esp = bfe6f688
  eip = b7741478   flg = 00010202

Stack Trace:
  [0] libc.so.6:memset~(0xbfe6f6f8, 0, 0xbfe6f6c0, 0xb636d900) + 56 bytes
  [1] libc.so.6:sched_getaffinity~(0, 0xbfe6f6c4, 0xbfe6f6f4, 0xb78cdab4) + 93 b
ytes
  [2] libguide.so:__kmp_affinity_determine_capable~(0, 0, 0, 0) + 83 bytes


Segmentation violation occurred within signal handler.
Unable to complete stack trace (stack was probably corrupted)
zsh: segmentation fault (core dumped)  matlab -nosplash -nojvm
(139)% 

Reply to: