Re: Matlab crashes



Michael Wild <themiwi.REMOVE.THIS@xxxxxxxxxxxxxxx> wrote in
message <46f7aa32$1@xxxxxxxxxxxxxxxxxxx>...
Cristian Bodo wrote:
Michael Wild <themiwi.REMOVE.THIS@xxxxxxxxxxxxxxx> wrote in
message <46f780be$1@xxxxxxxxxxxxxxxxxxx>...
Cristian Bodo wrote:
Michael Wild <themiwi.REMOVE.THIS@xxxxxxxxxxxxxxx>
wrote in
message <46f76e6a$1@xxxxxxxxxxxxxxxxxxx>...
Cristian Bodo wrote:
Hi, I created a dll by linking under Matlab several .obj
files with the gateway function appropriate (I'm
starting
from Fortran90).
When I launch the program from command window, every
time
Matlab crashes and this is the report:




------------------------------------------------------------------------
Segmentation violation detected at Mon Sep 24
09:35:33 2007


------------------------------------------------------------------------
Configuration:
MATLAB Version: 6.5.0.180913a (R13)
Operating System: Microsoft Windows XP
Window System: Version 5.1 (Build 2600: Service
Pack 2)
Processor ID: x86 Family 6 Model 13 Stepping 8,
GenuineIntel
Virtual Machine: Java 1.3.1_01 with Sun
Microsystems Inc.
Java HotSpot(TM) Client VM
(mixed mode)

Register State:
EAX = 00000000 EBX = 0fef3d80
ECX = 00000000 EDX = 00000000
ESI = 00000000 EDI = 00000037
EBP = 00deffac ESP = 00deffa4
EIP = 1b9abb54 FLG = 00010246

Stack Trace:
[0] Dynamic_Evaporator_gate.dll:0x1b9abb54(0x00df010c,
0x00df01b8, 0, 0x0384ff00)
[1] Dynamic_Evaporator_gate.dll:0x1b9a388c(2,
0xc000001e,
0xc000001e, 0x0fef3d80)
[2]
Dynamic_Evaporator_gate.dll:0x1b993a64(0x0fef3d80, 22,
230655, 0x1b9d12c4)
[3] Dynamic_Evaporator_gate.dll:0x1b915500(0xf9b52f2b,
0x40ce68cf, 0x50ac3679, 0x4042517c)
[4] Dynamic_Evaporator_gate.dll:0x1b915f86(0x224d7ba8,
0x00dfcef4 "ìTß", 0x00df5584, 0x224d7d08)
[5] Dynamic_Evaporator_gate.dll:0x1b95fff1(0x00dfd19c,
0x0fefe218, 0x0ff00048, 0x1b9e4e70)
[6] Dynamic_Evaporator_gate.dll:0x1b927ff6(0x00dfd240
"pÓß", 0x7af72432, 0x00dfd248, 0x00dfd5d0)
[7] Dynamic_Evaporator_gate.dll:0x1b911039(0x00dfd248,
0x00dfd5d0, 0x00dfd250, 0x00dfd6d4)
[8] libmex.dll:_mexRunMexFile(0, 0x00dfd5d0, 0,
0x00dfd6d4) + 50 bytes
[9] m_interpreter.dll:void __cdecl
inCallMexFunction(int,struct mxArray_tag * *
const,int,struct mxArray_tag * * const,void
(__cdecl*)(int,struct mxArray_tag * * const,int,struct
mxArray_tag * * const),struct _mex_context *,struct
mexfiles
*)(0, 0x00dfd5d0, 0, 0x00dfd6d4) + 476 bytes
[10] m_interpreter.dll:void __cdecl
inRunMexFile(int,struct mxArray_tag * * const,int,struct
mxArray_tag * * const,struct mexfiles *)(0,
0x00dfd5d0, 0,
0x00dfd6d4) + 126 bytes
[11] m_interpreter.dll:void __cdecl
inExecMexFile(int,int,struct mxArray_tag * *
const,struct
MATLAB_Function_tag *)(0, 0, 0x00dfd6d4, 0x0140f408) +
82 bytes
[12] m_interpreter.dll:_inExecFunction(0, 0,
0x00dfd6d4,
0x0140f408) + 38 bytes
[13] m_interpreter.dll:_inMMexExecute(537,
0x0140f408, 0,
0) + 533 bytes
[14] m_interpreter.dll:enum opcodes __cdecl
inMMex(char
const *,int,int,int,int *,int *)(0x01342f24
"Dynamic_Evaporator_gate", 537, 0, 0) + 94 bytes
[15] m_interpreter.dll:int __cdecl inInterp(enum
inDebugCheck,int,int,struct inPcodeNest_tag volatile
*)(2,
0, 0, 0x012f2868) + 2143 bytes
[16] m_interpreter.dll:_inInterPcode(2, 0x00dfdc54,
0, 0)
+ 193 bytes
[17] m_interpreter.dll:enum inExecutionStatus __cdecl
in_local_call_eval_function(int *,struct
_m_parser_interface
*,struct _pcodeheader *,int *,struct mxArray_tag * *
const,enum inDebugCheck)(0, 0x7a87fa78, 0x00dfdc54,
0x00dfdcf8) + 174 bytes
[18]
m_interpreter.dll:_inEvalStringWithIsVarFcn(0x0a217d90
"Dynamic_Evaporator_gate\n", 24, 0, 0) + 531 bytes
[19] m_interpreter.dll:_inEvalString(0x0a217d90
"Dynamic_Evaporator_gate\n", 24, 0, 0) + 50 bytes
[20] m_interpreter.dll:enum inExecutionStatus __cdecl
inEvalCmdWithLocalReturnandtype(char const *,int *,enum
inDebugCheck)(0x0a217d90 "Dynamic_Evaporator_gate\n",
0, 2,
0x00dfde30) + 68 bytes
[21] m_interpreter.dll:_inEvalCmdNoEnd(0x0a217d90
"Dynamic_Evaporator_gate\n", 1, 0x0047f617, 11) + 16
bytes
[22] matlab.exe:_mnParser(0x00dad15c, 271244, 0, 48) +
1001 bytes
[23] matlab.exe:_WinMain@16(0x00400000 "MZ&#65533;", 0,
271244,
1) + 3872 bytes
[24] matlab.exe:_WinMainCRTStartup(0x00dad15c, 24,
0x7ffd4000, 0x8054ab38) + 308 bytes
[25] kernel32.dll:0x7c816fd7(0x0047172c, 0, 0,
1245343)

