musl: embedded prealloc cross-snapshot fails on conflicting execinfo.h backtrace_symbols prototypes
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
Research direction
Start with the failing fixture in vlib/v/embed_file/tests/embed_file_cross_snapshot_test.v (test_cross_snapshot_runs_under_prealloc) and the C extern declarations for backtrace_symbols and backtrace_symbols_fd in vlib/builtin/builtin_backtraces_nix.c.v, then compare them with the included execinfo.h in the generated prog.c. Reproduce under the musl compiler setting with the generated C kept, and check vlib/v/gen/c/preamble_test.v for the expected signature. Done means the original fixture passes with no suppressed compiler errors, and a regression covers both system-header and headerless modes.
Written by the indexing model from the issue text.
Description
Executed master failure (not merely workflow status)
- Master revision:
d8083d40873efc7689abdb15f4ca21b4f5d59f4a. - Ubuntu musl: https://github.com/vlang/v/actions/runs/44918531732/job/136897140641 (completed 2026-11-21 17:08:56 UTC, after 1,435 vlib tests passed, 753 skipped, one executed failure).
- Failing fixture:
vlib/v/embed_file/tests/embed_file_cross_snapshot_test.v:472,test_cross_snapshot_runs_under_prealloc. Its nestedcc -std=gnu11 -w -o prog prog.c -lm -lpthreadexits 1 before the executable can run. This is a C prototype/ABI diagnostic, not a harness deadline, failed intentional fixture, or missing X11.
Exact compiler diagnostic
The generated prog.c includes /usr/include/execinfo.h (at line 3318) and then emits at lines 6517/6519:
char** backtrace_symbols(void** const_buffer, i32 size);
void backtrace_symbols_fd(void** const_buffer, i32 size, i32 fd);
The C system header declares char **backtrace_symbols(void *const *, int) and void backtrace_symbols_fd(void *const *, int, int). The void ** / void *const * difference is a function prototype conflict; adding -w does not suppress it.
Personally executed C-only discriminator with GCC 14 and #include <execinfo.h>: old generated-style prototypes fail gcc -std=gnu11 -fsyntax-only exit 1 with both conflicting type errors; accurate void *const * prototypes pass exit 0. This is not V compiler/native musl validation.
Source and applicability
vlib/builtin/builtin_backtraces_nix.c.v declares:
fn C.backtrace_symbols(a &voidptr, size i32) &&char
fn C.backtrace_symbols_fd(a &voidptr, size i32, fd i32)
That file's blob is c1844a136c64c87e43c5e115eaa64e304f7d7786 on both failing d808 and current master 1d8ff20033be7c4b39b2df9e4cd3a9900843efba. The V bindings' generated declarations disagree with the included native execinfo.h. Existing Cgen preamble test vlib/v/gen/c/preamble_test.v expects the correct void* const* signature in the target-libc preamble, so investigate duplicate V binding prototype generation and native-header ownership, not merely the libc preamble text. Related historic work: #32542 changes backtrace output but does not validate this nested musl fixture; #14250 supplies weak musl symbols, not a fix for conflicting prototypes.
Focused repair / validation next
- Under
-cc musl-gcc -gc none -d use_bundled_libgc, reproduce the originalembed_file_cross_snapshot_test.v, preserving-prealloc, 3 assertions and the snapshot's payload checksum. Keep generatedprog.cwith-keepc/-cg(or the test helper output). - Fix the actual C prototype/header ownership so there is no incompatible redeclaration when
<execinfo.h>is present. Preserve proper headerless declarations and native platform signatures on Linux/glibc, musl, macOS, and BSD rather than dropping necessary symbols globally. - Add a native V regression for both system-header and headerless modes and test original musl embed cross-snapshot plus
./v self, format, focused builtin/preamble tests, and the original failing integration. Do not skip the test or suppress compiler errors.
Status: unresolved / still applicable. Exact hosted descendant regression and local V toolchain unavailable in this investigation; no repair or green claim yet.
[!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.
- Dominant language
- V
- Stars
- 38.1k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 682
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vlang/v
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sagemathinc/sagebrush#1683 ·
Maintainers usually reply within 1 day
-
bot-triaged module: aotinductor module: compile-time module: inductor module: performance module: rocm oncall: export oncall: pt2 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
baseballyama/rsvelte#5235 ·
Maintainers usually reply within 1 day
-
lang-core: member access on a component instance reads its internal fields instead of giving nullOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midspiral/LemmaScript#355 · 1 comment ·
Maintainers usually reply within 1 day