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

NVS and compiler_builtins collision #4

Closed
lexxvir opened this issue Aug 2, 2019 · 13 comments
Closed

NVS and compiler_builtins collision #4

lexxvir opened this issue Aug 2, 2019 · 13 comments

Comments

@lexxvir
Copy link

lexxvir commented Aug 2, 2019

Hi @MabezDev,

It is not issue of your fork, but I just want to publish my experience with NVS (Non Volatile Storage of ESP32). I think we could track it here.

ESP IDF has such component as NVS. It is key-value storage built upon flash. Any action with NVS translates to flash interactions. Because application runs also from flash, IDF internally use some locks, to prevent flash interaction until NVS operation is done. Also, NVS uses some low level functions such memcpy. Such functions in IDF marked as IRAM, so they are placed in the Internal RAM, not in flash. So, locks and IRAM functions allows NVS does things while application runs from flash.

When we compiling rust application, rust compiler implicitly add libcompiler_builtins library to the linker parameters. libcompiler_builtins also contains low level functions such as memcpy, but these functions don't marked as IRAM. Because libcompiler_builtins appears first in linker arguments, linker uses memcpy from libcompiler_builtins instead of right version from Espressif's libc.

This issue appears as Guru Meditation Error: Core N panic'ed (IllegalInstruction) when you try to call nvs_flash_init() from IDF. Unfortunately, NVS is required for normal work of builtin WiFI, it is too hard to use WiFi without NVS.

@pacmancoder
Copy link

@lexxvir I think I found some temporary solution:

If you are targeting your rust code as static library, it can be processed with objdump to rename all conflicting symbols:

Here what I have done for my esp8266 project:

xtensa-lx106-elf-objcopy \
        --redefine-syms=symbol_renaming.map \
        firmware/target/xtensa-esp8266-none-elf/release/libfirmware.a

Where libfirmware.a is my resulting static library, which I link inside IDF shim project.

symbol_renaming.map has the following contents:

__ledf2 __rust__ledf2
__gedf2 __rust__gedf2
__unorddf2 __rust__unorddf2
__eqdf2 __rust__eqdf2
__ltdf2 __rust__ltdf2
__nedf2 __rust__nedf2
__gtdf2 __rust__gtdf2
__modsi3 __rust__modsi3

Example project can be found at (currently at rust-migration branch):
https://github.com/pacmancoder/shelter-unicorn/tree/migration-rust

But still, it is a pretty questionable workaround 😄

@lexxvir
Copy link
Author

lexxvir commented Aug 11, 2019

Hi @pacmancoder,

Thank you for share you workaround!

Unfortunately, I do not embedded Rust static library into C code, contrarily I compile regular Rust crate (lib/bin) that uses C code internally (IDF and couple of existing libraries). So I have not stage where I can remap symbol names.

Currently I use dumb workaround. I redefined linker used by the Rust compiler (through .cargo/config) to shell script. The script cuts libcompiler_builtin.a out from the linker command line parameters and calls real linker (g++). So far I have not issues with such solution, but I admit it is ugly hack.

@kekcheburec
Copy link

Hi @lexxvir
I think it depends on your work environment. I have not found this problem. compiler_builtins works fine by default.
I know that because of printf different errors may appear (I still do not quite understand why).
I use this code for output:

extern "C"{
    pub fn write(fd: i32, buf: *const core::ffi::c_void, count: u32) -> u32;
}

#[inline]
fn libc_println(handle: u32, msg: &str){
    unsafe {
        write(
            handle as i32,
            msg.as_ptr() as *const core::ffi::c_void,
            msg.len() as u32,
        );
    }
}

@lexxvir
Copy link
Author

lexxvir commented Aug 13, 2019

Hi @RomanSamusevich,

Do you use NVS? This issue appears only when you call NVS related function from IDF.

@kekcheburec
Copy link

kekcheburec commented Aug 13, 2019

