bin/73319: realpath() produces incorrect results when called from
James Van Bokkelen
jbvb at sandstorm.net
Sat Oct 30 10:50:27 PDT 2004
>Synopsis: realpath() produces incorrect results when called from threaded programs
>Arrival-Date: Sat Oct 30 17:50:22 GMT 2004
>Originator: James Van Bokkelen
>Release: FreeBSD 5.3-RC1
Sandstorm Enterprises Inc.
FreeBSD j3.sandstorm.net 5.3RC1 FreeBSD 5.3-RC1 #0 Sun Oct 17 01:25:37 UTC 2004 root at wv1u.samsco.home:/usr/obj/src/sys/GENERIC i386
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.
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.
haven't begun to review the source yet.
More information about the freebsd-bugs