GammaRay icon indicating copy to clipboard operation
GammaRay copied to clipboard

Segfault on iOS static probe

Open conor888 opened this issue 4 years ago • 2 comments

I have successfully built a static probe for iOS using a CMake toolchain, everything builds and links successfully, and I've included staticprobe.h and the GAMMARAY_STATIC_INJECT macro in my application. The app starts fine on an iPad Pro, but then doesn't respond to any input, and after 10-20 seconds, Xcode shows segfaults.

Build setup:

  • macOS Monterey 12.0
  • Xcode 13.0
  • Qt 5.15.6 for iOS
  • iOS 14.7.1 on iPad Pro
  • CMake iOS toolchain from: https://github.com/leetal/ios-cmake
  • CMake 3.18.0
  • GammaRay 2.11.2, then tried building from master, same results

Build process:

  • Modified 3rdparty/kde/CMakeLists.txt and set gammaray_kitemmodels to STATIC instead of SHARED
  • Modified plugins/widgetinspector/CMakeLists.txt and set gammaray_widget_export_actions to STATIC instead of SHARED (just to get the build to complete, even though I'm not linking it)
  • mkdir build ; cd build
  • cmake -DCMAKE_TOOLCHAIN_FILE=~/Downloads/ios-cmake-4.2.0/ios.toolchain.cmake -DPLATFORM=OS64 -G Xcode -DCMAKE_PREFIX_PATH=/Users/<username>/Qt/5.15.6/ios -DGAMMARAY_BUILD_UI=OFF -DGAMMARAY_STATIC_PROBE=ON -DENABLE_BITCODE=0 -DDEPLOYMENT_TARGET=12.0 ..
  • cmake --build . --config Release
  • Build will fail ~90% of the way through on gammaray_geopositioninfosource
  • Open generated GammaRay.xcodeproject
  • Delete gammaray_geopositioninfosource and gammaray_geopositioninfosource_autogen targets
  • Run cmake --build . --config Release again
  • Build successful

Project setup:

  • Included staticprobe.h in project
  • GAMMARAY_STATIC_INJECT macro
  • Include the following libraries in .pro project file:
    • gammaray_actioninspector_plugin.a
    • gammaray_codecbrowser_plugin.a
    • gammaray_eventmonitor_plugin.a
    • gammaray_fontbrowser_plugin.a
    • gammaray_guisupport.a
    • gammaray_probe.a
    • gammaray_qmlsupport.a
    • gammaray_quickinspector.a
    • gammaray_sceneinspector_plugin.a
    • gammaray_signalmonitor.a
    • gammaray_statemachineviewer_plugin.a
    • gammaray_styleinspector_plugin.a
    • gammaray_timertop_plugin.a
    • gammaray_translatorinspector.a
    • gammaray_widgetinspector_plugin.a
    • libgammaray_common-qt5_15-aarch64.a
    • libgammaray_common_internal.a
    • libgammaray_core-qt5_15-aarch64.a
    • libgammaray_kitemmodels-qt5_15-aarch64.a
    • libgammaray_quickinspector_shared.a
    • libgammaray_signalmonitor_shared.a
  • Add QT += scxml in .pro file since gammaray_statemachineviewer_plugin.a relies on it
  • Builds and links successfully

Running:

  • Starts up with error: Failed to connect to launcher, can't receive probe settings! "QLocalSocket::connectToServer: Invalid name"
  • App does not respond to any touch, buttons don't work, etc.
  • Shortly after, segfault occurs seemingly stemming from GammaRay attempting to inject its logo in the window icon, which iOS does not have:
    • image

Any help would be much appreciated! I know it's a lot and this likely isn't a supported use case, but I feel it's 90% of the way there to working on iOS as a static probe! Thanks

conor888 avatar Oct 14 '21 20:10 conor888

Any update on this? Over a year later and I tried pulling master and doing a build again. It seems now I don't have any issue with building gammaray_geopositioninfosource as I did last time, but still the application on iOS will start with the same error Failed to connect to launcher, can't receive probe settings! "QLocalSocket::connectToServer: Invalid name", and not respond to user input on the iPad screen.

conor888 avatar Dec 21 '22 01:12 conor888

sorry, no updates so far. I don't have an apple machine to test/debug stuff. However, patches are welcome.

Waqar144 avatar Jan 04 '23 14:01 Waqar144