Bug 2178198

Summary: 'gs -sDEVICE=display <file.ps>' segfaults
Product: [Fedora] Fedora Reporter: Zdenek Dohnal <zdohnal>
Component: ghostscriptAssignee: Richard Lescak <rlescak>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: akhaitovich, mjg, mosvald, rlescak, zdohnal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Postscript file for testing
none
Full backtrace none

Description Zdenek Dohnal 2023-03-14 14:06:27 UTC
Created attachment 1950633 [details]
Postscript file for testing

Description of problem:
If I want to view Postscript file with -sDEVICE=display, 'gs' segfaults

Version-Release number of selected component (if applicable):
ghostscript-10.0.0-3.fc38.x86_64

How reproducible:
Always

Steps to Reproduce:
1. $ gs -sDEVICE=display <file.ps>

Actual results:
Segfault

Expected results:
GUI viewer for Postscript files starts

Comment 1 Zdenek Dohnal 2023-03-14 14:09:05 UTC
Created attachment 1950635 [details]
Full backtrace

Comment 2 Michael J Gruber 2023-03-14 14:20:59 UTC
Note that the x11 device is named 'x11'. Has 'display' ever worked here? Not on 9.55 nor 9.56. (gs should fail more gracefully, of course.)

Comment 3 Zdenek Dohnal 2023-03-14 15:02:36 UTC
Not sure - I've tested 'display' device just because x11 device is missing since 10.0.0.

From upstream regarding x11 device - it's a dynamic device which got removed because some symbols became hidden, so now only the library is shipped and not a dynamic device. Users can use 'gsx' from ghostscript-gtk to view postscript files.

According to upstream 'display' is badly chosen name from the past, it is actually an in-memory rendering device used for rendering to a display on MS Win. But still it would be great if it didn't crash :)

Comment 4 Michael J Gruber 2023-03-14 15:33:58 UTC
Interesting. If I build 10.0.0 from ghostpdl.git (plus extract.git, minus the libs we de-bundle in fedora) I get the x11 device. I guess the distribution tarball (which the spec pulls, as it should) differs.

We have gsx in ghostscript-gtk in fedora.

And yes, crashing should not be the way in which gs communicates non-working devices or parameters ... But that should be an upstream bug.