[CMake] 2.4.7 TarTest test failure on Tru64 UNIX 5.1
Albert Chin
cmake at mlists.thewrittenword.com
Thu Sep 20 18:56:43 EDT 2007
Ok, this is interesting. TarTest is causing cmake to SEGV. Backtrace:
>0 0x120474a18 in strlcpy(dst=0x11fff31e8="", src=0x0, siz=16384) "/opt/build/cmake-2.4.7/Utilities/cmtar/compat/strlcpy.c":53
>#1 0x120470fd0 in mkdirhier(path=0x0) "/opt/build/cmake-2.4.7/Utilities/cmtar/util.c":89
>#2 0x120472708 in tar_extract_dir(t=0x140155a00, realname=0x11fff7540="tar_dir/") "/opt/build/cmake-2.4.7/Utilities/cmtar/extract.c":744
>#3 0x120471790 in tar_extract_file(t=0x140155a00, realname=0x11fff7540="tar_dir/") "/opt/build/cmake-2.4.7/Utilities/cmtar/extract.c":171
>#4 0x120472d58 in tar_extract_all(t=0x140155a00, prefix=0x0) "/opt/build/cmake-2.4.7/Utilities/cmtar/wrapper.c":129
So, what's the problem. dirname(). From dirname(3):
The dirname() function reads path and returns a pointer to a new string
that is a pathname of the parent directory of that file. Trailing /
(slash) characters in the path are not counted as part of the path. If
there is no / (slash), if path is a null pointer, or if path points to an
empty string, the dirname() function returns a pointer to the string .
(period).
[Tru64 UNIX] In applications that are compiled in an environment that
excludes the _XOPEN_SOURCE_EXTENDED standard definitions, the dirname()
function returns a NULL if there is no / (slash), and a core dump if path
is a null pointer, or if path points to an empty string.
The problem is that dirname("tar_dir/") == NULL. However, with
-D_XOPEN_SOURCE_EXTENDED, then dirname("tar_dir/") works. So, what
should we do? Is it possible to build Utilities/cmtar/util.c with
-D_XOPEN_SOURCE_EXTENDED on Tru64 UNIX only? I know I can do this for
_every_ file under Utilities/cmtar but want to restrict it only to
Utilities/cmtar/util.c.
--
albert chin (china at thewrittenword.com)
More information about the CMake
mailing list