Search code examples
segmentation-faultlatexarchlinuxpdflatexmiktex

MikTeX pdf compiler pdflatex: segmentation fault (core dumped) [running on Archlinux]


I have a problem with pdflatex compiler which goes with Miktex install.

I used to compile my tex file using pdflatex command which point to a compiler in MikTeX install directory (/home/***/usr/bin/Miktex/bin/pdflatex) but it seems, after an update of my system (archlinux), that it cannot work properly anymore.

I repeatedly get this error:

segmentation fault (core dumped) 

wether i run pdflatex, or pdflatex main or pdflatex main.tex

Sometimes after trying a dozen time it will finally start:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.10) (preloaded format=pdflatex.fmt)
 restricted \write18 enabled.
**

and if i enter the name of my file it will finally compile:

entering extended mode
(main.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-02>
(/home/***/.miktex/texmfs/install/tex/latex/koma-script/scrartcl.cls
Document Class: scrartcl 2022/10/12 v3.38 KOMA-Script document class (article)
(/home/***/.miktex/texmfs/install/tex/latex/koma-script/scrkbase.sty
(/home/***/.miktex/texmfs/install/tex/latex/koma-script/scrbase.sty
(/home/***/.miktex/texmfs/install/tex/latex/koma-script/scrlfile.sty
(/home/***/.miktex/texmfs/install/tex/latex/koma-script/scrlfile-hook.sty
(/home/***/.miktex/texmfs/install/tex/latex/koma-script/scrlogo.sty)))
(/home/***/.miktex/texmfs/install/tex/latex/graphics/keyval.sty)))
...

Any ideas on what is causing this segmentation fault error?

thanks for your help

EDIT: I thought maybe looking at dmesg can help to solve this issue:

traps: pdflatex[7362] general protection fault ip:7fb0976d81a8 sp:7ffcc465b120 error:0 in libboost_locale.so.1.81.0[7fb0976bc000+5f000]

a few days ago I had an update of libboost_locale.so.1.80.0 to libboost_locale.so.1.81.0.1. MikteX refused to compile because it couldn't find libboost_locale.so.1.80.0 (it was replaced by ... 1.81). So I did what I found to solve this issue which was linking the library like this :

/usr/lib/libboost_locale.so.1.80.0 -> libboost_locale.so.1.81.0

As you can see from dmesg above there is an error in that library. This may help to narrow the problem down, but I still don't know what is going on.

EDIT: To be more precise, once I linked this first library, it asked me for libboost_chrono.so.1.80 and libboost_thread.so.1.80 as well, so I felt I was on the right path doing that, in the end I created links for those three libraries (1.80 --> 1.81) which was in fact a mistake as Employed Russian pointed out below.


Solution

  • So I did what I found to solve this issue which was linking the library like this

    Doctor, it hurts when I do this.

    Undo this; find a copy of libboost_locale.so.1.80.0 and copy that library into /usr/lib, and that should fix your crash.

    There is a reason the libboost_locale 1.80 and 1.81 have different SONAME -- they are not ABI-compatible. So what you did is actually break every program which was built against version 1.80.

    Update:

    How do you preserve those kind of files when there is an update?

    Normally the package manager takes care to not remove older packages when there are other packages which depend on the older version.

    But the files in $HOME/usr/bin/Miktex/bin/... is not part of managed packages, and so the package manager doesn't know anything about them. Hence the breakage.

    You should either use managed packages for miktex, or you should exercise extreme care when updating. Most package managers also allow you to pin a package to a specific version, precisely so the manager doesn't blow up your unmanaged packages.

    Because those files just disappeared with the update and it is weird to have to manually reinstall them.

    There is nothing weird about this, as should be clear from above.

    Since my package manager doesn't show me the older version I guess I have to git clone it ..

    That may plant another land mine for future you. In addition, you may not know how to build the 1.80 version in ABI-compatible way.

    Instead you should search for "$your_distribution libboost_locale.1.80.0", download the package from distro repository, manually unpack that package into a temporary directory and copy the library over.

    For ArchLinux, you can download the older version(s) from https://archive.archlinux.org/packages/b/boost-libs/