{"action":"created","issue":{"url":"https://api.github.com/repos/etternagame/etterna/issues/321","repository_url":"https://api.github.com/repos/etternagame/etterna","labels_url":"https://api.github.com/repos/etternagame/etterna/issues/321/labels{/name}","comments_url":"https://api.github.com/repos/etternagame/etterna/issues/321/comments","events_url":"https://api.github.com/repos/etternagame/etterna/issues/321/events","html_url":"https://github.com/etternagame/etterna/issues/321","id":367606707,"node_id":"MDU6SXNzdWUzNjc2MDY3MDc=","number":321,"title":"getCpuid() causes crash (v0.60.0 git Release build, macOS 10.11.6)","user":{"login":"zelbrium","id":7142049,"node_id":"MDQ6VXNlcjcxNDIwNDk=","avatar_url":"https://avatars0.githubusercontent.com/u/7142049?v=4","gravatar_id":"","url":"https://api.github.com/users/zelbrium","html_url":"https://github.com/zelbrium","followers_url":"https://api.github.com/users/zelbrium/followers","following_url":"https://api.github.com/users/zelbrium/following{/other_user}","gists_url":"https://api.github.com/users/zelbrium/gists{/gist_id}","starred_url":"https://api.github.com/users/zelbrium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zelbrium/subscriptions","organizations_url":"https://api.github.com/users/zelbrium/orgs","repos_url":"https://api.github.com/users/zelbrium/repos","events_url":"https://api.github.com/users/zelbrium/events{/privacy}","received_events_url":"https://api.github.com/users/zelbrium/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-07T23:53:13Z","updated_at":"2018-10-08T01:12:33Z","closed_at":null,"author_association":"NONE","body":"`getCpuid()`, from `StageStats.cpp`, (which uses inline assembly) appears to be causing some kind of stack corruption on Release builds, resulting in crashing errors within the next few functions (usually in `getSystemUniqueId()` when trying to modify `str`, but also sometimes in `getCpuHash()`). This is indirectly called at the end of a song, so that's not very nice.\r\n\r\nI am building from git tag v0.60.0, macOS 10.11.6. On Debug builds, or when debugging with Xcode at all, the crash does not always occur. This bug may be related to currently-open #274, since it has the same error message, but it's a pretty generic error message, so maybe not.\r\n\r\n**To fix**\r\nI was able to fix the crash by using `__cpuid()` or `__get_cpuid()` from `cpuid.h` (same as what the Windows version of `getCpuHash()` uses) instead of the custom-built function `getCpuid()`. On my machine at least, both the custom function and the ones from `cpuid.h` return the same values.\r\n\r\nI am not familiar enough with inline assembly calls to figure out why `getCpuid()` is causing errors."},"comment":{"url":"https://api.github.com/repos/etternagame/etterna/issues/comments/427702675","html_url":"https://github.com/etternagame/etterna/issues/321#issuecomment-427702675","issue_url":"https://api.github.com/repos/etternagame/etterna/issues/321","id":427702675,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzcwMjY3NQ==","user":{"login":"nico-abram","id":24706838,"node_id":"MDQ6VXNlcjI0NzA2ODM4","avatar_url":"https://avatars3.githubusercontent.com/u/24706838?v=4","gravatar_id":"","url":"https://api.github.com/users/nico-abram","html_url":"https://github.com/nico-abram","followers_url":"https://api.github.com/users/nico-abram/followers","following_url":"https://api.github.com/users/nico-abram/following{/other_user}","gists_url":"https://api.github.com/users/nico-abram/gists{/gist_id}","starred_url":"https://api.github.com/users/nico-abram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nico-abram/subscriptions","organizations_url":"https://api.github.com/users/nico-abram/orgs","repos_url":"https://api.github.com/users/nico-abram/repos","events_url":"https://api.github.com/users/nico-abram/events{/privacy}","received_events_url":"https://api.github.com/users/nico-abram/received_events","type":"User","site_admin":false},"created_at":"2018-10-08T01:12:33Z","updated_at":"2018-10-08T01:12:33Z","author_association":"CONTRIBUTOR","body":"theropfather is testing on linux right now, I also made a branch with the change so travis C.I tries to compile it on both mac and linux (https://travis-ci.org/etternagame/etterna/builds/438418913?utm_source=github_status&utm_medium=notification). I'll get back to you soon.\r\n\r\nJust in case, this is the change you meant right? https://github.com/etternagame/etterna/commit/43ce3dfa91d7aea6d734f552bfa52fff492720e1\r\n\r\nAlso, thank YOU for finding and basically solving this :)"}}
{"actor":{"display_login":"nico-abram"}}