# QT GUI Segmentation Fault

**URL:** <https://www.ruby-forum.com/t/qt-gui-segmentation-fault/232856>\
**Category:** GNU Radio\
**Created:** [October 31, 2014, 6:55pm UTC](https://www.ruby-forum.com/t/qt-gui-segmentation-fault/232856 "2014-10-31T18:55:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [October 31, 2014, 6:55pm UTC](https://www.ruby-forum.com/t/qt-gui-segmentation-fault/232856/1 "2014-10-31T18:55:47Z")

</div>

Hi all,

I recently installed GNURadio on two laptops (installation via PYBOMBs)  
and  
everything has been running fine for a few weeks; but I’m suddenly  
running  
into issues with QT GUI on one of the laptops. I wasn’t sure what the  
issue  
was originally, but after narrowing it down I’m able to see the problem  
with a simple flow graph:

signal source → throttle → QT GUI Sink

Starting with a blank slate in GRC and building the flow graph works  
fine  
on one device; but the same flow graph on the second laptop opens and  
closes immediately with return code -11. If I run the python code  
outside  
of GRC, I get the segmentation fault.

I was looking for a solution and I came across bug 645 (  
[http://gnuradio.org/redmine/issues/645](http://gnuradio.org/redmine/issues/645)) that was resolved in 3.7.3, but  
these laptops have 3.7.6 (git-133-gd814810) installed.

I noticed that the bug report mentions the avx volk kernel as the issue  
and  
both of my machines indicate that they’re using volk machine avx\_64\_mmx.  
I  
also ran volk\_profile and changed “volk\_32fc\_32f\_multiply\_32fc a\_avx  
generic” to “volk\_32fc\_32f\_multiply\_32fc generic generic” as indicated  
in  
the bug report, but I still see the problem.

To be honest, I don’t really know how the volk library works and I’m not  
sure what else I should try changing. If anybody has suggestions, it  
would  
be greatly appreciated.

Thanks in advance,

-Mike

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 31, 2014, 7:16pm UTC](https://www.ruby-forum.com/t/qt-gui-segmentation-fault/232856/2 "2014-10-31T19:16:40Z")

</div>

Just a follow up on this - I was able to resolve the issue with the  
following modifications in the volk\_config file:

before: volk\_32fc\_32f\_multiply\_32fc a\_avx generic  
changed to: volk\_32fc\_32f\_multiply\_32fc generic generic

before: volk\_32fc\_deinterleave\_64f\_x2 a\_avx u\_avx  
changed to: volk\_32fc\_deinterleave\_64f\_x2 generic u\_avx

While I’m happy to have it working again, I don’t exactly know what this  
modification actually does. If anyone with knowledge of the volk library  
can give me a quick bit of info about what these modifications are  
actually  
doing and / or why this would resolve the segfault issue, it would ease  
my  
mind a bit.

Thanks,

-Mike

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 31, 2014, 8:52pm UTC](https://www.ruby-forum.com/t/qt-gui-segmentation-fault/232856/3 "2014-10-31T20:52:41Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 31, 2014, 8:58pm UTC](https://www.ruby-forum.com/t/qt-gui-segmentation-fault/232856/4 "2014-10-31T20:58:40Z")

</div>

Hi Johnathan,

Thanks for the reply. I’m using Ubuntu 14.04 on a Dell XPS laptop with 8  
cores. Results of the grep call are below:

model name : Intel(R) Core™ i7-2630QM CPU @ 2.00GHz  
model name : Intel(R) Core™ i7-2630QM CPU @ 2.00GHz  
model name : Intel(R) Core™ i7-2630QM CPU @ 2.00GHz  
model name : Intel(R) Core™ i7-2630QM CPU @ 2.00GHz  
model name : Intel(R) Core™ i7-2630QM CPU @ 2.00GHz  
model name : Intel(R) Core™ i7-2630QM CPU @ 2.00GHz  
model name : Intel(R) Core™ i7-2630QM CPU @ 2.00GHz  
model name : Intel(R) Core™ i7-2630QM CPU @ 2.00GHz

I noticed that there are 12 other uses of a\_avx in volk\_config. Is it  
likely that using any of the kernels with a\_avx will cause a similar  
issue?

-Mike

On Fri, Oct 31, 2014 at 2:19 PM, Johnathan C.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 31, 2014, 9:44pm UTC](https://www.ruby-forum.com/t/qt-gui-segmentation-fault/232856/5 "2014-10-31T21:44:00Z")

</div>

On Thu, Oct 30, 2014 at 4:07 PM, Michael R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> While I’m happy to have it working again, I don’t exactly know what this  
> modification actually does. If anyone with knowledge of the volk library can  
> give me a quick bit of info about what these modifications are actually  
> doing and / or why this would resolve the segfault issue, it would ease my  
> mind a bit.
> 
> Thanks,
> 
> -Mike

Hi Mike,

So each VOLK kernel has several internal implementations that are  
architecture specific (SSE, AVX, NEON, etc). A call to the VOLK  
library looks like volk\_32fc\_32f\_multiply\_32fc(output\_buffer,  
input\_buffer0, input\_buffer1, number\_of\_points). Internally VOLK has a  
dispatcher that uses the implementation that is “best” for your  
machine. The “best” implementation is determined by running  
volk\_profile which runs all of the implementations available and write  
the fastest one to volk\_config. At run-time VOLK reads this file to  
know which version of each kernel to actually run.

Can you tell me your processor model name and flags? A copy of  
/proc/cpuinfo (just one of the processors) would be useful.

Nathan

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 31, 2014, 10:03pm UTC](https://www.ruby-forum.com/t/qt-gui-segmentation-fault/232856/6 "2014-10-31T22:03:05Z")

</div>

Hi Nathan,

Thanks for the info. In case you didn’t see my previous reply, the  
processors are all “Intel(R) Core™ i7-2630QM CPU @ 2.00GHz”

-Mike

On Fri, Oct 31, 2014 at 3:32 PM, West, Nathan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [November 2, 2014, 4:30pm UTC](https://www.ruby-forum.com/t/qt-gui-segmentation-fault/232856/7 "2014-11-02T16:30:38Z")

</div>

On Fri, Oct 31, 2014 at 4:21 PM, Michael R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi Nathan,
> 
> Thanks for the info. In case you didn’t see my previous reply, the  
> processors are all “Intel(R) Core™ i7-2630QM CPU @ 2.00GHz”
> 
> -Mike

Ok, I think I understand what’s going wrong here. We’re calling an  
aligned  
VOLK call directly inside the fft function of that block that works off  
a  
buffer that we created (properly aligned) and a buffer that FFTW  
created.  
FFTW doesn’t always ship packaged with AVX support, so the FFT buffers  
are  
only designed for SSE use – that is, only guaranteed to be 16-byte  
aligned. AVX requires 32-byte alignment.

The fix is simply. Just remove the \_a call from lines 268 and 276 (in  
sink\_c\_impl.cc). I was thinking that both buffers would be guaranteed to  
have the right alignment, so I skipped the volk dispatcher and called  
directly into the aligned kernel. We might just have to ban use of  
anything  
but the dispatchers in GNU Radio code from now on.

I’m not in a place to fix this right now, so I just reopened issue #645  
to  
remind myself to do this when I can.

Tom
