{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8981","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8981/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8981/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8981/events","html_url":"https://github.com/RIOT-OS/RIOT/issues/8981","id":315800385,"number":8981,"title":"examples: gcoap: stack overflow when NON times out","user":{"login":"miri64","id":675644,"avatar_url":"https://avatars1.githubusercontent.com/u/675644?v=4","gravatar_id":"","url":"https://api.github.com/users/miri64","html_url":"https://github.com/miri64","followers_url":"https://api.github.com/users/miri64/followers","following_url":"https://api.github.com/users/miri64/following{/other_user}","gists_url":"https://api.github.com/users/miri64/gists{/gist_id}","starred_url":"https://api.github.com/users/miri64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miri64/subscriptions","organizations_url":"https://api.github.com/users/miri64/orgs","repos_url":"https://api.github.com/users/miri64/repos","events_url":"https://api.github.com/users/miri64/events{/privacy}","received_events_url":"https://api.github.com/users/miri64/received_events","type":"User","site_admin":false},"labels":[{"id":23399098,"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/bug","name":"bug","color":"fc2929","default":true},{"id":86443543,"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/network","name":"network","color":"8f00cc","default":false}],"state":"open","locked":false,"assignee":{"login":"kb2ma","id":2944058,"avatar_url":"https://avatars0.githubusercontent.com/u/2944058?v=4","gravatar_id":"","url":"https://api.github.com/users/kb2ma","html_url":"https://github.com/kb2ma","followers_url":"https://api.github.com/users/kb2ma/followers","following_url":"https://api.github.com/users/kb2ma/following{/other_user}","gists_url":"https://api.github.com/users/kb2ma/gists{/gist_id}","starred_url":"https://api.github.com/users/kb2ma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kb2ma/subscriptions","organizations_url":"https://api.github.com/users/kb2ma/orgs","repos_url":"https://api.github.com/users/kb2ma/repos","events_url":"https://api.github.com/users/kb2ma/events{/privacy}","received_events_url":"https://api.github.com/users/kb2ma/received_events","type":"User","site_admin":false},"assignees":[{"login":"kb2ma","id":2944058,"avatar_url":"https://avatars0.githubusercontent.com/u/2944058?v=4","gravatar_id":"","url":"https://api.github.com/users/kb2ma","html_url":"https://github.com/kb2ma","followers_url":"https://api.github.com/users/kb2ma/followers","following_url":"https://api.github.com/users/kb2ma/following{/other_user}","gists_url":"https://api.github.com/users/kb2ma/gists{/gist_id}","starred_url":"https://api.github.com/users/kb2ma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kb2ma/subscriptions","organizations_url":"https://api.github.com/users/kb2ma/orgs","repos_url":"https://api.github.com/users/kb2ma/repos","events_url":"https://api.github.com/users/kb2ma/events{/privacy}","received_events_url":"https://api.github.com/users/kb2ma/received_events","type":"User","site_admin":false},{"login":"kaspar030","id":4679640,"avatar_url":"https://avatars0.githubusercontent.com/u/4679640?v=4","gravatar_id":"","url":"https://api.github.com/users/kaspar030","html_url":"https://github.com/kaspar030","followers_url":"https://api.github.com/users/kaspar030/followers","following_url":"https://api.github.com/users/kaspar030/following{/other_user}","gists_url":"https://api.github.com/users/kaspar030/gists{/gist_id}","starred_url":"https://api.github.com/users/kaspar030/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaspar030/subscriptions","organizations_url":"https://api.github.com/users/kaspar030/orgs","repos_url":"https://api.github.com/users/kaspar030/repos","events_url":"https://api.github.com/users/kaspar030/events{/privacy}","received_events_url":"https://api.github.com/users/kaspar030/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/22","html_url":"https://github.com/RIOT-OS/RIOT/milestone/22","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/22/labels","id":3030855,"number":22,"title":"Release 2018.04","description":"","creator":{"login":"smlng","id":10532675,"avatar_url":"https://avatars1.githubusercontent.com/u/10532675?v=4","gravatar_id":"","url":"https://api.github.com/users/smlng","html_url":"https://github.com/smlng","followers_url":"https://api.github.com/users/smlng/followers","following_url":"https://api.github.com/users/smlng/following{/other_user}","gists_url":"https://api.github.com/users/smlng/gists{/gist_id}","starred_url":"https://api.github.com/users/smlng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smlng/subscriptions","organizations_url":"https://api.github.com/users/smlng/orgs","repos_url":"https://api.github.com/users/smlng/repos","events_url":"https://api.github.com/users/smlng/events{/privacy}","received_events_url":"https://api.github.com/users/smlng/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":107,"state":"open","created_at":"2018-01-12T08:24:04Z","updated_at":"2018-04-22T20:47:19Z","due_on":"2018-04-30T07:00:00Z","closed_at":null},"comments":2,"created_at":"2018-04-19T09:36:15Z","updated_at":"2018-04-23T04:43:50Z","closed_at":null,"author_association":"OWNER","body":"#### Description\r\nWhen I send a NON GET with the gcoap example the `coap` thread overflows if there is no request.\r\n\r\n#### Steps to reproduce the issue\r\n1. Flash gcoap example to board (I used `samr21-xpro`, did not check for other types of boards)\r\n2. Check current stack usage:\r\n\r\n```\r\n> ps \r\n2018-04-19 11:26:19,614 - INFO #  ps\r\n2018-04-19 11:26:19,622 - INFO # \tpid | name                 | state    Q | pri | stack  ( used) | base addr  | current     \r\n2018-04-19 11:26:19,630 - INFO # \t  - | isr_stack            | -        - |   - |    512 (  148) | 0x20000000 | 0x200001b8\r\n2018-04-19 11:26:19,638 - INFO # \t  1 | idle                 | pending  Q |  15 |    256 (  156) | 0x200006c0 | 0x20000724 \r\n2018-04-19 11:26:19,646 - INFO # \t  2 | main                 | running  Q |   7 |   1536 ( 1040) | 0x200007c0 | 0x20000c04 \r\n2018-04-19 11:26:19,655 - INFO # \t  3 | 6lo                  | bl rx    _ |   3 |   1024 (  460) | 0x200036a0 | 0x2000396c \r\n2018-04-19 11:26:19,663 - INFO # \t  4 | ipv6                 | bl rx    _ |   4 |   1024 (  432) | 0x20001764 | 0x20001a2c \r\n2018-04-19 11:26:19,671 - INFO # \t  5 | udp                  | bl rx    _ |   5 |   1024 (  272) | 0x20003e6c | 0x2000415c \r\n2018-04-19 11:26:19,680 - INFO # \t  6 | coap                 | bl mbox  _ |   6 |   1024 (  776) | 0x200012c4 | 0x200013bc \r\n2018-04-19 11:26:19,688 - INFO # \t  7 | at86rf2xx            | bl rx    _ |   2 |   1024 (  504) | 0x20000e84 | 0x20001174 \r\n2018-04-19 11:26:19,694 - INFO # \t    | SUM                  |            |     |   7424 ( 3788)\r\n```\r\n\r\nSend CoAP NON to fake destination:\r\n\r\n```\r\n> coap get affe::1 5683 /test\r\n2018-04-19 11:32:47,258 - INFO #  coap get affe::1 5683 /test\r\n2018-04-19 11:32:47,262 - INFO # gcoap_cli: sending msg ID 22606, 11 bytes\r\n> 2018-04-19 11:32:52,271 - INFO #  gcoap: timeout for msg ID 22606\r\n```\r\n\r\nCheck stack usage again:\r\n\r\n```\r\nps\r\n2018-04-19 11:32:55,406 - INFO # ps\r\n2018-04-19 11:32:55,414 - INFO # \tpid | name                 | state    Q | pri | stack  ( used) | base addr  | current     \r\n2018-04-19 11:32:55,422 - INFO # \t  - | isr_stack            | -        - |   - |    512 (  164) | 0x20000000 | 0x200001b8\r\n2018-04-19 11:32:55,430 - INFO # \t  1 | idle                 | pending  Q |  15 |    256 (  156) | 0x200006c0 | 0x20000724 \r\n2018-04-19 11:32:55,439 - INFO # \t  2 | main                 | running  Q |   7 |   1536 ( 1052) | 0x200007c0 | 0x20000c04 \r\n2018-04-19 11:32:55,447 - INFO # \t  3 | 6lo                  | bl rx    _ |   3 |   1024 (  460) | 0x200036a0 | 0x2000396c \r\n2018-04-19 11:32:55,455 - INFO # \t  4 | ipv6                 | bl rx    _ |   4 |   1024 (  432) | 0x20001764 | 0x20001a2c \r\n2018-04-19 11:32:55,463 - INFO # \t  5 | udp                  | bl rx    _ |   5 |   1024 (  328) | 0x20003e6c | 0x2000415c \r\n2018-04-19 11:32:55,472 - INFO # \t  6 | coap                 | bl mbox  _ |   6 |   1024 ( 1024) | 0x200012c4 | 0x200013bc \r\n2018-04-19 11:32:55,480 - INFO # \t  7 | �D                   | bl rx    _ |   2 |    279 ( -241) | 0x20000e84 | 0x20001174 \r\n2018-04-19 11:32:55,486 - INFO # \t    | SUM                  |            |     |   6679 ( 3375)\r\n```\r\n\r\n\r\n#### Expected results\r\nStack should not overflow.\r\n\r\n#### Actual results\r\nStack overflows and overwrites TCB of following thread (might cause crash later on).\r\n\r\n#### Versions\r\nThis was done on 689333ff04f102e1fd07c74eeda6fdc7f0b574b6 of RIOT."},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/383452728","html_url":"https://github.com/RIOT-OS/RIOT/issues/8981#issuecomment-383452728","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8981","id":383452728,"user":{"login":"kb2ma","id":2944058,"avatar_url":"https://avatars0.githubusercontent.com/u/2944058?v=4","gravatar_id":"","url":"https://api.github.com/users/kb2ma","html_url":"https://github.com/kb2ma","followers_url":"https://api.github.com/users/kb2ma/followers","following_url":"https://api.github.com/users/kb2ma/following{/other_user}","gists_url":"https://api.github.com/users/kb2ma/gists{/gist_id}","starred_url":"https://api.github.com/users/kb2ma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kb2ma/subscriptions","organizations_url":"https://api.github.com/users/kb2ma/orgs","repos_url":"https://api.github.com/users/kb2ma/repos","events_url":"https://api.github.com/users/kb2ma/events{/privacy}","received_events_url":"https://api.github.com/users/kb2ma/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T04:43:50Z","updated_at":"2018-04-23T04:43:50Z","author_association":"MEMBER","body":"I confirmed that the stack issue surfaced with #8772. Prior to this PR, stack size was 724 initially, and 996 (out of 1024 available) after sending a message.\r\n\r\nI did test gcoap when I reviewed #8772. I can only guess that I tested mostly on native."}}
{"actor":{"display_login":"kb2ma"}}