sciter-sdk / rust-sciter

Rust bindings for Sciter
https://sciter.com
MIT License
804 stars 76 forks source link

threads example crash. #33

Closed fragrans closed 6 years ago

fragrans commented 6 years ago
os: 
Windows 10, 64bit.

cargo: 
C:\Users\liang>rustc --version --verbose
rustc 1.25.0 (84203cac6 2018-03-25)
binary: rustc
commit-hash: 84203cac67e65ca8640b8392348411098c856985
commit-date: 2018-03-25
host: x86_64-pc-windows-msvc
release: 1.25.0
LLVM version: 6.0

sciter:
https://github.com/c-smile/sciter-sdk

PS E:\github\rust-sciter> cargo run --example threads
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target\debug\examples\threads.exe`
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: INCOMPATIBLE_TYPE', libcore\result.rs:945:5
stack backtrace:
   0:     0x7ff621732aea - std::sys::windows::backtrace::unwind_backtrace
                               at C:\projects\rust\src\libstd\sys\windows\backtrace\mod.rs:65
   1:     0x7ff621732aea - std::sys_common::backtrace::_print
                               at C:\projects\rust\src\libstd\sys_common\backtrace.rs:71
   2:     0x7ff6217359c2 - std::sys_common::backtrace::print
                               at C:\projects\rust\src\libstd\sys_common\backtrace.rs:59
   3:     0x7ff6217359c2 - std::panicking::default_hook::{{closure}}
                               at C:\projects\rust\src\libstd\panicking.rs:380
   4:     0x7ff621735634 - std::panicking::default_hook
                               at C:\projects\rust\src\libstd\panicking.rs:396
   5:     0x7ff621735f29 - std::panicking::rust_panic_with_hook
                               at C:\projects\rust\src\libstd\panicking.rs:576
   6:     0x7ff621735db0 - std::panicking::begin_panic<alloc::string::String>
                               at C:\projects\rust\src\libstd\panicking.rs:537
   7:     0x7ff621735c91 - std::panicking::begin_panic_fmt
                               at C:\projects\rust\src\libstd\panicking.rs:521
   8:     0x7ff621735c01 - std::panicking::rust_begin_panic
                               at C:\projects\rust\src\libstd\panicking.rs:497
   9:     0x7ff62173a6bc - core::panicking::panic_fmt
                               at C:\projects\rust\src\libcore\panicking.rs:71
  10:     0x7ff62170162a - core::result::unwrap_failed<sciter::capi::scvalue::VALUE_RESULT>
                               at C:\projects\rust\src\libcore\macros.rs:23
  11:     0x7ff6217012b5 - core::result::Result<sciter::value::Value, sciter::capi::scvalue::VALUE_RESULT>::unwrap<sciter::value::Value,sciter::capi::scvalue::VALUE_RESULT>
                               at C:\projects\rust\src\libcore\result.rs:782
  12:     0x7ff621703a75 - threads::{{impl}}::exec_task::{{closure}}
                               at E:\github\rust-sciter\examples\threads.rs:22
  13:     0x7ff621706945 - std::sys_common::backtrace::__rust_begin_short_backtrace<closure,()>
                               at C:\projects\rust\src\libstd\sys_common\backtrace.rs:136
  14:     0x7ff621702389 - std::thread::{{impl}}::spawn::{{closure}}::{{closure}}<closure,()>
                               at C:\projects\rust\src\libstd\thread\mod.rs:406
  15:     0x7ff621705df5 - std::panic::{{impl}}::call_once<(),closure>
                               at C:\projects\rust\src\libstd\panic.rs:293
  16:     0x7ff621704363 - std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure>,()>
                               at C:\projects\rust\src\libstd\panicking.rs:479
  17:     0x7ff621738241 - panic_unwind::__rust_maybe_catch_panic
                               at C:\projects\rust\src\libpanic_unwind\lib.rs:102
  18:     0x7ff621704257 - std::panicking::try<(),std::panic::AssertUnwindSafe<closure>>
                               at C:\projects\rust\src\libstd\panicking.rs:458
  19:     0x7ff621705e40 - std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure>,()>
                               at C:\projects\rust\src\libstd\panic.rs:358
  20:     0x7ff6217021ca - std::thread::{{impl}}::spawn::{{closure}}<closure,()>
                               at C:\projects\rust\src\libstd\thread\mod.rs:405
  21:     0x7ff6217023ef - alloc::boxed::{{impl}}::call_box<(),closure>
                               at C:\projects\rust\src\liballoc\boxed.rs:788
  22:     0x7ff6217375ae - alloc::boxed::{{impl}}::call_once
                               at C:\projects\rust\src\liballoc\boxed.rs:798
  23:     0x7ff6217375ae - std::sys_common::thread::start_thread
                               at C:\projects\rust\src\libstd\sys_common\thread.rs:24
  24:     0x7ff6217375ae - std::sys::windows::thread::{{impl}}::new::thread_start
                               at C:\projects\rust\src\libstd\sys\windows\thread.rs:55
  25:     0x7ffb6e0e1fe3 - BaseThreadInitThunk
  26:     0x7ffb6e39efb0 - RtlUserThreadStart
pravic commented 6 years ago

Interesting. I'll check it soon.

fragrans commented 6 years ago

Thanks.

pravic commented 6 years ago

Ok, I have to revert that. Should work again in 0.5.40.

Thanks for reporting!