tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Memory corruption bug in libtcc


From: Andreas Eriksson
Subject: [Tinycc-devel] Memory corruption bug in libtcc
Date: Fri, 20 Jan 2012 17:19:36 +0100

Hi.

I encountered a memory corruption bug in libtcc. It seems to put
random data into random data structures of the program that are
unrelated to libtcc. I've been able to reproduce the bug using a
simple test-case, which is attached. The output of what I get when I
run the test-case is also attached.

I encountered the bug on a x86_64 linux system, and the test case was
compiled using gcc 4.6.2. It was linked against the latest git version
of tcc. What optimization flag you use with gcc seem to affect how the
bug manifests itself. The output I've attached is what I get when I
compile using -O2, if I compile using -O1 I get a segfault instead.

I can't debug this any further due to lack of knowledge of tcc
internals, but hopefully one of you can figure it out from this. If
you need any more information from me let me know.

Regards

Andreas Eriksson

Attachment: output.txt
Description: Text document

Attachment: testcase.c
Description: Text Data


reply via email to

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