Assertion failed (irrArray.h)

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Cyanotype
Posts: 9
Joined: Sat Feb 08, 2014 3:51 am

Assertion failed (irrArray.h)

Post by Cyanotype »

Any idea what this could mean? My code is rather big so putting it all in here would be rather pointless... maybe someone has an idea what to look for?

Assertion failed!

Programm: C:\Path to my Program\launcher.exe
File: ..\..\include/irrArray.h, Line 137

Expression: !(index)=used)

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.


And windows spits out this:
Problem signature:
Problem Event Name: APPCRASH
Application Name: launcher.exe_unknown
Application Version: 0.0.0.0
Application Timestamp: 031f17a8
Fault Module Name: Irrlicht.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 086be850
Exception Code: 40000015
Exception Offset: 0020f508
OS Version: 6.3.9600.2.0.0.256.48
Locale ID: 3079
Additional Information 1: 21b2
Additional Information 2: 21b2b3da547cabd87f8fb23e8b345dfe
Additional Information 3: 9d34
Additional Information 4: 9d34a22572f3124d85e25cdbbcc35fb0
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Assertion failed (irrArray.h)

Post by CuteAlien »

Run it in debug in your IDE and you get a callstack where you can look at which place in your code that was called. It means you access the array outside of it's size. It's something in your code - Irrlicht is just helping you here to find it.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Cyanotype
Posts: 9
Joined: Sat Feb 08, 2014 3:51 am

Re: Assertion failed (irrArray.h)

Post by Cyanotype »

Hmm... the thing is the debugger just closes 0:

Debugger name and version: GNU gdb (GDB) 7.8.1
Child process PID: 7740
[Inferior 1 (process 7740) exited with code 03]
No stack.
Debugger finished with status 0

guess ill try writing a bazillion couts xD
jockey
Posts: 6
Joined: Tue Dec 30, 2014 8:06 pm

Re: Assertion failed (irrArray.h)

Post by jockey »

hi Cyanotype

Assertion is just a debugging help, sounds advanced but simply put it's just an if-statement but only in debug mode (I believe).

e.g.

Code: Select all

 
assert( index < size );
 
That will check if index is smaller then size, if not an assertion failure is given.

In practise for end-users when you get such a thing, you've passed the code that is the cause. Then your callstack comes into play. Please use it - as pointed to by CuteAlien - and roll it back until you get back into your own code. Propabillity is that the reason for an assertion failure is there to be found.
Cyanotype
Posts: 9
Joined: Sat Feb 08, 2014 3:51 am

Re: Assertion failed (irrArray.h)

Post by Cyanotype »

I either am missing a setting or there is a problem with my setup since my call stack is not showing anything after the run call from main.

I was writing some mutex locks and wrote this thread after thinking maybe I am chasing ghosts but your posts made me realize it must in fact have something to do with the thread, thanks. Letting the app run while I'm sleeping hoping to wake up to it not crashed haha.

Edit: It is solved, I was setting the text of a gui element during a draw call and that was causing the crash. Thanks all.
Last edited by Cyanotype on Wed Dec 31, 2014 1:37 pm, edited 1 time in total.
jockey
Posts: 6
Joined: Tue Dec 30, 2014 8:06 pm

Re: Assertion failed (irrArray.h)

Post by jockey »

Have to admit, don't know your debugger.
Post Reply