Quote:
Originally Posted by
Corona688
Of all the faith-based initiatives Bush funded, faith-based software maintenance has to be the worst.
Bottom line is, you don't know why it crashed, don't know why it stopped crashing, and don't know if the problem is truly solved yet or not. All we know is that something trashed some memory somewhere somehow. Time for a memory debugger.
I'm just saying that in these functions, the only memory I manage myself is in a single array, char line[]. All other memory management is done by the library. And since library-related memory troubles will be problems *within* the Pari stack rather than overflowing the Pari stack*, the particular tool recommended here seem powerless to help me.
What I would need is something that could help me debug memory use within the Pari stack.
* I recognize that you haven't seen the library code, so this you're going to have to trust... or not.
Quote:
Originally Posted by
Corona688
All this odd stack rearranging makes me more and more suspicious of memory trashing, not less!
Agreed. It's error-prone, to be sure. The biggest problem (in my experience with this library) is leaving garbage behind, but I have had occasional problems of corrupted data -- say, moving the pointer too far so that some members of a live structure can be overwritten later.
Quote:
Originally Posted by
Corona688
When it works perfectly it works perfectly, but one mistake and you're mangling your own stack frame. It could also be a disguised array-bounds problem, these macros are using hidden stack variables and writing beyond them could smash your stack too.
The testing behind the library code is quite solid; I'm not concerned about it going past the end of the stack or overwriting things in the 'valid data' portion. My code, on the other hand, is comparatively suspect: I could move the pointer to the wrong place, so that the (correct) library code would overwrite my data.
There are, as you suggest, several stack variables, but the only one that I use regularly is avma, the "available memory area" pointer.