Skip to content

crash when logging tuple with bare strings #3109

Closed
@tedhorst

Description

@tedhorst

The following program compiles fine, but segfaults when run (as of a52f6d2):

fn main() {
    log(error, ("hi there!", "you"));
}

Backtrace is:

Thread 2 Crashed:: scheduler loop 0
0   librustrt.dylib                 0x00000001017643e0 shape::log::walk_string2(std::pair<shape::ptr, shape::ptr> const&) + 94 (rust_shape.cpp:384)
1   librustrt.dylib                 0x000000010176454e shape::log::walk_vec2(bool, std::pair<shape::ptr, shape::ptr> const&) + 48 (rust_shape.cpp:426)
2   librustrt.dylib                 0x000000010176789d shape::ctxt<shape::data<shape::log, shape::ptr> >::walk_slice0() + 143 (rust_shape.h:1198)
3   librustrt.dylib                 0x0000000101767ee1 shape::ctxt<shape::data<shape::log, shape::ptr> >::walk() + 1565 (rust_shape.h:318)
4   librustrt.dylib                 0x0000000101764b84 shape::log::walk_struct2(unsigned char const*) + 106 (rust_shape.cpp:416)
5   librustrt.dylib                 0x0000000101767d03 shape::ctxt<shape::data<shape::log, shape::ptr> >::walk() + 1087 (rust_shape.h:477)
6   librustrt.dylib                 0x0000000101764708 shape_log_type + 264 (rust_shape.cpp:530)
7   librustrt.dylib                 0x000000010176c936 __morestack + 9
8   librustrt.dylib                 0x000000010175c745 rust_task::call_on_c_stack(void*, void*) + 155 (rust_task.h:463)
9   librustrt.dylib                 0x000000010175d7df upcall_log_type + 159 (rust_upcall.cpp:35)
10  log_bare_str                    0x00000001011b7ca5 main::_908aa4b47b687ff::_00 + 133
11  log_bare_str                    0x00000001011b7cde _rust_main + 46
12  librustrt.dylib                 0x000000010175c355 task_start_wrapper(spawn_args*) + 37 (rust_task.cpp:155)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions