question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segmentation Fault No TraceBack with PyQt5 via from PyQt5 import ...

See original GitHub issue

0.6.7 Python: 3.7.7 (default, Mar 10 2020, 15:43:03) Executable: /Users/seandavis/Desktop/FlightDeck/venv/bin/python OS: Darwin (macOS 10.14.6) Arch: x86_64

I’ve also tested with the latest development built of 0.6.8rc5

Installed Via PIP

I posted a previous issue which was environment related and was addressed by removing all python installs and re-installing 3.7.7 via brew.

After successfully compiling an app, I encounter a Segmentation Fault.

Seans-iMac:~ seandavis$ /Users/seandavis/Desktop/FlightDeck/flightdeck.dist/flightdeck 
Segmentation fault: 11
Seans-iMac:~ seandavis$ /Users/seandavis/Desktop/FlightDeck/flightdeck.dist/flightdeck --debug
2020-04-18 09:11:07,759 — INFO — Acquired lock: </Users/seandavis/Library/Application Support/FlightDeck/run.lock 3497@Seans-iMac.local>
Segmentation fault: 11

I have a built in --debug to the app to write to console events that occur. This Acquired lock is at the very start, even before initializing the GUI via PyQT5.

macOS does not have GDB installed, so I installed, setup the necessary certificates, re-ran nuitka with --debugger and ran it through to get some information.

python -m nuitka --plugin-enable=qt-plugins --include-plugin-directory="venv/lib/python3.7/site-packages/objc" --standalone --debugger --show-progress --show-scons flightdeck.py

As you can see below, it spins up two threads but does not report anything after. Essentially its ‘running’ but I have to force close terminal to get out.

Seans-iMac:FlightDeck seandavis$ gdb /Users/seandavis/Desktop/FlightDeck/flightdeck.dist/flightdeck
GNU gdb (GDB) 9.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin18.7.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /Users/seandavis/Desktop/FlightDeck/flightdeck.dist/flightdeck...
(gdb) run
Starting program: /Users/seandavis/Desktop/FlightDeck/flightdeck.dist/flightdeck 
\[New Thread 0x1803 of process 3469]
[New Thread 0x1903 of process 3469]

Ive compiled and ran this same application on Windows, the only difference being Windows is using win32 and not pyobjc for a specific action.

Running the app via python itself has no issues or complaints.

Modules Used

