[Top][All Lists]

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

Re: [Tinycc-devel] multiple states in parallel?

From: Rob Landley
Subject: Re: [Tinycc-devel] multiple states in parallel?
Date: Tue, 15 May 2007 14:35:47 -0400
User-agent: KMail/1.9.1

On Tuesday 15 May 2007 1:42 pm, Rainer Machne wrote:
> Hi,
> I am currently trying to integrate TCC in our software. It so far works 
> great and we get very nice performance enhancements.
> These emails in your archive are related to my problem, I think:
> http://lists.gnu.org/archive/html/tinycc-devel/2005-10/msg00047.html
> http://lists.gnu.org/archive/html/tinycc-devel/2003-05/msg00003.html
> http://lists.gnu.org/archive/html/tinycc-devel/2005-06/msg00024.html
> I have to use multiple states (created with tcc_new) in my program, and 
> it works fine.
> Only when the states are freed (with tcc_delete), I get a segmentation 
> fault, with a glibc error messages, either "munmap_chunk(): invalid 
> pointer: ..." or " double free or corruption".

I've been seeing those even without multiple states.  I've recently started 
collecting bug demonstrations at http://landley.net/code/tinycc/bugs that I 
hope to understand the code well enough to fix someday.

I printed out a copy of tcc.c as it was when I started my tree, and in my 
copious free time (of which I have none), I've been reading through it line 
by line.  I've read about the first 20% and the last 5%, but that leaves most 
of it in the middle I'm still really vague about.  Plus the add-ons like the 
assembler and elf stuff and so on.

> As an example I included a second state in the libtcc_test.c program, 
> see attachment.

Um, never having used libtcc before, I tried editing the #include to not have 
a "../" in it, and then did this:

> address@hidden:~/tinycc/tinycc$ tcc -L. libtcc_test.c -ltcc1
> tcc: undefined symbol 'tcc_new'
> tcc: undefined symbol 'tcc_set_output_type'
> tcc: undefined symbol 'tcc_compile_string'
> tcc: undefined symbol 'tcc_add_symbol'
> tcc: undefined symbol 'tcc_relocate'
> tcc: undefined symbol 'tcc_get_symbol'
> tcc: undefined symbol 'tcc_delete'

I'm obviously doing something wrong, but I'm not sure what.  Could you give me 
a build sequence for this, please?

> I am using the tinycc-rl-1.0.0 branch in Fedora.

*blinks*  Ok. :)

> Are there any patches for this, yet? Should I use another version of TCC?

The mercurial branch of the above (http://landley.net/hg/tinycc) has several 
more fixes (and screwed up build dependencies so it recompiles the thing 
again during the "install" phase, I need to fix that...).  But none of the 
fixes have to do with memory allocation.

> Thanks,
> Rainer Machne


reply via email to

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