Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Custom auto rooter test crashes on windows 86 #462

Open
jdm opened this issue Apr 29, 2019 · 2 comments
Open

Custom auto rooter test crashes on windows 86 #462

jdm opened this issue Apr 29, 2019 · 2 comments

Comments

@jdm
Copy link
Member

jdm commented Apr 29, 2019

The crash occurs during the call to JS_GC, which suggests that the AutoGCRooter structure or CustomAutoRooter vtable is not correct for that arch.

@jdm
Copy link
Member Author

jdm commented Apr 29, 2019

It does not crash on macOS x86.

@karlhelgason
Copy link

Visual C++ on x86 arch uses "thiscall" call convention for member functions.

The struct CustomAutoRooterVFTable as defined in
https://github.com/servo/mozjs/blob/master/src/jsgc.rs
is missing "thiscall" for x86 windows.

Unfortunately thiscall is only available in unstable rust
rust-lang/rust#42202

#[repr(C)]
pub struct CustomAutoRooterVFTable {
    #[cfg(windows)]
    pub padding: [usize; 1],
    #[cfg(not(windows))]
    pub padding: [usize; 2],
    #[cfg(all(windows, target_pointer_width = "32"))]
    pub trace: unsafe extern "thiscall" fn (this: *mut c_void, trc: *mut JSTracer),
    #[cfg(not(all(windows, target_pointer_width = "32")))]
    pub trace: unsafe extern "C" fn (this: *mut c_void, trc: *mut JSTracer),
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants