To: vim-dev@vim.org Subject: Patch 6.1.379 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.379 Problem: Linux with kernel 2.2 can't use the alternate stack in combination with threading, causes an infinite loop. Solution: Don't use the alternate stack in this situation. Files: src/os_unix.c *** ../vim61.378/src/os_unix.c Sun Mar 9 14:19:20 2003 --- src/os_unix.c Fri Mar 7 22:50:28 2003 *************** *** 1060,1066 **** --- 1060,1075 ---- /* Setup to use the alternate stack for the signal function. */ sa.sa_handler = func_deadly; sigemptyset(&sa.sa_mask); + # if defined(__linux__) && defined(_REENTRANT) + /* On Linux, with glibc compiled for kernel 2.2, there is a bug in + * thread handling in combination with using the alternate stack: + * pthread library functions try to use the stack pointer to + * identify the current thread, causing a SEGV signal, which + * recursively calls deathtrap() and hangs. */ + sa.sa_flags = 0; + # else sa.sa_flags = SA_ONSTACK; + # endif sigaction(signal_info[i].sig, &sa, NULL); #else # if defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGVEC) *** ../vim61.378/src/version.c Sun Mar 9 15:19:50 2003 --- src/version.c Sun Mar 9 15:21:23 2003 *************** *** 613,614 **** --- 613,616 ---- { /* Add new patch number below this line */ + /**/ + 379, /**/ -- A)bort, R)etry, B)ang it with a large hammer /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///