forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit48a565d
committed
Fix reference-after-free when waiting for another xact due to constraint.
If an insertion or update had to wait for another transaction to finish,because there was another insertion with conflicting key in progress,we would pass a just-free'd item pointer to XactLockTableWait().All calls to XactLockTableWait() and MultiXactIdWait() had similar issues.Some passed a pointer to a buffer in the buffer cache, after alreadyreleasing the lock. The call in EvalPlanQualFetch had already released thepin too. All but the call in execUtils.c would merely lead to reporting abogus ctid, however (or an assertion failure, if enabled).All the callers that passed HeapTuple->t_data->t_ctid were slightly bogusanyway: if the tuple was updated (again) in the same transaction, its ctidfield would point to the next tuple in the chain, not the tuple itself.Backpatch to 9.4, where the 'ctid' argument to XactLockTableWait was added(in commitf88d4cf)1 parent742734d commit48a565d
File tree
4 files changed
+14
-12
lines changed- src/backend
- access/heap
- catalog
- executor
4 files changed
+14
-12
lines changedLines changed: 8 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2742 | 2742 |
| |
2743 | 2743 |
| |
2744 | 2744 |
| |
2745 |
| - | |
| 2745 | + | |
2746 | 2746 |
| |
2747 | 2747 |
| |
2748 | 2748 |
| |
| |||
2769 | 2769 |
| |
2770 | 2770 |
| |
2771 | 2771 |
| |
2772 |
| - | |
| 2772 | + | |
2773 | 2773 |
| |
2774 | 2774 |
| |
2775 | 2775 |
| |
| |||
3298 | 3298 |
| |
3299 | 3299 |
| |
3300 | 3300 |
| |
3301 |
| - | |
| 3301 | + | |
3302 | 3302 |
| |
3303 | 3303 |
| |
3304 | 3304 |
| |
| |||
3378 | 3378 |
| |
3379 | 3379 |
| |
3380 | 3380 |
| |
3381 |
| - | |
| 3381 | + | |
3382 | 3382 |
| |
3383 | 3383 |
| |
3384 | 3384 |
| |
| |||
4396 | 4396 |
| |
4397 | 4397 |
| |
4398 | 4398 |
| |
4399 |
| - | |
| 4399 | + | |
4400 | 4400 |
| |
4401 | 4401 |
| |
4402 | 4402 |
| |
| |||
4452 | 4452 |
| |
4453 | 4453 |
| |
4454 | 4454 |
| |
4455 |
| - | |
| 4455 | + | |
4456 | 4456 |
| |
4457 | 4457 |
| |
4458 | 4458 |
| |
| |||
5168 | 5168 |
| |
5169 | 5169 |
| |
5170 | 5170 |
| |
5171 |
| - | |
| 5171 | + | |
5172 | 5172 |
| |
5173 | 5173 |
| |
5174 | 5174 |
| |
| |||
5229 | 5229 |
| |
5230 | 5230 |
| |
5231 | 5231 |
| |
5232 |
| - | |
| 5232 | + | |
5233 | 5233 |
| |
5234 | 5234 |
| |
5235 | 5235 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2288 | 2288 |
| |
2289 | 2289 |
| |
2290 | 2290 |
| |
2291 |
| - | |
| 2291 | + | |
2292 | 2292 |
| |
2293 | 2293 |
| |
2294 | 2294 |
| |
| |||
2337 | 2337 |
| |
2338 | 2338 |
| |
2339 | 2339 |
| |
2340 |
| - | |
| 2340 | + | |
2341 | 2341 |
| |
2342 | 2342 |
| |
2343 | 2343 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2104 | 2104 |
| |
2105 | 2105 |
| |
2106 | 2106 |
| |
2107 |
| - | |
| 2107 | + | |
2108 | 2108 |
| |
2109 | 2109 |
| |
2110 | 2110 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1245 | 1245 |
| |
1246 | 1246 |
| |
1247 | 1247 |
| |
| 1248 | + | |
1248 | 1249 |
| |
1249 | 1250 |
| |
1250 | 1251 |
| |
| |||
1306 | 1307 |
| |
1307 | 1308 |
| |
1308 | 1309 |
| |
| 1310 | + | |
1309 | 1311 |
| |
1310 |
| - | |
| 1312 | + | |
1311 | 1313 |
| |
1312 | 1314 |
| |
1313 | 1315 |
| |
|
0 commit comments
Comments
(0)