{"action":"opened","issue":{"url":"https://api.github.com/repos/megakilo/FreeRTOS-Sim/issues/1","repository_url":"https://api.github.com/repos/megakilo/FreeRTOS-Sim","labels_url":"https://api.github.com/repos/megakilo/FreeRTOS-Sim/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/megakilo/FreeRTOS-Sim/issues/1/comments","events_url":"https://api.github.com/repos/megakilo/FreeRTOS-Sim/issues/1/events","html_url":"https://github.com/megakilo/FreeRTOS-Sim/issues/1","id":148253644,"number":1,"title":"vPortYield returns sometimes with another FreeRTOS thread active","user":{"login":"pekkanikander","id":681239,"avatar_url":"https://avatars.githubusercontent.com/u/681239?v=3","gravatar_id":"","url":"https://api.github.com/users/pekkanikander","html_url":"https://github.com/pekkanikander","followers_url":"https://api.github.com/users/pekkanikander/followers","following_url":"https://api.github.com/users/pekkanikander/following{/other_user}","gists_url":"https://api.github.com/users/pekkanikander/gists{/gist_id}","starred_url":"https://api.github.com/users/pekkanikander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pekkanikander/subscriptions","organizations_url":"https://api.github.com/users/pekkanikander/orgs","repos_url":"https://api.github.com/users/pekkanikander/repos","events_url":"https://api.github.com/users/pekkanikander/events{/privacy}","received_events_url":"https://api.github.com/users/pekkanikander/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-14T05:07:50Z","updated_at":"2016-04-14T05:07:50Z","closed_at":null,"body":"When running under Mac OS X 10.11.4, `vPortYield()` sometimes (rarely) returns with another FreeRTOS thread active (pointed by `pxCurrentTCB`) than what was active when called.  This causes then problems much later, e.g. sometimes the idle thread gets removed from `pxReadyTasksLists[0]`, crashing FreeRTOS.\r\n\r\nI don't yet know the root source for the problem nor how to fix it, but the following commit adds a minimal piece of code that prints out a message when this happens.  With our code we get most of the time a crash (core dump) shortly afterwards.\r\n\r\nhttps://github.com/pekkanikander/FreeRTOS-Sim/commit/6082316f9a589905c7ea7b307a7f620bf5904062"}}