Bug 702326 - GPL Ghostscript 9.26: Unrecoverable error, exit code 1
Summary: GPL Ghostscript 9.26: Unrecoverable error, exit code 1
Status: RESOLVED INVALID
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Graphics Library (show other bugs)
Version: 9.26
Hardware: PC Linux
: P4 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-11 04:01 UTC by peanuts
Modified: 2020-04-11 10:10 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
file of the problem (112 bytes, application/postscript)
2020-04-11 04:01 UTC, peanuts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description peanuts 2020-04-11 04:01:18 UTC
Created attachment 19130 [details]
file of the problem

when I test the ImageMagick ,I met this problem,but I do not know why it became this .
here is the error

root@VM-0-15-ubuntu:/home/afl-Ima# ./ImageMagick/utilities/.libs/magick  convert ./sync_dir-i/fuzzer2/hangs/id\:000000\,src\:000122\,op\:havoc\,rep\:32 ./t.png
Error: /VMerror in (binary token, type=128)
VM status: 1 4891838 2331561728
Current allocation mode is local
GPL Ghostscript 9.26: Unrecoverable error, exit code 1



and I strace the problem get it

unlink("/tmp/magick-30069tXnSTUC8QfZZ") = 0
access("/tmp/magick-30069tXnSTUC8QfZZ.cache", F_OK) = -1 ENOENT (No such file or directory)
mmap(0x6210000e0000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x6210000e0000
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7ffa3e786ad0) = 30073
wait4(30073, Error: /VMerror in (binary token, type=128)
VM status: 1 4891838 2331561728
Current allocation mode is local
GPL Ghostscript 9.26: Unrecoverable error, exit code 1
[{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 30073
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30073, si_uid=0, si_status=1, si_utime=155, si_stime=138} ---
mmap(0x6210000f0000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x6210000f0000
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7ffa3e786ad0) = 30423
wait4(30423, Error: /VMerror in (binary token, type=128)
VM status: 1 4891838 2331561728
Current allocation mode is local
GPL Ghostscript 9.26: Unrecoverable error, exit code 1
[{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 30423
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30423, si_uid=0, si_status=1, si_utime=158, si_stime=137} ---

I hope it can be solved. thx
Comment 1 Robin Watts 2020-04-11 09:31:01 UTC
> I hope it can be solved. thx

Well, not with that information, it can't.

In order for us to look into the problem, you need to tell us how to reproduce it with Ghostscript. Just Ghostscript. Not ImageMagick.

You need to tell us exactly what command you used to trigger the problem, and (as you have done), include the input file.

If you have a problem caused by calling ImageMagick, report it to ImageMagick. The ImageMagick authors can then pass it onto us as a Ghostscript bug, because they are in a position to tell us exactly what Ghostscript command was used.

BUT the first thing we'll tell them to do is to test with the latest version of Ghostscript.

AND why is a /VMerror necessarily wrong in this case? It looks from your report like you're feeding the contents of a fuzzer into ImageMagick, so for the program to exit in an orderly manner with an error seems quite correct.
Comment 2 Chris Liddell (chrisl) 2020-04-11 09:58:55 UTC
Just to confirm; VMerror is *exactly* the correct behaviour in this case.

The binary token sequence in the file causes Ghostscript to have to attempt to allocate a Postscript array of size 434110447.

Although we don't enforce it, for compatibility with Adobe implementations, Postscript producers invariably limit the allowed array size to 65,535.

As Robin says, this is perfectly sensible, and intended behaviour.
Comment 3 peanuts 2020-04-11 10:10:03 UTC
thanks a lot! this issue can be closed.