Hi @lexxvir
All nvs functions (nvs.h, nvs_flash.h) work for me (wifi has not tested yet). I use the latest MabezDev / rust-xtensa, compiler-builtins 0.1.19 (standard unchanged). I use cargo xbuild for assembly.
it `s Magic.
I work with him very carefully, it may fall due to the lack of / 0 at the end. Or, as I wrote above, printf can cause various errors when working with nvs.

@lexxvir
Copy link
Author

lexxvir commented Aug 31, 2019

@romevich

Could please dump linker arguments when you linking your crate ?

@kekcheburec
Copy link

@lexxvir

cargo config

[build]
target = "xtensa-esp32-none-elf"

[target.xtensa-esp32-none-elf]
rustflags = [
  "-C", "save-temps",
  "-C", "link-arg=-nostartfiles",
  "-C", "target-cpu=esp32",
  "-C", "link-arg=-nostdlib",
  "-C", "link-arg=-ucall_user_start_cpu0",
  "-C", "link-arg=-Wl,--gc-sections",
  "-C", "link-arg=-Wl,-static",
  "-C", "link-arg=-Wl,--start-group",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/app_trace",
  "-C", "link-arg=-lapp_trace",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/app_update",
  "-C", "link-arg=-lapp_update",
  "-C", "link-arg=-uesp_app_desc",
  #"-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/asio",
  #"-C", "link-arg=-lasio",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/bootloader_support",
  "-C", "link-arg=-lbootloader_support",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/bt",
  "-C", "link-arg=-lbt",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/coap",
  "-C", "link-arg=-lcoap",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/console",
  "-C", "link-arg=-lconsole",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/driver",
  "-C", "link-arg=-ldriver",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/efuse",
  "-C", "link-arg=-lefuse",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp-tls",
  "-C", "link-arg=-lesp-tls",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp32",
  "-C", "link-arg=-lesp32",
  "-C", "link-arg=-L/home/roman/Experimental/esp/esp-idf/components/esp32/ld",
  "-C", "link-arg=-Tesp32_out.ld",
  "-C", "link-arg=-uld_include_panic_highint_hdl",
  "-C", "link-arg=-T/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp32/esp32.project.ld",
  "-C", "link-arg=-Tesp32.peripherals.ld",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_adc_cal",
  "-C", "link-arg=-lesp_adc_cal",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_common",
  "-C", "link-arg=-lesp_common",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_eth",
  "-C", "link-arg=-lesp_eth",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_event",
  "-C", "link-arg=-lesp_event",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_gdbstub",
  "-C", "link-arg=-lesp_gdbstub",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_http_client",
  "-C", "link-arg=-lesp_http_client",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_http_server",
  "-C", "link-arg=-lesp_http_server",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_https_ota",
  "-C", "link-arg=-lesp_https_ota",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_local_ctrl",
  "-C", "link-arg=-lesp_local_ctrl",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_ringbuf",
  "-C", "link-arg=-lesp_ringbuf",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_rom",
  "-C", "link-arg=-lesp_rom",
  "-C", "link-arg=-L/home/roman/Experimental/esp/esp-idf/components/esp_rom/esp32/ld",
  "-C", "link-arg=-Tesp32.rom.ld",
  "-C", "link-arg=-Tesp32.rom.libgcc.ld",
  "-C", "link-arg=-Tesp32.rom.syscalls.ld",
  "-C", "link-arg=-Tesp32.rom.newlib-data.ld",
  "-C", "link-arg=-Tesp32.rom.newlib-funcs.ld",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_websocket_client",
  "-C", "link-arg=-lesp_websocket_client",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_wifi",
  "-C", "link-arg=-lesp_wifi",
  "-C", "link-arg=-L/home/roman/Experimental/esp/esp-idf/components/esp_wifi/lib_esp32",
  "-C", "link-arg=-lcore",
  "-C", "link-arg=-lrtc",
  "-C", "link-arg=-lnet80211",
  "-C", "link-arg=-lpp",
  "-C", "link-arg=-lsmartconfig",
  "-C", "link-arg=-lcoexist",
  "-C", "link-arg=-lespnow",
  "-C", "link-arg=-lphy",
  "-C", "link-arg=-lmesh",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/espcoredump",
  "-C", "link-arg=-lespcoredump",
  #"-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/expat",
  #"-C", "link-arg=-lexpat",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/fatfs",
  "-C", "link-arg=-lfatfs",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/freemodbus",
  "-C", "link-arg=-lfreemodbus",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/freertos",
  "-C", "link-arg=-lfreertos",
  "-C", "link-arg=-Wl,--undefined=uxTopUsedPriority",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/heap",
  "-C", "link-arg=-lheap",
  #"-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/idf_test",
  #"-C", "link-arg=-lidf_test",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/jsmn",
  "-C", "link-arg=-ljsmn",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/json",
  "-C", "link-arg=-ljson",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/libsodium",
  "-C", "link-arg=-llibsodium",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/log",
  "-C", "link-arg=-llog",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/lwip",
  "-C", "link-arg=-llwip",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/main",
  "-C", "link-arg=-lmain",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/mbedtls",
  "-C", "link-arg=-lmbedtls",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/mdns",
  "-C", "link-arg=-lmdns",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/mqtt",
  "-C", "link-arg=-lmqtt",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/newlib",
  "-C", "link-arg=-lnewlib",
  "-C", "link-arg=-lc",
  "-C", "link-arg=-lm",
  "-C", "link-arg=-unewlib_include_locks_impl",
  "-C", "link-arg=-unewlib_include_heap_impl",
  "-C", "link-arg=-unewlib_include_syscalls_impl",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/nghttp",
  "-C", "link-arg=-lnghttp",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/nvs_flash",
  "-C", "link-arg=-lnvs_flash",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/openssl",
  "-C", "link-arg=-lopenssl",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/protobuf-c",
  "-C", "link-arg=-lprotobuf-c",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/protocomm",
  "-C", "link-arg=-lprotocomm",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/pthread",
  "-C", "link-arg=-lpthread",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/sdmmc",
  "-C", "link-arg=-lsdmmc",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/smartconfig_ack",
  "-C", "link-arg=-lsmartconfig_ack",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/soc",
  "-C", "link-arg=-lsoc",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/spi_flash",
  "-C", "link-arg=-lspi_flash",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/spiffs",
  "-C", "link-arg=-lspiffs",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/tcp_transport",
  "-C", "link-arg=-ltcp_transport",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/tcpip_adapter",
  "-C", "link-arg=-ltcpip_adapter",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/ulp",
  "-C", "link-arg=-lulp",
  #"-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/unity",
  #"-C", "link-arg=-lunity",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/vfs",
  "-C", "link-arg=-lvfs",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/wear_levelling",
  "-C", "link-arg=-lwear_levelling",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/wifi_provisioning",
  "-C", "link-arg=-lwifi_provisioning",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/wpa_supplicant",
  "-C", "link-arg=-lwpa_supplicant",
  "-C", "link-arg=-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/xtensa",
  "-C", "link-arg=-lxtensa",
  "-C", "link-arg=/home/roman/Experimental/esp/esp-idf/components/xtensa/esp32/libhal.a",
  "-C", "link-arg=-lgcc",
  "-C", "link-arg=-lstdc++",
  "-C", "link-arg=-lgcov",
  "-C", "link-arg=-Wl,--end-group",
  "-C", "link-arg=-Wl,-EL",
]

@lexxvir
Copy link
Author

lexxvir commented Sep 4, 2019

@romevich Sorry, I mean arguments that actually passed to the linker, not those you have configured.

Most easiest way to get all arguments it is define somewhere non existed function and call it:

#![no_std]
#![no_main]

use core::panic::PanicInfo;

extern "C" {
    fn non_exist_func();
}

#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
    loop {}
}

#[no_mangle]
unsafe fn app_main() {
    non_exist_func();
}

So you should get linker error with full command line arguments (explicit and implicit ones).

Or you can redefine linker in .cargo/config to shell script and just dump passed arguments to file.

@kekcheburec
Copy link

@lexxvir

error: linking with `xtensa-esp32-elf-gcc` failed: exit code: 1
  |
  = note: "xtensa-esp32-elf-gcc" "-L" "/home/roman/Experimental/rust/rust1/rust_test/blink/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib" "/home/roman/Experimental/rust/rust1/rust_test/blink/target/xtensa-esp32-none-elf/release/deps/blink-6db9f1d396fe6254.blink.cnqv2jox-cgu.0.rcgu.o" "-o" "/home/roman/Experimental/rust/rust1/rust_test/blink/target/xtensa-esp32-none-elf/release/deps/blink-6db9f1d396fe6254" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/home/roman/Experimental/rust/rust1/rust_test/blink/target/xtensa-esp32-none-elf/release/deps" "-L" "/home/roman/Experimental/rust/rust1/rust_test/blink/target/release/deps" "-L" "/home/roman/Experimental/rust/rust1/rust_test/blink/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib" "-Wl,-Bstatic" "/home/roman/Experimental/rust/rust1/rust_test/blink/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib/librustc_std_workspace_core-f651658f9c3c2a0a.rlib" "/home/roman/Experimental/rust/rust1/rust_test/blink/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib/libcore-f79f47342aa3c2d5.rlib" "/home/roman/Experimental/rust/rust1/rust_test/blink/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib/libcompiler_builtins-0686d155b28882ab.rlib" "-nostartfiles" "-nostdlib" "-ucall_user_start_cpu0" "-Wl,--gc-sections" "-Wl,-static" "-Wl,--start-group" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/app_trace" "-lapp_trace" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/app_update" "-lapp_update" "-uesp_app_desc" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/bootloader_support" "-lbootloader_support" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/bt" "-lbt" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/coap" "-lcoap" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/console" "-lconsole" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/driver" "-ldriver" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/efuse" "-lefuse" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp-tls" "-lesp-tls" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp32" "-lesp32" "-L/home/roman/Experimental/esp/esp-idf/components/esp32/ld" "-Tesp32_out.ld" "-uld_include_panic_highint_hdl" "-T/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp32/esp32.project.ld" "-Tesp32.peripherals.ld" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_adc_cal" "-lesp_adc_cal" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_common" "-lesp_common" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_eth" "-lesp_eth" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_event" "-lesp_event" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_gdbstub" "-lesp_gdbstub" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_http_client" "-lesp_http_client" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_http_server" "-lesp_http_server" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_https_ota" "-lesp_https_ota" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_local_ctrl" "-lesp_local_ctrl" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_ringbuf" "-lesp_ringbuf" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_rom" "-lesp_rom" "-L/home/roman/Experimental/esp/esp-idf/components/esp_rom/esp32/ld" "-Tesp32.rom.ld" "-Tesp32.rom.libgcc.ld" "-Tesp32.rom.syscalls.ld" "-Tesp32.rom.newlib-data.ld" "-Tesp32.rom.newlib-funcs.ld" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_websocket_client" "-lesp_websocket_client" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/esp_wifi" "-lesp_wifi" "-L/home/roman/Experimental/esp/esp-idf/components/esp_wifi/lib_esp32" "-lcore" "-lrtc" "-lnet80211" "-lpp" "-lsmartconfig" "-lcoexist" "-lespnow" "-lphy" "-lmesh" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/espcoredump" "-lespcoredump" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/fatfs" "-lfatfs" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/freemodbus" "-lfreemodbus" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/freertos" "-lfreertos" "-Wl,--undefined=uxTopUsedPriority" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/heap" "-lheap" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/jsmn" "-ljsmn" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/json" "-ljson" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/libsodium" "-llibsodium" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/log" "-llog" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/lwip" "-llwip" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/main" "-lmain" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/mbedtls" "-lmbedtls" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/mdns" "-lmdns" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/mqtt" "-lmqtt" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/newlib" "-lnewlib" "-lc" "-lm" "-unewlib_include_locks_impl" "-unewlib_include_heap_impl" "-unewlib_include_syscalls_impl" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/nghttp" "-lnghttp" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/nvs_flash" "-lnvs_flash" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/openssl" "-lopenssl" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/protobuf-c" "-lprotobuf-c" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/protocomm" "-lprotocomm" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/pthread" "-lpthread" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/sdmmc" "-lsdmmc" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/smartconfig_ack" "-lsmartconfig_ack" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/soc" "-lsoc" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/spi_flash" "-lspi_flash" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/spiffs" "-lspiffs" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/tcp_transport" "-ltcp_transport" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/tcpip_adapter" "-ltcpip_adapter" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/ulp" "-lulp" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/vfs" "-lvfs" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/wear_levelling" "-lwear_levelling" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/wifi_provisioning" "-lwifi_provisioning" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/wpa_supplicant" "-lwpa_supplicant" "-L/home/roman/Experimental/rust/rust1/rust_test/blink/idf_project/build/xtensa" "-lxtensa" "/home/roman/Experimental/esp/esp-idf/components/xtensa/esp32/libhal.a" "-lgcc" "-lstdc++" "-lgcov" "-Wl,--end-group" "-Wl,-EL" "-Wl,-Bdynamic"
  = note: /home/roman/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: /home/roman/Experimental/rust/rust1/rust_test/blink/target/xtensa-esp32-none-elf/release/deps/blink-6db9f1d396fe6254.blink.cnqv2jox-cgu.0.rcgu.o:(.literal.literal+0x0): undefined reference to `phantom_func'
          collect2: error: ld returned 1 exit status

