Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0
-
Component/s: Liquidsoap
-
Labels:None
Description
Wen seeking under stress, liquidsoap can segfault, most likely in relation with the Gc.
Attached is a script from David to reproduce it.
So far, I have noted that it does happen with only ogg decoding enabled and that it may not be related to a finalisation.
I suspect something fishy around the ogg sync code as it is full of caml callbacks from C but it may be something else..
Attached is a script from David to reproduce it.
So far, I have noted that it does happen with only ogg decoding enabled and that it may not be related to a finalisation.
I suspect something fishy around the ogg sync code as it is full of caml callbacks from C but it may be something else..
Releasing the Gc lock inside a finalization function was not a good idea!
This was in fact causing a global memory inconsistency, with logs of the
form:
2011/06/21 23:23:15 [decoder:4] Decoder "OGG" failed on "foo.ogg": Bad file descriptor in lseek()!
Thus, opening API in Vorbis.File has been changed:
* No close callback is passed.
* If no close callback is passed, ov_clear does not
mess with the Gc, thus removing the calls to
grab ocaml global lock.
* Removed exported close function and put all cleaning
in the finalization function.
* Thus, return a Unix.file_descr when opening
a file.
* Changed file opening function to more consistent names.