realworldocaml / book

V2 of Real World OCaml
https://dev.realworldocaml.org
Other
1.19k stars 175 forks source link

New comment on block [block-idp11168112] #2173

Open manzyuk opened 11 years ago

manzyuk commented 11 years ago

utop crashes when I press Control-C. The error below comes from the utop run inside Emacs, but I can reproduce it also when utop is run in a terminal. Should I file a bug report against utop or is anything wrong with my setup? In case of the latter, how would I go about debugging it?

utop[47]> let (r, w) = Pipe.create ();;
val r : '_a Pipe.Reader.t = <abstr>
val w : '_a Pipe.Writer.t = <abstr>
utop[48]> Pipe.write w "Hello World!";;
("bug in async scheduler"
 (("File_descr_watcher.post_check bug"
   (("select raised unexpected exn" Sys.Break)
    ((pre ((read (8)) (write ()))) (select_result (Error Sys.Break)))
    ((read ((num_keys 1024) (alist ((8 ())))))
     (write ((num_keys 1024) (alist ()))))))
  ((mutex ((id_of_thread_holding_lock 3) (num_using_blocker 0) (blocker ())))
   (is_running true) (have_called_go false)
   (fds_whose_watching_has_changed ())
   (file_descr_watcher
    (Select
     ((read ((num_keys 1024) (alist ((8 ())))))
      (write ((num_keys 1024) (alist ()))))))
   (fd_by_descr
    ((num_keys 1024)
     (alist
      ((39
        ((file_descr 39) (info interruptor_pipe_write) (kind Fifo)
         (supports_nonblock true) (have_set_nonblock true) (state Open)
         (watching ((read Not_watching) (write Not_watching)))
         (watching_has_changed false) (num_active_syscalls 0)
         (close_finished Empty)))
       (8
        ((file_descr 8) (info interruptor_pipe_read) (kind Fifo)
         (supports_nonblock true) (have_set_nonblock true) (state Open)
         (watching ((read (Watching Empty)) (write Not_watching)))
         (watching_has_changed false) (num_active_syscalls 1)
         (close_finished Empty)))))))
   (timerfd ()) (scheduler_thread_id 3)
   (interruptor
    ((pipe
      ((read
        ((file_descr 8) (info interruptor_pipe_read) (kind Fifo)
         (supports_nonblock true) (have_set_nonblock true) (state Open)
         (watching ((read (Watching Empty)) (write Not_watching)))
         (watching_has_changed false) (num_active_syscalls 1)
         (close_finished Empty)))
       (write
        ((file_descr 39) (info interruptor_pipe_write) (kind Fifo)
         (supports_nonblock true) (have_set_nonblock true) (state Open)
         (watching ((read Not_watching) (write Not_watching)))
         (watching_has_changed false) (num_active_syscalls 0)
         (close_finished Empty)))))
     (already_interrupted false) (clearbuffer <opaque>)))
   (signal_manager
    ((handlers_by_signal ((-8 ((bag ()))))) (delivered <opaque>)
     (thread_safe_notify_signal_delivered <fun>)))
   (thread_pool
    ((id 0) (state In_use)
     (mutex
      ((id_of_thread_holding_lock -1) (num_using_blocker 0) (blocker ())))
     (default_priority 0) (max_num_threads 50) (num_threads 7)
     (threads
      (((name read) (thread_id (10)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name "thread-pool thread") (thread_id (9)) (priority 0)
        (state Available) (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name fchmod) (thread_id (8)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name writev) (thread_id (7)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name close) (thread_id (6)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name stat) (thread_id (5)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name fcntl_getfl) (thread_id (4)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))))
     (available_threads
      (((name close) (thread_id (6)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name read) (thread_id (10)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name writev) (thread_id (7)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name fcntl_getfl) (thread_id (4)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name fchmod) (thread_id (8)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name stat) (thread_id (5)) (priority 0) (state Available)
        (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))
       ((name "thread-pool thread") (thread_id (9)) (priority 0)
        (state Available) (unfinished_work 0)
        (work_queue
         ((ev_q ()) (maxsize 1) (mutex <opaque>) (not_empty <opaque>)
          (not_full <opaque>) (finally <fun>))))))
     (work_queue ()) (unfinished_work 0) (num_work_completed 60)))
   (handle_thread_pool_stuck <fun>)
   (busy_pollers
    ((core_scheduler
      ((check_access ())
       (jobs
        ((normal ((jobs ()) (jobs_left_this_cycle 500)))
         (low ((jobs ()) (jobs_left_this_cycle 500)))))
       (main_execution_context
        ((monitor
          (((name main) (here ()) (id 1) (has_seen_error false)
            (someone_is_listening false) (kill_index 0))))
         (priority Normal) (backtrace_history ()) (kill_index 0)))
       (current_execution_context
        ((monitor
          (((name main) (here ()) (id 1) (has_seen_error false)
            (someone_is_listening false) (kill_index 0))))
         (priority Normal) (backtrace_history ()) (kill_index 0)))
       (max_num_jobs_per_priority_per_cycle 500) (uncaught_exn ())
       (global_kill_index 0) (num_jobs_run 891) (cycle_count 125)
       (cycle_start (2013-08-03 19:05:04.151723+03:00))
       (run_every_cycle_start ()) (last_cycle_time 0.0221729ms)
       (last_cycle_num_jobs 0)
       (events
        ((start (2013-08-03 17:42:45.332700+03:00))
         (now (2013-08-03 19:05:04.151723+03:00)) (alarm_precision 1ms)
         (alarms
          (((at (2013-08-03 19:05:05.000935+03:00))
            (value
             ((monitor
               (((name main) (here ()) (id 1) (has_seen_error false)
                 (someone_is_listening false) (kill_index 0))))
              (priority Normal) (backtrace_history ()) (kill_index 0))))))))
       (finalizer_jobs <opaque>) (thread_safe_finalizer_hook <fun>)))
     (pollers ())))
   (busy_poll_thread_is_running false)
   (core_scheduler
    ((check_access ())
     (jobs
      ((normal ((jobs ()) (jobs_left_this_cycle 500)))
       (low ((jobs ()) (jobs_left_this_cycle 500)))))
     (main_execution_context
      ((monitor
        (((name main) (here ()) (id 1) (has_seen_error false)
          (someone_is_listening false) (kill_index 0))))
       (priority Normal) (backtrace_history ()) (kill_index 0)))
     (current_execution_context
      ((monitor
        (((name main) (here ()) (id 1) (has_seen_error false)
          (someone_is_listening false) (kill_index 0))))
       (priority Normal) (backtrace_history ()) (kill_index 0)))
     (max_num_jobs_per_priority_per_cycle 500) (uncaught_exn ())
     (global_kill_index 0) (num_jobs_run 891) (cycle_count 125)
     (cycle_start (2013-08-03 19:05:04.151723+03:00))
     (run_every_cycle_start ()) (last_cycle_time 0.0221729ms)
     (last_cycle_num_jobs 0)
     (events
      ((start (2013-08-03 17:42:45.332700+03:00))
       (now (2013-08-03 19:05:04.151723+03:00)) (alarm_precision 1ms)
       (alarms
        (((at (2013-08-03 19:05:05.000935+03:00))
          (value
           ((monitor
             (((name main) (here ()) (id 1) (has_seen_error false)
               (someone_is_listening false) (kill_index 0))))
            (priority Normal) (backtrace_history ()) (kill_index 0))))))))
     (finalizer_jobs <opaque>) (thread_safe_finalizer_hook <fun>))))))
avsm commented 11 years ago

Did you create an upstream utop issue about this?

manzyuk commented 11 years ago

Yes, I should have mentioned it here: https://github.com/diml/utop/issues/32