-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terminate called after throwing an instance of 'std::bad_alloc' #716
Comments
It seems that TexStudio runs out of memory. I am not sure how Ubuntu manages virtual memory limits but you can try opening a shell, then type |
@MeanSquaredError Unfortunately, that seems not to be the issue:
|
Try starting TS in gdb while sending a copy of the output to a file, e.g. Then set a breakpoint at qBadAlloc Then run TexStudio Then once the breakpoint is called try getting memory allocation information by using the following two commands Then terminate TexStudio and post here the contents of output.txt |
Actually can you post here what you get when you type from shell |
@MeanSquaredError Here you go:
|
|
The malloc_stats() seems to go to standard error, so it is missing from the output. Can you please run again texstudio from gdb but redirect the stderr to stdout and then get the malloc_stats output. That is rm output.txt Then inside GDB break qBadAlloc Then once the breakpoint is called Then terminate TexStudio and post here the contents of output.txt |
I am guessing that txs is loading a tex file automatically? What packages are loaded ?
… Am 06.09.2019 um 20:47 schrieb MeanSquaredError ***@***.***>:
The malloc_stats() seems to go to standard error, so it is missing from the output. Can you please run again texstudio from gdb but redirect the stderr to stdout and then get the malloc_stats output. That is
rm output.txt
gdb /usr/bin/texstudio 2>&1 | tee output.txt
Then inside GDB
break qBadAlloc
run
Then once the breakpoint is called
call malloc_stats()
Then terminate TexStudio and post here the contents of output.txt
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@MeanSquaredError here you go:
|
@sunderme Unfortunately since txs terminates after random time it's hard for me to isolate packages that cause the issue. Here's the whole header of the document that is loaded (but not compiled!)
|
Using PS: when pasting very long contents, using an HTML element short summaryloooooooong contents// for example
<details>
<summary>short summary</summary>
loooooooong contents
</details> |
I did pretty much the same test as @muzimuzhi on Fedora 30 and the preamble worked fine. I looked into the code and it seems that LatexStyleParser::run is called in a separate background thread only when TexStudio comes across an import of a package for which it does not have an existing .cwl file (either manually or automatically built). So I suspect that it could be \usepackage{MinionPro} that is causing the problem. @eXcuvator can you try the following:
Then see if it will crash or if it will work normally with the modified file. |
Indeed, the file works fine when excluding MinionPro. |
The memory information during crash looks OK, just fragmented, but maybe that's OK too depending on the preamble being used. So I would guess that it just runs out of memory while parsing MinionPro.sty. If that's the case indeed then probably the most reasonable approach would be to catch the memory allocation exception during parsing and skip loading the .sty file that caused the out-of-memory error. @eXcuvator Is MinionPro.sty a large file? Can you upload it to some file sharing service and post the link here? |
@MeanSquaredError Here you go: https://gofile.io/?c=aITjtt |
@eXcuvator |
@MeanSquaredError There you go: https://gofile.io/?c=6GR4eZ |
Thanks for the file. The new file in turn needs otfontdef.sty |
@MeanSquaredError Hopefully this is all: https://gofile.io/?c=0yKax2 |
The archive contains an empty directory usr/local/share/texmf/tex/latex/MinionPro/ root@localhost:~/archive/downloads# unzip -v mp.zip
root@localhost:~/archive/downloads# |
@MeanSquaredError I'm terribly sorry. This one should do: https://gofile.io/?c=OnQEf6 |
@eXcuvator thank you for the archive. We are almost there with the installation of the font. So I guess it lacks the corresponding .tfm file. I guess it should be located in |
@MeanSquaredError This is a quite large folder, but here you go: https://gofile.io/?c=LITlth For future reference, I installed the font following the steps detailed here: https://www.clarkdonley.com/post/2015-03-installing-minionpro-for-latex-on-mac-os-x-yosemite/ |
It still needs some other files, so using that font from pdflatex with a sample .tex file fails. |
I managed to install the MinionPro font in latex and tested it on a couple of Linux machines (64-bit Intel). Normally TXS uses about 1.6 GB of VSS (total RAM+SWAP) out of which about 210 MB are RSS (real RAM). However when it starts autogenerating the CWL files MinionPro.cwl and MinionPro-FontDef.cwl For the first file the memory usage increases modestly by about 100 MB or so, however for the second file MinionPro-FontDef.cwl the total RAM (VSS) usage jumped slighly over 3 GB and real RAM (RSS) went to about 1.6 - 1.7 GB. This almost brought the first box which had only 4 GB to a grinding halt, it started swapping heavily and became unresponsive. However after a while it recovered. The second box which had more RAM handled it better - it still used more than 3 GB to generate the .cwl but it was fully usable while it generated the .cwl file. So my guess is that either your box does not have sufficient RAM+swap or maybe Ubuntu has placed some kind of memory allocation limit on TexStudio.
|
Hej @MeanSquaredError , it is a 64 bit machine. I don't have any
Here are the limits:
|
If it is just a corner case, we can just add minionpro.cwl to txs and avoid the scan process of that problematic package. |
@sunderme Adding the .cwl files for MinionPro is probably the most reasonable approach if it works. @eXcuvator I have uploaded the .cwl files for MinionPro as a zip archive here |
@MeanSquaredError Seems to work, no more crashes so far! |
Environment
TexStudio randomly crashes, sometimes even when there's no file opened. In the following debugging session, I simply opened a file and waited a bit. Reinstalling via apt-get, deleting .config folder did not help.
Debugging and backtrace
The text was updated successfully, but these errors were encountered: