Date: Sat, 30 Oct 2004 17:42:03 GMT From: James Van Bokkelen <jbvb@sandstorm.net> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/73319: realpath() produces incorrect results when called from threaded programs Message-ID: <200410301742.i9UHg3No040242@www.freebsd.org> Resent-Message-ID: <200410301750.i9UHoMpl069136@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410301742.i9UHg3No040242>