Created attachment 424468 [details] Test case. Description of problem: OCaml bindings take pointers to strings on the OCaml heap, and then allow other threads to run. For example: const char *filename = String_val (filenamev); int r; caml_enter_blocking_section (); r = guestfs_add_drive_ro (g, filename); If other threads run (after caml_enter_blocking_section and while waiting for the command to complete) then the GC could move or reclaim the string pointed to by 'filename'. Version-Release number of selected component (if applicable): 1.3.20 How reproducible: Test case attached which reproduces the problem most of the time. Steps to Reproduce: 1. Run test case with LIBGUESTFS_DEBUG=1 2. 3. Actual results: Strings are sometimes corrupted. Expected results: Strings should not be corrupted. Additional info: Should take a copy of strings before calling enter_blocking_section.
Patch posted upstream: https://www.redhat.com/archives/libguestfs/2010-June/msg00099.html
Fix seems obvious, simple and correct. Pushed upstream.