Bugzilla – Bug 1177922
ghostscript: txtwrite has memory issues
Last modified: 2024-01-10 12:50:02 UTC
Tumbleweed: [ghostscript-9.52-2.2.x86_64] » wget https://interoperability.blob.core.windows.net/files/MS-OXCMSG/%5bMS-OXCMSG%5d-181001.pdf » md5sum *pdf 434487f9faea2e8fe9f451b031a474a3 [MS-OXCMSG]-181001.pdf » ps2ascii \[MS-OXCMSG\]-181001.pdf malloc(): corrupted top size /usr/bin/ps2ascii: line 21: 11109 Aborted (core dumped) $GS_EXECUTABLE $OPTIONS -o - "$1" 15.2: [ghostscript-9.52-lp152.2.4.1.x86_64] gs: malloc.c:2422: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
/usr/bin/ps2ascii is a script that calls basically "gs -q -dSAFER -sDEVICE=txtwrite" so the root cause is related to the txtwrite device of Ghostscript. I can reproduce it with Ghostscript 9.52 on my openSUSE Leap 15.1 homeoffice laptop with "normal" PDFs (but not with PostScript files) like ---------------------------------------------------------------------------- # cat /usr/share/doc/release-notes/openSUSE/RELEASE-NOTES.en.pdf \ | gs -q -dSAFER -sDEVICE=txtwrite -o - - \ | cat - >openSUSE_RELEASE-NOTES.en.txt *** Error in `gs': malloc(): memory corruption: 0x00000000011c1c60 *** ---------------------------------------------------------------------------- and ---------------------------------------------------------------------------- # cat /usr/share/doc/release-notes/openSUSE/RELEASE-NOTES.de.pdf \ | gs -q -dSAFER -sDEVICE=txtwrite -o - - \ | cat - >openSUSE_RELEASE-NOTES.de.txt gs: malloc.c:2422: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. ---------------------------------------------------------------------------- interestingly there are different error messages which seem to depend on the language of the openSUSE RELEASE-NOTES PDF ;-) I found bugs at Ghostscript upstream with txtwrite memory issues like https://bugs.ghostscript.com/show_bug.cgi?id=702229 and its duplicate https://bugs.ghostscript.com/show_bug.cgi?id=702346 also with different error messages but perhaps all have in the end the same root cause. I will test latest Ghostscript 9.53 (need to build that first)...
Ghostscript 9.53.3 from OBS home:jsmeix:branches:Printing ghostscript works with the txtwrite Ghostscript device for https://interoperability.blob.core.windows.net/files/MS-OXCMSG/%5bMS-OXCMSG%5d-181001.pdf and also for the other PDFs where it had failed before.
Submitted to OBS Printing project and also directly to openSUSE:Factory because of https://build.opensuse.org/request/show/842834 -------------------------------------------------------------------------- # osc submitrequest -m 'Ghostscript version upgrade to 9.53.3 \ that fixes boo#1177922 and fixes compilation with FreeType 2.10.3+' \ home:jsmeix:branches:Printing ghostscript Printing ghostscript created request id 843001 # osc request accept -m 'Ghostscript version upgrade to 9.53.3 that \ fixes boo#1177922 and fixes compilation with FreeType 2.10.3+' 843001 Result of change request state: ok openSUSE:Factory Forward this submit to it? ([y]/n)y Ghostscript version upgrade to 9.53.3 that fixes boo#1177922 and fixes compilation with FreeType 2.10.3+ (forwarded request 843001 from jsmeix) New request # 843002 --------------------------------------------------------------------------
This is an autogenerated message for OBS integration: This bug (1177922) was mentioned in https://build.opensuse.org/request/show/843002 Factory / ghostscript
This issue is fixed because https://build.opensuse.org/request/show/843002 is accepted.
Ghostscript 9.53.3 was released in Tumbleweed snapshot 20201023 https://lists.opensuse.org/opensuse-factory/2020-10/msg00250.html