bugTiny C Compiler - Bugs: bug #56965, tcc 0.9.27 segfault when compiling...

 
 

bug #56965: tcc 0.9.27 segfault when compiling a trivial c program

Submitter:  Maarten <maartenbe>
Submitted:  Sun 29 Sep 2019 11:18:02 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
   

Tue 29 Nov 2022 07:52:11 PM UTC, comment #3: 

I can't reproduce anymore.

Anonymous
Tue 29 Nov 2022 06:36:32 PM UTC, comment #2: 

Please use:
git clone git://repo.or.cz/tinycc.git

Herman ten Brugge <hermantb>
Mon 30 Mar 2020 09:19:55 PM UTC, comment #1: 

can't reproduce on Windows 10, x86_64 with tcc 0.9.27(thanks to scoop)

Anonymous
Sun 29 Sep 2019 11:18:02 AM UTC, original submission:  

Source of trivial C program:
```
int main() {
return 0;
}
```

Output of configure:
```
CFLAGS=-g ./configure --prefix=$PWD/tt
Binary directory    /tmp/tcc-0.9.27/tt/bin
TinyCC directory    /tmp/tcc-0.9.27/tt/lib/tcc
Library directory   /tmp/tcc-0.9.27/tt/lib
Include directory   /tmp/tcc-0.9.27/tt/include
Manual directory    /tmp/tcc-0.9.27/tt/share/man
Info directory      /tmp/tcc-0.9.27/tt/share/info
Doc directory       /tmp/tcc-0.9.27/tt/share/doc
Source path         /tmp/tcc-0.9.27
C compiler          gcc (9.2)
Target OS           Linux
CPU                 x86_64
Creating config.mak and config.h
```

full backtrace:
```
#0  tcc_load_object_file (s1=0x467260, fd=3, file_offset=0) at tccelf.c:2462
        ehdr = {e_ident = "\177ELF\002\001\001\000\000\000\000\000\000\000\000", e_type = 1, e_machine = 62,
          e_version = 1, e_entry = 0, e_phoff = 0, e_shoff = 9120, e_flags = 0, e_ehsize = 64, e_phentsize = 0,
          e_phnum = 0, e_shentsize = 64, e_shnum = 69, e_shstrndx = 68}
        shdr = 0x46eb10
        sh = 0x46f6d0
        size = 192
        i = 47
        j = 26
        offset = 0
        offseti = 0
        nb_syms = 95
        sym_index = 0
        ret = 0
        seencompressed = 0
        strsec = 0x4702e0 ""
        strtab = 0x470dc0 ""
        old_to_new_syms = 0x0
        sh_name = 0x4702e9 ".strtab"
        name = 0x0
        sm_table = 0x46fc60
        sm = 0x0
        sym = 0x0
        symtab = 0x4704d0
        rel = 0x0
        s = 0x471dd0
        stab_index = 0
        stabstr_index = 0
#1  0x000000000040559f in tcc_add_file_internal (s1=0x467260, filename=0x7fffffffced0 "/usr/lib64/crt1.o", flags=64)
    at libtcc.c:1028
        ehdr = {e_ident = "\177ELF\002\001\001\000\000\000\000\000\000\000\000", e_type = 1, e_machine = 62,
          e_version = 1, e_entry = 0, e_phoff = 0, e_shoff = 9120, e_flags = 0, e_ehsize = 64, e_phentsize = 0,
          e_phnum = 0, e_shentsize = 64, e_shnum = 69, e_shstrndx = 68}
        fd = 3
        obj_type = 1
        ret = 3
#2  0x0000000000405831 in tcc_add_library_internal (s=0x467260, fmt=0x4337c7 "%s/%s", filename=0x433786 "crt1.o",
    flags=0, paths=0x46c650, nb_paths=1) at libtcc.c:1109
        buf = "/usr/lib64/crt1.o\000\377\377\377\177\000\000P$@\000\000\000\000\000p\324\377\377\377\177", '\000' <repeats 18 times>, "\027\026\376\367\377\177\000\000\001", '\000' <repeats 23 times>, "\220\241\311\367\377\177\000\000\340\322\377\377\377\177\000\000\016\202\376\367\377\177\000\000`rF\000\000\000\000\000 \305F\000\000\000\000\000x\324\377\377\377\177\000\000\000\000\000\000\000\000\000\000\376\"C\000\000\000\000\000\020\305F\000\000\000\000\000/main.c", '\000' <repeats 33 times>...
        i = 0
#3  0x00000000004058e3 in tcc_add_crt (s=0x467260, filename=0x433786 "crt1.o") at libtcc.c:1125
No locals.
#4  0x00000000004053fd in tcc_set_output_type (s=0x467260, output_type=2) at libtcc.c:978
No locals.
#5  0x0000000000403942 in main (argc0=2, argv0=0x7fffffffd478) at tcc.c:312
        s = 0x467260
        ret = 0
        opt = 0
        n = 1
        t = 0
        start_time = 0
        first_file = 0x402450 <_start> "\363\017\036\372\061\355I\211\321^H\211\342H\203\344\360PTI\307\300\360\003C"
        argc = 2
        argv = 0x7fffffffd478
        ppfp = 0x7ffff7e4f780 <_IO_2_1_stdout_>
```

Maarten <maartenbe>

 

(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 hermantb (Posted a comment)
  • -email is unavailable- added by maartenbe (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-d3ae.
    Corresponding source code