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

compiler memory leak analyzing ZIR instruction for @extern builtin #12378

Open
andrewrk opened this issue Aug 8, 2022 · 0 comments
Open

compiler memory leak analyzing ZIR instruction for @extern builtin #12378

andrewrk opened this issue Aug 8, 2022 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Aug 8, 2022

Zig Version: 0.10.0-dev.3483+c6ad6e62f

$ stage2/bin/zig build -p stage3 -Denable-llvm -Dskip-install-lib-files -Dforce-gpa
$ stage3/bin/zig build-exe ../test/standalone/cat/main.zig 
error(gpa): memory address 0x7f09e34c50d0 leaked: 
/home/andy/dev/zig/lib/std/mem/Allocator.zig:517:40: 0x300c7e2 in dupeZ__anon_7207 (zig)
    const new_buf = try allocator.alloc(T, m.len + 1);
                                       ^
/home/andy/dev/zig/src/Sema.zig:19694:39: 0x376d1b5 in zirBuiltinExtern (zig)
    new_decl.name = try sema.gpa.dupeZ(u8, options.name);
                                      ^
/home/andy/dev/zig/src/Sema.zig:934:72: 0x3596696 in analyzeBodyInner (zig)
                    .builtin_extern        => try sema.zirBuiltinExtern(     block, extended),
                                                                       ^
/home/andy/dev/zig/src/Sema.zig:603:30: 0x358b69b in analyzeBody (zig)
    _ = sema.analyzeBodyInner(block, body) catch |err| switch (err) {
                             ^
@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness. labels Aug 8, 2022
@andrewrk andrewrk added this to the 0.11.0 milestone Aug 8, 2022
@andrewrk andrewrk modified the milestones: 0.11.0, 0.12.0 Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

No branches or pull requests

1 participant