You are not logged in.

#1 2010-02-17 09:26:55

neutrix
Member
From: Bristol, UK
Registered: 2009-08-29
Posts: 64
Website

[SOLVED]Cannot run own program since last update : malloc.c:3096 error

Hi all,

It seems that due to a recent update a program that I am working on doesn't run any more.

It doesn't rely on any external libraries and compiles fine, but when it gets to a : "pointer = new class_object[4096];" it crashes with the error:

malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Aborted

I've done some searching but have been unable to find much other than this thread: http://bbs.archlinux.org/viewtopic.php?pid=654908 which leads me to believe that it might be a library version conflict. I am unsure how to debug this though. I also own an nvidia card running nvidia drivers, and the nvidia drivers were updated in the last update but I do not have the same file that the previous poster had a conflict with. I am also not sure how the nvidia drivers would cause problems as I'm not linking with OpenGL or any library other than the standard library.

Does anyone have any ideas?

Thanks!

Last edited by neutrix (2010-02-17 15:05:01)

Offline

#2 2010-02-17 14:21:54

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [SOLVED]Cannot run own program since last update : malloc.c:3096 error

you can run it in debug mode, alternatively sprinkle some cout/printf's around the place. I've done this more years than I care to remember, but I still use the printf's - it's a slog but it works ... usually.

Offline

#3 2010-02-17 14:41:24

neutrix
Member
From: Bristol, UK
Registered: 2009-08-29
Posts: 64
Website

Re: [SOLVED]Cannot run own program since last update : malloc.c:3096 error

Well this problem works both in debug and release builds. I've got the bug down to the individual line that it crashes at, I create an instance of a class like this:

Vec3 *vectorlist;
vectorlist = new Vec3[5012];  //CRASHES ON THIS LINE

Vec3 is a class that I've defined for 3D vectors. It doesn't do anything complicated or special, the constructor simply initializes the 3 components of the vector to 0. I am happy to post the full code (it isn't very complex) if someone else wants to try compiling it to see if it works on their computer.

I think the problem might not be in my code (considering it worked before the update), but instead might be some clash between library versions as in the thread that I linked to in my first post. I am not sure how to go about debugging a problem like this though.

Offline

#4 2010-02-17 15:04:12

neutrix
Member
From: Bristol, UK
Registered: 2009-08-29
Posts: 64
Website

Re: [SOLVED]Cannot run own program since last update : malloc.c:3096 error

I apologise, it appears you were right, it was a problem in my code. It was trying to allocate something of size 0 and it was causing the error. I will take this as a lesson to be more careful before posting my problem here. Thanks for your time.

Offline

#5 2010-02-17 15:27:47

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [SOLVED]Cannot run own program since last update : malloc.c:3096 error

*lol* In my humble experience - that's the case 99 times out of 100!!

Offline

Board footer

Powered by FluxBB