If it happens that _textdata_memsz ends up being an exact multiple of 4kB, then this will cause the .textdata section (after relocation) to start on a page boundary. This means that the hidden memory region (which is rounded down to the nearest page boundary) will start exactly at virtual address 0, i.e. UNULL. This means that init_eheap() will erroneously assume that it has failed to allocate a an external heap, since it typically ends up choosing the area that lies immediately below .textdata, which in this case will be the region with top==UNULL. A subsequent error is that memtop_urealloc() passes through the error return status -ENOMEM to the caller, which (rightly) assumes that the result represents a valid userptr_t address. Fixed by using alternative tests for heap non-existence, and by returning UNULL in case of an error from init_eheap().tags/v0.9.7
|
|
||
92 |
|
92 |
|
93 |
|
93 |
|
94 |
|
94 |
|
95 |
|
|
|
|
95 |
|
|
96 |
|
96 |
|
97 |
|
97 |
|
98 |
|
98 |
|
|
|
||
139 |
|
139 |
|
140 |
|
140 |
|
141 |
|
141 |
|
142 |
|
|
|
|
142 |
|
|
143 |
|
143 |
|
144 |
|
|
|
|
144 |
|
|
145 |
|
145 |
|
146 |
|
146 |
|
147 |
|
147 |
|