Bug 307

Summary: Memory leak caused by sfz engine not closing samples after being read from disk.
Product: LinuxSampler Reporter: Jacek Roszkowski <j.roszk>
Component: otherAssignee: Christian Schoenebeck <cuse>
Severity: major    
Priority: P5    
Version: SVN Trunk   
Hardware: Other   
OS: Linux   
Attachments: Bugfix

Description Jacek Roszkowski 2019-02-26 02:45:06 CET
Created attachment 90 [details]

While running linuxsampler on Raspberry Pi with big sfz file I've noticed that the memory usage was constantly increasing, leading to Segmentation fault when the limit was reached.

This behaviour is caused by a typo in sfz.h which leads to the function pSample->Close() not being called.

I've submitted a patch which fixes the problem for me.
Comment 1 Christian Schoenebeck 2019-02-27 15:55:10 CET
That's correct, I just applied your suggested change to SVN (r3487).

I guess it is time that we really use OVERRIDE everywhere in the code base to avoid such bugs in future.

Thanks for your patch!
Comment 2 Jacek Roszkowski 2019-02-27 17:38:29 CET
This patch probably revealed another bug with closing samples, but I'm still investigating the problem, because I don't know exact steps to reproduce with 100% accuracy.

With long samples (while reading from disk) wanted to be played again linuxsampler sometimes reports "SampleFile::SetPos (...) not opened" which causes the desired sample to be played again not immediately, but after the first playback is finished.
Comment 3 Christian Schoenebeck 2019-03-07 13:43:38 CET
I just added the previously mentioned OVERRIDEs to avoid this bug in future (SVN r3492).