Bug 30861

Summary: Linuxulator: stackgap does not handle recursion from interrupted syscalls.
Product: Base System Reporter: Marcel Moolenaar <marcel>
Component: kernAssignee: Marcel Moolenaar <marcel>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Marcel Moolenaar freebsd_committer freebsd_triage 2001-09-27 06:10:00 UTC
Peter says:

Ever wonder why things crash for no apparent reason?  I think I know why.
 
Check out the stackgap_alloc() stuff.  Then think about linuxthreads
where multiple processes are using the same stack gap.  Think what happens
when one process does a translated syscall, blocks, and another one does
a syscall and reuses the same gap space. :-(

Solutions are ugly. :-(

Possible solution 1:
  make the stackgap_*() functions reentrant and alloc/free the space.
  downside: we presently have a small gap space and dont "free" the
  gap space.  We could run out of space easily.

Possible solution 2:
  Use space below the user stack.  We may have to do this.  This is nasty
  too, because we will have to assume that there is nothing below the
  user stack %esp.

Possible solution 3:
  Put a lock around stackgap functions so that translated syscalls are
  not reentrant.  This is really nasty as it single threads linuxthreads
  syscalls.
Comment 1 Marcel Moolenaar freebsd_committer freebsd_triage 2001-09-27 06:20:04 UTC
Responsible Changed
From-To: freebsd-bugs->marcel

Note to self
Comment 2 Marcel Moolenaar freebsd_committer freebsd_triage 2001-11-18 18:59:45 UTC
State Changed
From-To: open->closed

Close this out since it was mostly a note to myself. It doesn't 
contain a trigger case or a patch so it's not expected that it 
will do much good in it's current form. A comment in the code 
would be more effective, because there it will be seen.