{"action":"closed","issue":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/8129","repository_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/8129/labels{/name}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/8129/comments","events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/8129/events","html_url":"https://github.com/zephyrproject-rtos/zephyr/issues/8129","id":328867890,"node_id":"MDU6SXNzdWUzMjg4Njc4OTA=","number":8129,"title":"scheduler: in update_cache() thread from next_up() and _current are the same","user":{"login":"mike-scott","id":9355527,"node_id":"MDQ6VXNlcjkzNTU1Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/9355527?v=4","gravatar_id":"","url":"https://api.github.com/users/mike-scott","html_url":"https://github.com/mike-scott","followers_url":"https://api.github.com/users/mike-scott/followers","following_url":"https://api.github.com/users/mike-scott/following{/other_user}","gists_url":"https://api.github.com/users/mike-scott/gists{/gist_id}","starred_url":"https://api.github.com/users/mike-scott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike-scott/subscriptions","organizations_url":"https://api.github.com/users/mike-scott/orgs","repos_url":"https://api.github.com/users/mike-scott/repos","events_url":"https://api.github.com/users/mike-scott/events{/privacy}","received_events_url":"https://api.github.com/users/mike-scott/received_events","type":"User","site_admin":false},"labels":[{"id":700751250,"node_id":"MDU6TGFiZWw3MDA3NTEyNTA=","url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/labels/area:%20Kernel","name":"area: Kernel","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"andyross","id":300115,"node_id":"MDQ6VXNlcjMwMDExNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/300115?v=4","gravatar_id":"","url":"https://api.github.com/users/andyross","html_url":"https://github.com/andyross","followers_url":"https://api.github.com/users/andyross/followers","following_url":"https://api.github.com/users/andyross/following{/other_user}","gists_url":"https://api.github.com/users/andyross/gists{/gist_id}","starred_url":"https://api.github.com/users/andyross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyross/subscriptions","organizations_url":"https://api.github.com/users/andyross/orgs","repos_url":"https://api.github.com/users/andyross/repos","events_url":"https://api.github.com/users/andyross/events{/privacy}","received_events_url":"https://api.github.com/users/andyross/received_events","type":"User","site_admin":false},"assignees":[{"login":"andyross","id":300115,"node_id":"MDQ6VXNlcjMwMDExNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/300115?v=4","gravatar_id":"","url":"https://api.github.com/users/andyross","html_url":"https://github.com/andyross","followers_url":"https://api.github.com/users/andyross/followers","following_url":"https://api.github.com/users/andyross/following{/other_user}","gists_url":"https://api.github.com/users/andyross/gists{/gist_id}","starred_url":"https://api.github.com/users/andyross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyross/subscriptions","organizations_url":"https://api.github.com/users/andyross/orgs","repos_url":"https://api.github.com/users/andyross/repos","events_url":"https://api.github.com/users/andyross/events{/privacy}","received_events_url":"https://api.github.com/users/andyross/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/milestones/25","html_url":"https://github.com/zephyrproject-rtos/zephyr/milestone/25","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/milestones/25/labels","id":2786864,"node_id":"MDk6TWlsZXN0b25lMjc4Njg2NA==","number":25,"title":"v1.12.0","description":"","creator":{"login":"zephyrbot","id":26360365,"node_id":"MDQ6VXNlcjI2MzYwMzY1","avatar_url":"https://avatars1.githubusercontent.com/u/26360365?v=4","gravatar_id":"","url":"https://api.github.com/users/zephyrbot","html_url":"https://github.com/zephyrbot","followers_url":"https://api.github.com/users/zephyrbot/followers","following_url":"https://api.github.com/users/zephyrbot/following{/other_user}","gists_url":"https://api.github.com/users/zephyrbot/gists{/gist_id}","starred_url":"https://api.github.com/users/zephyrbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zephyrbot/subscriptions","organizations_url":"https://api.github.com/users/zephyrbot/orgs","repos_url":"https://api.github.com/users/zephyrbot/repos","events_url":"https://api.github.com/users/zephyrbot/events{/privacy}","received_events_url":"https://api.github.com/users/zephyrbot/received_events","type":"User","site_admin":false},"open_issues":53,"closed_issues":130,"state":"open","created_at":"2017-09-23T12:51:54Z","updated_at":"2018-06-04T00:56:35Z","due_on":"2018-06-01T07:00:00Z","closed_at":null},"comments":4,"created_at":"2018-06-03T22:26:22Z","updated_at":"2018-06-04T00:56:35Z","closed_at":"2018-06-04T00:56:35Z","author_association":"MEMBER","body":"In my opinion, update_cache() should never be called where the result of next_up() and _current are the same.  This probably indicates some sort of spin condition.\r\n\r\nAn easy way to verify this is to compile the samples/net/lwm2m_client for real HW with the following change:\r\n```\r\ndiff --git a/kernel/sched.c b/kernel/sched.c\r\nindex 56ee09e04..2ec8cae37 100644\r\n--- a/kernel/sched.c\r\n+++ b/kernel/sched.c\r\n@@ -208,6 +208,8 @@ static void update_cache(int preempt_ok)\r\n #ifndef CONFIG_SMP\r\n        struct k_thread *th = next_up();\r\n \r\n+if (th == _current)\r\n+printk(\"> update_cache: SAME THREAD!!\\n\");\r\n        if (should_preempt(th, preempt_ok)) {\r\n                _kernel.ready_q.cache = th;\r\n        } else {\r\n```\r\n\r\nThe output of the UART console will spew (in this case I compiled for 96b_nitrogen using \"cmake -DBOARD=96b_nitrogen -DCONF_FILE=\"prj.conf overlay-bt.conf\" ..\"):\r\n```\r\n***** Booting Zephyr OS 1.12.0-rc2 *****\r\nZephyr Shell, Zephyr version: 1.12.0-rc2\r\nType 'help' for a list of available commands\r\nshell> [lib/lwm2m_engine] [DBG] lwm2m_engine_init: LWM2M engine thread started\r\n[lwm2m_obj_security] [DBG] security_create: Create LWM2M security instance: 0\r\n[lwm2m_obj_server] [DBG] server_create: Create LWM2M server instance: 0\r\n[lwm2m_obj_device] [DBG] device_create: Create LWM2M device instance: 0                                                       \r\n[lwm2m_obj_firmware] [DBG] firmware_create: Create LWM2M firmware instance: 0\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!                                                                                                 \r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\nprio recv thread stack (real size 448): unused 336      usage 112 / 448 (25 %)                                                \r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\nrecv thread stack (real size 1024):     unused 656      usage 368 / 1024 (35 %)                                               \r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n> update_cache: SAME THREAD!!\r\n***** Kernel OOPS! *****\r\nCurrent thread ID = 0x20004058\r\nFaulting instruction address = 0xe950\r\nFatal fault in ISR! Spinning...\r\n```"}}
{"actor":{"display_login":"mike-scott"}}