NetBSD Problem Report #53396

From martin@aprisoft.de  Mon Jun 25 06:57:47 2018
Return-Path: <martin@aprisoft.de>
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 2FE2E7A159
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 25 Jun 2018 06:57:47 +0000 (UTC)
Message-Id: <20180625065738.2B3EA5CC854@emmas.aprisoft.de>
Date: Mon, 25 Jun 2018 08:57:38 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: xfwm4 crashes
X-Send-Pr-Version: 3.95

>Number:         53396
>Category:       pkg
>Synopsis:       xfwm4 crashes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gutteridge
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 25 07:00:00 +0000 2018
>Closed-Date:    
>Last-Modified:  Tue Jan 29 03:16:05 +0000 2019
>Originator:     Martin Husemann
>Release:        NetBSD 8.99.19
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD whoever-brings-the-night.aprisoft.de 8.99.19 NetBSD 8.99.19 (WHOEVER) #230: Sat Jun 23 08:21:35 CEST 2018 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/sparc64/compile/WHOEVER sparc64
Architecture: sparc64
Machine: sparc64
>Description:

Propably when settings changed (or xfsettingsd crashed) I get a core from
xfwm4:

Core was generated by `xfwm4'.
Program terminated with signal SIGBUS, Bus error.
#0  0x00000000410058fc in sn_startup_sequence_get_last_active_time.localalias
    () from /usr/pkg/lib/libstartup-notification-1.so.0
[Current thread is 1 (process 1)]
(gdb) bt
#0  0x00000000410058fc in sn_startup_sequence_get_last_active_time.localalias
    () from /usr/pkg/lib/libstartup-notification-1.so.0
=> 0x410058fc <sn_startup_sequence_get_last_active_time.localalias.5+28>:      stx  %g1, [ %o2 ]
(gdb) info reg o2
o2             0xffffffffffffca04       -13820

That is: it is trying to store a 64bit value at an address not properly 
aligned.


>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53396: xfwm4 crashes
Date: Tue, 26 Jun 2018 08:48:13 +0200

 Obvious bug, sn_startup_sequence_get_last_active_time takes two long pointer
 arguments, but xfc4-wm passes pointers to may-be-different types.

 The patch below should fix it.

 Martin


 --- src/startup_notification.c.orig	2015-05-18 14:09:19.000000000 +0200
 +++ src/startup_notification.c	2018-06-26 08:44:51.580042779 +0200
 @@ -128,6 +128,7 @@ sn_collect_timed_out_foreach (void *elem
      SnStartupSequence *sequence;
      time_t tv_sec;
      suseconds_t tv_usec;
 +    long l_sec, l_usec;
      double elapsed;

      g_return_if_fail (data != NULL);
 @@ -135,7 +136,8 @@ sn_collect_timed_out_foreach (void *elem

      sequence = element;
      ctod = (CollectTimedOutData *) data;
 -    sn_startup_sequence_get_last_active_time (sequence, &tv_sec, &tv_usec);
 +    sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
 +    tv_sec = l_sec; tv_usec = l_sec;

      elapsed =
          ((((double) ctod->now.tv_sec - tv_sec) * G_USEC_PER_SEC +

Responsible-Changed-From-To: pkg-manager->youri
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Tue, 26 Jun 2018 06:57:12 +0000
Responsible-Changed-Why:
Over to maintainer


State-Changed-From-To: open->analyzed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Tue, 26 Jun 2018 06:57:12 +0000
State-Changed-Why:
Patch works for me, should be acceptable upstream


Responsible-Changed-From-To: youri->gutteridge
Responsible-Changed-By: gutteridge@NetBSD.org
Responsible-Changed-When: Tue, 08 Jan 2019 10:53:40 +0000
Responsible-Changed-Why:
Take.

From: "David H. Gutteridge" <gutteridge@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53396 CVS commit: pkgsrc/wm/xfce4-wm
Date: Wed, 9 Jan 2019 01:33:35 +0000

 Module Name:	pkgsrc
 Committed By:	gutteridge
 Date:		Wed Jan  9 01:33:35 UTC 2019

 Modified Files:
 	pkgsrc/wm/xfce4-wm: Makefile distinfo
 Added Files:
 	pkgsrc/wm/xfce4-wm/patches: patch-src_startup__notification.c

 Log Message:
 wm/xfce4-wm: fix crasher bug

 Address PR pkg/53396, reported and solved by Martin Husemann.


 To generate a diff of this commit:
 cvs rdiff -u -r1.66 -r1.67 pkgsrc/wm/xfce4-wm/Makefile
 cvs rdiff -u -r1.25 -r1.26 pkgsrc/wm/xfce4-wm/distinfo
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/wm/xfce4-wm/patches/patch-src_startup__notification.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Benny Siegert <bsiegert@gmail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, 
	Martin Husemann <martin@netbsd.org>
Subject: Re: pkg/53396: xfwm4 crashes
Date: Wed, 9 Jan 2019 09:42:21 +0100

 On Tue, Jun 26, 2018 at 8:50 AM Martin Husemann <martin@duskware.de> wrote:
 >  The patch below should fix it.

 Did you submit this upstream, Martin?

From: Martin Husemann <martin@duskware.de>
To: Benny Siegert <bsiegert@gmail.com>
Cc: gnats-bugs@netbsd.org
Subject: Re: pkg/53396: xfwm4 crashes
Date: Wed, 9 Jan 2019 09:46:19 +0100

 On Wed, Jan 09, 2019 at 09:42:21AM +0100, Benny Siegert wrote:
 > On Tue, Jun 26, 2018 at 8:50 AM Martin Husemann <martin@duskware.de> wrote:
 > >  The patch below should fix it.
 > 
 > Did you submit this upstream, Martin?

 I completely forgot about it until David pinged me yesterday - sorry
 (that is: no). Will do so now...

 Martin

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: martin@NetBSD.org
Subject: Re: pkg/53396: xfwm4 crashes
Date: Fri, 25 Jan 2019 16:20:53 +0000

 On Tue, Jun 26, 2018 at 06:50:01AM +0000, Martin Husemann wrote:
  >  Obvious bug, sn_startup_sequence_get_last_active_time takes two
  >  long pointer arguments, but xfc4-wm passes pointers to
  >  may-be-different types.
  >  
  >  The patch below should fix it.
  >     :
  >       time_t tv_sec;
  >       suseconds_t tv_usec;
  >  +    long l_sec, l_usec;
  >       double elapsed;
  >     :
  >  -    sn_startup_sequence_get_last_active_time (sequence, &tv_sec, &tv_usec);
  >  +    sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
  >  +    tv_sec = l_sec; tv_usec = l_sec;

 two questions:

 (1) Shouldn't it have not built without this change?
 (2) Isn't truncating time_t to long a bug? (That is, shouldn't
     sn_startup_sequence_get_last_active_time be changed to take the
     right types, at least for upstream?)

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/53396: xfwm4 crashes
Date: Fri, 25 Jan 2019 16:21:27 +0000

 not sent to gnats.

    ------

 From: Martin Husemann <martin@duskware.de>
 To: gutteridge@NetBSD.org, pkgsrc-bugs@netbsd.org
 Subject: Re: pkg/53396: xfwm4 crashes
 Date: Wed, 9 Jan 2019 11:35:13 +0100

 On Wed, Jan 09, 2019 at 08:50:01AM +0000, Martin Husemann wrote:
 >  I completely forgot about it until David pinged me yesterday - sorry
 >  (that is: no). Will do so now...

 https://bugzilla.xfce.org/show_bug.cgi?id=15028

State-Changed-From-To: analyzed->feedback
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Tue, 29 Jan 2019 03:16:05 +0000
State-Changed-Why:
martin@: I believe there are still issues here?

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.