New Ghostscript/GhostPDL compiler warnings - 2018-10-16-07:00:02 - 3c218c1463b9c2ff39b1ea514824815fde4853a7
[email protected] Tue, 16 Oct 2018 08:51:34 -0700 (PDT)
| Newsgroups | gmane.comp.printing.ghostscript.regression |
|---|---|
| Message-ID | <20181016155134.CA3F22040531@i7> |
Previous Revision: 30cd347f37bfb293ffdc407397d1023628400b81 Current Revision: 3c218c1463b9c2ff39b1ea514824815fde4853a7 commit 3c218c1463b9c2ff39b1ea514824815fde4853a7 Author: Chris Liddell <[email protected]> AuthorDate: Tue Oct 16 11:21:22 2018 +0100 CommitDate: Tue Oct 16 11:33:26 2018 +0100 Bug 699962: Ensure device survives Postscript "callout" In shutting down the interpreter, we run Postscript code to remove the 'real' device from the graphics state (replacing it with the nulldevice). That means we can shutdown and free the device in the C code, without impacting the remaining interpreter shutdown. There is, however, a very small chance that, whilst running the Postcript code, the interpreter will trigger a garbage collection - if that happens *after* the device reference has been removed from the graphics state, there is no 'link' to the device object for the garbager to follow. Thus the device can be freed before control returns from executing the Postscript. Register the device as a garbage collector 'root': thus it is implicitly marked and won't be freed before control returns. psi/imain.c Ghostscript: new scan-build warnings: ./psi/imain.c:991:13: warning: Access to field 'memory' results in a dereference of a null pointer (loaded from variable 'pdev') gs_unregister_root(pdev->memory, &dev_root, "gs_main_finit"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://miles.ghostscript.com:8080/artifex/3c218c1463b9c2ff39b1ea514824815fde4853a7/gs/index.html http://miles.ghostscript.com:8080/artifex/3c218c1463b9c2ff39b1ea514824815fde4853a7/gs-scan-build.txt