From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Baoqiu.Cui@yahoo.com Newsgroups: gmane.emacs.bugs Subject: Re: VM crashes on big INBOX file ==> problem found!!! Date: Fri, 26 Oct 2007 00:05:16 -0700 Organization: AT&T http://yahoo.sbc.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1193394093 29603 80.91.229.12 (26 Oct 2007 10:21:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2007 10:21:33 +0000 (UTC) To: gnu-emacs-bug@moderators.isc.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 26 12:21:35 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IlMJp-0000yo-NA for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Oct 2007 12:21:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IlMJh-0001Uc-2o for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Oct 2007 06:21:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IlJGm-0007gt-VI for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2007 03:06:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IlJGk-0007fd-JT for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2007 03:06:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IlJGk-0007fZ-BB for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2007 03:06:10 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IlJGj-00042n-IN for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2007 03:06:10 -0400 Original-Received: from moderators.individual.net ([130.133.4.7]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IlJGe-0006oz-Tn for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2007 03:06:05 -0400 Original-Received: from newssvr24-ext.news.prodigy.net ([207.115.32.224] helo=nlpi068.nbdc.sbc.com) by moderators.individual.net (Exim 4.67) for gnu-emacs-bug@moderators.isc.org with esmtp (envelope-from ) id <1IlJGc-0007Pr-Ca>; Fri, 26 Oct 2007 09:06:02 +0200 Original-Received: from localhost (localhost [[UNIX: localhost]]) by nlpi068.nbdc.sbc.com (8.13.1/8.12.5) id l9Q75xwF019036; Fri, 26 Oct 2007 03:05:59 -0400 Original-Path: 508a9475!not-for-mail Original-Newsgroups: comp.emacs,gnu.emacs.vm.bug,gnu.emacs.bug User-Agent: Gnus/5.1100000000000003 (Gnus v5.11) Emacs/22.1 (cygwin) Cancel-Lock: sha1:D1jUICk9cUu3HBtWeGBtvVfa5tY= Original-Lines: 127 Original-NNTP-Posting-Host: 216.145.49.15 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: nlpi068.nbdc.sbc.com 1193382357 ST000 216.145.49.15 (Fri, 26 Oct 2007 03:05:57 EDT) Original-NNTP-Posting-Date: Fri, 26 Oct 2007 03:05:57 EDT X-UserInfo1: FKPO@MC@@S@WRW\[GBCBNWX@RJ_XPDLMN@GZ_GYO^ZUDUWYAKVUOPCW[ML\JXUCKVFDYZKBMSFX^OMSAFNTINTDDMVW[X\THOPXZRVOCJTUTPC\_JSBVX\KAOTBAJBVMZTYAKMNLDI_MFDSSOLXINH__FS^\WQGHGI^C@E[A_CF\AQLDQ\BTMPLDFNVUQ_VM X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 3) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Fri, 26 Oct 2007 06:21:08 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16837 Archived-At: Baoqiu.Cui@yahoo.com writes: > Reiner Steib writes: > >>>>I also tried splitting this big folder into two (one with 44MB and >>>>one with 35MB), and VM can also crash on the small ones sometimes. >> >> Please clarify if *Emacs* or *VM* crashes. (What to you mean by >> "crash"?) > > It is Emacs that crashes... Everything is gone except a line of > "Segmentation fault emacs" on the console. I can easily recreate > this using the 79MB folder. OK. After running GDB on Emacs, I finally found the real cause for the crash. The problem is that, when VM is visiting the huge 79MB folder, garbage collection is triggered and function mark_object() (in alloc.c) is recursively called about 29,885 times (see the backtrace info below)!!! So many levels of mark_object() calls make the stack overflow, causing a segmentation fault. Since I am running Emacs on Cygwin, I had to change the following line in src/Makefile LD=$(CC) -Wl,--image-base,0x20000000 to LD=$(CC) -Wl,--image-base,0x20000000,--stack,8000000 to increase the stack limit to ~8MB and have the problem resolved. After making this change and rebuilding Emacs, now I am able to read the huge folder without any problem. I hope Emacs can do a better job in adjusting the stack limit, or at least add some document in etc/PROBLEMS. Here is the backtrace information before Emacs crashes: ------------------------------------------------------------------------ Current directory is ~/tmp/emacs-22.1/src/ GNU gdb 6.5.50.20060706-cvs (cygwin-special) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-cygwin"... DISPLAY = localhost:0.0 TERM = dumb Breakpoint 1 at 0x2009ff96: file emacs.c, line 431. Breakpoint 2 at 0x200b9ed9: file sysdep.c, line 1385. (gdb) r Starting program: /cygdrive/c/tmp/emacs-22.1/src/emacs.exe -geometry 80x40+0+0 Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll Loaded symbols for /usr/bin/cygncurses-8.dll Loaded symbols for /usr/bin/cygwin1.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll Loaded symbols for /usr/bin/cygjpeg-62.dll Loaded symbols for /usr/bin/cygpng12.dll Loaded symbols for /usr/bin/cygz.dll Loaded symbols for /usr/bin/cygtiff-5.dll Loaded symbols for /usr/bin/cygungif-4.dll Loaded symbols for /usr/X11R6/bin/cygX11-6.dll Loaded symbols for /usr/X11R6/bin/cygICE-6.dll Loaded symbols for /usr/X11R6/bin/cygSM-6.dll Loaded symbols for /usr/X11R6/bin/cygXaw3d-7.dll Loaded symbols for /usr/X11R6/bin/cygXext-6.dll Loaded symbols for /usr/X11R6/bin/cygXmu-6.dll Loaded symbols for /usr/X11R6/bin/cygXt-6.dll Loaded symbols for /usr/X11R6/bin/cygXpm-4.dll Breakpoint 3 at 0x20080c86: file xterm.c, line 7861. Program received signal SIGSEGV, Segmentation fault. mark_object (arg=567788100) at alloc.c:5700 5700 mark_object (ptr->contents[i]); (gdb) where #0 mark_object (arg=567788100) at alloc.c:5700 #1 0x200f4c9d in mark_object (arg=567788132) at alloc.c:5700 #2 0x200f4707 in mark_object (arg=564785749) at alloc.c:5825 #3 0x200f4883 in mark_object (arg=567803073) at alloc.c:5712 #4 0x200f4c9d in mark_object (arg=567807364) at alloc.c:5700 #5 0x200f4c9d in mark_object (arg=567788036) at alloc.c:5700 #6 0x200f4707 in mark_object (arg=564785805) at alloc.c:5825 #7 0x200f4883 in mark_object (arg=567803145) at alloc.c:5712 #8 0x200f4c9d in mark_object (arg=567807236) at alloc.c:5700 #9 0x200f4c9d in mark_object (arg=567787940) at alloc.c:5700 #10 0x200f4707 in mark_object (arg=564785861) at alloc.c:5825 #11 0x200f4883 in mark_object (arg=567803217) at alloc.c:5712 #12 0x200f4c9d in mark_object (arg=567807108) at alloc.c:5700 #13 0x200f4c9d in mark_object (arg=567787844) at alloc.c:5700 #14 0x200f4707 in mark_object (arg=564785917) at alloc.c:5825 #15 0x200f4883 in mark_object (arg=567803289) at alloc.c:5712 #16 0x200f4c9d in mark_object (arg=567806980) at alloc.c:5700 #17 0x200f4c9d in mark_object (arg=567787748) at alloc.c:5700 #18 0x200f4707 in mark_object (arg=564785973) at alloc.c:5825 #19 0x200f4883 in mark_object (arg=567803361) at alloc.c:5712 #20 0x200f4c9d in mark_object (arg=567806852) at alloc.c:5700 #21 0x200f4c9d in mark_object (arg=567787652) at alloc.c:5700 ... #29884 0x200f4707 in mark_object (arg=560521157) at alloc.c:5825 #29885 0x200f4899 in mark_object (arg=565795341) at alloc.c:5714 #29886 0x20145e0d in traverse_intervals_noorder (tree=0x21a518c4, function=0x200f4d80 , arg=539875329) at intervals.c:218 #29887 0x20145e36 in traverse_intervals_noorder (tree=0x21a518e0, function=0x200f4d80 , arg=539875329) at intervals.c:223 #29888 0x20145e36 in traverse_intervals_noorder (tree=0x21b9c8c4, function=0x200f4d80 , arg=539875329) at intervals.c:223 #29889 0x20145e36 in traverse_intervals_noorder (tree=0x21b9d380, function=0x200f4d80 , arg=539875329) at intervals.c:223 #29890 0x20145e36 in traverse_intervals_noorder (tree=0x21ba0588, function=0x200f4d80 , arg=539875329) at intervals.c:223 #29891 0x20145e36 in traverse_intervals_noorder (tree=0x21bbf534, function=0x200f4d80 , arg=539875329) at intervals.c:223 #29892 0x20145e36 in traverse_intervals_noorder (tree=0x21bce4fc, function=0x200f4d80 , arg=539875329) at intervals.c:223 Debugger finished ------------------------------------------------------------------------ Thanks to all of you for the help! Regards, Baoqiu