tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] The built-in memory and bounds checker cannot handle mmap


From: George Gaarder
Subject: [Tinycc-devel] The built-in memory and bounds checker cannot handle mmap'd memory and judges errno wrong
Date: Fri, 6 Apr 2018 12:33:02 +0800

Hi,

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.

Output:
  $ tcc 2018-04-06-02-tccmmap.c -b
  $ ./a.out 
  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.

Regards,
George Gaarder

Attachment: 2018-04-06-02-tccmmap.c
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]