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