-
Notifications
You must be signed in to change notification settings - Fork 70
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
Segmentation fault with Vte.Terminal.spawn_async #262
Comments
Since you apparently already understand the vte API: Can you provide some self-contained example reproducing the crash? Otherwise, I'd have to write such an example myself and I never used vte before. Edit: Quick look at vte's API docs say you could be referring to either https://developer.gnome.org/vte/unstable/vte-Vte-PTY.html#vte-pty-spawn-async or https://developer.gnome.org/vte/unstable/VteTerminal.html#vte-terminal-spawn-async. I'll definitely need more information. |
@psychon I refer to this here is the example #!/usr/bin/env lua
local lgi = require("lgi")
local Gtk = lgi.require('Gtk', '3.0')
local Gdk = lgi.require('Gdk', '3.0')
local Vte = lgi.require('Vte','2.91')
local GLib = lgi.require('GLib', '2.0')
local app = Gtk.Application()
local term = Vte.Terminal()
main_window = Gtk.Window {
width_request = 600,
height_request = 400,
Gtk.ScrolledWindow{ id = 'scroll' }
}
function app:on_activate()
font = term:get_font()
font:set_size(font:get_size() * 1.1)
term:spawn_async(
Vte.PtyFlags.DEFAULT, -- pty flag
nil, -- working directory
{ '/bin/bash' }, -- envv
nil, -- argv
GLib.SpawnFlags.DEFAULT, -- spawn_flags
1, -- child_setup
nil, -- child_setup_data
nil, -- child_setup_data_destroy
1000, -- timeout
nil, -- cancel callback
function() print('Hello World!') end
)
main_window.child.scroll:add(term)
main_window:show_all()
self:add_window(main_window)
end
app:run()
|
Hm. According to
I will need to figure out what the actual API of this function in gobject-introspection and lua is. It might be that it has less arguments than the C function (e.g. Edit:
Edit: From the same run as the above:
This is a random pointer somewhere after Edit: Another run:
This is executing all-zero memory? The crash then happens when it runs into something that it should not run into, I guess. |
I now think that this is a bug in Vte. The
Since no scope is given, the scope is Could you open a bug report at https://gitlab.gnome.org/GNOME/vte/-/issues? Perhaps the people there will conclude that my reasoning here is wrong. We will see. Edit: However, there is still something wrong going on. I do not understand what is going on with the
|
You mean the problem is with vte and not LGI? |
I don't quite understand Do you mean that the whole spawn_async is being called wrong? |
Well... I'd be more careful: I think there is at least one problem with vte. :-) According to the annotation on its arguments,
Neither do I. |
The error may be due to the vte, since the |
Data bound to callbacks must be flagged as "internal". The problem is also the callback itself data is marked as internal because of the following issue: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/430 Avoid the problem by checking the scope: if it is invalid, it is likely real data (and not a callback), hence it should be marked. Fixes lgi-devs#241, lgi-devs#262 and lgi-devs#285.
Data bound to a callback must be flagged as "internal". The problem is also the callback itself is marked as such because of this issue: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/430 Avoid the problem by checking the scope: if it is invalid, it is likely real data (and not a callback), hence it can be marked. Fixes lgi-devs#241, lgi-devs#262 and lgi-devs#285.
Fixed via #285. I assume. |
Not at all, the error is still valid today. |
Hello
I have made a terminal in lua
and I wanted to add tabs but I can not because the
spawn_async
ofvte
does not work with lgi,I did some tests and I found that the problem is withspawn_async
that makes the segmentation program faultI just wanted to know if there is any way to solve it :)
Thanks for your work on LGI ❤️
Thank You!
The text was updated successfully, but these errors were encountered: