{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/spl/issues/459","labels_url":"https://api.github.com/repos/zfsonlinux/spl/issues/459/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/spl/issues/459/comments","events_url":"https://api.github.com/repos/zfsonlinux/spl/issues/459/events","html_url":"https://github.com/zfsonlinux/spl/issues/459","id":90131533,"number":459,"title":"VERIFY3_IMPL implementation is not robust","user":{"login":"avg-I","id":1499700,"avatar_url":"https://avatars.githubusercontent.com/u/1499700?v=3","gravatar_id":"","url":"https://api.github.com/users/avg-I","html_url":"https://github.com/avg-I","followers_url":"https://api.github.com/users/avg-I/followers","following_url":"https://api.github.com/users/avg-I/following{/other_user}","gists_url":"https://api.github.com/users/avg-I/gists{/gist_id}","starred_url":"https://api.github.com/users/avg-I/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avg-I/subscriptions","organizations_url":"https://api.github.com/users/avg-I/orgs","repos_url":"https://api.github.com/users/avg-I/repos","events_url":"https://api.github.com/users/avg-I/events{/privacy}","received_events_url":"https://api.github.com/users/avg-I/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-22T15:23:55Z","updated_at":"2015-07-01T13:24:35Z","closed_at":null,"body":"The implementation in [debug.h](https://github.com/zfsonlinux/spl/blob/master/include/sys/debug.h#L63) has an obvious C macro problem: it might evaluate its arguments more than once and that could lead to wrong values being printed if the arguments are not invariant or not idempotent.\r\n\r\nFortunately, this is only a problem with reporting. But that can be quite confusing when debugging a problem. For example in this [issue](https://github.com/zfsonlinux/zfs/issues/3335#issue-70386369) you can see\r\n```\r\nVERIFY3(0 == nvlist_add_nvlist(config, \"feature_stats\", features)) failed (0 == 0)\r\n```\r\nwhich would imply that zero was not equal to zero.\r\n\r\nI think that the macro should follow the pattern employed in [zfs/assert.h](https://github.com/zfsonlinux/zfs/blob/master/lib/libspl/include/assert.h#L67)"},"comment":{"url":"https://api.github.com/repos/zfsonlinux/spl/issues/comments/117673117","html_url":"https://github.com/zfsonlinux/spl/issues/459#issuecomment-117673117","issue_url":"https://api.github.com/repos/zfsonlinux/spl/issues/459","id":117673117,"user":{"login":"avg-I","id":1499700,"avatar_url":"https://avatars.githubusercontent.com/u/1499700?v=3","gravatar_id":"","url":"https://api.github.com/users/avg-I","html_url":"https://github.com/avg-I","followers_url":"https://api.github.com/users/avg-I/followers","following_url":"https://api.github.com/users/avg-I/following{/other_user}","gists_url":"https://api.github.com/users/avg-I/gists{/gist_id}","starred_url":"https://api.github.com/users/avg-I/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avg-I/subscriptions","organizations_url":"https://api.github.com/users/avg-I/orgs","repos_url":"https://api.github.com/users/avg-I/repos","events_url":"https://api.github.com/users/avg-I/events{/privacy}","received_events_url":"https://api.github.com/users/avg-I/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T13:24:34Z","updated_at":"2015-07-01T13:24:34Z","body":"@behlendorf is the stack depth really of so much concern in this context?\r\nI wouldn't expect that using intermediate variables would add more than a couple of dozens of bytes to the stack. If the stack depth is balancing near the limit then the code would be extra fragile for any kinds of code changes."}}