On Aug 7, 2009, at 1:16 AM, Simon King wrote: > > Hi Robert, > > On 7 Aug., 09:06, Robert Bradshaw <[email protected]> > wrote: > ... >>> I came to asking about "sage -gdb" since sage's last words at >>> crashing >>> suggest to use "sage -gdb". But then I would expect that it is >>> explained in detail in the documentation. However, searching "sage - >>> gdb" in the developer's guide or reference manual yields nothing. >> >> Start it up with sage -gdb. Hitting ctl-C will dump you into the >> debugger. From there just google around for gdb documentation--sage- >> gdb is just running sage under gdb. > > Thank you! This was the bit of information I was missing: How can I > get the gdb prompt, so that I can insert break points and those > things. > > Meanwhile I found that the memory which caused the crash when freeing > it was allocated, and then re-allocated by realloc: 1. Allocate enough > memory to do some computation in that block of memory, and 2. since > the result of that computation will, in general, be smaller than that > block, do a re-allocation, so that now only the size of the result is > allocated. > > It realloc error prone?
Doubtful, or we'd be crashing all over. I thought it was guaranteed to give you back the same spot if you realloc to something smaller, but that may not be the case, and certainly isn't if it's something bigger. Have you tried not doing the realloc? Maybe something else is hanging onto it and still thinks it's full size. > Disclaimer: It isn't my code. But I link against it, so it is my > problem... > > Cheers, > Simon > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
