bash32-018 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 3.2
  4. Patch-ID: bash32-018
  5. Bug-Reported-by: osicka@post.cz
  6. Bug-Reference-ID: <228.177-19682-1132061412-1179356692@post.cz>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-05/msg00061.html
  8. Bug-Description:
  9. In certain cases, bash can lose the saved status of a background job, though
  10. it should still be reported by `wait'. Bash can also loop infinitely after
  11. creating and waiting for 4096 jobs.
  12. Patch:
  13. *** ../bash-20070510/jobs.c Thu Mar 8 16:05:50 2007
  14. --- bash-3.2/jobs.c Fri May 18 11:40:14 2007
  15. ***************
  16. *** 784,792 ****
  17. {
  18. old = js.j_firstj++;
  19. while (js.j_firstj != old)
  20. {
  21. if (js.j_firstj >= js.j_jobslots)
  22. js.j_firstj = 0;
  23. ! if (jobs[js.j_firstj])
  24. break;
  25. js.j_firstj++;
  26. --- 784,794 ----
  27. {
  28. old = js.j_firstj++;
  29. + if (old >= js.j_jobslots)
  30. + old = js.j_jobslots - 1;
  31. while (js.j_firstj != old)
  32. {
  33. if (js.j_firstj >= js.j_jobslots)
  34. js.j_firstj = 0;
  35. ! if (jobs[js.j_firstj] || js.j_firstj == old) /* needed if old == 0 */
  36. break;
  37. js.j_firstj++;
  38. ***************
  39. *** 798,806 ****
  40. {
  41. old = js.j_lastj--;
  42. while (js.j_lastj != old)
  43. {
  44. if (js.j_lastj < 0)
  45. js.j_lastj = js.j_jobslots - 1;
  46. ! if (jobs[js.j_lastj])
  47. break;
  48. js.j_lastj--;
  49. --- 800,810 ----
  50. {
  51. old = js.j_lastj--;
  52. + if (old < 0)
  53. + old = 0;
  54. while (js.j_lastj != old)
  55. {
  56. if (js.j_lastj < 0)
  57. js.j_lastj = js.j_jobslots - 1;
  58. ! if (jobs[js.j_lastj] || js.j_lastj == old) /* needed if old == js.j_jobslots */
  59. break;
  60. js.j_lastj--;
  61. ***************
  62. *** 964,968 ****
  63. realloc_jobs_list ();
  64. ! return (js.j_lastj);
  65. }
  66. --- 975,983 ----
  67. realloc_jobs_list ();
  68. ! #ifdef DEBUG
  69. ! itrace("compact_jobs_list: returning %d", (js.j_lastj || jobs[js.j_lastj]) ? js.j_lastj + 1 : 0);
  70. ! #endif
  71. !
  72. ! return ((js.j_lastj || jobs[js.j_lastj]) ? js.j_lastj + 1 : 0);
  73. }
  74. *** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006
  75. --- bash-3.2/patchlevel.h Mon Oct 16 14:22:54 2006
  76. ***************
  77. *** 26,30 ****
  78. looks for to find the patch level (for the sccs version string). */
  79. ! #define PATCHLEVEL 17
  80. #endif /* _PATCHLEVEL_H_ */
  81. --- 26,30 ----
  82. looks for to find the patch level (for the sccs version string). */
  83. ! #define PATCHLEVEL 18
  84. #endif /* _PATCHLEVEL_H_ */