mgieseki / dvisvgm

A fast DVI, EPS, and PDF to SVG converter
https://dvisvgm.de
GNU General Public License v3.0
294 stars 28 forks source link

Assertion violation + core dump #250

Closed matthias-vigelius closed 8 months ago

matthias-vigelius commented 8 months ago

Hi,

the attached dvi

faulty.zip

causes an assertion violation and associated crash on my machine when running

dvisvgm -n -v3 --optimize -ofaulty.svg faulty.dvi

The error message is

/usr/include/c++/13.2.1/bits/stl_vector.h:1125: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

For what it's worth, I'm running arch linux on kernel 6.5.5-arch1-1.

There is probably something wrong with my .dvi (it's created using asymptote) but it still shouldn't crash.

Thanks heaps for your effort, it's much appreciated.

Matthias

mgieseki commented 8 months ago

I can't reproduce the issue with the current version. What version of dvisvgm do you use (dvisvgm -V)?

matthias-vigelius commented 8 months ago

Hi, the version is dvisvgm 3.1.1 (the latest if I'm not mistaken). If I omit the --optimize flag it works fine.

mgieseki commented 8 months ago

Could you please verify if it's actually dvisvgm 3.1.1? I really can't reproduce the error with that version. Edit: Sorry, I tested the wrong build. I can now reproduce the memory issue and will commit the fix shortly.