stack overflow patches:

process overflows as high-level as possible;
   introduce overflow related errors
   ExpandWorkSpace should never call Error: use ErrorMessage instead,
   format_putc should never release memory, causes memory corruption,
   Linux does not like MAP_FIXED, it can overwrite the actual program
code.
   condor: twick configure to disable readline with condor.
----------------------------------------------------------------------


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@632 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2002-10-10 05:58:49 +00:00
parent 3e662aca31
commit 523fae9544
27 changed files with 502 additions and 170 deletions

View File

@@ -442,7 +442,7 @@ AllocateStaticArraySpace(StaticArrayEntry *p, static_array_types atype, Int arra
while ((p->ValueOfVE.floats = (Float *) AllocAtomSpace(asize) ) == NULL) {
YAPLeaveCriticalSection();
if (!growheap(FALSE)) {
Error(SYSTEM_ERROR, TermNil, "YAP failed to reserve space in growheap");
Error(SYSTEM_ERROR, TermNil, ErrorMessage);
return;
}
YAPEnterCriticalSection();
@@ -636,11 +636,14 @@ p_create_array(void)
farray = MkFunctor(AtomArray, size);
if (H+1+size > ASP-1024) {
if (!gc(2, ENV, P)) {
Error(SYSTEM_ERROR,TermNil,"YAP could not grow stack in array/2");
Error(OUT_OF_STACK_ERROR,TermNil,ErrorMessage);
return(FALSE);
} else {
if (H+1+size > ASP-1024) {
growstack( sizeof(CELL) * (size+1-(H-ASP-1024)));
if (!growstack( sizeof(CELL) * (size+1-(H-ASP-1024)))) {
Error(SYSTEM_ERROR, TermNil, ErrorMessage);
return FALSE;
}
}
}
goto restart;
@@ -666,7 +669,7 @@ p_create_array(void)
if (H+1+size > ASP-1024) {
WRITE_UNLOCK(ae->ARWLock);
if (!gc(2, ENV, P)) {
Error(SYSTEM_ERROR,TermNil,"YAP could not grow stack in array/2");
Error(OUT_OF_STACK_ERROR,TermNil,ErrorMessage);
return(FALSE);
} else
goto restart;
@@ -684,7 +687,7 @@ p_create_array(void)
else {
if (H+1+size > ASP-1024) {
if (!gc(2, ENV, P)) {
Error(SYSTEM_ERROR,TermNil,"YAP could not grow stack in array/2");
Error(OUT_OF_STACK_ERROR,TermNil,ErrorMessage);
return(FALSE);
} else
goto restart;