ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

[Bug] DEB version still crashes in ver. 0.8.0

Open Manamama opened this issue 2 years ago • 1 comments

Version

0.8.0

Bug description

This is a more elegant restatement of my similar report tucked into this other bug.

In short, it is a "dirty" box with many packages and limited free memory (somewhat on purpose, for bug hunting):

OS: Ubuntu 20.04.5 LTS x86_64 
Kernel: 5.4.0-135-generic 
Uptime: 4 days, 3 hours, 52 mins 
Packages: 4369 (dpkg), 31 (flatpak), 30 (snap) 
Memory: 6407MiB / 7844MiB 

Here are the outputs on that box:

#to make sure only the newest deb one is running:
pkill chat-gpt

Then:

chat-gpt
[2023-01-07][11:04:37][chatgpt::app::setup][INFO] stepup
[2023-01-07][11:04:37][chatgpt::app::setup][INFO] global_shortcut: ``
[2023-01-07][11:04:37][chatgpt::app::setup][INFO] global_shortcut_parse_error: [AcceleratorParseError]: Unexpected empty token while parsing accelerator
[2023-01-07][11:04:37][chatgpt::app::setup][INFO] stepup::run_check_update
[2023-01-07][11:04:37][chatgpt::utils][INFO] run_check_update: silent=false has_msg=None
[2023-01-07][11:04:37][attohttpc][DEBUG] trying to connect to lencx.github.io:443
[2023-01-07][11:04:37][attohttpc][DEBUG] trying to connect to [2606:50c0:8003::153]:443
[2023-01-07][11:04:37][attohttpc][DEBUG] failed to connect to [2606:50c0:8003::153]:443: Network is unreachable (os error 101)
[2023-01-07][11:04:37][attohttpc][DEBUG] trying to connect to 185.199.108.153:443
[2023-01-07][11:04:37][attohttpc][DEBUG] successfully connected to 185.199.108.153:443, took 51ms
[2023-01-07][11:04:38][attohttpc][DEBUG] GET /ChatGPT/install.json HTTP/1.1
[2023-01-07][11:04:38][attohttpc][DEBUG] creating a length body reader
[2023-01-07][11:04:38][attohttpc][DEBUG] creating gzip decoder
[2023-01-07][11:04:38][attohttpc][DEBUG] status code 200

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Aborted

When trying to debug some:

rust-gdb chat-gpt
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from chat-gpt...
(No debugging symbols found in chat-gpt)
(gdb) run
Starting program: /usr/bin/chat-gpt 
warning: File "/lib/x86_64-linux-gnu/libthread_db.so.1" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/home/zezen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/etc".
To enable execution of this file add
	add-auto-load-safe-path /lib/x86_64-linux-gnu/libthread_db.so.1
line to your configuration file "/home/zezen/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/zezen/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[New LWP 365203]
[New LWP 365204]
[New LWP 365205]
[New LWP 365206]
[New LWP 365207]
[New LWP 365208]
[New LWP 365209]
[New LWP 365210]
[New LWP 365211]
[New LWP 365212]
[New LWP 365213]
[New LWP 365214]
[New LWP 365215]
[2023-01-07][11:05:43][chatgpt::app::setup][INFO] stepup
[New LWP 365216]
[New LWP 365217]
[New LWP 365218]
[New LWP 365219]
[New LWP 365220]
[New LWP 365221]
[New LWP 365222]
[New LWP 365223]
[2023-01-07][11:05:43][chatgpt::app::setup][INFO] global_shortcut: ``
[2023-01-07][11:05:43][chatgpt::app::setup][INFO] global_shortcut_parse_error: [AcceleratorParseError]: Unexpected empty token while parsing accelerator
[2023-01-07][11:05:43][chatgpt::app::setup][INFO] stepup::run_check_update
[2023-01-07][11:05:43][chatgpt::utils][INFO] run_check_update: silent=false has_msg=None
[2023-01-07][11:05:43][attohttpc][DEBUG] trying to connect to lencx.github.io:443
[New LWP 365224]
[LWP 365224 exited]
[New LWP 365226]
[New LWP 365227]
[LWP 365226 exited]
[New LWP 365228]
[New LWP 365229]
[LWP 365227 exited]
[LWP 365228 exited]
[LWP 365229 exited]
[New LWP 365230]
[2023-01-07][11:05:43][attohttpc][DEBUG] trying to connect to [2606:50c0:8002::153]:443
[2023-01-07][11:05:43][attohttpc][DEBUG] failed to connect to [2606:50c0:8002::153]:443: Network is unreachable (os error 101)
[LWP 365230 exited]
[New LWP 365231]
[2023-01-07][11:05:43][attohttpc][DEBUG] trying to connect to 185.199.111.153:443
[2023-01-07][11:05:43][attohttpc][DEBUG] successfully connected to 185.199.111.153:443, took 62ms
[LWP 365231 exited]
[2023-01-07][11:05:43][attohttpc][DEBUG] GET /ChatGPT/install.json HTTP/1.1
[LWP 365215 exited]
[2023-01-07][11:05:43][attohttpc][DEBUG] creating a length body reader
[2023-01-07][11:05:43][attohttpc][DEBUG] creating gzip decoder
[2023-01-07][11:05:43][attohttpc][DEBUG] status code 200
[LWP 365213 exited]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "chat-gpt" received signal SIGSEGV, Segmentation fault.
0x00007ffff3a366bf in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
(gdb) c
Continuing.

