NetBSD Problem Report #48357

From www@NetBSD.org  Fri Nov  1 08:27:32 2013
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 30200A5B40
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  1 Nov 2013 08:27:32 +0000 (UTC)
Message-Id: <20131101082730.5027DA60EC@mollari.NetBSD.org>
Date: Fri,  1 Nov 2013 08:27:30 +0000 (UTC)
From: lechapelaing@yahoo.fr
Reply-To: lechapelaing@yahoo.fr
To: gnats-bugs@NetBSD.org
Subject: xfe crash when you delete just one file
X-Send-Pr-Version: www-1.0

>Number:         48357
>Category:       pkg
>Synopsis:       xfe crash when you delete just one file
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 01 08:30:00 +0000 2013
>Closed-Date:    Sat Nov 02 18:35:10 +0000 2013
>Last-Modified:  Sat Nov 02 18:35:10 +0000 2013
>Originator:     Germain Le Chapelain
>Release:        latest
>Organization:
>Environment:
NetBSD germ 5.99.65 NetBSD 5.99.65 (GENERIC) #0: Thu Aug 16 12:54:57 UTC 2012  german@germ:/usr/obj/sys/arch/amd64/compile/GENERIC amd64

>Description:
xfe crash in isEmptyDir at File.cc:494 when you delete files.


>How-To-Repeat:
open xfe.

delete files in a directory.

observe a crash

Program terminated with signal 11, Segmentation fault.
#0  0x00007f7ff628c920 in closedir () from /usr/lib/libc.so.12
(gdb) bt
#0  0x00007f7ff628c920 in closedir () from /usr/lib/libc.so.12
#1  0x00000000004192b8 in isEmptyDir (directory=<optimized out>) at File.cc:494
#2  0x0000000000459701 in FilePanel::onCmdFileDelete (this=0x7f7ff777f1c0) at FilePanel.cc:1642
#3  0x0000000000466396 in XFileExplorer::onCmdFileDelete (this=<optimized out>, o=<optimized out>, sel=<optimized out>, ptr=<optimized out>) at XFileExplorer.cc:2182
#4  0x00007f7ff6fc40a5 in FX::FXObject::tryHandle(FX::FXObject*, unsigned int, void*) () from /usr/pkg/lib/libFOX-1.6.so.0
#5  0x00007f7ff6f380c2 in FX::FXButton::onLeftBtnRelease(FX::FXObject*, unsigned int, void*) () from /usr/pkg/lib/libFOX-1.6.so.0
#6  0x00007f7ff6f314ce in FX::FXApp::dispatchEvent(_XEvent&) () from /usr/pkg/lib/libFOX-1.6.so.0
#7  0x00007f7ff6f30af3 in FX::FXApp::runOneEvent(bool) () from /usr/pkg/lib/libFOX-1.6.so.0
#8  0x00007f7ff6f30cfb in FX::FXApp::run() () from /usr/pkg/lib/libFOX-1.6.so.0
#9  0x000000000047fbf5 in main (argc=1, argv=<optimized out>) at main.cc:232

>Fix:
bash-4.2# cat /usr/pkgsrc/sysutils/xfe/patches/patch-src_File.cc
$NetBSD$

--- src/File.cc.orig    2013-11-01 01:01:06.000000000 +0000
+++ src/File.cc
@@ -490,8 +490,8 @@ FXint isEmptyDir(const FXString director
                        ret=1;
                else
                        ret=0;
+               closedir(dir);
        }
-       closedir(dir);
        return ret;
 }


>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48357 CVS commit: pkgsrc/sysutils/xfe
Date: Sat, 2 Nov 2013 18:27:39 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Sat Nov  2 18:27:39 UTC 2013

 Modified Files:
 	pkgsrc/sysutils/xfe: Makefile distinfo
 Added Files:
 	pkgsrc/sysutils/xfe/patches: patch-src_File.cc

 Log Message:
 PR 48357 Germain Le Chapelain: don't crash if opendir fails.
 PKGREVISION -> 13


 To generate a diff of this commit:
 cvs rdiff -u -r1.45 -r1.46 pkgsrc/sysutils/xfe/Makefile
 cvs rdiff -u -r1.10 -r1.11 pkgsrc/sysutils/xfe/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/xfe/patches/patch-src_File.cc

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

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 02 Nov 2013 18:35:10 +0000
State-Changed-Why:
committed, thanks

Please report this upstream too if you haven't.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.