Bug 1284

Summary: Segfaults on Mac OS X with at least fx2lafw, saleae-logic16, hantek-4032l, demo
Product: PulseView Reporter: Uwe Hermann <uwe>
Component: AcquisitionAssignee: Nobody <nobody>
Status: RESOLVED FIXED    
Severity: blocker CC: Anders.Montonen, andy, paulcrawfordgm, sigrok, silverdr, vpalmu
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: Mac OS X   
Attachments: Crash 1, Qt 5.5.1
Crash 2, Qt 5.11.1
Sample data for segfault 11
Crash 1 - segfault 11

Description Uwe Hermann 2018-09-23 14:51:14 CEST
As reported by felix_ on IRC there are PV segfaults on Mac currently, which I can reproduce.

One of the setups that reproducibly leads to the segfault:

 - Start PV, select fx2lafw (e.g. Saleae Logic), use 50Msamples and 12MHz samplerate, pres Run.

 - The acquisition will seem to hang/stop after 1-2 seconds, if you wait long enough or try to kill PV, there'll be a "Segmentation fault: 11" on the console. I'll attach the Mac debug log.

I've verified that this seems to be

 - Mac specific, doesn't seem to happen on Linux or Windows.

 - PV-specific, doesn't seem to happen with sigrok-cli.

 - Unrelated to Qt versions, happens with Qt 5.5.1 and Qt 5.11.1.

 - Not (very) driver-specific, happens with fx2lafw and saleae-logic16 at least.
Comment 1 Uwe Hermann 2018-09-23 14:52:49 CEST
Created attachment 456 [details]
Crash 1, Qt 5.5.1
Comment 2 Uwe Hermann 2018-09-23 14:53:10 CEST
Created attachment 457 [details]
Crash 2, Qt 5.11.1
Comment 3 Anders Montonen 2018-09-27 21:05:42 CEST
The same crash can be reproduced by loading the failing.sr or working.sr dumps from sigrok-dumps/sdcard/sd_mode/imx6_quad.
Comment 4 Christian Beer 2018-09-28 12:00:08 CEST
Created attachment 463 [details]
Sample data for segfault 11

I am a newbie but this crash also happens for me with latest daily. It happens when I open "Hoch.sr" and then try to choose a conversion for CH1. Crahes with both "threshold" and "shmitt-trigger".
Comment 5 Christian Beer 2018-09-28 12:01:08 CEST
Created attachment 464 [details]
Crash 1 - segfault 11

The crash that happens with the attached "Sample data for segault 11"
Comment 6 Christian Beer 2018-09-28 12:01:39 CEST
(In reply to Christian Beer from comment #4)
> Created attachment 463 [details]
> Sample data for segfault 11
> 
> I am a newbie but this crash also happens for me with latest daily. It
> happens when I open "Hoch.sr" and then try to choose a conversion for CH1.
> Crahes with both "threshold" and "shmitt-trigger".

"daily" meaning "nightly"
Comment 7 Uwe Hermann 2018-09-29 21:37:32 CEST
We're currently working on finding the best fix for this. We know it's happening when HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS in CMakeLists.txt in PulseView is enabled. Until the permanent fix lands in mainline (soonish) you can manually disable that and the crashes should stop.
Comment 8 Uwe Hermann 2018-10-03 17:27:55 CEST
*** Bug 1248 has been marked as a duplicate of this bug. ***
Comment 9 vpalmu 2018-10-11 12:47:54 CEST
*** Bug 1301 has been marked as a duplicate of this bug. ***
Comment 10 Uwe Hermann 2018-10-13 18:07:46 CEST
This has been fixed for now via a workaround in de2fc10b2b067705e623b9781a332ad8fa3f4f88. We'll probably have a more permanent solution later, but the crashes should be gone now.

Please try the latest DMG we provide and report back if everything works fine now, thanks!
Comment 11 paulcrawfordgm 2018-10-14 00:21:38 CEST
I have just tried the MacOS nightly image and it works fine now both at startup and extended running. Thanks for the fix!
(In reply to Uwe Hermann from comment #10)
> This has been fixed for now via a workaround in
> de2fc10b2b067705e623b9781a332ad8fa3f4f88. We'll probably have a more
> permanent solution later, but the crashes should be gone now.
> 
> Please try the latest DMG we provide and report back if everything works
> fine now, thanks!