Skip to content
This repository was archived by the owner on Jun 7, 2025. It is now read-only.
This repository was archived by the owner on Jun 7, 2025. It is now read-only.

Panic in new version when cross-compiled to Windows. #470

@John-Nagle

Description

@John-Nagle

Existing program using new Rend3, rev = "6dd847f", works when built on LInux with a Linux target, but if built for a cross-compiled Windows target, crashes under Wine 7.0. This program worked cross platform with version rev = "a972b0ff0a98bb79b2b1c8812e3a823840a5e02e"

Reproduce by:

git clone https://github.com/John-Nagle/ui-mock.git
cd ui-mock
cargo build --target x86_64-pc-windows-gnu --examples

cd to x86 target dir
wine ui-mock.exe

wine ui-mock.exe

0104:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
Proj dirs data local dir: "C:\\users\\john\\Local Settings\\Application Data\\animats\\ui-mock\\data"
Log path: "C:\\users\\john\\Local Settings\\Application Data\\animats\\ui-mock\\data\\log.txt"
0104:fixme:system:EnableNonClientDpiScaling (000000000001004A): stub
0084:fixme:imm:ImeSetActiveContext (0x3a7b0, 0): stub
0104:fixme:imm:ImeSetActiveContext (0x261270, 1): stub
0084:fixme:imm:ImmReleaseContext (0000000000010020, 000000000003A7B0): stub
0104:fixme:imm:ImmReleaseContext (000000000001004A, 0000000000261270): stub
0104:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0104:fixme:dxgi:dxgi_factory_EnumAdapterByGpuPreference Ignoring GPU preference 0x2.
0104:fixme:dxgi:dxgi_factory_EnumAdapterByGpuPreference Ignoring GPU preference 0x2.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/6dd847f/rend3/src/shader.rs:63:60
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Code from shader.rs is:

pub fn add_shaders_embed<T: RustEmbed>(&mut self, prefix: &str) {
        for file in T::iter() {
            let contents = String::from_utf8(T::get(&file).unwrap().data.into_owned()).unwrap();
            self.files.insert(format!("{prefix}/{file}"), contents);
        }
    }

Tried to get a backtrace, but in this environment the unwinder blew up and went into a loop that produced a long stream of the same error, then a crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions