🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.ghostscript.bug
Article #428

Unaligned access errors in mem_get_bits()

#428
From: Brian McAllister
Date: Fri, 25 Sep 1992 19:58
37 lines
1856 bytes
Ghostscript 2.5.2,  Ultrix 4.2, DS5000/200

I am getting "unaligned access errors" from gs.  I have traced the
problem to the function mem_get_bits().  Here is the call trace:
	main				gs.c:190
	(.....)
	gs_interpret			interp.c:182
	interp				interp.c:524
	zoutputpage			zdevice.c:169
	gs_output_page			gsdevice.c:88
	gdev_prn_output_page		gdevprn.c:238
	ln03_print_page			gdevln03.c:80
	sixel_printpage			gdevln03.c:146
	gdev_prn_copy_scan_lines	gdevprn.c:369
	gdev_prn_get_bits		gdevprn.c
	mem_get_bits			gdevmem1.c:180

The problem seems to be that when gdev_prn_copy_scan_lines() calls
gdev_prn_get_bits(), the "pad" argument is 0.  mem_get_bits() computes
the bytes_per_line using gs_device_raster(), and gets an odd number
(319 in this case), as its pad_to_word argument is 0.  This causes
memswab2() to be called with an odd address, leading to the unaligned
access errors.  The comment on memswab2() says "src and dest must be
16-bit aligned".  In this case, they are not.

I do not get the errors if I specify the laserjet driver, or use an X
window for display.  However, I don't see anything in
gdev_prn_copy_scan_lines() that allows it to change behavior (pad the
bytes_per_line) based on the output device.

As far as I can recall, gs2.4.1 did not exhibit this problem, and
gs2.5 did.

--
----
Brian McAllister       Internet: mcallister@mit.edu
                         BITNET: BRIAN@MITBATES
Technical Details
Message-ID: <BRIAN.92Sep25145844@kokom.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!kokom.mit.edu!brian

Show Full Headers
Complete Article Headers
Newsgroups: gnu.ghostscript.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!kokom.mit.edu!brian
From: brian@kokom.mit.edu (Brian McAllister)
Subject: Unaligned access errors in mem_get_bits()
Message-ID: <BRIAN.92Sep25145844@kokom.mit.edu>
Sender: gnulists@ai.mit.edu
Organization: Bates LINAC, MIT
Distribution: gnu
Date: Fri, 25 Sep 1992 19:58:44 GMT
Approved: bug-ghostscript@prep.ai.mit.edu
Lines: 38