[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] The built-in memory and bounds checker cannot handle mmap
[Tinycc-devel] The built-in memory and bounds checker cannot handle mmap'd memory and judges errno wrong
Fri, 6 Apr 2018 12:33:02 +0800
I just tried -b to see whether I forgot to free something, and I found that the memory and bounds checker will alert when I use the memory I mmap'd. While I was writing a demo for report, I found that the checker also reported out of region when I accessed errno. I was to print errno to see if I really opened the file to be mmap'd.
I think the warning for the mmap'd memory is not a problem, just needed to be pointed out in the document. But the errno one is quite strange.
The demo is sent together as an attachment.
$ tcc 2018-04-06-02-tccmmap.c -b
errno demo: 11539
bcheck.c __bound_ptr_indir4: 0x7f3a50abc698 is outside of the region
11539: Signal SIGSEGV (11) received
mmap demo: 11540
mmap demo no read: 11541
bcheck.c __bound_ptr_indir1: 0x7f3a50acf003 is outside of the region
11540: Signal SIGSEGV (11) received
My TCC Version:
$ tcc -v
tcc version 0.9.27 (x86_64 Linux)
By the way, this project is extraordinary great! I use it all the time. It is so wonderful for me to find people like you who remember what good software looks like.
Description: Binary data
- [Tinycc-devel] The built-in memory and bounds checker cannot handle mmap'd memory and judges errno wrong,
George Gaarder <=