{"action":"created","issue":{"url":"https://api.github.com/repos/tempesta-tech/tempesta/issues/251","repository_url":"https://api.github.com/repos/tempesta-tech/tempesta","labels_url":"https://api.github.com/repos/tempesta-tech/tempesta/issues/251/labels{/name}","comments_url":"https://api.github.com/repos/tempesta-tech/tempesta/issues/251/comments","events_url":"https://api.github.com/repos/tempesta-tech/tempesta/issues/251/events","html_url":"https://github.com/tempesta-tech/tempesta/issues/251","id":105797650,"number":251,"title":"Tempesta automatic reboot and crash dump","user":{"login":"krizhanovsky","id":884694,"avatar_url":"https://avatars.githubusercontent.com/u/884694?v=3","gravatar_id":"","url":"https://api.github.com/users/krizhanovsky","html_url":"https://github.com/krizhanovsky","followers_url":"https://api.github.com/users/krizhanovsky/followers","following_url":"https://api.github.com/users/krizhanovsky/following{/other_user}","gists_url":"https://api.github.com/users/krizhanovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/krizhanovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krizhanovsky/subscriptions","organizations_url":"https://api.github.com/users/krizhanovsky/orgs","repos_url":"https://api.github.com/users/krizhanovsky/repos","events_url":"https://api.github.com/users/krizhanovsky/events{/privacy}","received_events_url":"https://api.github.com/users/krizhanovsky/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tempesta-tech/tempesta/labels/Doc","name":"Doc","color":"bfd4f2"},{"url":"https://api.github.com/repos/tempesta-tech/tempesta/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"krizhanovsky","id":884694,"avatar_url":"https://avatars.githubusercontent.com/u/884694?v=3","gravatar_id":"","url":"https://api.github.com/users/krizhanovsky","html_url":"https://github.com/krizhanovsky","followers_url":"https://api.github.com/users/krizhanovsky/followers","following_url":"https://api.github.com/users/krizhanovsky/following{/other_user}","gists_url":"https://api.github.com/users/krizhanovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/krizhanovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krizhanovsky/subscriptions","organizations_url":"https://api.github.com/users/krizhanovsky/orgs","repos_url":"https://api.github.com/users/krizhanovsky/repos","events_url":"https://api.github.com/users/krizhanovsky/events{/privacy}","received_events_url":"https://api.github.com/users/krizhanovsky/received_events","type":"User","site_admin":false},"assignees":[{"login":"krizhanovsky","id":884694,"avatar_url":"https://avatars.githubusercontent.com/u/884694?v=3","gravatar_id":"","url":"https://api.github.com/users/krizhanovsky","html_url":"https://github.com/krizhanovsky","followers_url":"https://api.github.com/users/krizhanovsky/followers","following_url":"https://api.github.com/users/krizhanovsky/following{/other_user}","gists_url":"https://api.github.com/users/krizhanovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/krizhanovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krizhanovsky/subscriptions","organizations_url":"https://api.github.com/users/krizhanovsky/orgs","repos_url":"https://api.github.com/users/krizhanovsky/repos","events_url":"https://api.github.com/users/krizhanovsky/events{/privacy}","received_events_url":"https://api.github.com/users/krizhanovsky/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/tempesta-tech/tempesta/milestones/3","html_url":"https://github.com/tempesta-tech/tempesta/milestones/0.5.0%20Web%20Server","labels_url":"https://api.github.com/repos/tempesta-tech/tempesta/milestones/3/labels","id":1015684,"number":3,"title":"0.5.0 Web Server","description":"","creator":{"login":"krizhanovsky","id":884694,"avatar_url":"https://avatars.githubusercontent.com/u/884694?v=3","gravatar_id":"","url":"https://api.github.com/users/krizhanovsky","html_url":"https://github.com/krizhanovsky","followers_url":"https://api.github.com/users/krizhanovsky/followers","following_url":"https://api.github.com/users/krizhanovsky/following{/other_user}","gists_url":"https://api.github.com/users/krizhanovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/krizhanovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krizhanovsky/subscriptions","organizations_url":"https://api.github.com/users/krizhanovsky/orgs","repos_url":"https://api.github.com/users/krizhanovsky/repos","events_url":"https://api.github.com/users/krizhanovsky/events{/privacy}","received_events_url":"https://api.github.com/users/krizhanovsky/received_events","type":"User","site_admin":false},"open_issues":53,"closed_issues":130,"state":"open","created_at":"2015-03-10T23:31:23Z","updated_at":"2016-06-24T17:47:04Z","due_on":"2016-09-01T21:00:00Z","closed_at":null},"comments":1,"created_at":"2015-09-10T12:38:17Z","updated_at":"2016-06-26T15:17:42Z","closed_at":null,"body":"Best practice and configuration HOWTOs must be developed to make Tempesta-enabled Linux kernel automatically reboot on crash and produce dumps for bug reporting and analyzing. The best practice and HOWTO must be added to README.md as separate chapter."},"comment":{"url":"https://api.github.com/repos/tempesta-tech/tempesta/issues/comments/228606228","html_url":"https://github.com/tempesta-tech/tempesta/issues/251#issuecomment-228606228","issue_url":"https://api.github.com/repos/tempesta-tech/tempesta/issues/251","id":228606228,"user":{"login":"milabs","id":624823,"avatar_url":"https://avatars.githubusercontent.com/u/624823?v=3","gravatar_id":"","url":"https://api.github.com/users/milabs","html_url":"https://github.com/milabs","followers_url":"https://api.github.com/users/milabs/followers","following_url":"https://api.github.com/users/milabs/following{/other_user}","gists_url":"https://api.github.com/users/milabs/gists{/gist_id}","starred_url":"https://api.github.com/users/milabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milabs/subscriptions","organizations_url":"https://api.github.com/users/milabs/orgs","repos_url":"https://api.github.com/users/milabs/repos","events_url":"https://api.github.com/users/milabs/events{/privacy}","received_events_url":"https://api.github.com/users/milabs/received_events","type":"User","site_admin":false},"created_at":"2016-06-26T15:17:42Z","updated_at":"2016-06-26T15:17:42Z","body":"We should consider of using exception handling while doing in kernel mode.\r\n\r\n## Native kernel approach (extables)\r\n\r\nLinux kernel has limited exception model which allows user to handle faults on certain instructions. Every such an instruction's address needs to be handled via the `extable`. So, to catch the fault we must known for sure which the instruction may cause the fault and fill `extable` item with the instruction address and the fixup pointer. The latter is the address of the first instruction which takes the control after the fault.\r\n\r\nOne of the possible solutions is to fill Tempesta's module `extabe` in run-time with instruction ranges and specify fixup address for each range. So, let's assume that protected function looks like this:\r\n\r\n```\r\n<func>:\r\n    insn1\r\n    insn2\r\n    ...\r\n    insnN\r\n    ret\r\n```\r\n\r\nIn such a case we'll need to fill `extable` with every instruction address and specify the same `fixup` for all of them. So, `fixup` get's the control if some of the insn's causes fault.\r\n\r\nThere are many limitations of using such a technique. Except that module's `extable` going huge, there is a problem with `fixup` point by itself. It's required for the `fixup` to be in the context as the guarded `function`. Otherwise, `fixup` will have problems accessing the function variables.\r\n\r\nFor the example of using `extable` with kernel modules one can see that link:\r\nhttps://github.com/milabs/kmod_extable\r\n\r\n## SEH-implementation\r\n\r\nWindows has a great exception handling approach - SEH (Structured Exception Handling). The main idea is to use a chain if exception handlers. \r\n\r\n- The exception handlers are linked to each other\r\n- They form a linked list chain on the stack, and sit relatively close to the bottom of the stack\r\n- When an exception occurs, Windows retrieves the head of the SEH chain SEH chain walks through the list and tries to find the suitable handler to close the application properly\r\n\r\nAs for now, Linux kernel doesn't have ad ability to implement SEH without extending the kernel. Also, compiler support required to use the following code patterns:\r\n\r\n`__try {}  __except(...) {}` and `__try {} __finally {}`\r\n"}}
{"actor":{"display_login":"milabs"}}