NetBSD Problem Report #55819

From  Mon Nov 23 15:58:13 2020
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id A8DA61A921F
	for <>; Mon, 23 Nov 2020 15:58:13 +0000 (UTC)
Message-Id: <>
Date: Tue, 24 Nov 2020 00:58:04 +0900 (JST)
From: Izumi Tsutsui <>
Subject: 2020Q3 print/ghostscript-agpl dumps core on NetBSD/earm 9.1
X-Send-Pr-Version: 3.95

>Number:         55819
>Category:       pkg
>Synopsis:       2020Q3 print/ghostscript-agpl dumps core on NetBSD/earm 9.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 23 16:00:01 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.1
System: NetBSD hpt5325 9.1 NetBSD 9.1 (HPT5325) #2: Wed Nov 18 19:59:51 JST 2020  tsutsui@mirage:/s/netbsd-9/src/sys/arch/evbarm/compile/HPT5325 evbarm
Architecture: earm (earmv5)
Machine: evbarm
ps2pdf (that invoces /usr/pkg/bin/gsc) from pkgsrc-2020Q3
pkgsrc/print/ghostscript-agpl on NetBSD/earm (earmv5) dumps core
(see 'How-To-Repeat' section for details).

gdb shows:
Core was generated by `gs'.
Program terminated with signal SIGBUS, Bus error.
#0  0xbab881e8 in packed_get (mem=0xb9f39000, packed=0xb9bce2b4, 
    pref=0xb9bce2b4) at ./psi/iutil.c:707
707                 make_int(pref, (ps_int)value + packed_min_intval);

The 'make_int' macro is defined in ghostscript-9.53.1/psi/store.h.;a=blob;f=psi/store.h;h=fd7dc793147eba310b4147b507c34908dd0d7198;hb=09763e4d082755436bb36bbef912193357058535#l157
#define make_tasv(pref,newtype,newattrs,newsize,valfield,newvalue)\
  ((pref)->value.valfield = (newvalue),\
   r_set_type_attrs(pref, newtype, newattrs),\
   r_set_size(pref, newsize))
#define make_tasv_new(pref,t,a,s,vf,v)\
#define make_tasv_old(pcont,pref,t,a,s,vf,v,cname)\
  (ref_save(pcont,pref,cname), make_tasv_new(pref,t,a,s,vf,v))

/* Type-specific constructor macros for scalar (non-composite) types */

#define make_bool(pref,bval)\
  make_tv(pref, t_boolean, boolval, bval)
#define make_false(pref)\
  make_bool(pref, 0)
#define make_true(pref)\
  make_bool(pref, 1)

#define make_int(pref,ival)\
  make_tv(pref, t_integer, intval, ival)
#define make_int_new(pref,ival)\
  make_tv_new(pref, t_integer, intval, ival)

It smells caused by unaligned access, but needs to investigate
implementation details.

Note ghostscript-agpl-9.27nb3 from pkgsrc-2019Q3 also fails.

# uname -mrsp
NetBSD 9.1 evbarm earm
# pkg_add -U
pkg_add: Warning: package `ghostscript-agpl-9.53.1' was built for a platform:
pkg_add: NetBSD/earm 9.0 (pkg) vs. NetBSD/earm 9.1 (this host)
# echo hoge | ps2pdf -
Bus error (core dumped)

No idea.

Izumi Tsutsui

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.