The simple program
causes valgrind(1) to complain about a spurious invalid free():
==1557== Memcheck, a memory error detector
==1557== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==1557== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==1557== Command: ./a
==1557== Invalid free() / delete / delete / realloc()
==1557== at 0x4C232BC: free (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==1557== by 0x4007CB: main (in /tmp/a)
==1557== Address 0x5806058 is not stack'd, malloc'd or (recently) free'd
==1557== HEAP SUMMARY:
==1557== in use at exit: 0 bytes in 0 blocks
==1557== total heap usage: 0 allocs, 1 frees, 0 bytes allocated
==1557== All heap blocks were freed -- no leaks are possible
==1557== For counts of detected and suppressed errors, rerun with: -v
==1557== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
I suspect that valgrind doesn't properly intercept aligned_alloc(3) and thus doesn't
recognize the address when it is passed to free(). This issue does not occur on Linux,
I suspect it comes from the interaction between jemalloc(3) and valgrind.
see also Bug #220943.
Maintainership dropped ports r495096.
Assign to new maintainer.