This error was detected while a MEX-file was
running. If
the MEX-file
is not an official MathWorks function, please
examine its
source code
for errors. Please consult the External Interfaces
Guide
for information
on debugging MEX-files.

If it is an official MathWorks function, 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@xxxxxxxxxxxxx for
automated analysis.
For your convenience, this information has been
recorded in:

C:\DOCUME~1\User\IMPOST~1\Temp\matlab_crash_dump.716
2. Also, if the problem is reproducible, send the
crash
report to
support@xxxxxxxxxxxxx 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 prior to this
crash report
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.

Error in ==>


E:\CAREL\Dynamic_Evaporator_MATLAB\Dynamic_Evaporator_gate.dll

I supposed the problem was about some library, but using
verbose option during linking I understood that there
was a
conflict problem between libraries. I solved this
problem,
but Matlab crashes again!

This is a memory access violation. Somewhere in your code
you are
writing to a location that has not been allocated. But
without seeing
any of the code nobody will be able to help you any
further...

Michael

I cannot paste code for explicit reasons.
But I make an hypothesis: if the problem were about i/o
operation?It' possible?

yes, that is possible. especially if i/o is with
stdout/stdin. for those
you need the functions provided by matlab. see



http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/apiref/mexprintf.html

michael


The only command that I use is "write", but also commenting
everyone of them nothing changes.....

yeah, WRITE is one of them, but it depends on the file
unit you write
to. * or 1 are stdout and result in an error.

have you tried "sprinkling" mexPrintf statements in the
code to find out
where it segfaults?

michael


Sorry but, what do you mean by sprinkling a command?
Substitute every WRITE command with a mexPrintf statement?
.



Relevant Pages

  • Re: How to open an .exe file from command window
    ... Type "doc" in the command window ... Running External Programs ... the operating system. ...
    (comp.soft-sys.matlab)
  • Re: WD External hard drive trouble with read-only access
    ... You didn't bother to quote Badger's message - and the "forum" to which you posted your messages simply relayed them to the Microsoft public news server - with NO context - so I've pasted his instructions here, ... You must furnish Administrator credentials to open this window. ... any command or application you launch will run "elevated" - as Administrator. ... The Command Prompt window, elevated or not, is an emulation of MS-DOS, the operating system that many of us used for years before the first Windows arrived back in the 1950's. ...
    (microsoft.public.windows.vista.hardware_devices)
  • Re: WD External hard drive trouble with read-only access
    ... You must furnish Administrator credentials to open this window. ... any command or application you launch will run "elevated" - as Administrator. ... The Command Prompt window, elevated or not, is an emulation of MS-DOS, the operating system that many of us used for years before the first Windows arrived back in the 1950's. ...
    (microsoft.public.windows.vista.hardware_devices)
  • Re: Issues
    ... >> You can run CMD to open a command window. ... There is no DOS left in XP. ... Technically a "background process" but operating system is just fine. ...
    (alt.usage.english)
  • Re: Great SWT Program
    ... mostly solve the blind-typing problem that I definitely recall emacs ... Except of course that you need to know some arcane command language ... Hitting tab should insert a tab ... one-line "window" in which the rest of what I type appears, ...
    (comp.lang.java.programmer)