You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1453 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
la@iki.fi submitted me this bug report :
["tick" thread not dying when program is terminated by signal]
It took me a while to figure this one out, but this is actually a
consequence of LinuxThreads' non-POSIX-conformant signal handling :-)
I added a workaround in ocaml/otherlibs/systhreads/posix.c
(you can see it on camlcvs.inria.fr if you're interested). Hopefully
this kludge will become unnecessary when / if Linux has a fully
conformant POSIX threads implementation.
On Tue, Oct 29, 2002 at 05:07:21PM +0100, Xavier Leroy wrote:
la@iki.fi submitted me this bug report :
["tick" thread not dying when program is terminated by signal]
It took me a while to figure this one out, but this is actually a
consequence of LinuxThreads' non-POSIX-conformant signal handling :-)
I added a workaround in ocaml/otherlibs/systhreads/posix.c
(you can see it on camlcvs.inria.fr if you're interested). Hopefully
this kludge will become unnecessary when / if Linux has a fully
conformant POSIX threads implementation.
Ok, ...
Is it ok if i ship a version of ocaml with this one fixed ?
It would be simpler if you had a stable bug fix CVS branch or something
such, but you already know that.
Original bug ID: 1453
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Sven Luther
Version: 3.06
OS: Debian GNU/Linux
Submission from: astrasbourg-206-1-18-22.abo.wanadoo.fr (81.49.129.22)
Hello,
la@iki.fi submitted me this bug report :
===============BEGIN===============
Problem: take any program, such as:
(* t.ml *)
let rec thr str =
print_string str;
print_newline ();
Thread.delay 1.0;
thr str
let _ =
ignore (Thread.create thr "foo");
ignore (Thread.create thr "bar");
read_line ()
...and native-compile it with thread support:
$ ocamlopt -o t -thread unix.cmxa threads.cmxa t.ml
It works, all right:
$ ./t
foo
bar
foo
bar
foo
bar
...and creates two extra threads, one is ocaml's tick thread, the other,
dunno, something used internally by linuxthreads?
$ ps -C t
PID TTY TIME CMD
12240 pts/5 00:00:00 t
12241 pts/5 00:00:00 t
12242 pts/5 00:00:00 t
12243 pts/5 00:00:00 t
12244 pts/5 00:00:00 t
Now control-C the program, and it stops. But:
$ ps -C t
PID TTY TIME CMD
12242 pts/5 00:00:00 t
And this is apparently the "tick" thread:
$ strace -p 12242
select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {0, 50000}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {0, 50000}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {0, 50000}) = 0 (Timeout)
It has to be killed with kill -9. Not fun.
===============END=======================
I confirmed this, but it doesn't happen all the time, maybe 1/2 or 1/3 of the
time.
Maybe it is related to the moment the threaded program is interrupted.
Friendly,
Sven Luther
The text was updated successfully, but these errors were encountered: