tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] how debug a .c source that segfaults tcc during compi


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] how debug a .c source that segfaults tcc during compile?
Date: Sat, 23 Nov 2013 22:26:59 +0800
User-agent: KMail/4.11.3 (Linux/2.6.38-ac2-ac100; KDE/4.11.3; armv7l; ; )

Hi John,

Le vendredi 22 novembre 2013, 11:53:46 John Refling a écrit :
> I have a c program that works under gcc, but silently segfaults tcc during
> compile.
> 
> 
> 
> Are there some debugging options for tcc to see what is going on in order to
> fix my program?

I can't tell if your program is bug free but the segfault say more about tcc 
than about your program. Even if there was a bug, tcc shouldn't segfault when 
compiling your program. The only way a segfault in tcc can come from your 
program is if you are using the -run switch to "run the source of your 
program".

However, we would appreciate some help to debug what is the problem in tcc and 
fix it so that this does not happen. There is two things you can do to help.
The first one is to tell us what version of tcc gives this behavior. Is it the 
latest stable version (tcc 0.9.26) or some snapshot of the development branch. 
If it is with the stable version, please try with a fresh snapshot of the 
developement branch (see [0] for instructions).

Once done, the second thing would be to try to create a minimal test case. 
That is, try to remove as much as you can from your program while still having 
the bug. This is a trial and error process: remove some part of your program 
and see if the bug is still there. If yes continue, else undo the change and 
try to remove another part. Do this until anything you remove stop the bug 
from happening.

Note that if you can't do this second step are don't want to, the first one is 
already helpful and will save us some time.

[0] To have a fresh snapshot of the development branch of tcc, run a command 
git clone git://repo.or.cz/tinycc.git in an empty directory and then build tcc 
with the usual ./configure ; make ; make install commands.

Best regards,

Thomas



reply via email to

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