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

Condition.wait inside Event is not protected against spurious wakeups #7013

Closed
vicuna opened this issue Oct 10, 2015 · 2 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link

commented Oct 10, 2015

Original bug ID: 7013
Reporter: aha
Status: closed (set by @xavierleroy on 2017-09-24T15:33:05Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.3
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: otherlibs
Has duplicate: #7286

Bug description

Condition.wait at Line 87 (

Condition.wait condition masterlock
) is not protected against spurious wakeups. An Invalid_argument-"index out of bounds"-exception is thrown instead (at Line 93 or 96) - not very helpful.
See for example: ocsigen/lwt#186

Steps to reproduce

It's difficult to reproduce this failure, it varies too much between different standard libraries and os kernels, when a wakeup is triggered. So I can't provide any reference code to demonstrate it.

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 11, 2015

Comment author: @xavierleroy

Well spotted, thanks. Tentative fix on SVN trunk, revision 16490.

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 11, 2015

Comment author: sebmondet

Hi (I'm the original poster of ocsigen/lwt#186)

I had that bug happening relatively often (but only on MacOSX I think).

I've been trying since yesterday with Xavier's commit: 307f55a
on top of 4.02.3
(cf. https://github.com/smondet/ocaml/tree/4203_fix7013)
(because dependencies of my project do not build with trunk).

I haven't seen any thread dying with the backtrace so far with the patch in.

@vicuna vicuna closed this Sep 24, 2017

@vicuna vicuna added the otherlibs label Mar 14, 2019

@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.