openzfs / spl

A shim layer which adds the core interfaces required for OpenZFS.
https://zfsonlinux.org/
GNU General Public License v2.0
282 stars 181 forks source link

VERIFY*() macros evalulate parameters multiple times on failure #684

Closed DeHackEd closed 6 years ago

DeHackEd commented 6 years ago

Someone in IRC just had a crash in their system with the following error: https://paste.pound-python.org/show/gjjdCxPcRYtmVhyqVxXu/ What's odd is that the statement (0 == 0) implies the result should have been a success. In fact the VERIFY3U macro double-evaluated the arc_buf_alloc_impl call which succeeded the second time. That's a bug.

https://github.com/zfsonlinux/spl/blob/master/include/sys/debug.h#L66