On 2012-12-30, Volker Braun <[email protected]> wrote:
> ------=_Part_615_22553311.1356862244107
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sunday, December 30, 2012 3:05:52 AM UTC, Dima Pasechnik wrote:
>
>> GAP uses mmap to get/extend memory. 
>> On Linux, mmap has a MAP_NORESERVE parameter which tells the kernel 
>> whether or not to reserve the swap. 
>> Granted, if MAP_NORESERVE is set then one can get 
>> a segfault - but segfaults can be caught with longjumps. 
>>
>
> Well not quite, you need to install a SIGSEGV handler (Sage already has 
> one). 
sure.

> This would be a huge headache for libGAP, the signal handler would 
> then have to figure out if the segfault is because GAP is running out of 
> workspace (and run a GAP garbage collection cycle) or if the segfault is 
> due to a bug somewhere else (and print a stack backtrace).

I think it's just the matter of setting up a fresh signal handler before
calling mmap(), and reinstating the old one after this is done.
In a debugging mode, one might still run without MAP_NORESERVE.

Also, isn't a GAP's GC run before an attempt to extend the workspace
anyway?

Dima

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to