forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit76733b3
committed
Avoid using a fake relcache entry to own an SmgrRelation.
If an error occurs before we close the fake relcache entry, the thefake relcache entry will be destroyed by the SmgrRelation willsurvive until end of transaction. Its smgr_owner pointer ends uppointing to already-freed memory.The original reason for using a fake relcache entry here was to tryto avoid reusing an SMgrRelation across a relevant invalidation. Toavoid that problem, just call smgropen() again each time we need areference to it. Hopefully someday we will come up with a moreelegant approach, but accessing uninitialized memory is bad so let'sdo this for now.Dilip Kumar, reviewed by Andres Freund and Tom Lane. Report byJustin Pryzby.Discussion:http://postgr.es/m/20220802175043.GA13682@telsasoft.comDiscussion:http://postgr.es/m/CAFiTN-vSFeE6_W9z698XNtFROOA_nSqUXWqLcG0emob_kJ+dEQ@mail.gmail.com1 parent3d895bc commit76733b3
2 files changed
+28
-38
lines changedLines changed: 4 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
258 | 258 |
| |
259 | 259 |
| |
260 | 260 |
| |
261 |
| - | |
262 | 261 |
| |
| 262 | + | |
263 | 263 |
| |
264 | 264 |
| |
265 | 265 |
| |
| |||
276 | 276 |
| |
277 | 277 |
| |
278 | 278 |
| |
279 |
| - | |
280 |
| - | |
281 |
| - | |
282 |
| - | |
283 |
| - | |
284 |
| - | |
285 |
| - | |
286 |
| - | |
287 |
| - | |
288 |
| - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
289 | 282 |
| |
290 | 283 |
| |
291 | 284 |
| |
|
Lines changed: 24 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
487 | 487 |
| |
488 | 488 |
| |
489 | 489 |
| |
490 |
| - | |
491 |
| - | |
492 |
| - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
493 | 493 |
| |
494 | 494 |
| |
495 | 495 |
| |
| |||
3701 | 3701 |
| |
3702 | 3702 |
| |
3703 | 3703 |
| |
3704 |
| - | |
3705 |
| - | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
3706 | 3707 |
| |
3707 | 3708 |
| |
3708 | 3709 |
| |
| |||
3722 | 3723 |
| |
3723 | 3724 |
| |
3724 | 3725 |
| |
3725 |
| - | |
| 3726 | + | |
| 3727 | + | |
3726 | 3728 |
| |
3727 | 3729 |
| |
3728 | 3730 |
| |
| |||
3738 | 3740 |
| |
3739 | 3741 |
| |
3740 | 3742 |
| |
3741 |
| - | |
| 3743 | + | |
3742 | 3744 |
| |
3743 | 3745 |
| |
3744 | 3746 |
| |
3745 | 3747 |
| |
3746 | 3748 |
| |
3747 | 3749 |
| |
3748 |
| - | |
| 3750 | + | |
3749 | 3751 |
| |
3750 | 3752 |
| |
3751 | 3753 |
| |
| |||
3783 | 3785 |
| |
3784 | 3786 |
| |
3785 | 3787 |
| |
3786 |
| - | |
3787 |
| - | |
| 3788 | + | |
3788 | 3789 |
| |
3789 | 3790 |
| |
3790 | 3791 |
| |
3791 | 3792 |
| |
3792 | 3793 |
| |
3793 | 3794 |
| |
3794 |
| - | |
3795 |
| - | |
3796 |
| - | |
3797 |
| - | |
3798 |
| - | |
3799 |
| - | |
3800 |
| - | |
3801 |
| - | |
3802 |
| - | |
3803 |
| - | |
3804 | 3795 |
| |
3805 | 3796 |
| |
3806 | 3797 |
| |
| |||
3810 | 3801 |
| |
3811 | 3802 |
| |
3812 | 3803 |
| |
3813 |
| - | |
| 3804 | + | |
| 3805 | + | |
3814 | 3806 |
| |
3815 | 3807 |
| |
3816 | 3808 |
| |
3817 | 3809 |
| |
3818 | 3810 |
| |
3819 |
| - | |
| 3811 | + | |
3820 | 3812 |
| |
3821 |
| - | |
| 3813 | + | |
3822 | 3814 |
| |
3823 | 3815 |
| |
3824 | 3816 |
| |
| |||
3828 | 3820 |
| |
3829 | 3821 |
| |
3830 | 3822 |
| |
3831 |
| - | |
| 3823 | + | |
3832 | 3824 |
| |
3833 | 3825 |
| |
3834 | 3826 |
| |
3835 | 3827 |
| |
3836 |
| - | |
3837 |
| - | |
3838 |
| - | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
3839 | 3836 |
| |
3840 | 3837 |
| |
3841 | 3838 |
| |
|
0 commit comments
Comments
(0)