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
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code