discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Segmentation fault in wav file sink


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Segmentation fault in wav file sink
Date: Mon, 12 Dec 2011 11:41:53 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

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

Attachment: pgpqMyq65F9yx.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]