home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / bsd / 11773 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  1.7 KB

  1. Xref: sparky comp.unix.bsd:11773 comp.bugs.4bsd:245
  2. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!emory!swrinde!zaphod.mps.ohio-state.edu!howland.reston.ans.net!spool.mu.edu!olivea!hal.com!decwrl!deccrl!news.crl.dec.com!news!nntpd.lkg.dec.com!decvax.dec.com!jtkohl
  3. From: jtkohl@decvax.dec.com (John Kohl Base File System)
  4. Newsgroups: comp.unix.bsd,comp.bugs.4bsd
  5. Subject: syscall(2) broken on i386 + FIX
  6. Message-ID: <1993Jan24.171107.9454@nntpd.lkg.dec.com>
  7. Date: 24 Jan 93 17:11:07 GMT
  8. Sender: usenet@nntpd.lkg.dec.com (USENET News System)
  9. Organization: Digital Equipment Corporation
  10. Lines: 33
  11.  
  12. This bug seems to derive from the Net/2 i386 BSD code; it's in BSD/386,
  13. and probably also in 386BSD.
  14.  
  15. Description:
  16.     syscall(2) doesn't work right.  It leaves $sp off by a word,
  17. which can lead to disaster when it's called repeatedly (as it is in
  18. XView3.0).
  19.  
  20. Repeat-By:
  21.     Write a program that has a local variable on the stack;
  22. initialize it, then call syscall() repeatedly.  Note that the value
  23. eventually gets trashed when the stack works its way up over the
  24. variable.
  25. Fix:
  26. *** /cdrom/usr/src/lib/libc/i386/sys/syscall.s    Wed Jan  1 16:22:58 1992
  27. --- syscall.s    Sat Jan 23 01:24:01 1993
  28. ***************
  29. *** 45,50 ****
  30. --- 45,52 ----
  31.       pop    %eax    /* syscall number */
  32.       push    %ecx
  33.       LCALL(7,0)
  34. +     push    %ecx    /* need to push a word to keep stack frame intact
  35. +                upon return; the word must be the return address. */
  36.       jb    1f
  37.       ret
  38.   1:
  39.  
  40. --
  41. John Kohl <jtkohl@zk3.dec.com> or <jtkohl@mit.edu>
  42. working for but not representing:    Digital Equipment Corporation
  43. Member of the League for Programming Freedom---get details: lpf@uunet.uu.net
  44. (The above opinions are MINE.  Don't put my words in somebody else's mouth!)
  45.