@lexxvir
Copy link
Author

lexxvir commented Sep 6, 2019

@romevich It seems you are using ESP IDF v.4.0 (or master branch). I use stable release v.3.3. There is chance that NVS implementation was changed and it fixed issue somehow.

I will try to migrate to IDF 4.0 and check issue again.

@pacmancoder
Copy link

@lexxvir Forgot to mention, I have got this issue on the master branch for esp8266 RTOS SDK (IDF-style).

@reitermarkus
Copy link

I'm using ESP-IDF 4.0-beta2 and there don't seem to be any conflicting symbols with NVS.

@MabezDev
Copy link
Member

MabezDev commented Apr 7, 2020

Hope this is all sorted now. Let me know if it still persists.

@MabezDev MabezDev closed this as completed Apr 7, 2020
MabezDev pushed a commit that referenced this issue Apr 7, 2022
…rochenkov

make memcmp return a value of c_int_width instead of i32

This is an attempt to fix rust-lang#32610 and rust-lang#78022, namely, that `memcmp` always returns an `i32` regardless of the platform.  I'm running into some issues and was hoping I could get some help.

Here's what I've been attempting so far:

1. Build the stage0 compiler with all the changes _expect_ for the changes in `library/core/src/slice/cmp.rs` and `compiler/rustc_codegen_llvm/src/context.rs`; this is because `target_c_int_width` isn't passed through and recognized as a valid config option yet.  I'm building with `./x.py build --stage 0 library/core library/proc_macro compiler/rustc`
2. Next I add in the `#[cfg(c_int_width = ...)]` params to `cmp.rs` and `context.rs` and build the stage 1 compiler by running `./x.py build --keep-stage 0 --stage 1 library/core library/proc_macro compiler/rustc`.  This step now runs successfully.
3. Lastly, I try to build the test program for AVR mentioned in rust-lang#78022 with `RUSTFLAGS="--emit llvm-ir" cargo build --release`, and look at the resulting llvm IR, which still shows:

