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

[BUG] v2 laucher crash when path to instance info file does not exist #293

Open
juozaspo opened this issue Sep 12, 2023 · 0 comments
Open
Labels
bug Something doesn't work pending A fix for the issue is in the works v2

Comments

@juozaspo
Copy link

juozaspo commented Sep 12, 2023

Describe the bug
V2 launcher crash when path to instance info file does not exist, e.g. after accidentally deleting instance folder or instance file w/o deleting instance entry using Betacraft ui or editing settings.json and deleting such entry, also no error message or crash log in betacraft.log file, program silently fails with a segfault.

To Reproduce
Steps to reproduce the behavior:

  1. Create instance, close v2 launcher
  2. Delete instance folder and/or settings file while not removing instance using the launcher ui
  3. Try to run the launcher, see it fail to start as window would not appear
  4. Run under gdb, see a segfault as shown in backtrace below

Expected behavior
No crash when instance file could not be loaded, it should be created with default settings if file does not exist or is corrupt, also instance should be disabled and/or warning/error/etc should be shown if needed, including cases where file could not be renamed/deleted/modified/etc.

Screenshots
N/A

Desktop (please complete the following information):

Additional context

gdb log including backtrace
juozas@xubuntu:~$ LC_ALL=C gdb /opt/betacraft/bin/Betacraft 
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 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:
<https://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 /opt/betacraft/bin/Betacraft...
(No debugging symbols found in /opt/betacraft/bin/Betacraft)
(gdb) r
Starting program: /opt/betacraft/bin/Betacraft 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Detected locale "C" with character encoding "UTF-8", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.
[New Thread 0x7fffef330640 (LWP 5760)]
[New Thread 0x7fffeeb2f640 (LWP 5761)]
[17:00:36] Files initialized
[New Thread 0x7fffee259640 (LWP 5762)]
[Thread 0x7fffee259640 (LWP 5762) exited]
<ip censored>
[New Thread 0x7fffee259640 (LWP 5763)]
[Thread 0x7fffee259640 (LWP 5763) exited]
[New Thread 0x7fffee259640 (LWP 5764)]
[Thread 0x7fffee259640 (LWP 5764) exited]
[New Thread 0x7fffee259640 (LWP 5765)]
[Thread 0x7fffee259640 (LWP 5765) exited]
[New Thread 0x7fffee259640 (LWP 5766)]
[Thread 0x7fffee259640 (LWP 5766) exited]

Thread 1 "Betacraft" received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-vec.S:126
126	../sysdeps/x86_64/multiarch/strlen-vec.S: No such file or directory.
(gdb) set pagination off
(gdb) thread apply all bt full

Thread 3 (Thread 0x7fffeeb2f640 (LWP 5761) "QXcbEventQueue"):
#0  0x00007ffff63ccd7f in __GI___poll (fds=0x7fffeeb2eab8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
        sc_ret = -516
        sc_cancel_oldtype = 0
        sc_ret = <optimized out>
#1  0x00007ffff57197e2 in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
No symbol table info available.
#2  0x00007ffff571b22c in xcb_wait_for_event () from /lib/x86_64-linux-gnu/libxcb.so.1
No symbol table info available.
#3  0x00007ffff2e7fd28 in ?? () from /opt/betacraft/plugins/platforms/../../lib/libQt6XcbQpa.so.6
No symbol table info available.
#4  0x00007ffff6b0638f in ?? () from /opt/betacraft/bin/../lib/libQt6Core.so.6
No symbol table info available.
#5  0x00007ffff6348b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
        ret = <optimized out>
        pd = <optimized out>
        out = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737488344000, 1820314035544037417, 140737198093888, 11, 140737324025936, 140737488344352, -1820350775209846743, -1820332133814593495}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#6  0x00007ffff63daa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
No locals.

Thread 2 (Thread 0x7fffef330640 (LWP 5760) "QDBusConnection"):
#0  0x00007ffff63ccd7f in __GI___poll (fds=0x555569a5f840, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
        sc_ret = -516
        sc_cancel_oldtype = 0
        sc_ret = <optimized out>
#1  0x00007ffff58311f6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#2  0x00007ffff57d93e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#3  0x00007ffff6c19caa in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/betacraft/bin/../lib/libQt6Core.so.6
No symbol table info available.
#4  0x00007ffff697ad7b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/betacraft/bin/../lib/libQt6Core.so.6
No symbol table info available.
#5  0x00007ffff6a8740c in QThread::exec() () from /opt/betacraft/bin/../lib/libQt6Core.so.6
No symbol table info available.
#6  0x00007ffff618568a in ?? () from /opt/betacraft/bin/../lib/libQt6DBus.so.6
No symbol table info available.
#7  0x00007ffff6b0638f in ?? () from /opt/betacraft/bin/../lib/libQt6Core.so.6
No symbol table info available.
#8  0x00007ffff6348b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
        ret = <optimized out>
        pd = <optimized out>
        out = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737488343840, 1820314035544037417, 140737206486592, 2, 140737324025936, 140737488344192, -1820347476138092503, -1820332133814593495}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#9  0x00007ffff63daa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
No locals.

Thread 1 (Thread 0x7ffff569c900 (LWP 5757) "Betacraft"):
#0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-vec.S:126
No locals.
#1  0x000055555562ff24 in bc_file_absolute_path ()
No symbol table info available.
#2  0x000055555562b792 in bc_instance_fill_object_from_json ()
No symbol table info available.
#3  0x000055555562c7c9 in bc_instance_get_all ()
No symbol table info available.
#4  0x00005555556125fa in InstanceListWidget::populateInstanceList() ()
No symbol table info available.
#5  0x0000555555612ec8 in InstanceListWidget::InstanceListWidget(QWidget*) ()
No symbol table info available.
#6  0x000055555560cb87 in MainWindow::MainWindow(QWidget*) ()
No symbol table info available.
#7  0x0000555555606db0 in main ()
No symbol table info available.
@juozaspo juozaspo added the bug Something doesn't work label Sep 12, 2023
@notdevcody notdevcody added pending A fix for the issue is in the works v2 labels Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work pending A fix for the issue is in the works v2
Projects
None yet
Development

No branches or pull requests

2 participants