thread 'main' has overflowed its stack
fatal runtime error: stack overflow

Thread 1 "chat-gpt" received signal SIGABRT, Aborted.
0x00007ffff13efa7c in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) q
A debugging session is active.

	Inferior 1 [process 365199] will be killed.

Quit anyway? (y or n) y

After setting breakpoint on that library (GPTChat itself taught me that ;) - I have never "rusted" before) and backtracing:

(gdb) backtrace
#0  0x00007ffff3a366f2 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#1  0x00007ffff3a366f7 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#2  0x00007ffff3a366f7 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#3  0x00007ffff3a366f7 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#4  0x00007ffff3a366f7 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#5  0x00007ffff3a366f7 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#6  0x00007ffff3a366f7 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#7  0x00007ffff3a366f7 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#8  0x00007ffff3a366f7 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#9  0x00007ffff3a366f7 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
[...]
#40904 0x00007ffff3c4321b in gtk_widget_realize () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#40905 0x00007ffff3c434e8 in gtk_widget_map () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#40906 0x00007ffff39d2550 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#40907 0x00007ffff3a1d913 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#40908 0x00007ffff1bb5640 in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#40909 0x00007ffff1bb57a3 in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#40910 0x00007ffff3c434aa in gtk_widget_map () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#40911 0x00007ffff1b97d2f in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#40912 0x00007ffff1bb37d5 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#40913 0x00007ffff1bb5554 in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#40914 0x00007ffff1bb57a3 in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#40915 0x00007ffff3c3d1ce in gtk_widget_show () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#40916 0x00007ffff3c49a79 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#40917 0x00007ffff3a1da80 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#40918 0x0000555555921681 in  ()
#40919 0x00005555556d452c in  ()
#40920 0x00005555556da5f4 in  ()
#40921 0x0000555555954976 in  ()
#40922 0x00005555556b691d in  ()
#40923 0x00005555556d97e8 in  ()
#40924 0x00005555556d84ed in  ()
#40925 0x00005555556d83e5 in  ()
#40926 0x000055555560906c in  ()
#40927 0x000055555573e56a in  ()
#40928 0x000055555570f917 in  ()
#40929 0x00005555555f862e in  ()
#40930 0x000055555570f555 in  ()
#40931 0x00007ffff1382d90 in  () at /lib/x86_64-linux-gnu/libc.so.6
#40932 0x00007ffff1382e40 in __libc_start_main () at /lib/x86_64-linux-gnu/libc.so.6
#40933 0x00005555555edc9e in  ()

So my uneducated guess is that

gtk_widget_show ()

is to blame somewhere. Let us ask Uncle ChatGPT for opinion:

It looks like the segmentation fault is occurring when the gtk_widget_realize function is called, which is part of the GTK library that is used for building graphical user interfaces. This function is called as part of a chain of function calls that starts with g_signal_emit and ends with gtk_widget_show.

It is difficult to determine the cause of the segmentation fault based on the information provided. It could be due to a bug in the GTK library, or it could be caused by an issue in the code that is calling these functions. To further troubleshoot this issue, you could try running the program under a debugger, setting breakpoints in the relevant functions and examining the state of the program at those points.

NB. Even the older version DEB used to run on a "clean" Ubuntu 22 box, so this 0.8.0 one will likely run there too.

OS

OS: Ubuntu 20.04.5 LTS x86_64

Environment

Low RAM memory, many packages installed

Temp fix:

The AppImage way, as before. Or a "clean" box (which I do not use, only for such A/B tests).

Manamama avatar Jan 07 '23 11:01 Manamama

I'm not familiar with linux, and I don't know how to deal with this issue at the moment.

lencx avatar Jan 08 '23 03:01 lencx