bugTiny C Compiler - Bugs: bug #41917, libtcc_test segfault when compiled...


bug #41917: libtcc_test segfault when compiled with tcc

Submitted by:  Domingo Alvarez Duarte <mingodad>
Submitted on:  Fri 21 Mar 2014 01:27:20 AM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 21 Mar 2014 01:27:20 AM UTC, original submission:

Hello !

I'm using linux ubuntu 12.04 X86_64.

Testing my virtual io with tcc I found that the libtcc_test when compiled with tcc segfault if lib_path is not given.

tcc -o libtcc_test libtcc_test.c -L.. -ltcc -ldl
./libtcc_test lib_path=.. <<< here ok
./libtcc_test <<< here segfault

But when compiled with gcc
./libtcc_test <<< here ok

I followed the error and it happens on error1 function, when try to access stderr, probably memory corrupted and the error happen here by side effect:

if (!s1->error_func) {
/* default case: stderr */
fprintf(stderr, "%s\n", buf); <<<< when try to access stderr
} else {
s1->error_func(s1->error_opaque, buf);

Domingo Alvarez Duarte <mingodad>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mingodad (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    No Changes Have Been Made to This Item

    Back to the top

    Powered by Savane 3.1-cleanup1