This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch RFC: Use internal qsort function in libbacktrace
- From: Ian Lance Taylor <iant at google dot com>
- To: Rainer Orth <ro at cebitec dot uni-bielefeld dot de>
- Cc: Paolo Carlini <paolo dot carlini at oracle dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 7 Mar 2014 07:24:38 -0800
- Subject: Re: Patch RFC: Use internal qsort function in libbacktrace
- Authentication-results: sourceware.org; auth=none
- References: <mcrppm1mi78 dot fsf at iant-glaptop dot roam dot corp dot google dot com> <5319AEB2 dot 6040300 at oracle dot com> <yddsiqutdgt dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE>
On Fri, Mar 7, 2014 at 4:12 AM, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> Hi Paolo,
>
>> On 03/05/2014 04:34 AM, Ian Lance Taylor wrote:
>>> The GNU glibc qsort function will call malloc in some cases. That makes
>>> it unsuitable for libbacktrace, which is intended to work when called
>>> from a signal handler. This patch changes libbacktrace to use an
>>> internal qsort function.
>>>
>>> I'm posting this for comments in case anybody sees anything wrong with
>>> the implementation. I'll commit it in a day or two if I don't hear
>>> anything.
>>>
>>> Bootstrapped and ran libbacktrace and Go tests on
>>> x86_64-unknown-linux-gnu.
>> Sorry if I missed some messages or I'm just confused, but today I'm seeing
>> a lot of regressions all of the same form:
>>
>> libsanitizer/asan/.libs/libasan.so: undefined reference to `backtrace_qsort'
>>
>> Confirmed in eg:
>>
>> http://gcc.gnu.org/ml/gcc-testresults/2014-03/msg00399.html
>>
>> Any idea what's up?
>
> I suspect the following patch (yet untested) will fix this:
>
> 2014-03-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>
> * libbacktrace/Makefile.am (libsanitizer_libbacktrace_la_SOURCES):
> Add ../../libbacktrace/sort.c.
> * libbacktrace/Makefile.in: Regenerate.
> * libbacktrace/backtrace-rename.h (backtrace_qsort): Define.
Sorry about that. It did not occur to me to run the sanitizer tests.
Thanks for the fix.
Ian