[yoshimi] Re: Crash happening when I enter /usr/share/

  • From: Will Godfrey <willgodfrey@xxxxxxxxxxxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Mon, 5 Apr 2021 11:57:59 +0100

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 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

I never expected anyone to have so many files in a directory!
FilerLine size shares MIDI_LEARN_BLOCK which is currently set to 400.

As a test, try temporarily changing all occurrences of this in
src/UI/MasterUI.fl to something like 600.

Originally I tried to make this variable size, but kept hitting obscure
problems. I guess I'll have to give that another try :(

Will.

-- 
Will J Godfrey
https://willgodfrey.bandcamp.com/
http://yoshimi.github.io
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.
Yoshimi source code is available from either: 
https://sourceforge.net/projects/yoshimi
Or: https://github.com/Yoshimi/yoshimi
Our list archive is at: https://www.freelists.org/archive/yoshimi
To post, email to yoshimi@xxxxxxxxxxxxx

Other related posts: