This is the mail archive of the libc-alpha@sourceware.org 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] Check return from htab_find_slot()


On 11/12/13 08:34, Marcus Shawcroft wrote:
This patch addresses another issue highlighted by the recent "isolate
erroneous path" patch applied to gcc trunk.

The failure mechanism is similar to:
https://sourceware.org/ml/libc-alpha/2013-11/msg00291.html

In this case htab_find_slot() may result in a call to calloc() and
hence may return NULL.  The code in _dl_make_tlsdesc_dynamic does not
check the return value from htab_find_slot before dereferencing it.
The "isolate erroneous path" code in trunk gcc spots the ill defined
behaviour and inserts an abort(), this leads to a link error for at
least ARM and AArch64 builds of glibc.

This patch adds a check on the return value, I think the fix is
obvious, if I'll commit tomorrow if I don't get any objections.
Note that if you define a trap instruction in the arm/aarch64 backends, that will be used instead of a call to abort. Can you use the undefined instruction to generate a suitable trap?


jeff


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