> Date: Sun, 4 Nov 2012 18:44:51 +0200 > From: eliz@gnu.org > Subject: Re: bug#12774: 24.2.50; EMACS 24.2.50.1 crashing‏ > To: vincent.b.1@hotmail.fr > CC: 12774@debbugs.gnu.org > > > From: Vincent Belaïche > > Date: Sat, 3 Nov 2012 23:24:15 +0100 > > > > The crash can happen without my doing anything special previously > > except opening that attached file USING_CEDET_FROM_BZR which causes > > loading orgmode. Also it seems that it has to do with the size of my > > init.el file --- and not only to its content. > > OK. Here's what I'm asking you to do. Start Emacs under GDB, like > this: > > c:\Documents and Settings\Vincent>gdb C:/Programme/GNU/Emacs/bin/emacs.exe > > (Note: do NOT invoke Emacs via the --exec= switch, since that does not > load the symbol table and other debugging info from emacs.exe.) > > Once GDB shows its prompt, type these commands: > > (gdb) break ralloc.c:353 > (gdb) break w32heap.c:141 > (gdb) break w32heap.c:155 > (gdb) run > > Please verify that the 3 source lines where you set breakpoints are > the ones marked below: > My ralloc.c is Bzr-110429 and the breakpoint line is 352 instead of 353 > ralloc.c: > > if ((*real_morecore) (- excess) == 0) > { > /* If the system didn't want that much memory back, adjust > the end of the last heap to reflect that. This can occur > if break_value is still within the original data segment. */ > >>>>>>> last_heap->end = (char *) last_heap->end + excess; > /* Make sure that the result of the adjustment is accurate. > It should be, for the else clause above; the other case, > which returns the entire last heap to the system, seems > unlikely to trigger this mode of failure. */ > if (last_heap->end != (*real_morecore) (0)) > emacs_abort (); > } > My w32heap.c is Bzr-110429, and the breakpoint lines are 194 instead of 141, and 208 instead of 155. > w32heap.c: > > /* Sanity checks. */ > if ((data_region_end - size) < data_region_base) > >>>>> return NULL; > > /* We can only decommit full pages, so allow for > partial deallocation [cga]. */ > new_data_region_end = (data_region_end - size); > new_data_region_end = (unsigned char *) > ((DWORD_PTR) (new_data_region_end + syspage_mask) & ~syspage_mask); > new_size = real_data_region_end - new_data_region_end; > real_data_region_end = new_data_region_end; > if (new_size > 0) > { > /* Decommit size bytes from the end of the heap. */ > if (using_dynamic_heap > && !VirtualFree (real_data_region_end, new_size, MEM_DECOMMIT)) > >>>>> return NULL; > } > > If your sources are different, adjust the line numbers in the "break" > commands accordingly. > > Now do whatever you usually do to get Emacs to crash, and wait for one > of the breakpoints to break (they will break before the crash, so > don't expect the abort dialog). > > Then please tell which of the breakpoints on the 2 "return NULL" in > w32heap.c breaks. If it's the second one, the one after the call to > VirtualFree, please type this command: > > (gdb) print w32_last-error() > The break occurred in the 3rd breakpoint (second one in w32heap.c), i.e. *NOT* the one after the call to VirtualFree, but one the previous one in the same file. > (note the parentheses: they are important) and tell what it prints. > > Then please type "continue", which should stop at the breakpoint in > ralloc.c, and tell what do the following commands produce: > > (gdb) print last_heap->end > (gdb) print last_heap->bloc_start > (gdb) print excess > (gdb) print sbrk(0) > > Also, please type "xbacktrace" and post the Lisp-level backtrace this > produces. If you don't invoke GDB from the src directory, you may > need to type "source /path/to/emacs/src/.gdbinit" to make "xbacktrace" > work. > Please find attached the log which I got. Please note the following: - at line 83 the message `Undefined command: "xbacktrace". Try "help".' occurs again because I typed RET a second time. - at line 89 `Are you sure you want to change it? (y or n) [answered Y; input not from terminal]' the answered was autnomously produced by EMACS which I am was using as a terminal --- because that makes it easier to save the log to a file and to recall past commands --- I don't know why EMACS used with `M-x shell' does not always behave well when you are asked interactive questions, but that is a completely different issue. - At line 109 I tried print w32_last-error() to see what happens, even though that is not the 2nd breakpoint (1st in w32heap.c) - At lines 111 & 112 I typed RET twice, and this is why you get the same error messages again `No symbol "w32_last" in current context.' > > Thanks. All thanks are to you for your kind support. Vincent.