Skip to content

Runtime memory access error I can't explain #26293

@einar-hjortdal

Description

@einar-hjortdal

Describe the bug

When running this test, this line causes no issue, but this line causes a runtime memory access error. I believe this is a compiler bug.

Reproduction Steps

  1. clone
  2. git checkout c8db48b55eae20f3c9308ea70dc42127cba45780
  3. v run peony_test.v

Expected Behavior

Both println should output the same string

Current Behavior

second println causes runtime memory access error

Possible Solution

No response

Additional Information/Context

Looks like this bug causes the database to receive bad parameters too: instead of returning the expected result of 1, it returns 0. That is because it doesn't receive the string provided but something else, however I can't output what that something else is, because of the memory bounds violation.

V version

V 0.5.0 cab281f

Environment details (OS name and version, etc.)

V full version V 0.5.0 e3b915d.cab281f
OS linux, "openmamba release 2025.12.1 for x86_64 (rolling)"
Processor 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
Memory 10.07GB/31.16GB
V executable /home/einar/.local/lib64/v/v
V last modified time 2026-01-08 14:54:14
V home dir OK, value: /home/einar/.local/lib64/v
VMODULES OK, value: /home/einar/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: /home/einar/Documents/projects/vlang/active/peony
Git version git version 2.52.0
V git status weekly.2025.38-682-gcab281ff
.git/config present true
cc version cc (GCC) 15.2.1 20251019
gcc version gcc (GCC) 15.2.1 20251019
clang version N/A
tcc version tcc version 0.9.28rc 2025-02-13 HEAD@f8bd136d (x86_64 Linux)
tcc git status thirdparty-linux-amd64 696c1d84
emcc version N/A
glibc version ldd (GNU libc) 2.42

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.

Metadata

Metadata

Assignees

Labels

BugThis tag is applied to issues which reports bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions