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

Graphics + Threads gives fatal error on Thread.delay #3716

Closed
vicuna opened this issue Jul 6, 2005 · 1 comment
Closed

Graphics + Threads gives fatal error on Thread.delay #3716

vicuna opened this issue Jul 6, 2005 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jul 6, 2005

Original bug ID: 3716
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Category: otherlibs

Bug description

Full_Name: Berke Durak
Version: 3.08.3
OS: Debian
Submission from: vol75-1-81-57-79-249.fbx.proxad.net (81.57.79.249)

Hello,

It seems threads and graphics still don't go well together. The following
code:

let _ =
Graphics.open_graph " 300x300";
Thread.delay 2.0;
;;

produces

Fatal error: exception Unix.Unix_error(11, "select", "")

when compiled as byte or native code. It should be noted that reducing the
delay to, say, 0.5 seconds sometimes produces the same error, but sometimes
doesn't.
Here is a strace output:

...
fcntl64(3, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK|O_ASYNC) = 0
getpid() = 24726
fcntl64(3, F_SETOWN, 24726) = 0
select(0, [], [], [], {2, 0}) = ? ERESTARTNOHAND (To be restarted)
--- SIGIO (I/O possible) @ 0 (0) ---
rt_sigprocmask(SIG_BLOCK, [IO], [IO], 8) = 0
ioctl(3, FIONREAD, [288]) = 0
read(3, "\f\0\17\0\1\0\240\3\352\3\10\0\1\0\3\0\10\0>\10\10\032"..., 288) = 288
write(3, "5\30\4\0\3\0\240\3\1\0\240\3\0\4\356\0027\1\4\0\4\0\240"..., 116) =
116
write(3, ">\30\7\0\3\0\240\3\1\0\240\3\2\0\240\3\351\3\v\0\351\3"..., 28) = 28
write(3, ">\30\7\0\3\0\240\3\1\0\240\3\2\0\240\3\344\3\r\0\344\3"..., 28) = 28
write(3, ">\30\7\0\3\0\240\3\1\0\240\3\2\0\240\3\343\3\16\0\343\3"..., 28) = 28
write(3, ">\30\7\0\3\0\240\3\1\0\240\3\2\0\240\3\345\3\17\0\345\3"..., 28) = 28
write(3, ">\30\7\0\3\0\240\3\1\0\240\3\2\0\240\3\342\3\21\0\342\3"..., 28) = 28
write(3, ">\30\7\0\3\0\240\3\1\0\240\3\2\0\240\3\352\3\21\0\352\3"..., 28) = 28
write(3, ">\30\7\0\3\0\240\3\1\0\240\3\2\0\240\3\342\3\22\0\342\3"..., 28) = 28
write(3, ">\30\7\0\3\0\240\3\1\0\240\3\2\0\240\3\351\3\22\0\351\3"..., 28) = 28
ioctl(3, FIONREAD, [32]) = 0
read(3, "\16\0\25\0\1\0\240\3\0\0>\0\352\3\0\0\10\0\0\0\3\0\240"..., 32) = 32
ioctl(3, FIONREAD, [256]) = 0
read(3, "\16\0\26\0\1\0\240\3\0\0>\0\351\3\0\0\v\0\0\0\3\0\240\3"..., 256) =
256
ioctl(3, FIONREAD, [0]) = 0
rt_sigprocmask(SIG_BLOCK, [VTALRM], [IO], 8) = 0
rt_sigprocmask(SIG_SETMASK, [IO], NULL, 8) = 0
sigreturn() = ? (mask now [])
--- SIGIO (I/O possible) @ 0 (0) ---
rt_sigprocmask(SIG_BLOCK, [IO], [IO], 8) = 0
ioctl(3, FIONREAD, [0]) = 0
sigreturn() = ? (mask now [])
write(2, "Fatal error: exception Unix.Unix"..., 57) = 57
exit_group(2) = ?

--
Berke Durak

@xavierleroy
Copy link
Contributor

Since 4.07, Thread.delay is resilient to interrupts, solving this issue.

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

3 participants