Error: "Assertion Failed"

Anything that doesn't fit elsewhere.
Post Reply
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Error: "Assertion Failed"

Post by shailesh »

I have a model of a myelinated axon with several graphs (embedded in VBox & Deck) for displaying membrane potential of various nodes and internodes. When changing the number of nodes in the axon, at runtime, these graphs have to be destroyed and regenerated depending on the number of nodes specified. But doing this a few times, over and over, crashed the program with an error message pop-up dialog titled "Assertion Failed" (the pop-up itself does not open-up and can only be seen in the taskbar). What could be causing this?

For destroying the graphs, I re-initialize the objref corresponding to those graphs. The model is somewhat huge and I wasn't sure I could break it down into a simpler version easily. I could mail you the model if needed.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Error: "Assertion Failed"

Post by ted »

shailesh wrote:The model is somewhat huge and I wasn't sure I could break it down into a simpler version easily. I could mail you the model if needed.
Sounds like that's what you'll have to do. Send to ted dot carnevale at yale dot edu.
Please use the zip file format, and omit any .dll, .o, or .c files, as well as any .i686 or .x86 directories and their contents.
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: Error: "Assertion Failed"

Post by shailesh »

Did you get a chance to reproduce the error with the model that I mailed?
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Error: "Assertion Failed"

Post by ted »

Yes I tried it and yes I saw the error message once, but I'm having the hardest time getting it to recur. The first and only time I saw it was after I was just fooling around running a series of simulations, then clicked on the "Excitatory Myelinated" panel's "Re-Create" button a couple of times, and there was the error. I quit NEURON and tried to deliberately cause the error, but so far without success. Is it necessary to run one or more simulations, or is it enough to click on one of these "Re-Create" buttons several times? Just clicking 4 or even many times on one or the other button, or always on one, doesn't seem to do it on this PC under 32 bit CentOS 6.4 with NEURON 7.3 (840:c597ab253106) 2013-03-31. What version of NEURON are you using, and under what OS?

I do have a couple of hints for how to speed up simulations. First, would set nseg = 1 in the sections with "tomato can" shape (i.e. those with diam=L). Avoiding screen updates during the simulation also helps, whether by hiding panels that have many graphs (and revealing them later (can be done with the NEURON Main Menu panel and I believe by hoc statements) or by minimizing the number of graphs that are updated during the simulation and deferring the plotting of most results until after the end of a run, at which point recorded Vectors are then drawn to graphs that haven't been added to one of the graphLists.
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: Error: "Assertion Failed"

Post by shailesh »

That is interesting as I am able to reproduce those errors like clockwork (not that I am particularly pleased). Every 4th attempt for those set of default parameters - ERROR!
My specs:
NEURON -- Release 7.3 (849:5be3d097b917) 2013-04-11 (32-bit)
Windows 7 64-bit

The error pops-up even without running any simulation; merely while setting up the model repeatedly via 'Re-Create Axon'.
If the errors still don't come up, could you open 'init.hoc' and change:
EX_NUM = 20 to EX_NUM = 100
IN_NUM = 20 to IN_NUM = 100

(or maybe even bigger values). Doing that in my case makes the error appear on the 1st/2nd attempt itself. Meanwhile I will try running it on a different machine (Linux) and see if I can reproduce the error.

p.s. Those tips on speeding up the simulations (once I get it working) are handy. Thanks.
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: Error: "Assertion Failed"

Post by shailesh »

I did test it on a Linux Machine and it didn't generate the error no matter how many times I tried it (except for some weird behavior of the VBOX containing several graphs - but no Crashes); even for EX_NUM & IN_NUM = 100 or 200.
Also, I ran the model on another Windows machine and it reproduced the error on the very 4th attempt.

Could it be due to some restriction/limitation related to cygwin etc?
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Error: "Assertion Failed"

Post by ted »

shailesh wrote:Could it be due to some restriction/limitation related to cygwin etc?
The clue was in your previous post. The 64 bit Windows version is implemented with MinGW. It seems that every combination of OS and software development environment is prone to its own special bugs. Also, at this point in its development MinGW seems to have some rough edges in comparison to the more mature cygwin.

So I'd bet that the 32 bit Windows version wouldn't have the problem you encountered. Also, there's no real speed penalty for using the 32 bit version, especially not when performance is limited by screen updates. Its only "non-bug-related" practical difference from the 64 bit version is that the latter can handle larger models and bigger data structures--but one wouldn't be dealing with such models in an interactive mode i.e. with a GUI that includes live graphs.
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: Error: "Assertion Failed"

Post by shailesh »

Oh I think there was a misunderstanding... My OS is 64-bit Windows 7... But I am running 32-bit NEURON (I had shifted to the 32-bit version as per your advice for one of my earlier queries when I was having trouble using the print and file Window manager)

My specs:
NEURON -- Release 7.3 (849:5be3d097b917) 2013-04-11 (32 -bit)
Windows 7 : 64-bit

So could it be some memory allocation related limitation to cygwin itself. Could not think of other causes as it worked fine on Linux and your machine.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Error: "Assertion Failed"

Post by ted »

shailesh wrote:So could it be some memory allocation related limitation to cygwin itself. Could not think of other causes as it worked fine on Linux and your machine.
Well, it worked fine under Linux on my PC, but under 64 bit Win 7 and Vista the 32 bit cygwin NEURON failed as you described--actually more dramatically under Vista, messing up refresh of the entire MSWin desktop. However, on a hunch I tried clicking on the RunControl panel's Init button after each click on a "Re-Create" button and that was enough to prevent the problem. So as a temporary workaround, you might try changing the xbutton calls in procspanels_simple.hoc that set up the "Re-Create" buttons to
xbutton("Re-Create Axon - Default Values", "create_ex_myln_Axon() stdinit()")
and
xbutton("Re-Create Axon - Default Values", "create_in_myln_Axon() stdinit()")
and that should allow the code to work under both MSWin and Linux.
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: Error: "Assertion Failed"

Post by shailesh »

Wow! That's an interesting finding and certainly helps me out quite a bit in this situation - especially since it does not affect anything else. Thanks!

But I should maybe just add that even with stdinit(), we still do see the error when we change 'init.hoc' to have:
EX_NUM = 100
IN_NUM = 100
(basically larger values)

It would have been satisfying to have known what causes the issue; though it is a case of time spent vs gain trade-off.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Error: "Assertion Failed"

Post by hines »

I don't have a fix for this but apparently the underlying Windows library has a limited resource which is becoming unavailable. The reason the stdinit() avoids the problem is that each time
it removes the unused graphs from the graphList[0]. Otherwise that list keeps accumulating Graph instances which are not destroyed. After adding 80 more (4 button presses) the wiindows resource
apparently becomes unavailable (also why you cannot have 100 of them at once). Also the message box that pops up apparently also uses the resource which prevents the contents from becomming displayed.
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: Error: "Assertion Failed"

Post by shailesh »

That does explain a lot of what is happening. Thanks for the 'verdict' on the issue. Now that it is known I can work on managing my resources more thriftily.
... and yes in recent times I have begun to wonder whether it would be much better to have my simulations on Linux.... apart from this issue, it also seems to result in faster runs
Post Reply