On Sun, Dec 11, 2011 at 01:18:59AM -0700, Matt Mills wrote: > All, > > The attached script crashes with a segmentation fault (or with the I/O error > text in the code). My C++ knowledge is lacking however I believe this is > because work() and close() are both being called simultaneously from different > threads. The close() call is being made while the execution of work() is > already past the "is this file handle working?" test (I think?).
Hi Matt, a couple of things: * Do you randomly get either segfault or i/o error? I always get the i/o with this code. * Your code stresses the WAV-code a lot :) What are you trying to accomplish? Are you finding a bug in wavfile_sink or do you need this behaviour for something? Because you don't need close() if you just want to switch files. * In any case, you're right. It's possible to call close() during work() after do_update() is finished and thus yank the fp out from under our feet. Actually, I can't think of any case where we need to call close() manually--perhaps it should even be private? MB -- Karlsruhe Institute of Technology (KIT) Communications Engineering Lab (CEL) Dipl.-Ing. Martin Braun Research Associate Kaiserstraße 12 Building 05.01 76131 Karlsruhe Phone: +49 721 608-43790 Fax: +49 721 608-46071 www.cel.kit.edu KIT -- University of the State of Baden-Württemberg and National Laboratory of the Helmholtz Association
pgpq8TIVK989b.pgp
Description: PGP signature
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio