Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault on iOS static probe #654

Open
conor888 opened this issue Oct 14, 2021 · 2 comments
Open

Segfault on iOS static probe #654

conor888 opened this issue Oct 14, 2021 · 2 comments

Comments

@conor888
Copy link

conor888 commented Oct 14, 2021

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:

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
Copy link
Author

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.

@Waqar144
Copy link
Contributor

Waqar144 commented Jan 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants