W-M-R opened a new pull request, #21362:
URL: https://github.com/apache/nuttx/pull/21362
## Summary
- `arch/sim/src/Makefile`, `arch/sim/src/sim/CMakeLists.txt`: always define
`_FILE_OFFSET_BITS=64` and `_TIME_BITS=64` for the host build. Tying them
to
`CONFIG_FS_LARGEFILE` produced a struct layout mismatch between the NuttX
headers and the host libc.
- `arch/sim/src/sim/sim_ummheap.c`: keep the umm free list with XOR-mangled
pointers. The list head lives in a global, so lasan treated the whole heap
as reachable and could not report leaks; with the mangled form the
addresses are no longer recorded as valid pointers.
## Impact
- Simulator-only.
- On 64-bit hosts behaviour is unchanged apart from the layout fix; leak
detection under lasan works again.
## Testing
Host: Ubuntu 22.04, gcc 13.
./tools/configure.sh sim:nsh
make -j
./nuttx
Build and boot both with and without `CONFIG_FS_LARGEFILE`; before the change
the host/NuttX struct layouts disagreed when the option was off.
lasan: build `sim:asan` (or the board's lasan configuration), allocate and
leak a block, and confirm the leak is now reported. Before the change the
umm free list head in a global kept the whole heap reachable, so nothing was
reported.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]