Assertion failed when loading a file, returned temporary path wrong

Thibaut Cuvelier tcuvelier at lyx.org
Sat Feb 6 21:16:39 UTC 2021


Dear list,

I recently rebuilt LyX from master (roughly alpha 2), and I now get this
output when configuring LyX (actually, once configure.py has finished):

+checking list of textclasses...
        done
+generating default list of packages...
        done
LyX: Done!
support\filetools.cpp (521): LyX could not create temporary directory in
C:/Windows'
RunCommand: could not start child process

Moreover, when loading a file, I get an assertion error:

TextClass.cpp (94): Conversion of layout with layout2layout.py has failed.
TextClass.cpp (363): Unable to convert
D:/Thibaut/LyX/lib/layouts/article.layout to format 92
Error reading `[layouts/article.layout]'
(Check `article')
Check your installation and try Tools/Reconfigure...
Error: Could not load class
----------------------------------------
Due to some error in it, the layout file:
article
could not be loaded. A default textclass with default
layouts will be used. LyX will not be able to produce
correct output.
RunCommand: could not start child process
TextClass.cpp (94): Conversion of layout with layout2layout.py has failed.
TextClass.cpp (363): Unable to convert
D:/Thibaut/LyX/lib/layouts/article.layout to format 92
Error reading `[layouts/article.layout]'
(Check `article')
Check your installation and try Tools/Reconfigure...
RunCommand: could not start child process
TextClass.cpp (94): Conversion of layout with layout2layout.py has failed.
TextClass.cpp (363): Unable to convert
D:/Thibaut/LyX/lib/layouts/article.layout to format 92
Error reading `[layouts/article.layout]'
(Check `article')
Check your installation and try Tools/Reconfigure...
support\lassert.cpp (52): ASSERTION false VIOLATED IN
D:\Thibaut\LyX\src\LayoutFile.cpp:253
Assertion triggered in void __cdecl lyx::doAssertWithCallstack(bool) by
failing check "false" in file D:\Thibaut\LyX\src
\support\lassert.cpp:45

Process finished with exit code 3

I suspect that the root cause of this is Package::system_temp_dir() returns
C:\Windows, which is not a writeable directory (only system files belong
there).

The cause of this is that I overwrote some parameters when starting my
built LyX, so that the environment variables were no more set. This caused
the Win32 call GetTempPath to return C:\Windows, because the first
tentatives (based on environment variables) failed. See
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppatha
for the details.

In LyX, maybe there should be an explicit check in createTmpDir
(filetools.cpp) whether the temporary directory is writeable, and have an
error box in the GUI if it is not? Currently, if someone falls into the
same trap as I did, there is no explicit error message, even though this
creates an assertion error later on and probably other failures if
assertions are disabled.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210206/2ceda3a1/attachment.html>


More information about the lyx-devel mailing list