Ticket #1156 (closed bug: duplicate)

Opened 2 years ago

Last modified 1 year ago

usleep hangs indefinitely when using -threaded

Reported by: Eelis Assigned to:
Priority: normal Milestone: 6.8.1
Component: Runtime System Version: 6.6
Severity: normal Keywords: usleep threaded unistd
Cc: Difficulty: Unknown
Test Case: Architecture: x86_64 (amd64)
Operating System: Linux

Description

Consider the following two-line program.

  import System.Posix.Unistd
  main = usleep 1000000

When compiled without -threaded, the program nicely sleeps for one second, as expected. When compiled with -threaded, however, the program simply hangs.

Change History

02/23/07 06:07:40 changed by igloo

  • milestone set to 6.6.2.

We're getting EINTR mid-sleep and throwErrnoIfMinus1Retry_ is ultimately causing us to sleep (for the full length) again.

03/01/07 07:36:35 changed by Eelis

  • status changed from new to closed.
  • component changed from Compiler to Runtime System.
  • resolution set to duplicate.

This problem is actually one of the listed symptoms of the problem described in ticket #850 (which I personally feel deserves a higher priority than "low", considering that it renders perfectly ordinary system functions utterly unusable in the threaded RTS).

11/12/07 04:36:20 changed by simonmar

  • milestone changed from 6.6.2 to 6.8.1.