On Mon, 5 Apr 2021 11:47:30 +0200
Frank Neumann <beachnase@xxxxxx> wrote:
Hi all, (and happy easter to those to whom it applies),I never expected anyone to have so many files in a directory!
I found a reproducible crash (SIGSEGV) today, based on current Yoshimi (git
commit 22beca9b4).
It's happening as soon as I go to Instrument->Load External and then navigate
to my /usr/share folder. That folder is pretty crowded in my (Linux Mint 20.1)
OS,
it holds some 470 directories and a handful of files.
I was suspecting that either some files/folders have "problematic" characters
in their names, or maybe it's the plain amount of them.
So, I created a copy of that folder structure in /home/xx and started moving
items from it to a ".a" subfolder. And yes, at some point the crashing stops -
roughly when there are only some 406 folders left. It's not a particular folder
that causes the crash to happen - it's about their number, or maybe the
accumulated
length of the strings of all folders.
The crash is happening in src/MasterUI.cpp - a file generated by FLTK. For the
record,
my FLTK version is 1.3.4, so "one behind" the current latest release 1.3.5.
The release notes of 1.3.5 don't mention a specific bug fixed in this area.
I have created a Yoshimi debug build and briefly went through the core dump
with gdb;
find the log below (crash happens in thread #1, at the end of the log). There
is a
local variable "lineno" which has an unhealthy value and which then I guess
causes
the SIGSEGV.
This is the code location of the crash:
while(!tofetch.empty())
{
size_t pos = tofetch.find("\n");
string next = tofetch.substr(0, pos);
filerline[lineno] = new FilerLine(0, 0, 390, 20);
<------------------ here
filerline[lineno]->init(synth,lineno);
The fact that this happens in a generated file makes it appear likely that FLTK
itself is at fault, but maybe there are some "buffer limits" in Yoshimi that
could also be the reason, so I am sending this here first.
Can anyone reproduce this? Or, would you have suggestion how I should further
instrument the code to find out more?
Thanks,
Frank