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
signal handling ?bug difference between bytecode and native #7942
Comments
Comment author: administrator Thanks for your bug report.
I have reproduced the bug with the working version, and I will
If you're not too picky about the frequency of the reports, you can -- Damien |
Comment author: administrator
Please try the following patch, which should fix your bug. There Note that this patch is against the already-patched version of -- Damien Index: asmrun/signals.cRCS file: /net/pauillac/caml/repository/csl/asmrun/signals.c,v *** 342,348 ****
*** 538,549 **** |
Comment author: administrator [problems with signal handling]
This bug is now completely fixed in the current working version (3.06+17), -- Damien |
Comment author: administrator Fixed on PowerPC by DD, 2002-11-7. Fix propagated to all other platforms |
Original bug ID: 1466
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: John Hale
Version: 3.06 + ocaml-3.06-macosx-3.patch
OS: Mac OS X 10.2.1 6D52
Submission from: goedel.cog.jhu.edu (128.220.29.8)
bug report
November 1st 2002
John Hale
hale@cogsci.jhu.edu
file located at:
http://www.cog.jhu.edu/grad-students/hale/hale-bug-report.tar.gz
The bug is a bus error that stops the native version of the program.
The byte code version works fine.
This program is a natural language parser which is relatively expensive to run.
It works by constructing a "chart" of records about possible constituents that
might explain the string its presented with.
Since this process is so expensive, I want to print out at periodic intervals
an
indication of how large the chart is (there is also another data structure
called
the agenda whose size is interesting). Rather than constantly calling Unix time
functions to see if it's time to determine and print out the sizes of these
structures,
I'd like to use signals so that the operating system can notify the program to
do so
at user-specifiable intervals.
The idea is that, at initialization time, a signal handler will be set up
runme.ml:607
let measured_lately = ref true in
Sys.set_signal Sys.sigalrm (Sys.Signal_handle
(function x -> if x<>Sys.sigalrm then ()
else measured_lately := false ));
ignore (Unix.setitimer Unix.ITIMER_REAL
{Unix.it_interval=measurechartsizeinterval;
Unix.it_value=measurechartsizeinterval});
whose only function is to change the value of a ref cell called
"measured_lately".
Then, in the main loop of the program this value will be constantly tested.
chart.ml:200
if (!t) then () else
(print_stat st chart q; (* if it's false the alarm has gone off *)
flush stdout;
t := true);
exhaust t st chart q inf
this is in the recursive function "exhaust" (meaning "exhaustively apply the
grammar
rules to the entries already in the chart) in the module Chart. The test is
made
just before the function tail-recurs.
To replicate the bug, unpack the archive and issue
% make runme
on the command line. This should build the native code version that bombs with a
bus error
on my system. To exercise the (working) bytecode version, uncomment the #load
lines at the
top of runme.ml, and comment the final line that calls "parse". Then runme.ml
can be
#use'd in the toplevel and you can issue the parse command manually. this works
fine for me
in that status messages about the size of the chart and agenda are printed out
at 5 second
intervals. This interval is set in the "measurechartsizeinterval" variable on
line 582 in runme.ml.
My system is
Objective Caml version 3.06 including the patch from
http://caml.inria.fr/caml-macosx-howto/index.html
Mac OS X 10.2.1 build 6D52
PowerBook G4
I'm eager to hear of any news about this issue, whether it's a problem with my
code or something
to complain about to Apple -- whatever -- please keep me posted. I am a huge
O'Caml fan and
want to use signals :)
best,
-john
The text was updated successfully, but these errors were encountered: