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

Segfault when creating a new file #1174

Open
madmaxoft opened this issue Feb 26, 2024 · 5 comments
Open

Segfault when creating a new file #1174

madmaxoft opened this issue Feb 26, 2024 · 5 comments

Comments

@madmaxoft
Copy link
Contributor

I'm using ZBS from current master at 803d382 on KDE Neon. I've just noticed a segfault in ZBS that is 100%-repeatable on one of my computers, but not on the other (with identical OS and ZBS version):

  1. Open ZBS
  2. Change to a different project folder using toolbar and browsing for the folder
  3. Create a new file via the rclk menu in the Project dock window
  4. ZBS crashes

I've tried running ZBS under gdb with the following:

gdb bin/linux/x64/lua

[... snip ...]

(No debugging symbols found in bin/linux/x64/lua)
(gdb) r src/main.lua
Starting program: /home/xoft/Programs/ZeroBraneStudio/bin/linux/x64/lua src/main.lua
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after vfork from child process 24605]

[... snip ...]

[Thread 0x7ffff21ff640 (LWP 24758) exited]

(lua:24602): Gtk-WARNING **: 20:30:06.069: Negative content width -8 (allocation 10, extents 9x9) while allocating gadget (node entry, owner GtkEntry)
[Thread 0x7ffff32b7640 (LWP 24759) exited]
[New Thread 0x7ffff32b7640 (LWP 24760)]
[New Thread 0x7ffff21ff640 (LWP 24761)]
[New Thread 0x7fffd8ffd640 (LWP 24762)]
[New Thread 0x7fffd27fc640 (LWP 24763)]
double free or corruption (out)

Thread 1 "lua" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352601600) at ./nptl/pthread_kill.c:44
Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
44      ./nptl/pthread_kill.c: No such file or directory.

Unfortunately I'm not too familiar with Linux troubleshooting, so I have no idea what to explore next in order to provide more information. Not to mention that I don't think this is exactly ZBS's fault, Lua shouldn't segfault like this, I assume some loaded library is causing this.

@pkulchenko
Copy link
Owner

Interesting; thank you for the report. Do you also get the crash when you cancel adding the filename (select new file, but then use Esc to cancel)? Does the filename matter in this case or does it happen with any file added?

@madmaxoft
Copy link
Contributor Author

madmaxoft commented Feb 26, 2024

I don't even get to enter a filename, ZBS crashes within a second or two after displaying the filename edit box.

@madmaxoft
Copy link
Contributor Author

I think I know what could be causing this.

I have a script that is run by cron that creates a file in the affected project folder, then edits another file, and removes the (previously created) file really quickly (SQLite DB single-row append), it runs every 5 seconds. ZBS seems to catch on the file being created and removed, and that seems to throw it off. The crash doesn't happen in any other project folder, only in this specific one.

@pkulchenko
Copy link
Owner

Very interesting; can you try setting filetree.showchanges=false in the config and see if it makes any difference?

@madmaxoft
Copy link
Contributor Author

No more segfaults when this setting is applied.

So I guess we found the reason, but what can be done about it?

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