1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

Fix SIGALRM core dump (Solaris patch 230-18229654)

This should fix the following Solaris bug:
18229654 ksh93 read not reentrant in alarm context dumps core
with the patch taken from:
https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/230-18229654.patch

Unfortunately the link to the details is inaccessible
as lists.research.att.com is dead.
This commit is contained in:
Martijn Dekker 2021-01-08 18:50:34 +00:00
parent 99cbb7f794
commit 13e7b26202
2 changed files with 6 additions and 1 deletions

View file

@ -134,7 +134,7 @@ static void trap_timeout(void* handle)
tp->timeout = 0;
tp->flags |= L_FLAG;
tp->sh->sigflag[SIGALRM] |= SH_SIGALRM;
if(sh_isstate(SH_TTYWAIT))
if(sh_isstate(SH_TTYWAIT) && !tp->sh->bltinfun)
sh_timetraps(tp->sh);
}

View file

@ -2643,6 +2643,11 @@ int sh_exec(register const Shnode_t *t, int flags)
break;
}
}
if(shp->trapnote&SH_SIGALRM)
{
shp->trapnote &= ~SH_SIGALRM;
sh_timetraps(shp);
}
if(shp->trapnote || (shp->exitval && sh_isstate(SH_ERREXIT)) &&
t && echeck)
sh_chktrap(shp);