tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Debugger options: difference output between linux and


From: Michael Matz
Subject: Re: [Tinycc-devel] Debugger options: difference output between linux and windows
Date: Fri, 15 May 2020 23:12:04 +0200 (CEST)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hello,

On Fri, 15 May 2020, Massimo Sala wrote:

* linux:   -DLUA_USE_LINUX -g -b
   lua -v
   bcheck.c __bound_ptr_add: 0x7fffffffe66f is outside of the region
   bcheck.c bound_error: invalid pointer
   /opt/packages/tcc.sh: line 49: 19914 Segmentation fault      ./lua -v

From the output I cannot understand if this instrumentation is working and
there is a problem in Lua, or there is a problem in the tcc instrumentation
code.

I read at https://bellard.org/tcc/tcc-doc.html    "Note: -b is only
available on i386"
Does it mean cannot work on intel, 64 bits cpu ?

Nope, that's outdated docu, -b is supposed to work on x86-64. But I fear you'll have to debug this a bit on your own. Current mob branch should actually be a bit more verbose in telling where the invalid access is happening, so it seems you're using an older version; please update to current git.

In the worst case you can run the whole thing in a debugger and set a breakpoint on bound_error or tcc_backtrace. In recent mob branch you can also set the environment variable TCC_BOUNDS_NEVER_FATAL to 1, in which case the error is only logged but the program keeps running (and possibly accessing the invalid pointer, which might turn out to be harmless).


Ciao,
Michael.

reply via email to

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