bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: append-to-file can crash Emacs


From: Alex Schroeder
Subject: Re: append-to-file can crash Emacs
Date: 23 Apr 2001 18:12:20 +0200
User-agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/20.7

Eli Zaretskii <address@hidden> writes:

> On 22 Apr 2001, Alex Schroeder wrote:
> 
> > In GNU Emacs 20.7.1 (i686-pc-linux-gnu, X toolkit)
> >  of Sun Apr  8 2001 on snail
> > 
> > The code I attached crashes my Emacs.
> 
> Is it possible to see a crash traceback?

Hm, I never did this before.  Does the following help?
I am sorry, it is quite verbose because I don't know what you might be
looking for.

First, the elisp code I executed, second a log of some gdb dabbling of
mine.  Feel free to ask more detailed questions.  :)

Alex.

(require 'cl)
(defun command-cookies (file)
  (interactive "FWrite cookie files: ")
  (setq file (or file "~/tmp/commands"))
  (my-append-string-to-file "%\n%\n" file)
  (loop with i = 1
        for num from 1
        when (> num 99) do (setq num 1 i (1+ i))
        for s being the symbols
        when (commandp s) do
        (my-append-string-to-file
         (concat (describe-function s)
                 "\n\nInvoke with:\n\n"
                 (with-temp-buffer
                   (where-is s t)
                   (buffer-string))
                 "\n%\n")
         (concat file "-" i))))

(defun my-append-string-to-file (str file)
  "Append string STR to FILE."
  (with-temp-buffer
    (insert str)
    (append-to-file (point-min) (point-max) file)))


address@hidden:/usr/local/src/emacs-20.7 > gdb src/emacs
GNU gdb 4.18
Copyright 1998 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 und
er certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show wa
rranty" for details.
This GDB was configured as "i386-suse-linux"...
(gdb) run
Starting program: /usr/local/src/emacs-20.7/src/emacs 

Program received signal SIGSEGV, Segmentation fault.
0x8101d5d in print (obj=1073731385, 
    printcharfun=404767956, escapeflag=1)
    at print.c:1283
1283              if (!NULL_INTERVAL_P (XSTRING (obj)->intervals))
(gdb) backtrace
#0  0x8101d5d in print (obj=1073731385, 
    printcharfun=404767956, escapeflag=1)
    at print.c:1283
#1  0x810095a in Fprin1 (object=1073731385, 
    printcharfun=404767956) at print.c:860
#2  0x8101992 in print_error_message (
    data=1479519540, stream=404767956) at print.c:1071
#3  0x809a4c8 in cmd_error_internal (data=1479519540, 
    context=0xbfffedb8 "") at keyboard.c:1038
#4  0x809a417 in cmd_error (data=1479519540)
    at keyboard.c:989
#5  0x80f3bbf in internal_condition_case (
    bfun=0x809a730 <command_loop_1>, 
    handlers=404768412, hfun=0x809a370 <cmd_error>)
    at eval.c:1140
#6  0x809a5de in command_loop_2 () at keyboard.c:1093
#7  0x80f36f7 in internal_catch (tag=404768388, 
    func=0x809a5c0 <command_loop_2>, arg=404767908)
    at eval.c:925
#8  0x809a583 in command_loop () at keyboard.c:1072
#9  0x809a151 in recursive_edit_1 () at keyboard.c:821
#10 0x809a269 in Frecursive_edit () at keyboard.c:869
#11 0x80992d2 in main (argc=1, argv=0xbffff324, 
    envp=0xbffff32c) at emacs.c:1361
(gdb) list
1278              int need_nonhex = 0;
1279    
1280              GCPRO1 (obj);
1281    
1282    #ifdef USE_TEXT_PROPERTIES
1283              if (!NULL_INTERVAL_P (XSTRING (obj)->intervals))
1284                {
1285                  PRINTCHAR ('#');
1286                  PRINTCHAR ('(');
1287                }
(gdb) source src/.gdbinit
Warning: /usr/local/src/emacs-20.7/../lwlib: Datei oder Verzeichnis nicht 
gefunden.
DISPLAY = :0
TERM = xterm
Breakpoint 1 at 0x80981a6: file emacs.c, line 284.
Breakpoint 2 at 0x8088b12: file xterm.c, line 5335.
(gdb) xtype obj
The history is empty.
(gdb) pr obj
The history is empty.
(gdb) p obj
$1 = 1073731385
(gdb) pr

Program received signal SIGSEGV, Segmentation fault.
0x8101d5d in print (obj=1073731385, 
    printcharfun=404825844, escapeflag=1)
    at print.c:1283
1283              if (!NULL_INTERVAL_P (XSTRING (obj)->intervals))
The program being debugged stopped while in a function called from GDB.
When the function (debug_print) is done executing, GDB will silently
stop (instead of continuing to evaluate the expression containing
the function call).
(gdb) xtype
Lisp_String
0
(gdb) xstring
$2 = (struct Lisp_String *) 0xfffd739
Cannot access memory at address 0xfffd739.
(gdb) 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]