staticanalysis / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

ASAN and interaction with GNU Smalltalk JIT #339

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. From the C-stack we call into a "trampoline" that will take the first 
argument and jump to the address that was passed.
2. When the first C method is being called that is using a stack variable there 
will be stack-overflow

I would like to know if this is a known problem and what the JIT should do to 
indicate the new start of the C-stack?

The runtime code is here:
http://git.savannah.gnu.org/gitweb/?p=smalltalk.git;a=blob;f=libgst/xlat.c;h=479
78ac156a56f537885679f1c590a9d516c008a;hb=HEAD#l434

And a call from the JIT to C code can be seen here:

http://git.savannah.gnu.org/gitweb/?p=smalltalk.git;a=blob;f=libgst/xlat.c;h=479
78ac156a56f537885679f1c590a9d516c008a;hb=HEAD#l2964

Original issue reported on code.google.com by zeck...@googlemail.com on 12 Sep 2014 at 1:57

GoogleCodeExporter commented 9 years ago
> I would like to know if this is a known problem

I don't think so. Stack is poisoned at function prologue (via Asan 
instrumentation code) and unpoisoned at epilogue. So unless your JIT does some 
magic with stack frames or there are some noreturn functions this could 
indicate a real bug.

Could you provide ASan error message? Also details on C/JIT interface 
(especially stack handling) would help.

Original comment by tetra2...@gmail.com on 12 Sep 2014 at 5:42