On Jan 14, 9:41 pm, Carl Witty <[EMAIL PROTECTED]> wrote:
> On Jan 14, 4:24 pm, "Joel B. Mohler" <[EMAIL PROTECTED]> wrote:
> > Does anyone care that Ctrl+c
> > can leak memory from c/c++ libs?
>
> It's worse than just leaking memory; as far as I know, it's quite
> possible that hitting Ctrl-c at the exact wrong time could cause
> corruption that would make subsequent computations crash or return
> wrong answers.
I agree in principle that such corruption could occur, but it seems
quite unlikely that it would actually occur much in practice. I guess
that the library could be doing some caching of preliminary results in
a global data structure. The ctrl+c could cause this cache to be half-
written. I'm thinking that for the most part we'll only lose the
memory and the library will probably lose the pointer to it because
said pointer is on the stack.
I guess that global (to the library) variables would be the main point
of concern. Pari's memory manager seems to be a particularly thorny
example of this. I'm almost curious enough to see if I can cause
tremendous breakage by repeatedly interrupting pari at something.
--
Joel
--~--~---------~--~----~------------~-------~--~----~
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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---