DLL Question
March 15, 2006 10:55 AM
Subscribe
Repeated calls to a user created dll cause stack overflow.
I'm having a really hard tine with this one :( This is all C code, using the Borland Developer 10.
I've created a dll using the .def file method that only contains a function that has a single printf command. Then I've got anther program which calls the fucntion in the dll 100,000 times. After ~60,000 iterations the program stack overflows.
Interestingly, if I change the number of arguments to the function in the dll the less the number of arguments the longer it takes to overflow.
I've tried freeing the library after every call and re-initializing it, but that doesn't seem to help.
This link is almost exactly what I'm seeing:
http://www.swox.com/list-archives/gmp-discuss/2005-November/001954.html
posted by sleslie to computers & internet (4 comments total)
Can you look at it under the debugger? That should pretty clearly show what happens, if you have the patience and knowledge to interpret what you're seeing. I mean, it's fine if you don't, but the debugger is the right tool here if you can use it properly.
It is possible to write a printf() statement which consumes memory without releasing it due to side-effects. (Or it could be a bug in Borland's stuff, they've had a few).
posted by mdevore at 11:13 AM on March 15, 2006