TeXmacs falling into infinite crash loop

I am using TexMacs in MacOS BigSur. After using TexMacs for a couple of times, it will start crashing and getting this error message:
52%20PM
No matter how many times I click re-open, it keeps crashing and getting the same error message. It will only start working again if I delete all the files in the “systems” folder in .TexMacs.

Welcome @stochastic_guy!

Are you doing anything specific when these crashes start happening? It would be good to find a way to reproduce your problem, otherwise it will be hard for others to debug it.

It may be also be helpful if you can start TeXmacs from the terminal when the crash happens. The output may contain some clues as to the reason of the crash.

Initially, it was when I changed and saved settings and preferences within TexMacs. To keep working with TexMacs, I just deleted “systems” folder. The next time it crashes I will try to run TexMacs from terminal and share the output here.

Thank you @jeroen :slight_smile:

This is the error I get while trying to open with Terminal

Welcome to TeXmacs 2.1
------------------------------------------------------------------------------
kpsepath works with your TeX distribution
kpsewhich works with your TeX distribution
mktextfm works with your TeX distribution
mktexpk works with your TeX distribution
texhash works with your TeX distribution
attempt install of inkscape extension 
 installing or updating inkscape extension
------------------------------------------------------------------------------
Installation completed successfully !
I will now start up the editor
------------------------------------------------------------------------------
/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/progs/kernel/boot/abbrevs.scm:81:12: In procedure scm_lreadr in expression (read (open-file # OPEN_READ)):
/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/progs/kernel/boot/abbrevs.scm:81:12: /Users/Athul/.TeXmacs/system/interactive.scm:6:33: Unknown # object: #\<
TeXmacs] With linked TrueType support
/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/progs/init-buffer.scm:15:9: In expression (buffer-missing-style?):
/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/progs/init-buffer.scm:15:9: Unbound variable: buffer-missing-style?
Throwing widget should be attached
-------------------------------------------------
Error message:
  widget should be attached

System information:
  TeXmacs version  : 2.1
  Built by         : magix
  Building date    : Tue Jun 22 14:17:23 CEST 2021
  Operating system : darwin16.7.0
  Vendor           : apple
  Processor        : @CONFIG_HOST_CPU@
  Crash date       : Fri Jul  2 10:49:25 CDT 2021

TeXmacs does not yet have a current view
Backtrace of C++ stack:
  1   TeXmacs                             0x0000000102294ec8 : get_crash_report(char const*) + 312
  2   TeXmacs                             0x00000001018825a0 : tm_throw(char const*) + 112
  3   TeXmacs                             0x000000010200d728 : attach_view(url, url) + 328
  4   TeXmacs                             0x000000010200de34 : window_set_view(url, url, bool) + 388
  5   TeXmacs                             0x00000001020123bb : new_buffer_in_new_window(url, tree, tree) + 267
  6   TeXmacs                             0x0000000102012626 : open_window(tree) + 86
  7   TeXmacs                             0x000000010170c266 : TeXmacs_main(int, char**) + 11302
  8   TeXmacs                             0x0000000102d1a304 : invoke_main_func() + 36
  9   TeXmacs                             0x0000000102cf2baf : c_body() + 15
  10  TeXmacs                             0x0000000102d4f157 : scm_c_catch() + 391
  11  TeXmacs                             0x0000000102cf2b2d : scm_i_with_continuation_barrier() + 157
  12  TeXmacs                             0x0000000102cf2b94 : scm_c_with_continuation_barrier() + 52
  13  TeXmacs                             0x0000000102d4d059 : scm_i_with_guile_and_parent() + 41
  14  TeXmacs                             0x0000000102d1a2c7 : scm_boot_guile() + 39
  15  TeXmacs                             0x000000010170f8b5 : main() + 1397
  16  libdyld.dylib                       0x00007fff20496f5d : start() + 1
  17  ???                                 0x0000000000000001 : 0x0() + 1

-------------------------------------------------
libc++abi: terminating with uncaught exception of type string
Abort trap: 6
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...397 completed.

[Process completed]

Thanks for the details. Does this happen consistently when you open TeXmacs or with a specific file? If it is consistent, do you remember what you did just before it started?

This is happening consistently when launching Texmacs from applications. I am not doing anything in specific. I am only opening and trying out different commands from the User guide for inserting specific symbols or something like that.

Usually this happens when I start Texmacs after it was used a couple of days ago. Then I have to re-install everything to get Texmacs working. Then this whole process keeps repeating.

You should be able to restart correctly only by removing the $HOME/.TeXmacs directory. Usually this happens because TeXmacs crashed for some reason and corrupted some initialisation files. After that every time you restart the program it will read the corrupted file and crash again. So only the first crash is relevant. It would be interesting to know if you are doing a manipulation which provoke the first crash or if just crashes for unknown reasons. Are you on a M1 Mac? Or is still an Intel Mac?

I am in Intel Mac. I don’t think I am doing any manipulation. I haven’t started using Texmacs for my projects because of the crashing issues. So basically I am just trying different commands in a new file and closing without saving.

It seems from your log messages that specifically ~/.TeXmacs/system/interactive.scm has been corrupted somehow. This would also explain why deleting the system directory helped you before. If you haven’t deleted it yet, it may be worthwhile looking at that file. To be honest, I don’t know what its function is.

In order to help you we would need to know what happened strange the run before the one where TeXmacs crashes at startup. As I told you the corrupted file seems to be /Users/Athul/.TeXmacs/system/interactive.scm and as long as it is there TeXmacs will continue crashing at startup. You can remove it, or better move it somewhere else and maybe send it here so that we can make ourselves an idea what is going wrong. But at that point the strangeness already happened, so we would need to focus what happens before that point.

If it helps, here is a version of interactive.scm that is probably corrupted:

((docgrep-in-doc
   (("0" . "page break"))
   (("0" . "comment"))
   (("0" . "developer "))
   (("0" . "context macr")))
 (add-style-package
   (("0" . "macros"))
   (("0" . "macros.ts")))
 (set-main-style
   (("0" . "Metropolis"))
   (("0" . "metropolis")))
 (graphics-set-dash-style-unit*
   (("0" . "=") ("1" . "="))
   (("0" . "=") ("1" . #<eof>)))
 (table-set-padding (("0" . "2pt")))
 (load-buffer-in-new-window
   (("0"
     system->url
     "/Users/jon/Documents/sconing-sgdt/sconing.tm"))
   (("0"
     system->url
     "/Users/jon/Documents/naive-logical-relations/macros.ts"))
   (("0"
     system->url
     "/Users/jon/.TeXmacs/progs/my-init-texmacs.scm")))
 (recent-buffer
   (("0"
     .
     "/Users/jon/Documents/talks/muri22/slides2.tm"))
   (("0"
     .
     "/Users/jon/Documents/talks/muri22/metropolis.ts"))
   (("0"
     .
     "/Users/jon/Documents/talks/muri22/slides.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/styles/beamer.ts"))
   (("0"
     .
     "/Users/jon/Source/foreign/tm-forge/styles/beamer/metropolis/metropolis-demo.tm"))
   (("0"
     .
     "/Users/jon/Documents/naive-logical-relations/texmacs.tm"))
   (("0"
     .
     "/Users/jon/Library/Containers/com.apple.mail/Data/Library/Mail Downloads/C836FBAD-979F-484C-A817-962CB82BEE1E/fast-and-responsive.tm"))
   (("0"
     .
     "/Users/jon/Library/Containers/com.apple.mail/Data/Library/Mail Downloads/3732C94B-1ED7-4B70-8B13-FD9BC524106F/slow-and-sluggish.tm"))
   (("0"
     .
     "/Users/jon/Documents/sconing-sgdt/sconing.tm"))
   (("0"
     .
     "/Users/jon/Documents/naive-logical-relations/macros.ts"))
   (("0" . "tmfs://db/bib/global"))
   (("0"
     .
     "/Users/jon/Documents/naive-logical-relations/more-notes.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/packages/standard/std-utils.ts"))
   (("0"
     .
     "/Users/jon/Documents/naive-logical-relations/macros.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/progs/link/ref-edit.scm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/packages/cite/cite-author-year.ts"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/packages/standard/std-math.ts"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/packages/standard/std-markup.ts"))
   (("0"
     .
     "/Users/jon/Documents/denotational-store/ch1.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/packages/compute/program.ts"))
   (("0"
     .
     "/Users/jon/.TeXmacs/progs/my-init-texmacs.scm"))
   (("0"
     .
     "tmfs://revision/927af9919e59b675a2e823df0a001a79996f4eda/file/Users/jon/Documents/denotational-store/paper.tex"))
   (("0"
     .
     "tmfs://commit/927af9919e59b675a2e823df0a001a79996f4eda/file/Users/jon/Documents/denotational-store"))
   (("0"
     .
     "tmfs://git/log/file/Users/jon/Documents/denotational-store"))
   (("0"
     .
     "tmfs://apidoc/type=module&what=convert.rewrite.init-rewrite"))
   (("0" . "tmfs://apidoc/type=symbol&what="))
   (("0"
     .
     "/Users/jon/Documents/denotational-store/references/refs-bibtex.bib"))
   (("0"
     .
     "/Users/jon/Documents/naive-logical-relations/slides.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/doc/devel/format/regular/prim-page-break.en.tm"))
   (("0" . "tmfs://grep/type=doc&what=page break"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/packages/utilities/comment.ts"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/doc/main/faq/faq.en.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/doc/about/projects/todo.en.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/plugins/python/doc/python-demo.en.tm"))
   (("0" . "tmfs://grep/type=doc&what=comment"))
   (("0"
     .
     "/Users/jon/.TeXmacs/progs/my-init-buffer.scm"))
   (("0" . "tmfs://grep/type=doc&what=developer "))
   (("0"
     .
     "tmfs://help/article/tm/doc/main/math/man-math.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/main/text/man-structure.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/main/text/man-layout-issues.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/main/text/man-text.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/main/interface/man-session-edit.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/main/interface/man-spreadsheet.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/main/interface/man-itf.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/devel/style/design/style-example.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/devel/style/style.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/main/layout/man-float.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/main/layout/man-layout.en.tm"))
   (("0"
     .
     "tmfs://help/normal/tm/doc/main/man-manual.en.tm"))
   (("0"
     .
     "tmfs://help/article/tm/doc/devel/format/basics/basics.en.tm"))
   (("0"
     .
     "tmfs://help/article/tm/doc/main/interface/man-itf.en.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/doc/devel/format/stylesheet/prim-transient.en.tm"))
   (("0" . "tmfs://grep/type=doc&what=context macr"))
   (("0"
     .
     "tmfs://help/article/tm/doc/about/welcome/start.en.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/styles/article/acm/acmsmall.ts"))
   (("0"
     .
     "tmfs://help/article/tm/doc/main/graphics/man-graphics.en.tm"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/packages/standard/std-fold.ts"))
   (("0"
     .
     "/Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/packages/beamer/title/title-bar.ts"))
   (("0"
     .
     "tmfs://help/article/tm/doc/main/beamer/man-beamer.en.tm"))
   (("0"
     .
     "tmfs://help/article/tm/doc/about/welcome/new-welcome.en.tm")))
 (font-import
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-SemiboldIt.otf"))
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-Semibold.otf"))
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-Regular.otf"))
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-MediumIt.otf"))
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-Medium.otf"))
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-It.otf"))
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-BoldIt.otf"))
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-BoldCnIt.otf"))
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-BoldCn.otf"))
   (("0"
     system->url
     "/Users/jon/Downloads/Fonts-2/Minion Pro/MinionPro-Bold.otf")))
 (animate-selection (("0" . "3")))
 (wrapped-print-to-file
   (("0"
     system->url
     "/Users/jon/Documents/talks/muri22/slides2.pdf"))
   (("0"
     system->url
     "/Users/jon/Documents/talks/muri22/slides.pdf"))
   (("0"
     system->url
     "/Users/jon/Documents/naive-logical-relations/texmacs.pdf"))
   (("0"
     system->url
     "/Users/jon/Source/jonsterling.github.com/docs/papers/sterling:2022:wg6.pdf"))
   (("0" system->url "/Users/jon/Desktop/test.pdf"))
   (("0" system->url "/Users/jon/test.pdf")))
 (clipboard-paste
   (("0"
     .
     "(stree-<gtr>tree
 `(with \"gr-geometry\"     
      (tuple \"geometry\" \"400px\" \"300px\" \"center\")
    \"font-shape\" \"italic\"
    (graphics
      ;; the arc and the line together make the semicircle
      (with \"color\" \"black\"  (arc ,pA ,pC ,pB))
      (with \"color\" \"black\"  (line ,pA ,pB))
      ;; a closed polyline for the triangle
      (with \"color\" \"red\" \"line-width\" \"1pt\" 
            (cline ,pA ,pB ,pC))
      ;; add letters using text-at
      (with \"color\" \"black\"  (text-at \"A\" ,tA))
      (with \"color\" \"black\"  (text-at \"B\" ,tB))
      (with \"color\" \"black\"  (text-at \"C\" ,tC))
      ;; finally decorate with the TeXmacs symbol
      (with \"color\" \"blue\"  \"font-shape\" \"upright\" 
            (text-at (TeXmacs) ,(pt -0.55 -0.75))))))"))))
2 Likes

@jonsterling Thanks, I’ve looked at your file and it’s the lines following graphics-set-dash-style-unit* that are the problem. It seems the graphics editor doesn’t perform sufficient check on the input of the dash style dialog. I’ve filed a new bug for this case:
https://savannah.gnu.org/bugs/index.php?62655

It seems more error handling is necessary when parsing and writing to interactive.scm.

1 Like

Did find a solution for this?

I’m having a similar issue, described here: Cannot open TeXmacs. In my case, TeXmacs crashes opening files stored in iCloud Drive. I’m curious if you find a similar pattern!