Bug 307 - Memory leak caused by sfz engine not closing samples after being read from disk.
Summary: Memory leak caused by sfz engine not closing samples after being read from disk.
Status: RESOLVED FIXED
Alias: None
Product: LinuxSampler
Classification: Unclassified
Component: other (show other bugs)
Version: SVN Trunk
Hardware: Other Linux
: P5 major
Assignee: Christian Schoenebeck
URL:
Depends on:
Blocks:
 
Reported: 2019-02-26 02:45 CET by Jacek Roszkowski
Modified: 2019-03-07 13:43 CET (History)
0 users

See Also:


Attachments
Bugfix (782 bytes, application/octet-stream)
2019-02-26 02:45 CET, Jacek Roszkowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Roszkowski 2019-02-26 02:45:06 CET
Created attachment 90 [details]
Bugfix

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