Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 4 Jul 2011 20:44:24 -0400
From: Rich Felker <>
Subject: cluts - posix_memalign test

I recently fixed the issue with musl's posix_memalign not returning
failure when the align argument is smaller than sizeof(size_t), but
cluts is still throwing an error in that case:

W:posix_memalign returned EINVAL, but gave a non-NULL pointer (alignment=1)

I believe this error is mistaken. posix_memalign is not giving a
non-NULL pointer to the caller. Rather the caller is seeing the value
it wrote to the pointer before making the call.

I suppose some versions of posix_memalign might clear the pointer to
null if allocation fails, but I could find no text in the standard
that requires or even allows posix_memalign to modify the pointer when
it fails, so at present musl does not touch it.

I'd welcome input from anyone who has a good argument that this is
incorrect, but short of that, I think cluts is checking a condition
that need not (and maybe can't) be true.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.