1

Q:  How can I narrow down this gdb backtrace to a specific character, or set of characters, that is causing a Emacs to suffer a segmentation fault when using prin1?

Program received signal SIGSEGV, Segmentation fault.
0x0000000100141da7 in print_object (obj=4790542093, printcharfun=0, 
    escapeflag=true) at print.c:1350
1350    {
(gdb) bt full
#0  0x0000000100141da7 in print_object (obj=4790542093, printcharfun=0, 
    escapeflag=true) at print.c:1350
        buf = "\000\000\000\000\000\000\000\000\070\346\211\035\001", '\000' <repeats 11 times>, "\303o\024\034\001\000\000\000\350\345\211\035\001", '\000' <repeats 11 times>, "\320\360:_\377\177"
#1  0x000000010014261f in print_object (obj=4766068675, printcharfun=0, 
    escapeflag=true) at print.c:1659
        halftail = 4766068675
        print_length = 9223372036854775807
        i = 1
        buf = "\000\000\000\000\000\000\000\000\070\346\211\035\001", '\000' <repeats 11 times>, "\265މ\035\001\000\000\000\350\345\211\035\001", '\000' <repeats 11 times>, "`\363:_\377\177"
#2  0x0000000100143a77 in print_object (obj=<optimized out>, printcharfun=0, 
    escapeflag=true) at print.c:1965
        idx = 0
        tem = 4790542093
        size = 10
        buf = "\000\000\000\000\000\000\000\000\070\346\211\035\001", '\000' <repeats 11 times>, "\243#\n\034\001\000\000\000\350\345\211\035\001", '\000' <repeats 11 times>, "\360\365:_\377\177"
#3  0x000000010014261f in print_object (obj=4765393827, printcharfun=0, 
    escapeflag=true) at print.c:1659
---Type <return> to continue, or q <return> to quit---
  • I think p obj and then xpr should show you what's being printed. – npostavs Jul 2 '17 at 17:03
  • @npostavs -- thank you. I came up with a way to reproduce this error, and will spend some time working on it over the next few days. – lawlist Jul 2 '17 at 17:33
1

@npostavs was able to track the problem down in the Emacs bug report 27571: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=27571

In a nutshell, the error is caused because the ulimit stack size is too low to handle this particular situation. ulimit -S -s unlimited resolves this issue.

In the event the Emacs team implements a fix, or if another solution is found, I will update this answer.

I the meantime, I am starting the GUI version of Emacs with a bash script that first executes ulimit -S -s unlimited followed by the absolute path to the Emacs executable and the & symbol.

#!/bin/sh

ulimit -S -s unlimited

/path/to/emacs &

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.