MarcelGarus / MarcelGarus/c1c

c1c crashes with error "free(): invalid next size (fast): 0x00007fffd618e7d0"

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I tried compiling the test.c1 program from the repository and c1c crashed with the following backtrace:

*** Error in `./c1c': free(): invalid next size (fast): 0x00007fffd618e7d0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7f943d8d0bfb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7f943d8d6fc6]
/lib/x86_64-linux-gnu/libc.so.6(+0x7780e)[0x7f943d8d780e]
./c1c(+0x122e)[0x7f943e00122e]
./c1c(+0xfc6)[0x7f943e000fc6]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f943d8802e1]
./c1c(+0xaba)[0x7f943e000aba]
======= Memory map: ========
7f9438000000-7f9438021000 rw-p 00000000 00:00 0
7f9438021000-7f943c000000 ---p 00000000 00:00 0
7f943d640000-7f943d656000 r-xp 00000000 00:00 534852             /lib/x86_64-linux-gnu/libgcc_s.so.1
7f943d656000-7f943d657000 ---p 00016000 00:00 534852             /lib/x86_64-linux-gnu/libgcc_s.so.1
7f943d657000-7f943d855000 ---p 00000017 00:00 534852             /lib/x86_64-linux-gnu/libgcc_s.so.1
7f943d855000-7f943d856000 r--p 00015000 00:00 534852             /lib/x86_64-linux-gnu/libgcc_s.so.1
7f943d856000-7f943d857000 rw-p 00016000 00:00 534852             /lib/x86_64-linux-gnu/libgcc_s.so.1
7f943d860000-7f943d9f5000 r-xp 00000000 00:00 534827             /lib/x86_64-linux-gnu/libc-2.24.so
7f943d9f5000-7f943d9fd000 ---p 00195000 00:00 534827             /lib/x86_64-linux-gnu/libc-2.24.so
7f943d9fd000-7f943dbf5000 ---p 0000019d 00:00 534827             /lib/x86_64-linux-gnu/libc-2.24.so
7f943dbf5000-7f943dbf9000 r--p 00195000 00:00 534827             /lib/x86_64-linux-gnu/libc-2.24.so
7f943dbf9000-7f943dbfb000 rw-p 00199000 00:00 534827             /lib/x86_64-linux-gnu/libc-2.24.so
7f943dbfb000-7f943dbff000 rw-p 00000000 00:00 0
7f943dc00000-7f943dc22000 r-xp 00000000 00:00 534805             /lib/x86_64-linux-gnu/ld-2.24.so
7f943dc22000-7f943dc23000 r-xp 00022000 00:00 534805             /lib/x86_64-linux-gnu/ld-2.24.so
7f943de23000-7f943de24000 r--p 00023000 00:00 534805             /lib/x86_64-linux-gnu/ld-2.24.so
7f943de24000-7f943de25000 rw-p 00024000 00:00 534805             /lib/x86_64-linux-gnu/ld-2.24.so
7f943de25000-7f943de26000 rw-p 00000000 00:00 0
7f943df00000-7f943df02000 rw-p 00000000 00:00 0
7f943df10000-7f943df11000 rw-p 00000000 00:00 0
7f943df20000-7f943df23000 rw-p 00000000 00:00 0
7f943e000000-7f943e001000 r-xp 00000000 00:00 1446759            /home/clemens/c1c/c1c
7f943e001000-7f943e002000 r-xp 00001000 00:00 1446759            /home/clemens/c1c/c1c
7f943e201000-7f943e202000 r--p 00001000 00:00 1446759            /home/clemens/c1c/c1c
7f943e202000-7f943e203000 rw-p 00002000 00:00 1446759            /home/clemens/c1c/c1c
7fffd618e000-7fffd61af000 rw-p 00000000 00:00 0                  [heap]
7fffdccbd000-7fffdd4bd000 rw-p 00000000 00:00 0                  [stack]
7fffdda28000-7fffdda29000 r-xp 00000000 00:00 0                  [vdso]
Aborted (core dumped)

I am using GCC 6.3.0 on WSL (Debian).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the crash by compiling test.c1 with c1c in the reported GCC 6.3.0 Debian-on-WSL environment. Start from the provided backtrace and use a debugger or memory checker to locate the invalid free. Done means test.c1 compiles without the allocator abort and the regression is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.