Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4581 closed defect (fixed)

OMEdit crashes when the simulation fails

Reported by: Andrea Bartolini Owned by: Martin Sjölund
Priority: blocker Milestone: 1.13.0
Component: Run-time Version: v1.13.0-dev-nightly
Keywords: Cc:

Description

When the simulation fails, OMEdit crashes with the following message:

Following error has occurred while retrieving detailed gdb backtrace,

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
/tmp/OpenModelica_andrea/OMEdit/omeditbacktracecommands.txt:3: Error in sourced command file:
No thread selected

it seems the problem is the opening of the result file (attached), if you try to open it from File->Open Result File you can reproduce the problem.

OMEdit 1.13.0~dev-37-g1506f4d
Connected to OpenModelica 1.13.0~dev-231-g1d31692
sysop Ubuntu - bit

Attachments (2)

PowerGrids.Electrical.Test.OneBusLineLoad1_res.mat (32.6 KB ) - added by Andrea Bartolini 7 years ago.
PowerGrids.Electrical.Test.OneBusLineLoad1.mos (190 bytes ) - added by Adeel Asghar 7 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Adeel Asghar, 7 years ago

I can open the result file without any issue.
It might be some other reason.

Last edited 7 years ago by Adeel Asghar (previous) (diff)

comment:2 by Andrea Bartolini, 7 years ago

any suggestion for further investigation ?

comment:3 by Andrea Bartolini, 7 years ago

for example, if I use the cpp runtime the problem disappears...

comment:4 by Andrea Bartolini, 7 years ago

more....

for example with cpp I get in the window message:

init | error | <p>SimManager: Nonlinear solver 55 stopped at time 0 with error in algloop solver: <br>
Nonlinear solver failed!</p>stdout | error | <p>
Simulation process failed. Exited with code 1.</p>

and in message browser:

[17] 12:38:25 Scripting Error
Failed to open simulation result /mnt/myData/encData/zz_tmpFolder/OpenModelica/PowerGrids.Electrical.Test.OneBusLineLoad1/PowerGrids.Electrical.Test.OneBusLineLoad1_res.mat: Corrupt header (1)

in reply to:  4 comment:5 by Adeel Asghar, 7 years ago

Milestone: 1.12.01.13.0

Replying to Andrea.Bartolini:

more....

for example with cpp I get in the window message:

init | error | <p>SimManager: Nonlinear solver 55 stopped at time 0 with error in algloop solver: <br>
Nonlinear solver failed!</p>stdout | error | <p>
Simulation process failed. Exited with code 1.</p>

No idea about this error. Probably someone from cpp runtime developers group can help with this.

and in message browser:

[17] 12:38:25 Scripting Error
Failed to open simulation result /mnt/myData/encData/zz_tmpFolder/OpenModelica/PowerGrids.Electrical.Test.OneBusLineLoad1/PowerGrids.Electrical.Test.OneBusLineLoad1_res.mat: Corrupt header (1)

That's fine because the result file is invalid.

Can you share your model?

If you are using v1.13.0-dev-nightly then don't set the milestone as 1.12.0.

comment:6 by Francesco Casella, 7 years ago

Summary: OMEdit chrases when the simulation failsOMEdit crashes when the simulation fails

comment:7 by Adeel Asghar, 7 years ago

Component: OMEditRun-time
Owner: changed from Adeel Asghar to Martin Sjölund
Status: newassigned

Martin there is some issue with the read_matlab4.c.
It doesn't crash on Windows.

Limited backtrace at point of segmentation fault
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaRuntimeC.so(+0x16e97)[0x7fac0b50be97]
/lib/x86_64-linux-gnu/libc.so.6(+0x354b0)[0x7fac0bab44b0]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaRuntimeC.so(+0x31722)[0x7fac0b526722]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaRuntimeC.so(omc_matlab4_stopTime+0x19)[0x7fac0b526d29]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaRuntimeC.so(omc_matlab4_val+0x57)[0x7fac0b526d87]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libomcruntime.so(+0x53b9e)[0x7fac0b7a3b9e]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_CevalScriptBackend_cevalInteractiveFunctions3+0x4b5f)[0x7fac0c60142f]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_CevalScript_cevalInteractiveFunctions2+0xb24f)[0x7fac0ca54a9f]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_CevalScript_cevalInteractiveFunctions+0x406)[0x7fac0ca55926]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_CevalScript_ceval+0x20c)[0x7fac0ca56a0c]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Interactive_evaluateExpr+0x29d)[0x7fac0ca346bd]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Interactive_evaluateExprToStr+0x183)[0x7fac0ca34953]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Interactive_evaluate2+0x302)[0x7fac0ca36f72]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Interactive_evaluateToStdOut+0x21f)[0x7fac0ca377ef]
/home/adeas31/OpenModelica/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Main_translateFile+0x4db)[0x7fac0c8ff8ab]
Segmentation fault (core dumped)

comment:8 by Martin Sjölund, 7 years ago

@adeas31: I will fix the crash, but I suggest making OMPlot detect the case when 0==reader->nrows (empty data_2 matrix) because we then don't know the start-time, stop-time, etc. We could of course have some sort of recovery method to try to fix the file until the last time it was synched to disk before the crash, but that's secondary.

comment:9 by Martin Sjölund, 7 years ago

Resolution: fixed
Status: assignedclosed

Fixed in PR1937

comment:10 by Francesco Casella, 7 years ago

I have observed the same behaviour also under Windows. I've started a new nightly build to check if this PR solves the problem

comment:11 by Francesco Casella, 7 years ago

I confirm that the fix also solved the crash issue under Windows.

Note: See TracTickets for help on using tickets.