OBSERVATIONS 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. The latest diff (www.freebsd.org/~cracauer/) passes all tests for
  2. SIGINT. SIGQUIT is a different matter, though.
  3. OUTDATED INFORMATION FOLLOWS, don't use
  4. %%
  5. Neue bde-version:
  6. test09 (shell-wait is not interruptable by SIGINT)
  7. %%
  8. CRA = my diffs.
  9. BDE = Bruce diffs.
  10. BDE version 19980212:
  11. Test 2: It should send SIGQUIT to cat, it doesn't.
  12. Test 9: can't break wait()
  13. %% older notes:
  14. test2:
  15. trap '' 2
  16. while : ; do cat ; echo -n $? ; done
  17. test6:
  18. trap '' 3
  19. while : ; do cat ; echo -n $? ; done
  20. The trapped signal should be ignored. If SIGINT is ignored (test 2),
  21. SIGQUIT exits `cat`, but not the shell (means the loop will continue
  22. and `cat` will be called again).
  23. If SIGQUIT is ignored, SIGINT both exit the whole script.
  24. I'm not sure this asymmetric behaviour is intended, but currently CRA
  25. and BDE versions has is.
  26. I think SIGTERM should exit the script in all cases immedeatly. CRA
  27. version does this, BDE version ignores SIGTERM.
  28. bash1 falls over completely on these tests.
  29. bash2 works like CRA version.
  30. Other tests:
  31. ------------
  32. BDE version fails on 5, the shell terminated while the forground child
  33. is running (like the unpatched FreeBSD sh did).
  34. BDE version handles SIGQUIT seperately from SIGINT in test 1, and 3,
  35. but not in test 4 and 5.
  36. bash2 fails on 5, it gets a SIGQUIT that was sent to a
  37. SIGQUIT-catching process after that process exits. Reliably, it
  38. doesn't matter how much time was passed between SIGQUIT to process and
  39. exit or process.
  40. As Bruce noted, bash version 1 fails on test 2 like my version of sh
  41. does. bash1 doesn't have the bash2 problem on test 5 (getting signals
  42. that were caught by the child after the child exits).
  43. zsh fails on test 1 and 5 in a similar way bash2 failed on 5: After a
  44. child exits that received SIGINT, it terminates immedeatly.
  45. I wonder how bash 2 manages to fail on test 5, but to pass test 1...
  46. csh fails on test 1 in two ways:
  47. - when the SIGINT/SIGQUIT-catching child receives both SIGQUIT and
  48. SIGINT, csh exits immedeatly, while the child is still running.
  49. - when only one or more SIGQUIT are delivered to the child, csh gets
  50. it after the child exits and terminates with coredump.
  51. csh also ignores SIGQUIT where SIGINT is caught.
  52. test2.csh is different from test1.sh in that all signals should be
  53. caught. csh fails in that it sometimes gets SIGQUIT and exits with
  54. coredump (the shell, not the child).
  55. Other stuff not directly relevant to these fixes:
  56. =================================================
  57. csh oddness:
  58. ------------
  59. When the "catcher" program resets the terminal, there's a time-window
  60. where C-g is mapped to SIGQUIT, but "catcher" already exited. In other
  61. word, if you type C-g while in "catcher", then immedeatly C-d, csh
  62. will get SIGQUIT. I thought that remapping the terminal keys should
  63. have been done before the shell is re-entered. The same happens to
  64. tcsh.
  65. With sh variants I didn't manage to deliver SIGQUIT by C-g.