This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)

On 10/08/2013 03:04 PM, Jeff Law wrote:
>> It seems incredibly useful to enable the asserts and trigger these
>> violations as early as possible. If you don't care you can disable
>> the asserts?
> Another approach would be similar to what we're doing with memstomp.
> ie, build a set of wrappers which check for these argument goofs and
> allow users to dl-preload DSOs with the wrappers.
> When I first proposed the idea for these sanity checking dl-preload
> libraries for Fedora I envisioned that we could go beyond just
> checking for overlapping memory areas in the mem* and str* functions.
> There could be a set of pthread wrapper functions that check for
> whatever invariants we can in the pthread* functions without a huge
> performance hit.

Right, you could wrap everything up and check all inputs against
non-NULL where the headers say __attribute__ ((__nonnull__ params))
or __nonnull(params) (short-hand in glibc).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]