{"action":"created","issue":{"url":"https://api.github.com/repos/LMMS/lmms/issues/2192","repository_url":"https://api.github.com/repos/LMMS/lmms","labels_url":"https://api.github.com/repos/LMMS/lmms/issues/2192/labels{/name}","comments_url":"https://api.github.com/repos/LMMS/lmms/issues/2192/comments","events_url":"https://api.github.com/repos/LMMS/lmms/issues/2192/events","html_url":"https://github.com/LMMS/lmms/issues/2192","id":95854248,"number":2192,"title":"Random crashes while playing","user":{"login":"Umcaruje","id":6282045,"avatar_url":"https://avatars.githubusercontent.com/u/6282045?v=3","gravatar_id":"","url":"https://api.github.com/users/Umcaruje","html_url":"https://github.com/Umcaruje","followers_url":"https://api.github.com/users/Umcaruje/followers","following_url":"https://api.github.com/users/Umcaruje/following{/other_user}","gists_url":"https://api.github.com/users/Umcaruje/gists{/gist_id}","starred_url":"https://api.github.com/users/Umcaruje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Umcaruje/subscriptions","organizations_url":"https://api.github.com/users/Umcaruje/orgs","repos_url":"https://api.github.com/users/Umcaruje/repos","events_url":"https://api.github.com/users/Umcaruje/events{/privacy}","received_events_url":"https://api.github.com/users/Umcaruje/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LMMS/lmms/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/LMMS/lmms/labels/core","name":"core","color":"2c974f"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":54,"created_at":"2015-07-18T19:44:59Z","updated_at":"2016-03-31T07:14:29Z","closed_at":"2016-03-17T21:15:44Z","body":"While using LMMS, I found that it crashes frequently while you play a pattern, BB track or the whole song and change parameters while doing that. It will also crash while just playing a project. I can't offer steps to reproduce, as this behavior is quite random. However, I made a debug build and collected backtraces from the crashes: [`gist.github.com/Umcaruje/bf88cfb78948224120a9`](https://gist.github.com/Umcaruje/bf88cfb78948224120a9)\r\n\r\nCrash under `bt2` happened around 4 times, while the others happened only once. I will update that gist regularly with new backtraces. \r\n\r\nAs far as I understand from reading these backtraces, this seems to be an issue with the Mixer code.\r\n\r\nOS is Xubuntu 15.04 x64. The machine I use is not a very powerful one - Dual core 1.6 Ghz Intel processor and 2GB of ram. LMMS is compiled from source, `stable-1.1` branch. `master` is currently unusable for me because of #2159.\r\n\r\nHas a strong connection to #2153."},"comment":{"url":"https://api.github.com/repos/LMMS/lmms/issues/comments/203792336","html_url":"https://github.com/LMMS/lmms/issues/2192#issuecomment-203792336","issue_url":"https://api.github.com/repos/LMMS/lmms/issues/2192","id":203792336,"user":{"login":"Fastigium","id":10221829,"avatar_url":"https://avatars.githubusercontent.com/u/10221829?v=3","gravatar_id":"","url":"https://api.github.com/users/Fastigium","html_url":"https://github.com/Fastigium","followers_url":"https://api.github.com/users/Fastigium/followers","following_url":"https://api.github.com/users/Fastigium/following{/other_user}","gists_url":"https://api.github.com/users/Fastigium/gists{/gist_id}","starred_url":"https://api.github.com/users/Fastigium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fastigium/subscriptions","organizations_url":"https://api.github.com/users/Fastigium/orgs","repos_url":"https://api.github.com/users/Fastigium/repos","events_url":"https://api.github.com/users/Fastigium/events{/privacy}","received_events_url":"https://api.github.com/users/Fastigium/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T07:14:29Z","updated_at":"2016-03-31T07:14:29Z","body":"I agree that the crash is most likely caused by running out of buffers. OTOMH I see two possible causes: 1) LMMS was stressed real heavily and all the 512 buffers were actually in use, or 2) there is some code path that acquires buffers and does not release them. In case of 2, I'd very much like to find out which code path that is.\r\n\r\n@Umcaruje was LMMS stressed heavily when the crash occurred? If not, could you add a line like `qDebug( \"%d buffers available\", int( s_availableIndex ) + 1 );` at [the end of `BufferManager::refresh()`](https://github.com/LMMS/lmms/blob/0f8a2e7060612533bdb9c989a7554eccd7e59c89/src/core/BufferManager.cpp#L111)? You may need to `#include <QDebug>`, too. Then start using LMMS like you did before the crash again, and peek at the output periodically to see if the number it prints drops or stays the same. It may fluctuate, but it should not become consistently lower. If it does, we're leaking buffers somewhere. Also, if it suddenly stops printing sometimes, the crash could be caused by `BufferManager::refresh()` not being called in time.\r\n\r\nOh, and @zonkmachine:\r\n\r\n> If I read this correctly i = 0 means that the buffer manager just handed out the last available buffer\r\n\r\nNope, not in this case. The crash occurs before the value of i is set, so its value is meaningless at that point. The reason it exists is that there really is no such thing as declaring a variable in the middle of the contents of a function; the compiler just adds it to the current scope, so in gdb it shows up \"before it's declared\", if you get what I mean."}}