artifact_id;status_id;status_name;priority;submitter_id;submitter_name;assigned_to_id;assigned_to_name;open_date;close_date;last_modified_date;summary;details;"Resolution";"Severity";"Operating System";"Version";"URL"
171;1;"Open";3;103;"Stefano Zacchiroli";100;"Nobody";"2009-02-24 10:50";"";"2009-03-11 20:35";"""data error"" / segfault when fiddling with the underlying in_channel value";"Fiddling with the in_channel value over which bzip2 input channel has been create confuses the bzip2 bindings.

As an example, asking for the in_channel length using Pervasives.in_channel_length seems to have the side effect of lseek-ing the underlying file descriptor to the file end (see in_channel_length implementation in byterun/io.c). Further attempt to read bzip-ed data will raise Data_error, or segfaults. The attached patch for examples/bunzip2.ml showcases the problem.
";"None";"None";"None";"0.6.0";""
768;1;"Open";5;738;"Romain Slootmaekers";218;"Stéphane Glondu";"2010-10-05 09:54";"";"2010-11-02 09:50";"exceptions don't get registered properly.";"whenever there's something wrong, the binding looks up the exception to be thrown, and throws it.
The exceptions are supposed to be registered in the Bz2 module with
let _ = begin
  ...
  Callback.register_exception ""mlbz_data_exn"" Data_error;
  ...
end

unfortunately this does not happen. 
(you can add a print statement to see for yourself that it does not get executed in a program)

I attached an archive that contains a program kaboom.ml and a data file that shows the problem.
It crashes with a segmentation violation because
caml_named_value(""mlbz_data_exn"");

SEGV's

I attached a simple patch that adds a register_exceptions function to explicitly register the exceptions
(maybe that's not what you want)

have fun.";"Fixed";"major";"None";"0.6.0";""