{"action":"closed","issue":{"url":"https://api.github.com/repos/BOINC/boinc/issues/1567","labels_url":"https://api.github.com/repos/BOINC/boinc/issues/1567/labels{/name}","comments_url":"https://api.github.com/repos/BOINC/boinc/issues/1567/comments","events_url":"https://api.github.com/repos/BOINC/boinc/issues/1567/events","html_url":"https://github.com/BOINC/boinc/issues/1567","id":56225334,"number":1567,"title":"Immediate Segmentation Fault with library after init under linux - Stacksize","user":{"login":"romw","id":985772,"avatar_url":"https://avatars.githubusercontent.com/u/985772?v=3","gravatar_id":"","url":"https://api.github.com/users/romw","html_url":"https://github.com/romw","followers_url":"https://api.github.com/users/romw/followers","following_url":"https://api.github.com/users/romw/following{/other_user}","gists_url":"https://api.github.com/users/romw/gists{/gist_id}","starred_url":"https://api.github.com/users/romw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romw/subscriptions","organizations_url":"https://api.github.com/users/romw/orgs","repos_url":"https://api.github.com/users/romw/repos","events_url":"https://api.github.com/users/romw/events{/privacy}","received_events_url":"https://api.github.com/users/romw/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"davidpanderson","id":985729,"avatar_url":"https://avatars.githubusercontent.com/u/985729?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpanderson","html_url":"https://github.com/davidpanderson","followers_url":"https://api.github.com/users/davidpanderson/followers","following_url":"https://api.github.com/users/davidpanderson/following{/other_user}","gists_url":"https://api.github.com/users/davidpanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpanderson/subscriptions","organizations_url":"https://api.github.com/users/davidpanderson/orgs","repos_url":"https://api.github.com/users/davidpanderson/repos","events_url":"https://api.github.com/users/davidpanderson/events{/privacy}","received_events_url":"https://api.github.com/users/davidpanderson/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-02-02T11:31:58Z","updated_at":"2015-02-02T11:32:09Z","closed_at":"2015-02-02T11:32:09Z","body":"**Reported by tstrunk on 23 Apr 42474430 18:25 UTC**\nWhen building an application with the current boinc api lib and running it live (that is with shared mem), the timer thread segfaults on Ubuntu 11.10.\r\n\r\nThe culprit is the timer thread, which dies after TIMER_PERIOD seconds are over (first time timer_handler is called). I think the problem is that the child thread exhausts its stacksize. I can attribute the crash to this changeset (25659):\r\nhttp://boinc.berkeley.edu/trac/changeset/25659/boinc/trunk/boinc/api/boinc_api.cpp\r\n\r\nOn Ubuntu MAXPATHLEN is 4096. Setting any of the fields changed in the changeset to MAXPATHLEN will produce a segfault. Even raising only abspath[to abspath[3096](1024]) produces said segfault.\r\n\r\nI'd like to increase the threads stacksize in valgrind, but you can only increase the main thread stacksize there, not the childs. This is one of the error messages:\r\n==24957== Can't extend stack to 0x40273c0 during signal delivery for thread 2:\r\n==24957==   too small or bad protection modes\r\n\r\nThis is the test application, it inits and then sleeps forever and either segfaults or doesn't, depending on MAXPATHLEN.\r\n\r\n```\r\n\r\n#include <iostream>\r\n#include <diagnostics.h>\r\n#include <boinc_api.h>\r\nint main(int argc, const char* argv [])\r\n{\r\n    boinc_init_diagnostics( BOINC_DIAG_TRACETOSTDERR|BOINC_DIAG_HEAPCHECKENABLED);\r\n    int rc = boinc_init();\r\n    for (unsigned int i = 0; i < 10000 ;)\r\n    {\r\n        sleep(3000);\r\n    }\r\n}\r\n\r\n```\r\n"}}