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

Windows XP doesn't have ConditionVariables, which notify requires via mpsc channels #79

Closed
bbigras opened this issue Jun 15, 2016 · 18 comments

Comments

@bbigras
Copy link
Contributor

bbigras commented Jun 15, 2016

I'm not sure if I should report this here or not. I don't know what's the status of xp support with Rust. A simple 'hello world' works but the sample code from README.md results in a 'thread panicked while processing panic. aborting.'.

rustc 1.9.0 (e4e8b6668 2016-05-18)
notify = "2.6.1"

@passcod
Copy link
Member

passcod commented Jun 16, 2016

Is there any more than that message, by some chance? Sounds pretty hard to debug if not.

@passcod passcod added Z-needs implementation Needs an implementation, will accept PRs os-windows labels Jun 16, 2016
@passcod
Copy link
Member

passcod commented Jun 16, 2016

Tagging with help-wanted because there's no label for "I have no idea."

@passcod
Copy link
Member

passcod commented Jun 16, 2016

CCing @retep998 and @maurizi as the usual Windows suspects.

@retep998
Copy link

Windows XP support is super shady. While libstd does not link to any functions that are unavailable on Windows XP (hence "Hello world!" works), certain std functionality does load those functions at runtime and will panic if they don't exist. It's quite likely that somewhere rsnotify depends on some functionality that requires an API that isn't available on Windows XP.

@passcod passcod removed the Z-needs implementation Needs an implementation, will accept PRs label Jun 16, 2016
@passcod
Copy link
Member

passcod commented Jun 16, 2016

So, probably want to close that as wontfix?

@maurizi
Copy link
Contributor

maurizi commented Jun 16, 2016

@BrunoQC maybe if you run the sample program with RUST_BACKTRACE=1 to get a backtrace that would help determine if the problem is with Rust in general or something specific to rsnotify?

@bbigras
Copy link
Contributor Author

bbigras commented Jun 16, 2016

F:\Dev\rust\test_notify\target\release>set RUST_BACKTRACE=1

F:\Dev\rust\test_notify\target\release>test_notify.exe
thread panicked while processing panic. aborting.

@retep998
Copy link

What happens if you do fn main(){panic!()}? Does that panic while panicking?

@bbigras
Copy link
Contributor Author

bbigras commented Jun 16, 2016

F:\Dev\rust\test_panic\target\debug>test_panic.exe
thread panicked while processing panic. aborting.

@retep998
Copy link

Yep, so Rust is currently just broken on Windows XP when it comes to panicking. So you'll just have to get a debugger that works on Windows XP and use that to get a backtrace instead.

@bbigras
Copy link
Contributor Author

bbigras commented Jun 16, 2016

Like this?

F:\Dev\rust\test_notify\target\debug>gdb test_notify.exe
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from F:\Dev\rust\test_notify\target\debug\test_notify.exe...done.
(gdb) run
Starting program: F:\Dev\rust\test_notify\target\debug/test_notify.exe
[New Thread 944.0xb0]
[New Thread 944.0x69c]
thread panicked while processing panic. aborting.

Program received signal SIGILL, Illegal instruction.
0x00489b50 in std::sys_common::unwind::begin_unwind_inner::h39d40f52add53ef7 ()
(gdb) bt
#0  0x00489b50 in std::sys_common::unwind::begin_unwind_inner::h39d40f52add53ef7 ()
#1  0x00489ac3 in std::sys_common::unwind::begin_unwind::hd78480d5ec5c51b2 ()
#2  0x004bba57 in std::sys::c::AcquireSRWLockShared::fallback::h9437df0460b592c9 ()
#3  0x00489bce in std::sys_common::unwind::begin_unwind_inner::h39d40f52add53ef7 ()
#4  0x00489ac3 in std::sys_common::unwind::begin_unwind::hd78480d5ec5c51b2 ()
#5  0x004bba57 in std::sys::c::AcquireSRWLockShared::fallback::h9437df0460b592c9 ()
#6  0x00489bce in std::sys_common::unwind::begin_unwind_inner::h39d40f52add53ef7 ()
#7  0x00489ac3 in std::sys_common::unwind::begin_unwind::hd78480d5ec5c51b2 ()
#8  0x004bb937 in std::sys::c::SleepConditionVariableSRW::fallback::h3ba0cdf394e650a8 ()
#9  0x00488b5d in std::thread::park::h0427818cd37b30b3 ()
#10 0x004b0c60 in std::sync::mpsc::blocking::WaitToken::wait::h021a385a9b027589 ()
#11 0x0045fb35 in notify::sync::mpsc::oneshot::{{impl}}::recv (self=0x244d38) at ../src/libstd\sync\mpsc/oneshot.rs:148
#12 0x0045f141 in notify::sync::mpsc::{{impl}}::recv (self=0x22fd3c) at ../src/libstd\sync\mpsc/mod.rs:841
#13 0x0045bd0e in notify::windows::{{impl}}::send_action_require_ack (self=0x22fd30, action=..., pb=0x22fb08)
    at C:\Users\bbigras\.cargo\registry\src\github.aaakk.us.kg-48ad6e4054423464\notify-2.6.1\src/windows.rs:381
#14 0x00416188 in test_notify::windows::{{impl}}::watch<&str> (self=0x22fd30, path=...)
    at C:\Users\bbigras\.cargo\registry\src\github.aaakk.us.kg-48ad6e4054423464\notify-2.6.1\src/windows.rs:420
#15 0x004018f4 in test_notify::watch () at src/main.rs:18
#16 0x0041b771 in test_notify::main () at src/main.rs:34
#17 0x004c3dae in std::sys_common::unwind::try::try_fn::h09ba69fd13531e58 ()
#18 0x004b825b in __rust_try ()
#19 0x004b81cc in std::sys_common::unwind::inner_try::h9eebd8dc83f388a6 ()
#20 0x004c3c1a in std::rt::lang_start::h5b0863080165c75e ()
#21 0x0041b943 in main ()
(gdb)

@passcod
Copy link
Member

passcod commented Jun 16, 2016

Ah, XP doesn't have ConditionVariables, and the mpsc channels use that.

@retep998
Copy link

Perhaps one day someone can replace the mutexes and condvars and such in Rust's std with https://github.com/Amanieu/parking_lot. Then it would work on Windows XP (and be faster too!).

@passcod
Copy link
Member

passcod commented Jun 17, 2016

We could also bypass that process and use nonstd concurrency in notify directly, but that's a bit of a bigger project.

@passcod
Copy link
Member

passcod commented Dec 28, 2017

Possibly maybe could be solved by not using mpsc at all i.e. the v5 design. To be tested.

@passcod passcod added this to the 5.0.0 milestone Dec 28, 2017
@passcod passcod changed the title 'thread panicked while processing panic. aborting.' on windows xp Windows XP doesn't have ConditionVariables, which notify requires via mpsc channels Dec 28, 2017
@passcod passcod mentioned this issue Dec 29, 2017
5 tasks
@passcod
Copy link
Member

passcod commented Jan 1, 2018

v5 will not solve this, as futures use condition variables internally. Truly an upstream issue.

@passcod passcod removed this from the 5.0.0 milestone Jan 1, 2018
@bbigras
Copy link
Contributor Author

bbigras commented Jan 8, 2018

Btw I don't need XP support anymore. Maybe someone else do.

@passcod
Copy link
Member

passcod commented Jan 9, 2018

I'll close this, then.

@passcod passcod closed this as completed Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants