- From: alan.garny at dpag.ox.ac.uk (Alan Garny)
- Subject: [cellml-dev] Alan Garny's branch
- Date: Thu, 18 Jun 2009 19:00:54 +0100
>
> > Indeed, if you have time, it would be nice if you could have a look at
>
> > the problem I am currently facing. Basically, I start OpenCell and go
>
> > straight into the COR view. From there, I try to open one or several
>
> > CellML files at once. Sometimes, by opening those files, OpenCell will
>
> > just crash. No warning, no nothing. gdb seems to think that the
>
> > problem is with:
>
> >
>
> I haven't been able to reproduce this; it could be that your build has
>
> an out-of-date object file (dependencies between headers and objects are
>
> not automatically generated in OpenCell, so we could be missing some).
>
> Does a clean build experience the same problems?
>
>
Ok, I have just build the CellML DOM API from scratch, and done the same
>
with my COR view branch. From there, I did my usual testing which consists
>
of starting OpenCell, switch into the COR view, and then open one or
>
several CellML files at a time. From there, if OpenCell doesn't crash, I
>
would just close it and start over again. Anyway, I did that several times
>
and eventually, I did get OpenCell to crash, so though some object files
>
might have been out of date, it would seem that it is not the (whole)
issue
>
here.
>
>
For information, here is what bt in gdb gives me:
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
(gdb) bt
>
#0 0x00000000 in ?? ()
>
#1 0xb36e2bbb in x2p::mathml_dom::MathMLApplyElement::QueryInterface
>
(this=0xacd2eb8, aIID=@0xb3016290, aInstancePtr=0xbff00c38)
>
at ./interfaces/x2pMathML_content_APISPEC.cpp:15722
>
#2 0xb300f4c9 in nsCOMPtr_base::assign_from_qi () from
>
/home/gry/COR/opencellStage/components/libDataCollector.so
>
#3 0xb2fde5f5 in nsCOMPtr (this=0xbff00e78, qi={mRawPtr = 0xacd2ec4}) at
>
/home/gry/XULRunner-SDK/include/xpcom/nsCOMPtr.h:645
>
#4 0xb2fdfcf8 in RecursivelyAppendCode (aMathML=0xacd2ec4,
>
aOutput=@0xbff00f30, aIndent=@0xa7cebe0, flags=1, contextPrec=UNAMBIG,
>
aHighlight=0x0) at DataCollector/MathMLInputServices.cpp:769
>
#5 0xb2fe3efe in MathMLInputServices::MathMLToInputFormat
(this=0xa7ce488,
>
aMathML=0xacd2ec4, aHighlight=0x0, aIndent=@0xa7cebe0,
>
aOutput=@0xbff00f30) at DataCollector/MathMLInputServices.cpp:960
>
#6 0xb2fd9344 in CellMLInputServices::Math (this=0xa7cebd0,
>
aCompName=@0xbff01100, aDOMElement=0xacd7cd4, aOutput=@0xacd2d30,
>
aReaction=@0xbff0116a) at DataCollector/CellMLInputServices.cpp:866
>
#7 0xb2fdd14f in CellMLInputServices::Component (this=0xa7cebd0,
>
aDOMElement=0xacd9b6c, aOutput=@0xacd2d30)
>
at DataCollector/CellMLInputServices.cpp:540
>
#8 0xb2fdd9de in CellMLInputServices::CellMLToInputFormat
(this=0xa7cebd0,
>
aCellML=0xacd2d24, aOutput=@0xacd2d30)
>
at DataCollector/CellMLInputServices.cpp:192
>
#9 0xb7bee2ed in NS_InvokeByIndex_P () from /home/gry/XULRunner-
>
SDK/bin/libxul.so
>
#10 0xb747feef in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#11 0xb74854fd in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#12 0xb7f68505 in js_Invoke () from
/home/gry/XULRunner-SDK/bin/libmozjs.so
>
#13 0xb7f5cc7e in ?? () from /home/gry/XULRunner-SDK/bin/libmozjs.so
>
#14 0xb7f68554 in js_Invoke () from
/home/gry/XULRunner-SDK/bin/libmozjs.so
>
#15 0xb747d61d in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#16 0xb7478e1f in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#17 0xb7beee01 in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#18 0xb77302cb in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#19 0xb77307d2 in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#20 0xb77476e1 in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#21 0xb77478a1 in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#22 0xb77480d2 in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#23 0xb788ee5b in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#24 0xb788f93a in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#25 0xb7bee2ed in NS_InvokeByIndex_P () from /home/gry/XULRunner-
>
SDK/bin/libxul.so
>
#26 0xb747feef in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#27 0xb74854fd in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
#28 0xb7f68505 in js_Invoke () from
/home/gry/XULRunner-SDK/bin/libmozjs.so
>
#29 0xb7f5cc7e in ?? () from /home/gry/XULRunner-SDK/bin/libmozjs.so
>
#30 0xb7f68554 in js_Invoke () from
/home/gry/XULRunner-SDK/bin/libmozjs.so
>
#31 0xb747d61d in ?? () from /home/gry/XULRunner-SDK/bin/libxul.so
>
---Type <return> to continue, or q <return> to quit---
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
This points to the line I mentioned in my previous message, i.e.
>
>
nsCOMPtr<mathml_domIMathMLApplyElement> mma(do_QueryInterface(aMathML));
Just for information, it would seem that the above was a red herring. See
http://cellml-opencell.hg.sourceforge.net/hgweb/cellml-opencell/rev/721316a4
1a1b for more information. I have tried several times the functional test I
mentioned earlier, and so far I haven't managed to get OpenCell to crash
while I would definitely have by now using the previous code. So, I am as
confident as I can be that the crash issue has now been fixed (and yes, the
crashes were due to a stupid mistake/oversight of mine!).
Now, I still have a 'problem', not critical in the sense that it doesn't
crash OpenCell, but annoying nonetheless: memory leak. Unfortunately, I am
not clear what could be the cause of those memory leaks. Here is a typical
trace that I got using Valgrind:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==28349== 620 bytes in 31 blocks are possibly lost in loss record 438 of 716
==28349== at 0x40269EE: operator new(unsigned int)
(vg_replace_malloc.c:224)
==28349== by 0xAA48375:
X2PFactory_mathml_domIMathMLElement::MakeX2P(void*)
(x2pMathML_content_APISPEC.cpp:3170)
==28349== by 0xAA097EC:
x2p::mathml_dom::MathMLContainer::GetArgument(unsigned int,
mathml_domIMathMLElement**) (x2pMathML_content_APISPEC.cpp:3297)
==28349== by 0xB0374A0:
CellMLInputServices::InMemoryMathFromMathMLElements(cellml_apiIMathList*,
domIElement*, mathml_domIMathMLElement**) (CellMLInputServices.cpp:611)
==28349== by 0xB038210:
CellMLInputServices::InMemoryMathFromComponent(nsString_external const&,
domIElement*, bool const&, mathml_domIMathMLElement**)
(CellMLInputServices.cpp:777)
==28349== by 0xB03B384: CellMLInputServices::Math(nsString_external
const&, domIElement*, nsACString&, bool const&)
(CellMLInputServices.cpp:850)
==28349== by 0xB03F2AA: CellMLInputServices::Component(domIElement*,
nsACString&) (CellMLInputServices.cpp:538)
==28349== by 0xB03FB21:
CellMLInputServices::CellMLToInputFormat(cellml_apiIModel*, nsACString&)
(CellMLInputServices.cpp:190)
==28349== by 0x4A1C2EC: NS_InvokeByIndex_P (in
/home/gry/XULRunner-SDK/bin/libxul.so)
==28349== by 0x42ADEEE: (within /home/gry/XULRunner-SDK/bin/libxul.so)
==28349== by 0x42B34FC: (within /home/gry/XULRunner-SDK/bin/libxul.so)
==28349== by 0x4096504: js_Invoke (in
/home/gry/XULRunner-SDK/bin/libmozjs.so)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help on this would certainly be very much appreciated...
Cheers, Alan.
Archive powered by MHonArc 2.6.18.