Skip to content

SIGBUS in codegen while generating comptime value #8320

Open
@mattnite

Description

@mattnite

I'm using okredis and I'm getting SIGBUS due to the following code:

    const reply = try client.trans(struct {
        id: void,
        user: void,
    }, .{
        .{ "SET", keys.id, username },
        HSET.init(keys.user, &[_]FV{
            .{ .field = "id", .value = id },
            .{ .field = "email", .value = username },
        }),
    });

if I comment out this piece of code we're fine:

    const reply = try client.trans(struct {
        id: void,
        user: void,
    }, .{
        .{ "SET", keys.id, username },
        //HSET.init(keys.user, &[_]FV{
        //    .{ .field = "id", .value = id },
        //    .{ .field = "email", .value = username },
        //}),
    });

here is where the okredis code is.

and here is the backtrace I get:

Code Generation [817/2399] .okredis.serializer.CommandSerializer.serializeCommand...... 
Thread 1 "zig" received signal SIGBUS, Bus error.
[Switching to LWP 14557]
0x000000000285430d in gen_const_val(CodeGen*, ZigValue*, char const*) ()
(gdb) bt
#0  0x000000000285430d in gen_const_val(CodeGen*, ZigValue*, char const*) ()
#1  0x0000000002855323 in gen_const_val_ptr(CodeGen*, ZigValue*, char const*) ()
#2  0x000000000284a7e1 in ir_llvm_value(CodeGen*, IrInstGen*) ()
#3  0x000000000285c524 in ir_render_instruction(CodeGen*, IrExecutableGen*, IrInstGen*) ()
#4  0x00000000028503f6 in do_code_gen(CodeGen*) ()
#5  0x000000000284c2ae in codegen_build_object(CodeGen*) ()
#6  0x0000000002843f7e in zig_stage1_build_object ()
#7  0x00000000025d5b81 in Compilation.performAllTheWork ()
#8  0x00007ffff7f8a428 in ?? ()
#9  0x0000000000000000 in ?? ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorstage1The process of building from source via WebAssembly and the C backend.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions