mesa-19.1.0/src/util/futex.h:82] -> [mesa-19.1.0/src/util/futex.h:76] -> [mesa-19.1.0/src/util/futex.h:85]: (error) Using pointer to local variable 'tmo' that is out of scope. Source code is if (timeout != NULL) { const struct _umtx_time tmo = { ._timeout = *timeout, ._flags = UMTX_ABSTIME, ._clockid = CLOCK_MONOTONIC }; uaddr = (void *)(uintptr_t)sizeof(tmo); uaddr2 = (void *)&tmo; } return _umtx_op(addr, UMTX_OP_WAIT_UINT, (uint32_t)value, uaddr, uaddr2) == -1 ? errno : 0;
Indeed, that's a dangling pointer to data that should not exist anymore, good catch! I just posted an MR with a fix, can you compile-test it for me? I don't have a FreeBSD machine available. https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1086 How did you find this btw? The error message doesn't look familiar to me and looking it up doesn't return many results. I'd love to be able to find these myself :)
Fixed by: commit 9996ddbb27c9eb39cd234a4abce6c3742572c770 Author: Eric Engestrom <eric.engestrom@intel.com> Date: Wed Jun 12 17:23:27 2019 +0100 util/futex: fix dangling pointer use I'm still curious how you found this though ;)
I found this by using a static analysis tool called cppcheck. I strongly recommend it for all C and C++ code. Not everything it mentions is worth fixing, but it does a deeper code analysis than almost all compilers. I have no FreeBSD machine here either.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.