|
From: | Paul Eggert |
Subject: | bug#18361: New 'sort' implementation can crash Emacs |
Date: | Fri, 29 Aug 2014 22:22:48 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 |
Dmitry Antipov wrote:
If an undefined behavior doesn't cause crash,
Unfortunately undefined behavior in qsort can cause a crash (or an infinite loop, etc., etc.). It's platform-dependent, and on many platforms the problem happens only in unusual cases, so I'm not surprised your tests didn't find it. But it definitely can happen. See, for example,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42157 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51297These crash reports are for Solaris qsort, but today I found similar issues in the latest glibc qsort by code inspection (e.g., the path qsort takes when memory is low). These issues are not qsort bugs, since the qsort spec requires a total-order comparison function. It's a bug in the Emacs trunk.
[Prev in Thread] | Current Thread | [Next in Thread] |