Skip to content

Misleading v_stable_sort appears in backtraces #27408

@gechandesu

Description

@gechandesu

Describe the bug

Running ./v -g -o vdbg cmd/v && ./vdbg 'foo.v' && 'foo' on foo.v produced a compiler error.

Reproduction Steps

./v -g -o vdbg cmd/v && ./vdbg 'foo.v' && 'foo'
fn main() {
	panic('aaaa')
}

Expected Behavior

Normal backtrace

Current Behavior

V panic: aaaa
 v hash: 3690f88
    pid: 0xae6b6
    tid: 0xae6b6
/tmp/v_1000/foo.01KTS896K8JKKAMCSZM3TQGYY9.tmp.c:854: at v_stable_sort: Backtrace
/tmp/v_1000/foo.01KTS896K8JKKAMCSZM3TQGYY9.tmp.c:854: by v_stable_sort
/tmp/v_1000/foo.01KTS896K8JKKAMCSZM3TQGYY9.tmp.c:854: by v_stable_sort
0x7fa15f827741: by ???
0x7fa15f827879: by ???
0x00604135: by ???

Possible Solution

No response

Additional Information/Context

Generated by v bug from foo.v.

V version

V 0.5.1 3690f88

Environment details (OS name and version, etc.)

|V full version      |V 0.5.1 2f3c0f1f397c08bfc5ef73e7ff62794471b2b811.3690f88
|:-------------------|:-------------------
|OS                  |linux, Linux version 7.0.11-arch1-1 (linux@archlinux) (gcc (GCC) 16.1.1 20260430, GNU ld (GNU Binutils) 2.46.0) #1 SMP PREEMPT_DYNAMIC Tue, 02 Jun 2026 18:26:58 +0000
|Processor           |16 cpus, 64bit, little endian, 12th Gen Intel(R) Core(TM) i5-1240P
|Memory              |5.22GB/15.34GB
|                    |
|V executable        |/home/ge/.vlang/v
|V last modified time|2026-06-10 13:35:52
|                    |
|V home dir          |OK, value: /home/ge/.vlang
|VMODULES            |OK, value: /home/ge/.vmodules
|VTMP                |OK, value: /tmp/v_1000
|Current working dir |OK, value: /tmp
|                    |
|Git version         |git version 2.54.0
|V git status        |weekly.2026.03-2253-g3690f882
|.git/config present |true
|                    |
|cc version          |cc (GCC) 16.1.1 20260430
|gcc version         |gcc (GCC) 16.1.1 20260430
|clang version       |clang version 22.1.6
|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.43

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

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions