forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb76fb6c
committed
Temporarily make MemoryContextContains return false
5265e91 changed MemoryContextContains to update it so that it workscorrectly with the new MemoryChunk code added inc6e0fe1. However,5265e91 was done with the assumption that MemoryContextContains wouldonly ever be given pointers to memory that had been returned by one of ourMemoryContext allocators. It seems that's not true and many of our 32-bitbuildfarm animals are clearly showing that.There are some code paths that call MemoryContextContains with a pointerpointing part way into an allocated chunk. The example of this found bythe 32-bit buildfarm animals is the int2int4_sum() function. Thisfunction returns transdata->sum, which is not a pointer to memory that wasallocated directly. This return value is then subsequently passed toMemoryContextContains which causes it to crash due to it thinking thememory directly prior to that pointer is a MemoryChunk. What's actuallyin that memory is the field in the struct that comes prior to the "sum"field. This problem didn't occur in 64-bit world because BIGINT is abyval type and the code which was calling MemoryContextContains with thebad pointer only does so with non-byval types.Here, instead of reverting5265e91 and making MemoryContextContainscompletely broken again, let's just make it always return false for now.Effectively prior to5265e91 it was doing that anyway, this at leastmakes that more explicit. The only repercussions of this with the currentMemoryContextContains calls are that we perform a datumCopy() when wemight not need to. This should make the 32-bit buildfarm animals happyagain and give us more time to consider a long-term fix.Discussion:https://postgr.es/m/20220907130552.sfjri7jublfxyyi4%40jrouhaud1 parente7936f8 commitb76fb6c
1 file changed
+9
-20
lines changedLines changed: 9 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
826 | 826 |
| |
827 | 827 |
| |
828 | 828 |
| |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
829 | 837 |
| |
830 | 838 |
| |
831 | 839 |
| |
| |||
845 | 853 |
| |
846 | 854 |
| |
847 | 855 |
| |
| 856 | + | |
848 | 857 |
| |
849 | 858 |
| |
850 | 859 |
| |
| |||
960 | 969 |
| |
961 | 970 |
| |
962 | 971 |
| |
963 |
| - | |
964 |
| - | |
965 | 972 |
| |
966 | 973 |
| |
967 | 974 |
| |
| |||
1000 | 1007 |
| |
1001 | 1008 |
| |
1002 | 1009 |
| |
1003 |
| - | |
1004 |
| - | |
1005 | 1010 |
| |
1006 | 1011 |
| |
1007 | 1012 |
| |
| |||
1040 | 1045 |
| |
1041 | 1046 |
| |
1042 | 1047 |
| |
1043 |
| - | |
1044 |
| - | |
1045 | 1048 |
| |
1046 | 1049 |
| |
1047 | 1050 |
| |
| |||
1083 | 1086 |
| |
1084 | 1087 |
| |
1085 | 1088 |
| |
1086 |
| - | |
1087 |
| - | |
1088 | 1089 |
| |
1089 | 1090 |
| |
1090 | 1091 |
| |
| |||
1168 | 1169 |
| |
1169 | 1170 |
| |
1170 | 1171 |
| |
1171 |
| - | |
1172 |
| - | |
1173 | 1172 |
| |
1174 | 1173 |
| |
1175 | 1174 |
| |
| |||
1203 | 1202 |
| |
1204 | 1203 |
| |
1205 | 1204 |
| |
1206 |
| - | |
1207 |
| - | |
1208 | 1205 |
| |
1209 | 1206 |
| |
1210 | 1207 |
| |
| |||
1244 | 1241 |
| |
1245 | 1242 |
| |
1246 | 1243 |
| |
1247 |
| - | |
1248 |
| - | |
1249 | 1244 |
| |
1250 | 1245 |
| |
1251 | 1246 |
| |
| |||
1299 | 1294 |
| |
1300 | 1295 |
| |
1301 | 1296 |
| |
1302 |
| - | |
1303 |
| - | |
1304 | 1297 |
| |
1305 | 1298 |
| |
1306 | 1299 |
| |
| |||
1336 | 1329 |
| |
1337 | 1330 |
| |
1338 | 1331 |
| |
1339 |
| - | |
1340 |
| - | |
1341 | 1332 |
| |
1342 | 1333 |
| |
1343 | 1334 |
| |
| |||
1377 | 1368 |
| |
1378 | 1369 |
| |
1379 | 1370 |
| |
1380 |
| - | |
1381 |
| - | |
1382 | 1371 |
| |
1383 | 1372 |
| |
1384 | 1373 |
| |
|
0 commit comments
Comments
(0)