```
...
%11 = call addrspace(1) i32 `@memcmp(i8*` nonnull %5, i8* nonnull %10, i16 5) #7, !dbg !1191                                                                                                                                                                                                                                %.not = icmp eq i32 %11, 0, !dbg !1191
...
; Function Attrs: nounwind optsize                                                                                                                                                                                                                                                                                          declare i32 `@memcmp(i8*,` i8*, i16) local_unnamed_addr addrspace(1) #4
```

Any ideas what I'm missing here?  Alternately, if this is totally the wrong approach I'm open to other suggestions.

cc `@Rahix`
MabezDev pushed a commit that referenced this issue Dec 7, 2023
Change prefetch to avoid deadlock

Was abled to reproduce the deadlock in rust-lang#118205 and created a coredump when it happen. When looking at the backtraces  I noticed that the prefetch of exported_symbols (Thread 17 frame 4) started after the "actual" exported_symbols (Thread 2 frame 18) but it also is working on some of the collect_crate_mono_items (Thread 17 frame12 ) that Thread 2 is blocked on resulting in a deadlock.

This PR results in less parallell work that can be done at the same time but from what I can find we do not call the query exported_symbols from multiple places in the same join call any more.

```
Thread 17 (Thread 0x7f87b6299700 (LWP 11370)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f87be5166a9 in <parking_lot::condvar::Condvar>::wait_until_internal () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#2  0x00007f87be12d854 in <rustc_query_system::query::job::QueryLatch>::wait_on () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#3  0x00007f87bd27d16f in rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::CrateNum, rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#4  0x00007f87bd0b5b6a in rustc_query_impl::query_impl::exported_symbols::get_query_non_incr::__rust_end_short_backtrace () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#5  0x00007f87bdaebb0a in rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#1} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#6  0x00007f87bdae1509 in rayon_core::join::join_context::call_b::<core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>, rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#1}, (), &[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>::{closure#0}::{closure#1}>::{closure#0}>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#7  0x00007f87bdae32ff in <rayon_core::job::StackJob<rayon_core::latch::SpinLatch, rayon_core::join::join_context::call_b<core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>, rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#1}, (), &[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>::{closure#0}::{closure#1}>::{closure#0}>::{closure#0}, core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>> as rayon_core::job::Job>::execute () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#8  0x00007f87b8338823 in <rayon_core::registry::WorkerThread>::wait_until_cold () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#9  0x00007f87bc2edbaf in rayon_core::join::join_context::<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#10 0x00007f87bc2ed313 in rayon_core::registry::in_worker::<rayon_core::join::join_context<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0}, ((), ())> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#11 0x00007f87bc2db2a4 in rayon::iter::plumbing::bridge_producer_consumer::helper::<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#12 0x00007f87bc2eead2 in <rayon_core::job::StackJob<rayon_core::latch::SpinLatch, rayon_core::join::join_context::call_b<(), rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}>::{closure#0}, ()> as rayon_core::job::Job>::execute () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#13 0x00007f87b8338823 in <rayon_core::registry::WorkerThread>::wait_until_cold () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#14 0x00007f87be52d1f9 in <rayon_core::registry::ThreadBuilder>::run () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#15 0x00007f87b8461c57 in <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}::{closure#0}, ()> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#16 0x00007f87b846e465 in rustc_span::set_session_globals_then::<(), rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}::{closure#0}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#17 0x00007f87b844f282 in <<crossbeam_utils::thread::ScopedThreadBuilder>::spawn<<rayon_core::ThreadPoolBuilder>::build_scoped<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#18 0x00007f87b846af58 in <<std::thread::Builder>::spawn_unchecked_<alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output = ()> + core::marker::Send>, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#19 0x00007f87b7898e85 in std::sys::unix::thread::Thread::new::thread_start () from /home/andjo403/.rustup/toolchains/stage1/lib/libstd-d570b0650d35d951.so
#20 0x00007f87b7615609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#21 0x00007f87b7755133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f87b729b700 (LWP 11368)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f87b7887b51 in std::sys::unix::locks::futex_condvar::Condvar::wait () from /home/andjo403/.rustup/toolchains/stage1/lib/libstd-d570b0650d35d951.so
#2  0x00007f87b8339478 in <rayon_core::sleep::Sleep>::sleep () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#3  0x00007f87b83387c3 in <rayon_core::registry::WorkerThread>::wait_until_cold () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#4  0x00007f87bc2edbaf in rayon_core::join::join_context::<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#5  0x00007f87bc2ed313 in rayon_core::registry::in_worker::<rayon_core::join::join_context<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0}, ((), ())> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#6  0x00007f87bc2db50c in <rayon::vec::IntoIter<rustc_middle::mir::mono::MonoItem> as rayon::iter::ParallelIterator>::for_each::<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#7  0x00007f87bc2e8cd7 in <rustc_session::session::Session>::time::<(), rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#8  0x00007f87bc2b8f2c in rustc_monomorphize::collector::collect_crate_mono_items () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#9  0x00007f87bc2c30d9 in rustc_monomorphize::partitioning::collect_and_partition_mono_items () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#10 0x00007f87bcf2cde6 in rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#11 0x00007f87bd156a3c in <rustc_query_impl::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#12 0x00007f87bd1c6a7d in rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#13 0x00007f87bd15df40 in rustc_query_impl::query_impl::collect_and_partition_mono_items::get_query_non_incr::__rust_end_short_backtrace () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#14 0x00007f87bd7a0ad9 in rustc_codegen_ssa::back::symbol_export::exported_symbols_provider_local () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#15 0x00007f87bcf29acb in rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::exported_symbols::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#16 0x00007f87bcfdb350 in <rustc_query_impl::query_impl::exported_symbols::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::CrateNum)>>::call_once () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#17 0x00007f87bd27d64f in rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::CrateNum, rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#18 0x00007f87bd0b5b6a in rustc_query_impl::query_impl::exported_symbols::get_query_non_incr::__rust_end_short_backtrace () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#19 0x00007f87bda927ce in rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::VecCache<rustc_span::def_id::CrateNum, rustc_middle::query::erase::Erased<[u8; 16]>>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#20 0x00007f87bda9c93f in <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#21 0x00007f87bdaa6ef7 in rustc_metadata::rmeta::encoder::encode_metadata_impl () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#22 0x00007f87bdae0b77 in rayon_core::join::join_context::<rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<()>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>::{closure#0}::{closure#0}>::{closure#0}, rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<()>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>::{closure#0}::{closure#1}>::{closure#0}, core::option::Option<rustc_data_structures::marker::FromDyn<()>>, core::option::Option<rustc_data_structures::marker::FromDyn<()>>>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#23 0x00007f87bdaded2f in rayon_core::registry::in_worker::<rayon_core::join::join_context<rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<()>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>::{closure#0}::{closure#0}>::{closure#0}, rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<()>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>::{closure#0}::{closure#1}>::{closure#0}, core::option::Option<rustc_data_structures::marker::FromDyn<()>>, core::option::Option<rustc_data_structures::marker::FromDyn<()>>>::{closure#0}, (core::option::Option<rustc_data_structures::marker::FromDyn<()>>, core::option::Option<rustc_data_structures::marker::FromDyn<()>>)> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#24 0x00007f87bdaa5a03 in rustc_metadata::rmeta::encoder::encode_metadata () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#25 0x00007f87bdaed628 in rustc_metadata::fs::encode_and_write_metadata () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#26 0x00007f87b86608be in rustc_interface::passes::start_codegen () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#27 0x00007f87b8664946 in <rustc_middle::ty::context::GlobalCtxt>::enter::<<rustc_interface::queries::Queries>::codegen_and_build_linker::{closure#0}, core::result::Result<rustc_interface::queries::Linker, rustc_span::ErrorGuaranteed>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#28 0x00007f87b864db00 in <rustc_interface::queries::Queries>::codegen_and_build_linker () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#29 0x00007f87b849400f in <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#0}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#30 0x00007f87b846e067 in rustc_span::set_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}::{closure#0}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#31 0x00007f87b844dc13 in <rayon_core::thread_pool::ThreadPool>::install::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#32 0x00007f87b84509a1 in <rayon_core::job::StackJob<rayon_core::latch::LatchRef<rayon_core::latch::LockLatch>, <rayon_core::registry::Registry>::in_worker_cold<<rayon_core::thread_pool::ThreadPool>::install<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> as rayon_core::job::Job>::execute () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#33 0x00007f87b8338823 in <rayon_core::registry::WorkerThread>::wait_until_cold () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#34 0x00007f87be52d1f9 in <rayon_core::registry::ThreadBuilder>::run () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#35 0x00007f87b8461c57 in <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}::{closure#0}, ()> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#36 0x00007f87b846e465 in rustc_span::set_session_globals_then::<(), rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}::{closure#0}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#37 0x00007f87b844f282 in <<crossbeam_utils::thread::ScopedThreadBuilder>::spawn<<rayon_core::ThreadPoolBuilder>::build_scoped<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#38 0x00007f87b846af58 in <<std::thread::Builder>::spawn_unchecked_<alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output = ()> + core::marker::Send>, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#39 0x00007f87b7898e85 in std::sys::unix::thread::Thread::new::thread_start () from /home/andjo403/.rustup/toolchains/stage1/lib/libstd-d570b0650d35d951.so
#40 0x00007f87b7615609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#41 0x00007f87b7755133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

```

fixes rust-lang#118205
fixes rust-lang#117759 from the latest logs it is the same query map as in rust-lang#118205
fixes rust-lang#118529
fixes rust-lang#117784
cc rust-lang#118206

r? `@SparrowLii`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants