forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit29ddb54
committed
Fix inconsistent out-of-memory error reporting in dsa.c.
Commit16be2fd introduced the flag DSA_ALLOC_NO_OOM to control whetherthe DSA allocator would raise an error or return InvalidDsaPointer onfailure to allocate. One edge case was not handled correctly: if wefail to allocate an internal "span" object for a large allocation, wewould always return InvalidDsaPointer regardless of the flag; a callernot expecting that could then dereference a null pointer.This is a plausible explanation for a one-off report of a segfault.Remove a redundant pair of braces so that all three stanzas that handleDSA_ALLOC_NO_OOM match in style, for visual consistency.While fixing inconsistencies, if FreePageManagerGet() can't supply thepages that our book-keeping says it should be able to supply, then weshould always report a FATAL error. Previously we treated that as aregular allocation failure in one code path, but as a FATAL conditionin another.Back-patch to 10, where dsa.c landed.Author: Thomas MunroReported-by: Jakub GlapaDiscussion:https://postgr.es/m/CAEepm=2oPqXxyWQ-1o60tpOLrwkw=VpgNXqqF1VN2EyO9zKGQw@mail.gmail.com1 parent9e138a4 commit29ddb54
1 file changed
+16
-8
lines changedLines changed: 16 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
693 | 693 |
| |
694 | 694 |
| |
695 | 695 |
| |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
696 | 704 |
| |
| 705 | + | |
697 | 706 |
| |
698 | 707 |
| |
699 | 708 |
| |
| |||
790 | 799 |
| |
791 | 800 |
| |
792 | 801 |
| |
793 |
| - | |
794 | 802 |
| |
795 | 803 |
| |
796 | 804 |
| |
797 | 805 |
| |
798 |
| - | |
799 | 806 |
| |
800 | 807 |
| |
801 | 808 |
| |
| |||
1669 | 1676 |
| |
1670 | 1677 |
| |
1671 | 1678 |
| |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
1672 | 1683 |
| |
1673 |
| - | |
1674 |
| - | |
1675 |
| - | |
1676 |
| - | |
1677 |
| - | |
1678 |
| - | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
1679 | 1687 |
| |
1680 | 1688 |
| |
1681 | 1689 |
| |
|
0 commit comments
Comments
(0)