altgraph==0.17
appdirs==1.4.3
dicttoxml==1.7.4
FormEncode==1.3.1
future==0.18.2
macholib==1.14
Nuitka==0.6.7
packaging==20.3
psutil==5.7.0
PyDispatcher==2.0.5
pyobjc==6.2
pyobjc-core==6.2
pyobjc-framework-Accounts==6.2
pyobjc-framework-AddressBook==6.2
pyobjc-framework-AdSupport==6.2
pyobjc-framework-AppleScriptKit==6.2
pyobjc-framework-AppleScriptObjC==6.2
pyobjc-framework-ApplicationServices==6.2
pyobjc-framework-Automator==6.2
pyobjc-framework-AVFoundation==6.2
pyobjc-framework-AVKit==6.2
pyobjc-framework-BusinessChat==6.2
pyobjc-framework-CalendarStore==6.2
pyobjc-framework-CFNetwork==6.2
pyobjc-framework-CloudKit==6.2
pyobjc-framework-Cocoa==6.2
pyobjc-framework-Collaboration==6.2
pyobjc-framework-ColorSync==6.2
pyobjc-framework-Contacts==6.2
pyobjc-framework-ContactsUI==6.2
pyobjc-framework-CoreAudio==6.2
pyobjc-framework-CoreAudioKit==6.2
pyobjc-framework-CoreBluetooth==6.2
pyobjc-framework-CoreData==6.2
pyobjc-framework-CoreLocation==6.2
pyobjc-framework-CoreMedia==6.2
pyobjc-framework-CoreMediaIO==6.2
pyobjc-framework-CoreML==6.2
pyobjc-framework-CoreServices==6.2
pyobjc-framework-CoreSpotlight==6.2
pyobjc-framework-CoreText==6.2
pyobjc-framework-CoreWLAN==6.2
pyobjc-framework-CryptoTokenKit==6.2
pyobjc-framework-DictionaryServices==6.2
pyobjc-framework-DiscRecording==6.2
pyobjc-framework-DiscRecordingUI==6.2
pyobjc-framework-DiskArbitration==6.2
pyobjc-framework-DVDPlayback==6.2
pyobjc-framework-EventKit==6.2
pyobjc-framework-ExceptionHandling==6.2
pyobjc-framework-ExternalAccessory==6.2
pyobjc-framework-FinderSync==6.2
pyobjc-framework-FSEvents==6.2
pyobjc-framework-GameCenter==6.2
pyobjc-framework-GameController==6.2
pyobjc-framework-GameKit==6.2
pyobjc-framework-GameplayKit==6.2
pyobjc-framework-ImageCaptureCore==6.2
pyobjc-framework-IMServicePlugIn==6.2
pyobjc-framework-InputMethodKit==6.2
pyobjc-framework-InstallerPlugins==6.2
pyobjc-framework-InstantMessage==6.2
pyobjc-framework-Intents==6.2
pyobjc-framework-IOSurface==6.2
pyobjc-framework-iTunesLibrary==6.2
pyobjc-framework-LatentSemanticMapping==6.2
pyobjc-framework-LaunchServices==6.2
pyobjc-framework-libdispatch==6.2
pyobjc-framework-LocalAuthentication==6.2
pyobjc-framework-MapKit==6.2
pyobjc-framework-MediaAccessibility==6.2
pyobjc-framework-MediaLibrary==6.2
pyobjc-framework-MediaPlayer==6.2
pyobjc-framework-MediaToolbox==6.2
pyobjc-framework-Metal==6.2
pyobjc-framework-MetalKit==6.2
pyobjc-framework-ModelIO==6.2
pyobjc-framework-MultipeerConnectivity==6.2
pyobjc-framework-NaturalLanguage==6.2
pyobjc-framework-NetFS==6.2
pyobjc-framework-Network==6.2
pyobjc-framework-NetworkExtension==6.2
pyobjc-framework-NotificationCenter==6.2
pyobjc-framework-OpenDirectory==6.2
pyobjc-framework-OSAKit==6.2
pyobjc-framework-Photos==6.2
pyobjc-framework-PhotosUI==6.2
pyobjc-framework-PreferencePanes==6.2
pyobjc-framework-PubSub==6.2
pyobjc-framework-QTKit==6.2
pyobjc-framework-Quartz==6.2
pyobjc-framework-SafariServices==6.2
pyobjc-framework-SceneKit==6.2
pyobjc-framework-ScreenSaver==6.2
pyobjc-framework-ScriptingBridge==6.2
pyobjc-framework-SearchKit==6.2
pyobjc-framework-Security==6.2
pyobjc-framework-SecurityFoundation==6.2
pyobjc-framework-SecurityInterface==6.2
pyobjc-framework-ServiceManagement==6.2
pyobjc-framework-Social==6.2
pyobjc-framework-SpriteKit==6.2
pyobjc-framework-StoreKit==6.2
pyobjc-framework-SyncServices==6.2
pyobjc-framework-SystemConfiguration==6.2
pyobjc-framework-UserNotifications==6.2
pyobjc-framework-VideoSubscriberAccount==6.2
pyobjc-framework-VideoToolbox==6.2
pyobjc-framework-Vision==6.2
pyobjc-framework-WebKit==6.2
pyparsing==2.4.6
PyQt5==5.14.1
PyQt5-sip==12.7.1
six==1.14.0
SQLObject==3.8.0
toml==0.10.0
xmltodict==0.12.0
  1. Is there a way to help determine where the fault is? GDB doesn’t seem to help.
  2. I’m not familiar with how C works, I’ve already stopped one of the threads from starting on launch which runs the objc components to see if this was the issue. Does the compiled instance still consider pyobjc even if its never called?
  3. As I’ve mentioned earlier, the PyQT5 components (including threads) works fine on a Windows compiled equivalent, and its a central component of the app.

In the mean time I’ll re-compile over-and-over with print statements to see where its failing.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
alitrackcommented, Apr 20, 2020

make a empty folder under PyQt5,

mkdir /Users/seandavis/Desktop/FlightDeck/flightdeck.dist/PyQt5/Qt

and try it again.

0reactions
photoszztcommented, Dec 25, 2021

I’m hitting the same problem but creating an empty Qt dir doesn’t help for my case. But I’m using the app bundle.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pyqt5 segmentation fault on import - python - Stack Overflow
It works fine for me using python 2.7.14, qt 5.9.1, sip 4.19.3 and pyqt 5.9. The gdb output is no real use unless...
Read more >
python - Segmentation fault, running out of memory? PyQt5
It looks like the program is looking for a handle in libEGL and that function is triggering the segfault. Unfortunately this likely has...
Read more >
Segmentation Fault With QProcess Manager - Python GUIs
Ren-Hsien_Hsu | 2021-01-16 04:21:25 UTC | #1 Hello, I tried to play with the qprocess_manager, but I've been getting TypeError: Traceback ...
Read more >
Peacock Segmentation Fault: 11 for all Examples
Type "help", "copyright", "credits" or "license" for more information. >>> import PyQt5. >>> PyQt5.__file__. ' ...
Read more >
When C extensions crash: easier debugging for your Python ...
If we run it: $ python3 crash.py Segmentation fault (core dumped). There's no traceback. And if you can't get access to the core...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found