Crash in os.flatpak.FlatpakHostCommand.start when constructing the RPC parameters using g_variant_new() #3616
-
When building with Lines 286 to 293 in bee2188 The GDB trace of the thread in question at this stage is as follows:
The details of the locals/arguments in frame 6 are as follows:
I'm not entirely sure what the code in question does and more precisely what it should do instead. To figure this out, somebody with better knowledge of Glib would have to help out, as I know very little of it. Reading material
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
To test this (from the top of my head):
diff --git a/com.mitchellh.ghostty.yml b/com.mitchellh.ghostty.yml
index cb8e295..0521103 100644
--- a/com.mitchellh.ghostty.yml
+++ b/com.mitchellh.ghostty.yml
@@ -6,6 +6,8 @@ sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.ziglang
command: ghostty
+build-options:
+ no-debuginfo: true
finish-args:
- "--allow=devel"
- "--device=dri"
@@ -21,13 +23,13 @@ modules:
build-options:
append-path: /usr/lib/sdk/ziglang
build-commands:
- - cd ghostty && patch -p1 --forward < ../flatpak.patch
+ # - cd ghostty && patch -p1 --forward < ../flatpak.patch
- tar -xf vendor.tar.gz -C ghostty
# The listed integrations are _disabled_ such that we _do_ build them from
# source. This way we don't have to add each library as an explicit
# dependency, simplifying the build process.
- cd ghostty && zig build
- -Doptimize=ReleaseFast
+ -Doptimize=Debug
-Dgtk-adwaita=true
-Dcpu=baseline
-Dflatpak=true
@@ -43,9 +45,12 @@ modules:
--prefix /app
- install -Dm644 ${FLATPAK_ID}.metainfo.xml -t /app/share/metainfo/
sources:
- - type: archive
- url: https://release.files.ghostty.org/1.0.0/ghostty-source.tar.gz
- sha256: 7fcb5fed08bd23d54be138af4f63a78cf5addddbe40322465b520cf14c46f181
+ # - type: archive
+ # url: https://release.files.ghostty.org/1.0.0/ghostty-source.tar.gz
+ # sha256: 7fcb5fed08bd23d54be138af4f63a78cf5addddbe40322465b520cf14c46f181
+ # dest: ghostty
+ - type: dir
+ path: /var/home/yorickpeterse/Projects/zig/ghostty
dest: ghostty
- type: dir
path: data Then open flatpak run org.flatpak.Builder --force-clean --install-deps-from=flathub --ccache --mirror-screenshots-url=https://dl.flathub.org/media/ --repo=repo builddir com.mitchellh.ghostty.yml
flatpak install ./repo com.mitchellh.ghostty --reinstall Then to run a debug session: flatpak run --devel --command=bash com.mitchellh.ghostty
gdb /app/bin/ghostty Then press |
Beta Was this translation helpful? Give feedback.
-
👋 Ptyxis author here just peeking in.
Crashing in If you're going the route of calling the D-Bus API directly, here is an example of doing that from my IDE project GNOME Builder, https://gitlab.gnome.org/GNOME/gnome-builder/-/blob/main/src/libide/threading/ide-flatpak-subprocess.c#L1385 which should be pretty easy to rewrite in Zig. |
Beta Was this translation helpful? Give feedback.
-
Forgot to add this over the weekend: I looked at the data passed to the glib function in question, but it seems everything is valid, i.e. there are no NULL pointers passed for the PWD or the arguments as far as I was able to tell. It's possible If anybody is reading this and has a familiarity with both Zig and the glib API, help with this would be greatly appreciated 😃 |
Beta Was this translation helpful? Give feedback.
-
@mitchellh Seeing as this is an actual bug, would it be possible to promote this discussion into an issue? That might also help with the visibility 😃 |
Beta Was this translation helpful? Give feedback.
I opened a PR (#5213) with the fix for this, but I still haven't got the actual terminal working yet. It stopped crashing at least, though.