Skip to main content
gamedev.net
🔒 Locked

ptr=malloc(24) : Unhandled exception

Started by m4gnus Jan 30, 2006 at 1:53 PM 3 replies 950+ views
Original Post
m4gnus
m4gnus
My problem is as simple as annoying: I'm just trying to reserve a special amount of memory(the size is defined by some flags) using ptr=malloc(size) and it worked fine for now but now i tried some different flags so that i get a size of 24 but when i call ptr=malloc(size) (with size=24) i get an unhandled exception in 0x0000003c. How can this be possible? sadly i cannot show you the address the pointer is pointing to because the debugger refuses to tell but i think that shouldn't matter anyway. regards, m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
255
255
This is probably the result of a memory access error or stack corruption somewhere earlier in your program. Run your program through a memory debugger if you can.
m4gnus
m4gnus
Quote:
Run your program through a memory debugger if you can.

if you tell me what exactly a memory debugger does and if Visual .net 2003 has one i probably can.

How can memory access errors or a stack corruption be caused? i can isolate the problem quite fast but if i don't know what i'm searching for it could quite a long time to fix the problem.

regards,
m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
m4gnus
m4gnus
ok fixed the problem. i used the [5] operator of a std::vector without putting any elements in it.
"There are 10 types of people in the world... those who understand binary and those who don't."

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.