From owner-freebsd-bugs@FreeBSD.ORG Sat Oct 30 17:50:27 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5389416A4CE for ; Sat, 30 Oct 2004 17:50:27 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F7C343D58 for ; Sat, 30 Oct 2004 17:50:25 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9UHoM0g069137 for ; Sat, 30 Oct 2004 17:50:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9UHoMpl069136; Sat, 30 Oct 2004 17:50:22 GMT (envelope-from gnats) Resent-Date: Sat, 30 Oct 2004 17:50:22 GMT Resent-Message-Id: <200410301750.i9UHoMpl069136@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, James Van Bokkelen Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2166416A4CE for ; Sat, 30 Oct 2004 17:42:04 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1241543D1D for ; Sat, 30 Oct 2004 17:42:04 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i9UHg38Z040244 for ; Sat, 30 Oct 2004 17:42:03 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i9UHg3No040242; Sat, 30 Oct 2004 17:42:03 GMT (envelope-from nobody) Message-Id: <200410301742.i9UHg3No040242@www.freebsd.org> Date: Sat, 30 Oct 2004 17:42:03 GMT From: James Van Bokkelen To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: bin/73319: realpath() produces incorrect results when called from threaded programs X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2004 17:50:27 -0000 >Number: 73319 >Category: bin >Synopsis: realpath() produces incorrect results when called from threaded programs >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 30 17:50:22 GMT 2004 >Closed-Date: >Last-Modified: >Originator: James Van Bokkelen >Release: FreeBSD 5.3-RC1 >Organization: Sandstorm Enterprises Inc. >Environment: FreeBSD j3.sandstorm.net 5.3RC1 FreeBSD 5.3-RC1 #0 Sun Oct 17 01:25:37 UTC 2004 root@wv1u.samsco.home:/usr/obj/src/sys/GENERIC i386 >Description: When invoked via the 'realpath' command or from a non-threaded application, realpath("/usr/ni", buf) returns "/usr/ni". But when invoked from a threaded app, it returns "/us/ni". Other paths using more than one '/' character fail in the same way. >How-To-Repeat: A threaded Qt application we are porting from 4.8 failed because its QFileDialog objects could not navigate the file system. Using gdb, we found that realpath() was returning incorrect results. I then wrote a simple test program, which worked right, as does the 'realpath' command. I then added a call to realpath() to a threaded C-language app (no Qt or C++ use at all), and it fails the same way. If requested, I will put together a simple demonstration, but I thought I'd submit the inital report ASAP. >Fix: haven't begun to review the source yet. >Release-Note: >Audit-Trail: >Unformatted: