NetBSD Problem Report #55284

From www@netbsd.org  Fri May 22 13:59:47 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 56F7E1A9227
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 22 May 2020 13:59:47 +0000 (UTC)
Message-Id: <20200522135946.76F7B1A9228@mollari.NetBSD.org>
Date: Fri, 22 May 2020 13:59:46 +0000 (UTC)
From: romain@dolbeau..org
Reply-To: romain@dolbeau..org
To: gnats-bugs@NetBSD.org
Subject: 'wmweather' broken on architecture where sizeof(long) < sizeof(time_t)
X-Send-Pr-Version: www-1.0

>Number:         55284
>Category:       pkg
>Synopsis:       'wmweather' broken on architecture where sizeof(long) < sizeof(time_t)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 22 14:00:00 +0000 2020
>Originator:     Romain Dolbeau
>Release:        pkgsrc 2020Q1
>Organization:
-
>Environment:
NetBSD ss20.dolbeau.name 9.0 NetBSD 9.0 (GENERIC.MP) #0: Fri Feb 14 00:06:28 UTC 2020  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/sparc/compile/GENERIC.MP sparc
>Description:
'wmweather' is broken on architecture where sizeof(long) < sizeof(time_t), as it passes a pointer to a 'long' (4 bytes on NetBSD/sparc) to time(), which takes a pointer to a time_t (8 bytes).

On NetBSD/sparc said long is not 8-bytes aligned, leading to a 'Bus error' due to a misaligned load (rather than a stack corruption).
>How-To-Repeat:
start wmweather on NetBSD/sparc -> Bus error.
>Fix:
I have a patch that I will submit in a follow-up e-mail, which introduce an extra time_t variable to avoid the issue.

NetBSD Home
NetBSD PR Database Search

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