Segmentation violation Error in my MEX file

2 次查看(过去 30 天)
mex unravel.c
IM=imread('F:\TEST\test.tiff');
IM=imresize(IM,[1024 1024]);
TG=im2jpeg(IM,50);
TG=jpeg2im(TG);
after running this code i got an error
Abnormal termination:
Segmentation violation
%few lines in between this %
Caught MathWorks::System::FatalException
[Please exit and restart MATLAB]>>
  2 个评论
Walter Roberson
Walter Roberson 2012-9-29
Your traceback shows a problem in the (unknown code for) unravel, but the MATLAB code you show has no obvious call to "unravel". Where is "unravel" being called?
Walter Roberson
Walter Roberson 2012-10-1
The forum indicates that you have edited your Question, but it looks pretty much the same to me ? I don't see what you have changed?

请先登录,再进行评论。

采纳的回答

PRAKASH BHARTI
PRAKASH BHARTI 2012-9-29
编辑:Jan 2017-10-30
Full description of error which i got.
------------------------------------------------------------------------
Segmentation violation detected at Sat Sep 29 10:40:08 2012
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled
Default Encoding: windows-1252
MATLAB License : XXXXXXXX
MATLAB Root : C:\Program Files\MATLAB\R2011a
MATLAB Version : 7.12.0.635 (R2011a)
Operating System: Microsoft Windows 7
Processor ID : x86 Family 6 Model 10 Stepping 7, GenuineIntel
Virtual Machine : Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : Version 6.1 (Build 7601: Service Pack 1)
Fault Count: 1
Abnormal termination:
Segmentation violation
Register State (from fault):
RAX = 000000003d931200 RBX = 0000000000000000
RCX = 0000000000000001 RDX = 0000000001719880
RSP = 0000000001718d60 RBP = 0000000001719760
RSI = 000000003d936db0 RDI = 0000000001719760
R8 = 0000000000000003 R9 = 0000000001719760
R10 = 0000000000000003 R11 = 0000000001719880
R12 = 0000000001719880 R13 = 0000000035d5ec20
R14 = 0000000000000003 R15 = 000000006b67fd40
RIP = 0000000075a25e76 EFL = 00010206
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x0000000075a25e76 C:/Program Files/MATLAB/R2011a/bin/win64/libmx.dll+00024182 ( mxGetM+000006 )
[ 1] 0x000007fef61711ee F:/TEST/unravel.mexw64+00004590 ( mexFunction+000110 )
[ 2] 0x0000000072933333 C:/Program Files/MATLAB/R2011a/bin/win64/libmex.dll+00013107 ( mexRunMexFile+000131 )
[ 3] 0x000000007293205f C:/Program Files/MATLAB/R2011a/bin/win64/libmex.dll+00008287 ( inSwapMexfileReader+000223 )
[ 4] 0x0000000072932228 C:/Program Files/MATLAB/R2011a/bin/win64/libmex.dll+00008744 ( inSwapMexfileReader+000680 )
[ 5] 0x000000006b62f859 C:/Program Files/MATLAB/R2011a/bin/win64/m_dispatcher.dll+00063577 ( Mfh_file::dispatch_fh+000473 )
[ 6] 0x000000006b62fccf C:/Program Files/MATLAB/R2011a/bin/win64/m_dispatcher.dll+00064719 ( Mfunction_handle::dispatch+000767 )
[ 7] 0x000000006a5c4f34 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00675636 ( inDestroyWS+409812 )
[ 8] 0x000000006a5b25e8 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00599528 ( inDestroyWS+333704 )
[ 9] 0x000000006a58a0aa C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00434346 ( inDestroyWS+168522 )
[ 10] 0x000000006a59812b C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00491819 ( inDestroyWS+225995 )
[ 11] 0x000000006a59ab49 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00502601 ( inDestroyWS+236777 )
[ 12] 0x000000006a59de65 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00515685 ( inDestroyWS+249861 )
[ 13] 0x000000006a5b4c73 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00609395 ( inDestroyWS+343571 )
[ 14] 0x000000006a5b4dc0 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00609728 ( inDestroyWS+343904 )
[ 15] 0x000000006a5a624b C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00549451 ( inDestroyWS+283627 )
[ 16] 0x000000006a5a42ac C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00541356 ( inDestroyWS+275532 )
[ 17] 0x000000006a5b1009 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00593929 ( inDestroyWS+328105 )
[ 18] 0x000000006b62f859 C:/Program Files/MATLAB/R2011a/bin/win64/m_dispatcher.dll+00063577 ( Mfh_file::dispatch_fh+000473 )
[ 19] 0x000000006b62fccf C:/Program Files/MATLAB/R2011a/bin/win64/m_dispatcher.dll+00064719 ( Mfunction_handle::dispatch+000767 )
[ 20] 0x000000006a5a182b C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00530475 ( inDestroyWS+264651 )
[ 21] 0x000000006a59e082 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00516226 ( inDestroyWS+250402 )
[ 22] 0x000000006a5b4c73 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00609395 ( inDestroyWS+343571 )
[ 23] 0x000000006a5b4dc0 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00609728 ( inDestroyWS+343904 )
[ 24] 0x000000006a5a624b C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00549451 ( inDestroyWS+283627 )
[ 25] 0x000000006a5a42ac C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00541356 ( inDestroyWS+275532 )
[ 26] 0x000000006a5b1009 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00593929 ( inDestroyWS+328105 )
[ 27] 0x000000006b62f859 C:/Program Files/MATLAB/R2011a/bin/win64/m_dispatcher.dll+00063577 ( Mfh_file::dispatch_fh+000473 )
[ 28] 0x000000006b62fccf C:/Program Files/MATLAB/R2011a/bin/win64/m_dispatcher.dll+00064719 ( Mfunction_handle::dispatch+000767 )
[ 29] 0x000000006a5a182b C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00530475 ( inDestroyWS+264651 )
[ 30] 0x000000006a60d99c C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00973212 ( inIsDefinedVariable+019900 )
[ 31] 0x000000006a59f8db C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00522459 ( inDestroyWS+256635 )
[ 32] 0x000000006a5b4c73 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00609395 ( inDestroyWS+343571 )
[ 33] 0x000000006a5b4dc0 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00609728 ( inDestroyWS+343904 )
[ 34] 0x000000006a5a624b C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00549451 ( inDestroyWS+283627 )
[ 35] 0x000000006a5a42ac C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00541356 ( inDestroyWS+275532 )
[ 36] 0x000000006a5b1009 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00593929 ( inDestroyWS+328105 )
[ 37] 0x000000006b62f859 C:/Program Files/MATLAB/R2011a/bin/win64/m_dispatcher.dll+00063577 ( Mfh_file::dispatch_fh+000473 )
[ 38] 0x000000006b62fccf C:/Program Files/MATLAB/R2011a/bin/win64/m_dispatcher.dll+00064719 ( Mfunction_handle::dispatch+000767 )
[ 39] 0x000000006a626de8 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+01076712 ( inSetPredictor+001000 )
[ 40] 0x000000006a633415 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+01127445 ( inInitInterestRegistry+004309 )
[ 41] 0x000000006a635175 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+01134965 ( inIsCodeBlockComplete+007445 )
[ 42] 0x000000006a635148 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+01134920 ( inIsCodeBlockComplete+007400 )
[ 43] 0x000000006a63510e C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+01134862 ( inIsCodeBlockComplete+007342 )
[ 44] 0x000000006a5f8113 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+00885011 ( inGetSeqVarPtrsFromCurrentWS+007315 )
[ 45] 0x000000006a6298e0 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+01087712 ( inEvalCmdWithLocalReturn+000304 )
[ 46] 0x000000006a62983c C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+01087548 ( inEvalCmdWithLocalReturn+000140 )
[ 47] 0x000000006a6297f1 C:/Program Files/MATLAB/R2011a/bin/win64/m_interpreter.dll+01087473 ( inEvalCmdWithLocalReturn+000065 )
[ 48] 0x0000000079fb833a C:/Program Files/MATLAB/R2011a/bin/win64/libmwbridge.dll+00033594 ( mnDebugPrompt+000106 )
[ 49] 0x0000000079fbd0d2 C:/Program Files/MATLAB/R2011a/bin/win64/libmwbridge.dll+00053458 ( mnParser+000418 )
[ 50] 0x00000000749ab604 C:/Program Files/MATLAB/R2011a/bin/win64/mcr.dll+00243204 ( mcrInstance::mnParser_on_interpreter_thread+000036 )
[ 51] 0x000000007498ed24 C:/Program Files/MATLAB/R2011a/bin/win64/mcr.dll+00126244 ( DepfunRules::postWarning+045636 )
[ 52] 0x000000007498edb1 C:/Program Files/MATLAB/R2011a/bin/win64/mcr.dll+00126385 ( DepfunRules::postWarning+045777 )
[ 53] 0x0000000001b89676 C:/Program Files/MATLAB/R2011a/bin/win64/uiw.dll+00366198 ( UIW_IsUserMessage+000086 )
[ 54] 0x0000000001b89d44 C:/Program Files/MATLAB/R2011a/bin/win64/uiw.dll+00367940 ( ws_ProcessPendingEventsWaitForWindows+000356 )
[ 55] 0x00000000774d87fe C:/Windows/system32/USER32.dll+00165886 ( GetMenuBarInfo+000638 )
[ 56] 0x00000000774bf5fb C:/Windows/system32/USER32.dll+00062971 ( SystemParametersInfoW+000235 )
[ 57] 0x00000000774c4895 C:/Windows/system32/USER32.dll+00084117 ( IsProcessDPIAware+000465 )
[ 58] 0x0000000077961225 C:/Windows/SYSTEM32/ntdll.dll+00332325 ( KiUserCallbackDispatcher+000031 )
[ 59] 0x00000000774c9e6a C:/Windows/system32/USER32.dll+00106090 ( SfmDxSetSwapChainStats+000026 )
[ 60] 0x00000000774c615e C:/Windows/system32/USER32.dll+00090462 ( GetMessageA+000078 )
[ 61] 0x0000000001b63f07 C:/Program Files/MATLAB/R2011a/bin/win64/uiw.dll+00212743 ( UIW_SetCurrentDialog+000855 )
[ 62] 0x0000000001b8b117 C:/Program Files/MATLAB/R2011a/bin/win64/uiw.dll+00373015 ( ws_FreeSystemFont+000519 )
[ 63] 0x000000006999b7b3 C:/Program Files/MATLAB/R2011a/bin/win64/libuij.dll+00178099 ( sysq::ws_ppeHook::~ws_ppeHook+009539 )
[ 64] 0x000000006999cf3c C:/Program Files/MATLAB/R2011a/bin/win64/libuij.dll+00184124 ( svWS_CommitDatabaseUpdates+002796 )
[ 65] 0x000000006999d97a C:/Program Files/MATLAB/R2011a/bin/win64/libuij.dll+00186746 ( svWS_CommitDatabaseUpdates+005418 )
[ 66] 0x000000006999dbbd C:/Program Files/MATLAB/R2011a/bin/win64/libuij.dll+00187325 ( svWS_CommitDatabaseUpdates+005997 )
[ 67] 0x000000006999ddb8 C:/Program Files/MATLAB/R2011a/bin/win64/libuij.dll+00187832 ( svWS_CommitDatabaseUpdates+006504 )
[ 68] 0x000000006999df10 C:/Program Files/MATLAB/R2011a/bin/win64/libuij.dll+00188176 ( svWS_CommitDatabaseUpdates+006848 )
[ 69] 0x000000007498e28f C:/Program Files/MATLAB/R2011a/bin/win64/mcr.dll+00123535 ( DepfunRules::postWarning+042927 )
[ 70] 0x000000007498f051 C:/Program Files/MATLAB/R2011a/bin/win64/mcr.dll+00127057 ( DepfunRules::postWarning+046449 )
[ 71] 0x000000007498f37e C:/Program Files/MATLAB/R2011a/bin/win64/mcr.dll+00127870 ( DepfunRules::postWarning+047262 )
[ 72] 0x000000013f417304 C:/Program Files/MATLAB/R2011a/bin/win64/MATLAB.exe+00029444 ( ???+000000 )
[ 73] 0x000000013f4173d9 C:/Program Files/MATLAB/R2011a/bin/win64/MATLAB.exe+00029657 ( ???+000000 )
[ 74] 0x000000013f4178cb C:/Program Files/MATLAB/R2011a/bin/win64/MATLAB.exe+00030923 ( ???+000000 )
[ 75] 0x00000000773a652d C:/Windows/system32/kernel32.dll+00091437 ( BaseThreadInitThunk+000013 )
[ 76] 0x000000007793c521 C:/Windows/SYSTEM32/ntdll.dll+00181537 ( RtlUserThreadStart+000033 )
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 this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.
Thank you for your help.** This crash report has been saved to disk as C:\Users\PRAKASH\AppData\Local\Temp\matlab_crash_dump.5208-1 **
Caught MathWorks::System::FatalException
[Please exit and restart MATLAB]>>

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by