Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autofree crash with $dbg #23490

Open
Eliyaan opened this issue Jan 16, 2025 · 2 comments
Open

autofree crash with $dbg #23490

Eliyaan opened this issue Jan 16, 2025 · 2 comments
Labels
Autofree Bugs/feature requests, that are related to -autofree. Bug This tag is applied to issues which reports bugs.

Comments

@Eliyaan
Copy link
Contributor

Eliyaan commented Jan 16, 2025

Describe the bug

it crashes pretty fast because of a double free.

Reproduction Steps

import os
os.execute("cat bug.v")
$dbg

run with v -autofree run bug.v, wait for the break point, type a bit in the input and then it crashes.

Expected Behavior

It not to crash.

Current Behavior

❯ v -autofree  run bug.v
Break on [main] main in bug.v:6
free(): double free detected in tcache 2
0x7f78cd87a62c: at ???: RUNTIME ERROR: abort() called
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
0x7f78cd7ea0e0: by ???
�B}�az          ⏎      

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.9 6ac1d08.f9106a8

Environment details (OS name and version, etc.)

V full version V 0.4.9 6ac1d08.f9106a8
OS linux, "Void Linux"
Processor 4 cpus, 64bit, little endian, Intel(R) Pentium(R) Gold 7505 @ 2.00GHz
Memory 16.47GB/23.16GB
V executable /home/nopana/v/v
V last modified time 2025-01-16 19:06:29
V home dir OK, value: /home/nopana/v
VMODULES OK, value: /home/nopana/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: /home/nopana/projects/tests
Git version git version 2.47.1
V git status weekly.2025.1-67-gf9106a86
.git/config present true
cc version cc (GCC) 13.2.0
gcc version gcc (GCC) 13.2.0
clang version N/A
tcc version tcc version 0.9.28rc 2024-07-31 HEAD@1cee0908 (x86_64 Linux)
tcc git status thirdparty-linux-amd64 0134e9b9
emcc version N/A
glibc version ldd (GNU libc) 2.39

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@Eliyaan Eliyaan added the Bug This tag is applied to issues which reports bugs. label Jan 16, 2025
@felipensp
Copy link
Member

/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:5845: by _v_free
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:7676: by string_free
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:9767: by readline__Readline_refresh_line
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:9851: by readline__Readline_commit_line
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:9591: by readline__Readline_execute
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:9344: by readline__Readline_read_line_utf8
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:9363: by readline__Readline_read_line
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:10130: by v__debug__Debugger_read_line
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:10251: by v__debug__Debugger_interact
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:10414: by main__main
/tmp/v_1000/bug.01JHSW9VDH3ABKD8NMBQ6NSCAF.tmp.c:10476: by main

@felipensp felipensp added the Autofree Bugs/feature requests, that are related to -autofree. label Jan 17, 2025
Copy link

Connected to Huly®: V_0.6-21919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Autofree Bugs/feature requests, that are related to -autofree. Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

2 participants