0

I've recently made significant changes to my emacs configuration, and now it's crashing every now and then (maybe every week or so). The only thing that I noticed about it is that it happens when I switch buffers with C-x b.

I get a dialog box with an option to produce a backtrace to the file emacs_backtrace.txt, supposedly on the current directory at the moment it crashed.

But I can't find that file, not on the emacs/bin/ directory, nor on the directory of the file that I was visiting was at the time of the crash...

I thought about bisecting init.el to find the culprit, but since the crash is so intermittent it's going to take a while. So I'm hoping to find some kind of clue on the backtrace.

But where is the file?

I'm on MS Windows with emacs 29.2.

2
  • 1
    gnu.org/software/emacs/manual/html_node/emacs/Crashing.html Commented Mar 5, 2024 at 17:30
  • The above link says that the file is stored "in the current directory of the Emacs process". In my Linux system, I can check /proc/<Emacs pid>/cwd to find that it is my home directory, but YMMV. You can try searching the file system(s) for it. Commented Mar 5, 2024 at 19:35

1 Answer 1

1

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=12908

It's always written in the current directory of the Emacs process, which is normally a single directory determined by what your desktop shortcut says.

[the file is written] only if you click NO on the abort dialog.

Emacs on Windows doesn't change its current directory from where it was started, so the backtrace will normally end up in the same directory for all invocations of Emacs on that machine by that user.)

The main Emacs process doesn't invoke chdir on GNU or Unix either, unless you use the --chdir option.

2
  • If I've understood correctly, I'd expect C-h v command-line-default-directory to give the correct value on Windows (if it was always run the same way via a desktop icon). Commented Mar 6, 2024 at 14:24
  • Thanks! The file is not on the executable's directory, which is the same as the one on the shortcut, and also corresponds to the return of C-h v command-line-default-directory. After searching the entire disk, it appears that the file in not produced at all... Commented Mar 6, 2024 at 17:37

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.