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

 
 

bug #41917: libtcc_test segfault when compiled with tcc

Submitter:  Domingo Alvarez Duarte <mingodad>
Submitted:  Fri 21 Mar 2014 01:27:20 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

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>

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

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

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

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

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16-2753.
    Corresponding source code