[18963] in Athena Bugs

home help back first fref pref prev next nref lref last post

linux 8.4.25: matlab - Problem with Mex files

daemon@ATHENA.MIT.EDU (Martin Szummer)
Thu May 17 18:16:24 2001

Message-Id: <200105172216.SAA04197@caprera.mit.edu>
To: bugs@MIT.EDU
CC: szummer@media.MIT.EDU, help@bcs.MIT.EDU, max@ai.MIT.EDU
Date: Thu, 17 May 2001 18:16:11 -0400
From: Martin Szummer <szummer@MIT.EDU>

System name:		caprera.mit.edu
Type and version:	i686 8.4.25
Display type:		XFree86 3.3.6 SVGA

Shell:			/bin/athena/tcsh
Window manager:		ctwm

What were you trying to do?

  Compile and Run a sample MEX file from Matlab 5.3.1


What's wrong:
  I take the sample Mex file yprime.c from the Matlab distribution.
       /mit/matlab/matlab_v5.3.1/distrib/extern/examples/mex/yprime.c

 and compile it with mex as below.
 It seg faults the first time I run it,
 but not the second time.

 I tried this on several Athena Linux machines:
 panarea, caprera, ischia - all with this problem.  
 Mex works fine under Windows, and under AI-lab suns.

 Action item: Please confirm the problem and suggest a workaround!
  The first seg-fault often messes up matlab causing memory corruption,
  so one has to avoid running into it!

------------------
Complete transcript:

  add matlab
  matlab

  >> mex yprime.c
  Attaching gnu ... 
  Reading .cshrc.mine
  >> yprime(3, [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 us this crash report.

      2. Provide a brief description of what you were doing when this
	 problem occurred.

      3. If possible, include M-files, MEX-files, or MDL-files that aid
	 in reproducing it.

      4. E-mail or FAX this information to us at:
		    E-mail:   support@mathworks.com
		       FAX:   508-647-7201


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

  >> yprime(3, [1; 2; 3; 4])

  ans =

      2.0000
      8.9685
      4.0000
     -1.0947

What should have happened:

  shouldn't seg-fault the first time!

Please describe any relevant documentation references:



home help back first fref pref prev next nref lref last post