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

Create-exe with Serialized object fail #3481

Closed
ptitSeb opened this issue Jan 16, 2023 · 1 comment · Fixed by #3496
Closed

Create-exe with Serialized object fail #3481

ptitSeb opened this issue Jan 16, 2023 · 1 comment · Fixed by #3496
Assignees
Labels
priority-high High priority issue
Milestone

Comments

@ptitSeb
Copy link
Contributor

ptitSeb commented Jan 16, 2023

Describe the bug

CI tests create_exe_serialized_works and create_exe_with_object_input_serialized have been disable because they are not working.

The generated EXE is somehow incorect, and just segfault during some Rust's Stdlib initialization.

Isolating a binary and running it with gdb gives this output:

─── Output/messages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7d1eff3 in __GI_getenv (name=0x16b0810 "RUST_BACKTRACE") at ./stdlib/getenv.c:51
51      ./stdlib/getenv.c: No such file or directory.
─── Assembly ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 0x00007ffff7d1efe1  __GI_getenv+33 movzbl (%rdi),%eax
 0x00007ffff7d1efe4  __GI_getenv+36 mov    %rdi,%r13
 0x00007ffff7d1efe7  __GI_getenv+39 test   %al,%al
 0x00007ffff7d1efe9  __GI_getenv+41 je     0x7ffff7d1f088 <__GI_getenv+200>
 0x00007ffff7d1efef  __GI_getenv+47 cmpb   $0x0,0x1(%rdi)
 0x00007ffff7d1eff3  __GI_getenv+51 mov    0x0(%rbp),%rbx
 0x00007ffff7d1eff7  __GI_getenv+55 jne    0x7ffff7d1f030 <__GI_getenv+112>
 0x00007ffff7d1eff9  __GI_getenv+57 or     $0x3d,%ah
 0x00007ffff7d1effc  __GI_getenv+60 test   %rbx,%rbx
 0x00007ffff7d1efff  __GI_getenv+63 jne    0x7ffff7d1f015 <__GI_getenv+85>
─── Breakpoints ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── Expressions ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── History ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── Memory ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── Registers ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    rax 0x0000000000000052    rbx 0x0000000000000000    rcx 0x0000000000000001    rdx 0x000000000000000f    rsi 0x000000000000000f       rdi 0x00000000016b0810    rbp 0x00000000016d1000    rsp 0x00007fffffffb440    r8 0x00007ffff7eb2c60    r9 0x0000000000000000    r10 0x0000000000000022    r11 0x0000000000000020
    r12 0x0000000000000001    r13 0x00000000016b0810    r14 0x00007fffffffb4e8    r15 0x00007fffffffb680    rip 0x00007ffff7d1eff3    eflags [ PF IF RF ]           cs 0x00000033             ss 0x0000002b            ds 0x00000000            es 0x00000000             fs 0x00000000             gs 0x00000000
─── Source ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Cannot display "getenv.c"
─── Stack ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[0] from 0x00007ffff7d1eff3 in __GI_getenv+51 at ./stdlib/getenv.c:51
[1] from 0x000000000038ec50 in std::sys::unix::os::getenv+141 at library/std/src/sys/unix/os.rs:552
[2] from 0x000000000038ec50 in std::env::_var_os+160 at library/std/src/env.rs:273
[3] from 0x000000000039548f in std::env::var_os<&str>+23 at library/std/src/env.rs:269
[4] from 0x000000000039548f in std::panic::get_backtrace_style+63 at library/std/src/panic.rs:303
[5] from 0x0000000000399226 in std::panicking::default_hook+54 at library/std/src/panicking.rs:269
[6] from 0x0000000000399d36 in std::panicking::rust_panic_with_hook+246 at library/std/src/panicking.rs:698
[7] from 0x0000000000399be9 in std::panicking::begin_panic_handler::{closure#0}+121 at library/std/src/panicking.rs:586
[8] from 0x0000000000398454 in std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::{closure_env#0}, !>+20 at library/std/src/sys_common/backtrace.rs:138
[9] from 0x0000000000399959 in std::panicking::begin_panic_handler+73 at library/std/src/panicking.rs:584
[+]
─── Threads ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[1] id 2683 name wasm.out from 0x00007ffff7d1eff3 in __GI_getenv+51 at ./stdlib/getenv.c:51
─── Variables ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
arg name = 0x16b0810 "RUST_BACKTRACE": 82 'R'
loc ep = <optimized out>, name_start = <optimized out>
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
>>> x/x $rbp
0x16d1000:      Cannot access memory at address 0x16d1000
>>> q
```
@ptitSeb ptitSeb added this to the v3.2 milestone Jan 16, 2023
@theduke
Copy link
Contributor

theduke commented Jan 16, 2023

Tests disabled in #3480

@ptitSeb ptitSeb added the priority-high High priority issue label Jan 17, 2023
fschutt added a commit that referenced this issue Jan 17, 2023
fschutt added a commit that referenced this issue Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-high High priority issue
Projects
None yet
3 participants