forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf727b6e
committed
Clean up assorted failures under clang's -fsanitize=undefined checks.
Most of these are cases where we could call memcpy() or other libcfunctions with a NULL pointer and a zero count, which is forbiddenby POSIX even though every production version of libc allows it.We've fixed such things before in a piecemeal way, but apparentlynever made an effort to try to get them all. I don't claim thatthis patch does so either, but it gets every failure I observe incheck-world, using clang 12.0.1 on current RHEL8.numeric.c has a different issue that the sanitizer doesn't like:"ln(-1.0)" will compute log10(0) and then try to assign theresulting -Inf to an integer variable. We don't actually use theresult in such a case, so there's no live bug.Back-patch to all supported branches, with the idea that we mightstart running a buildfarm member that tests this case. This includesback-patchingc1132aa (Check the size in COPY_POINTER_FIELD),which previously silenced some of these issues in copyfuncs.c.Discussion:https://postgr.es/m/CALNJ-vT9r0DSsAOw9OXVJFxLENoVS_68kJ5x0p44atoYH+H4dg@mail.gmail.com1 parent72918ea commitf727b6e
File tree
10 files changed
+52
-48
lines changed- contrib/pgcrypto
- src
- backend
- access
- heap
- transam
- nodes
- storage/ipc
- utils
- adt
- time
- fe_utils
10 files changed
+52
-48
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
203 |
| - | |
| 203 | + | |
204 | 204 |
| |
205 | 205 |
| |
206 | 206 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
312 |
| - | |
| 312 | + | |
313 | 313 |
| |
314 | 314 |
| |
315 | 315 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1520 | 1520 |
| |
1521 | 1521 |
| |
1522 | 1522 |
| |
1523 |
| - | |
1524 |
| - | |
| 1523 | + | |
| 1524 | + | |
1525 | 1525 |
| |
1526 | 1526 |
| |
1527 | 1527 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
296 | 296 |
| |
297 | 297 |
| |
298 | 298 |
| |
299 |
| - | |
300 |
| - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
301 | 302 |
| |
302 | 303 |
| |
303 | 304 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5257 | 5257 |
| |
5258 | 5258 |
| |
5259 | 5259 |
| |
5260 |
| - | |
5261 |
| - | |
| 5260 | + | |
| 5261 | + | |
| 5262 | + | |
5262 | 5263 |
| |
5263 | 5264 |
| |
5264 | 5265 |
| |
|
Lines changed: 21 additions & 33 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
61 |
| - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
62 | 65 |
| |
63 | 66 |
| |
64 | 67 |
| |
| |||
293 | 296 |
| |
294 | 297 |
| |
295 | 298 |
| |
296 |
| - | |
297 |
| - | |
298 |
| - | |
299 |
| - | |
300 |
| - | |
301 |
| - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
302 | 302 |
| |
303 | 303 |
| |
304 | 304 |
| |
| |||
872 | 872 |
| |
873 | 873 |
| |
874 | 874 |
| |
875 |
| - | |
876 |
| - | |
877 |
| - | |
878 |
| - | |
879 |
| - | |
880 |
| - | |
881 |
| - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
882 | 879 |
| |
883 | 880 |
| |
884 | 881 |
| |
| |||
979 | 976 |
| |
980 | 977 |
| |
981 | 978 |
| |
982 |
| - | |
983 |
| - | |
984 |
| - | |
985 |
| - | |
986 |
| - | |
987 |
| - | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
988 | 982 |
| |
989 | 983 |
| |
990 | 984 |
| |
| |||
1005 | 999 |
| |
1006 | 1000 |
| |
1007 | 1001 |
| |
1008 |
| - | |
1009 |
| - | |
1010 |
| - | |
1011 |
| - | |
1012 |
| - | |
1013 |
| - | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
1014 | 1005 |
| |
1015 |
| - | |
1016 |
| - | |
1017 |
| - | |
1018 |
| - | |
1019 |
| - | |
1020 |
| - | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
1021 | 1009 |
| |
1022 | 1010 |
| |
1023 | 1011 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
748 | 748 |
| |
749 | 749 |
| |
750 | 750 |
| |
751 |
| - | |
752 |
| - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
753 | 756 |
| |
754 | 757 |
| |
755 | 758 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8130 | 8130 |
| |
8131 | 8131 |
| |
8132 | 8132 |
| |
| 8133 | + | |
| 8134 | + | |
| 8135 | + | |
| 8136 | + | |
8133 | 8137 |
| |
8134 | 8138 |
| |
8135 | 8139 |
| |
8136 | 8140 |
| |
8137 | 8141 |
| |
8138 | 8142 |
| |
| 8143 | + | |
| 8144 | + | |
| 8145 | + | |
| 8146 | + | |
8139 | 8147 |
| |
8140 | 8148 |
| |
8141 | 8149 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
594 | 594 |
| |
595 | 595 |
| |
596 | 596 |
| |
597 |
| - | |
598 |
| - | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
599 | 600 |
| |
600 | 601 |
| |
601 |
| - | |
602 |
| - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
603 | 605 |
| |
604 | 606 |
| |
605 | 607 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
913 | 913 |
| |
914 | 914 |
| |
915 | 915 |
| |
916 |
| - | |
| 916 | + | |
| 917 | + | |
917 | 918 |
| |
918 | 919 |
| |
919 | 920 |
| |
|
0 commit comments
Comments
(0)