Re: [Nfs-ganesha-devel] address sanitizer defeats -O0

2017-08-03 Thread Matt Benjamin
Correct. Matt On Thu, Aug 3, 2017 at 10:44 AM, Daniel Gryniewicz wrote: > I do not believe it's reorganizing code. I think the code in the first > section is wrong, and the second version is needed. > > Once you've dec'd the refcount, you cannot access the pointer. At that >

Re: [Nfs-ganesha-devel] address sanitizer defeats -O0

2017-08-03 Thread Daniel Gryniewicz
I do not believe it's reorganizing code. I think the code in the first section is wrong, and the second version is needed. Once you've dec'd the refcount, you cannot access the pointer. At that point, another thread could deref and free, and you'd be left with freed memory. You *must*

[Nfs-ganesha-devel] address sanitizer defeats -O0

2017-08-03 Thread William Allen Simpson
It's improperly reorganizing code. === Accessing freed memory at ==> Logically, this couldn't happen! int free_nfs_request(request_data_t *reqdata) { atomic_dec_uint32_t(>r_d_refs); LogDebug(COMPONENT_DISPATCH, "%s: %p fd %d xp_refs %" PRIu32 " r_d_refs %"