Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Debugging segmentation fault inside mex call to LAPACK

Subject: Debugging segmentation fault inside mex call to LAPACK

From: aolney@gmail.com

Date: 21 Feb, 2006 14:43:49

Message: 1 of 2

I've created a mex file that wraps the LAPACK subroutine dstein.

It compiles fine.

I've attached a debugger and traced the execution of the mex file when
it is called from Matlab.

Everything is fine until the internal mex call to dstein. At this
point, a segmentation fault is thrown.

Is there some way to get more information about the fault? I'm sure
this is a common need.

One thought I had was to not use the Matlab LAPACK library, but instead
compile with just the source necessary for dstein (including all the
BLAS, etc). That would give me the source to trace the fault.

Subject: Debugging segmentation fault inside mex call to LAPACK

From: aolney@gmail.com

Date: 22 Feb, 2006 12:21:33

Message: 2 of 2

Fixed the seg fault (caused by a bad parameter) but still had some
problems with dstein.

It looks like the best way to use it is to pass in a IBLOCK array that
is all ones, and an ISPLIT array that is all zeros except the first
position which should be the order of the matrix.

To figure that out I had to make a mex file for dstebz and check the
the output IBLOCK and ISPLIT arrays it was producing (since this is the
kind of input dstein expects, but the documentation doesn't elaborate
that) Oh well.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us