{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10081","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10081/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10081/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10081/events","html_url":"https://github.com/RIOT-OS/RIOT/issues/10081","id":365167569,"node_id":"MDU6SXNzdWUzNjUxNjc1Njk=","number":10081,"title":"IOTA pkg implementation and trouble with stack_overflows","user":{"login":"Citrullin","id":4502018,"node_id":"MDQ6VXNlcjQ1MDIwMTg=","avatar_url":"https://avatars0.githubusercontent.com/u/4502018?v=4","gravatar_id":"","url":"https://api.github.com/users/Citrullin","html_url":"https://github.com/Citrullin","followers_url":"https://api.github.com/users/Citrullin/followers","following_url":"https://api.github.com/users/Citrullin/following{/other_user}","gists_url":"https://api.github.com/users/Citrullin/gists{/gist_id}","starred_url":"https://api.github.com/users/Citrullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Citrullin/subscriptions","organizations_url":"https://api.github.com/users/Citrullin/orgs","repos_url":"https://api.github.com/users/Citrullin/repos","events_url":"https://api.github.com/users/Citrullin/events{/privacy}","received_events_url":"https://api.github.com/users/Citrullin/received_events","type":"User","site_admin":false},"labels":[{"id":91234472,"node_id":"MDU6TGFiZWw5MTIzNDQ3Mg==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/core","name":"core","color":"0052cc","default":false},{"id":114180965,"node_id":"MDU6TGFiZWwxMTQxODA5NjU=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/pkg","name":"pkg","color":"006b75","default":false},{"id":23399102,"node_id":"MDU6TGFiZWwyMzM5OTEwMg==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"miri64","id":675644,"node_id":"MDQ6VXNlcjY3NTY0NA==","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},"assignees":[{"login":"miri64","id":675644,"node_id":"MDQ6VXNlcjY3NTY0NA==","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}],"milestone":null,"comments":2,"created_at":"2018-09-29T21:15:07Z","updated_at":"2018-09-29T21:56:41Z","closed_at":null,"author_association":"NONE","body":"Hey,\r\nI am implementing a IOTA light wallet for a while and since RIOT is my preferred OS, I used it as underlying RTOS. \r\n\r\nHardware:\r\nSTM32F1 aka bluepill\r\n\r\nBut I have a problem. \r\nWhile this implementation works fine:\r\nhttps://github.com/Citrullin/RIOT/blob/iota_old_implementation/examples/iota_transaction_light/main.c\r\n\r\nThis one doesn't and I get sometimes stack_overflows and sometimes it just stops without any error.\r\nhttps://github.com/Citrullin/RIOT/blob/iota_new_implementation/examples/iota_transaction_light/main.c\r\n\r\nThe main difference between these two implementation is the usage of global variables as buffer instead of declaring it within the functions. But both should be on the stack, as understand it, so that shouldn't make a difference. But I am not sure how RIOT is handling this.\r\n\r\nI also created a example for a Linux environment: https://github.com/Citrullin/iota_microwallet_debug_example\r\nJust clone, update (init) the submodule, execute ./compile and ./main. This uses the new implementation and works fine.\r\n\r\nSo, how and where do I need to increase the stack size for my package? \r\n\r\nI think the new implementation is way cleaner. So I prefer to going with that. But since my C knowledge is not really good I have still some trouble debugging in a good way. Something I need to work on.\r\n"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/425678098","html_url":"https://github.com/RIOT-OS/RIOT/issues/10081#issuecomment-425678098","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10081","id":425678098,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTY3ODA5OA==","user":{"login":"miri64","id":675644,"node_id":"MDQ6VXNlcjY3NTY0NA==","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},"created_at":"2018-09-29T21:56:41Z","updated_at":"2018-09-29T21:56:41Z","author_association":"MEMBER","body":"Another tip: most stack overflows are caused by either having a too deep function call hierarchy (e.g. by recursion, but it can also happen by carelessly dangling from one function to the next) or by putting *really big* objects onto your stack (i.e. within the scope of functions). I did not really look into your code, but if you allocate some large buffers on your stack, reconsider if you can't make them static global variables instead). If necessary you can protect them for multi-access with mutexes or the like."}}
{"actor":{"display_login":"miri64"}}