[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 06/07: call do_update after calling open in
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 06/07: call do_update after calling open in the file source constructor, otherwise if seek is called before work, a segmentation fault will occur as d_fp is null |
Date: |
Thu, 26 Jun 2014 19:54:37 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch maint
in repository gnuradio.
commit 4f6b982c87b36a377ed270f2fd4ae6cddb6e0aa3
Author: cottrema <address@hidden>
Date: Mon Jun 23 11:02:08 2014 +1200
call do_update after calling open in the file source constructor,
otherwise if seek is called before work, a segmentation fault will occur
as d_fp is null
---
gr-blocks/lib/file_source_impl.cc | 1 +
gr-blocks/python/blocks/qa_file_source_sink.py | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/gr-blocks/lib/file_source_impl.cc
b/gr-blocks/lib/file_source_impl.cc
index 941ca15..0c3d752 100644
--- a/gr-blocks/lib/file_source_impl.cc
+++ b/gr-blocks/lib/file_source_impl.cc
@@ -67,6 +67,7 @@ namespace gr {
d_updated(false)
{
open(filename, repeat);
+ do_update();
}
file_source_impl::~file_source_impl()
diff --git a/gr-blocks/python/blocks/qa_file_source_sink.py
b/gr-blocks/python/blocks/qa_file_source_sink.py
index f35912b..89841d3 100644
--- a/gr-blocks/python/blocks/qa_file_source_sink.py
+++ b/gr-blocks/python/blocks/qa_file_source_sink.py
@@ -88,6 +88,22 @@ class test_file_source_sink(gr_unittest.TestCase):
result_data = snk2.data()
self.assertFloatTuplesAlmostEqual(expected_result, result_data)
+ def test_file_source_can_seek_after_open(self):
+ src_data = range(1000)
+
+ filename = "tmp.32f"
+ src = blocks.vector_source_f(src_data)
+ snk = blocks.file_sink(gr.sizeof_float, filename)
+ snk.set_unbuffered(True)
+
+ self.tb.connect(src, snk)
+ self.tb.run()
+
+ source = blocks.file_source(gr.sizeof_float, filename)
+ self.assertTrue(source.seek(0, os.SEEK_SET))
+
+ os.remove(filename)
+
if __name__ == '__main__':
gr_unittest.run(test_file_source_sink, "test_file_source_sink.xml")
- [Commit-gnuradio] [gnuradio] branch maint updated (c138442 -> 6e40376), git, 2014/06/26
- [Commit-gnuradio] [gnuradio] 06/07: call do_update after calling open in the file source constructor, otherwise if seek is called before work, a segmentation fault will occur as d_fp is null,
git <=
- [Commit-gnuradio] [gnuradio] 04/07: tag_checker.h: fix unitialized d_has_next_tag; coverity 1128348, git, 2014/06/26
- [Commit-gnuradio] [gnuradio] 07/07: runtime: fixed order of initializing warning in tag_checker constructor., git, 2014/06/26
- [Commit-gnuradio] [gnuradio] 05/07: check_lfsr_32k: fix < instead of <<; coverity 1046413, git, 2014/06/26
- [Commit-gnuradio] [gnuradio] 02/07: cmake: runtime: On Darwin, malloc is always aligned to a 16 byte boundary, to work with Altivec and SSE (etc) SIMD; so, set ALIGNED_MALLOC to 16 for those Darwin systems that do not have posix_memalign., git, 2014/06/26
- [Commit-gnuradio] [gnuradio] 01/07: add attributes for clang compiler, git, 2014/06/26
- [Commit-gnuradio] [gnuradio] 03/07: runtime: fix comment in posix_memalign., git, 2014/06/26