Opened 8 years ago

Closed 8 years ago

#4175 closed defect (fixed)

OMEdit 1.11.0 Beta1 crashes

Reported by: Francesco Casella Owned by: Adeel Asghar
Priority: blocker Milestone: 1.11.0
Component: OMEdit Version:
Keywords: Cc:

Description

@ceraolo reports a crash of OMEdit in ticket:2960#comment:38 when the following actions are performed on the attached TestCrash.mo model:

  1. open OMEdit
  2. load TestCrash.mo
  3. open and run IdTwoPWM
  4. while remaining in Plottting perspective, acting on the variables browser change the parameter "Fcar" inside pwmPulser from 1000 to 2000, key "Enter" and and click on the Re-simulate button
  5. CRASH

I confirm that this is reproducible in OMEdit 1.11.0 Beta1, and it should be fixed before the release.

I also have another crash case to report:

  1. Open the attached SimpleBrayton.mo file
  2. Select and run the SimpleBrayton.Simulations.Initialize_base_plant
  3. When the simulation is finished, go to the Simulation Output window and click on the first Debug more link.
  4. OMEdit crashes, and the crash report window shows up
  5. If I fill it in and hit Send, nothing happens, eventually I have to hit Cancel

I think this should also be fixed before the release.

Attachments (2)

TestCrash.mo (12.6 KB ) - added by Francesco Casella 8 years ago.
SimpleBrayton.mo (413.3 KB ) - added by Francesco Casella 8 years ago.

Download all attachments as: .zip

Change History (8)

by Francesco Casella, 8 years ago

Attachment: TestCrash.mo added

by Francesco Casella, 8 years ago

Attachment: SimpleBrayton.mo added

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

I found this little beauty:

while (pComponent->getParentComponent()) {
  pComponent = pComponent->getParentComponent();
}

Actually crashes with NULL pointer...

Last edited 8 years ago by Martin Sjölund (previous) (diff)

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

Thread 1 "OMEdit" received signal SIGSEGV, Segmentation fault.
Component::getParentComponent (this=0xff000000ff000000)
    at ./Component/Component.h:182
182	  Component* getParentComponent() {return mpParentComponent;}
(gdb) up
#1  0x000000000071f83d in Component::getRootParentComponent (this=0x1ed78880)
    at Component/Component.cpp:733
733	  while (pComponent->getParentComponent()) {
(gdb) print this->getParentComponent()
[Thread 0x7fffd756a700 (LWP 16194) exited]
$1 = (Component *) 0x1ed78e70
(gdb) print this->getParentComponent()->getParentComponent()
$2 = (Component *) 0x1ed7b110
(gdb) print this->getParentComponent()->getParentComponent()->getParentComponent()
$3 = (Component *) 0xff000000ff000000
(gdb) print this->getParentComponent()->getParentComponent()->getParentComponent()->getParentComponent()

That is opening IdTwoPwm without MSL loaded and then loading MSL. Some component seems to have been unloaded or somehow an invalid pointer...

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

Adding some debug trace for the Component destructor:

Removing component 0x1eb855b0
(gdb) print this->getParentComponent()->getParentComponent()
$5 = (Component *) 0x1eb855b0

So when deleting components, its children are not updated. Perhaps we need smart pointers or reference counting, Adeel?

comment:4 by Adeel Asghar, 8 years ago

The first crash case is fixed in a3df365/OMEdit.

comment:5 by Adeel Asghar, 8 years ago

The second crash is due to unexpected integer formatter in the new xmltcp code. I fixed it in 0778a51/OMCompiler and made OMEdit 31e6d94/OMEdit not to crash if Martin introduces such errors again :).

comment:6 by Adeel Asghar, 8 years ago

Resolution: fixed
Status: newclosed

The crash mentioned in comment:2 is fixed in 8b76c51/OMEdit.

Note: See TracTickets for help on using tickets.