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

Struggling to launch manually built GC #430

Open
awsdert opened this issue Apr 14, 2023 · 5 comments
Open

Struggling to launch manually built GC #430

awsdert opened this issue Apr 14, 2023 · 5 comments

Comments

@awsdert
Copy link

awsdert commented Apr 14, 2023

For starters I tried the way it seemed like it was supposed to be launched which got me:

$ ./gameconqueror
bash: ./gameconqueror: Permission denied
$ sudo ./gameconqueror
...
sudo: ./gameconqueror: command not found

So then I tried adding the variables to the makefile and adding a launch target which got me further but I still ran into an issue:

$ make launch
/usr/bin/pkexec /mnt/CODE/github/scanmem/gui/GameConqueror.py
Error executing /mnt/CODE/github/scanmem/gui/GameConqueror.py: Permission denied
make: *** [Makefile:982: launch] Error 127

What do I need to do to get it to launch so I can test the changes I make?

Edit: Btw lines 975+ in the makefile now look like this:

PKEXEC:=$(shell command -v "pkexec")
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

DATADIR?=$(abspath .)
launch:
	$(PKEXEC) $(DATADIR)/GameConqueror.py
@sriemer
Copy link
Member

sriemer commented Apr 19, 2023

Please check file permissions, check if pkexec policies have been installed properly, please provide your Linux distribution and version. First of all, follow the README before changing any code to stay in a supported scenario.

@awsdert
Copy link
Author

awsdert commented Apr 19, 2023

Ah right, I forgot linux requires an execution permission, I'll check that when I next get round to trying sometime before the end of the week

@awsdert
Copy link
Author

awsdert commented Apr 19, 2023

Got round to it and yeah that sorted the problem, ran into an error at the first hurdle, since this is the 1st time I'm diving into python and I'm new to gameconqueror's code I started by trying to add the column for the new attribute for each entry "Pointer Type", I used the "Type" variant as a template then edited it based on what I could see needed changing and what probably needed changing, I added this under MEMORY_TYPES

POINTER_TYPES = ['','int8', 'uint8',
                'int16', 'uint16',
                'int32', 'uint32',
                'int64', 'uint64']

And added this under the last entry of the # init CheatList TreeView section:

 # Pointer Type
        misc.treeview_append_colomn(self.cheatlist_tv,_('Pointer Type'), 5
                                        ,renderer_class = Gtk.CellRendererCombo
                                        ,attributes = (('text',5),)
                                        ,properties = (('editable', True)
                                                      ,('has-entry', False)
                                                      ,('model', misc.build_simple_str_liststore(POINTER_TYPES))
                                                      ,('text-column', 0))
                                        ,signals = (('edited', self.cheatlist_edit_type_cb),
                                                    ('editing-started', self.cheatlist_edit_start),
                                                    ('editing-canceled', self.cheatlist_edit_cancel),)

And got this error output:

(GameConqueror.py:411773): Gtk-CRITICAL **: 13:27:37.258: gtk_clipboard_get_for_display: assertion 'display != NULL' failed
/mnt/CODE/github/scanmem/gui/./GameConqueror.py:1199: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading
  GObject.threads_init()
./GameConqueror.py:1200: DeprecationWarning: Gdk.threads_init is deprecated
  Gdk.threads_init()

(GameConqueror.py:411773): Gtk-CRITICAL **: 13:27:37.261: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(GameConqueror.py:411773): Gtk-CRITICAL **: 13:27:37.261: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(GameConqueror.py:411773): Gtk-CRITICAL **: 13:27:37.261: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
./gameconqueror: line 10: 411773 Segmentation fault      (core dumped) $PKEXEC $DATADIR/GameConqueror.py "$@"

Judging by the output it's only catching the error, not telling me where to look, any ideas?

@sriemer
Copy link
Member

sriemer commented Apr 21, 2023

Don't try to run GameConqueror as root. Run it from a user account that has a GNOME installed, is logged in to a GNOME session, and a display variable is set this way.
Otherwise, do the full coredump debugging procedure.

  • set ulimit -c unlimited to collect the coredump at all
  • check the tool that collects coredumps in cat /proc/sys/kernel/core_pattern (usually systemd)
  • retrigger the coredump, find it in /var/lib/systemd/coredump/
  • install gdb, open gdb, the executable, and the coredump
  • install the related source and debug packages that gdb reports
  • use gdb bt command to look at the backtrace/calltrace

@awsdert
Copy link
Author

awsdert commented Apr 22, 2023

After being reminded of that permissions issue I went back to just ./gameconqueror, is the gnome stuff not passed through that way then? In that case what would I need to add to the command to get it to pass through always? Is just setting DISPLAY=$DISPLAY between $PKEXEC and $DATADIR/GameConqueror.py enough?

Edit: That didn't work out, turns out it insists on the next argument being the name of the file to execute

Edit 2: Gonna try adding an argument to GameConqueror.py itself so that can directly declare the variables that need during experiments, I'm sure it's not needed for the official version so it's not a big deal if that's not included via whatever patch I eventually manage to submit. Anyways here's what I'm considering trying, since I'm not heavily familiar with python or argparse I figure I best get a sanity check here 1st:

parser.add_argument('-D', '--define', type=str, action='append', dest='define',
                        help=_('define an environment variable'))
...
for i in args.define:
        n = l = i:len()
        if ( "=" in i )
            l = i.index("=")
            n = l + 1
        x = i[:l]
        v = i[n:]
        os.environ[x] = v

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