Skip to content

Memsan reports use-of-uninitialized-value in 1.76.0 temp_directory_path() #185

Closed
@tonyelewis

Description

@tonyelewis

Compiling and executing the following code with Boost 1.75, Clang 10.0 and -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer:

#include <boost/filesystem.hpp>

int main() {
	::boost::filesystem::temp_directory_path();
}

…gives:

==8==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x4d1fd6 in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*) /root/.conan/data/boost/1.75.0/_/_/source/source_subfolder/libs/filesystem/src/operations.cpp:2603:7
    #1 0x4ed91a in boost::filesystem::detail::temp_directory_path(boost::system::error_code*) /root/.conan/data/boost/1.75.0/_/_/source/source_subfolder/libs/filesystem/src/operations.cpp:2799:24
    #2 0x49fe1c in boost::filesystem::temp_directory_path() (/fsprob/build/fsprob+0x49fe1c)
    #3 0x49a9f8 in main (/fsprob/build/fsprob+0x49a9f8)
    #4 0x7f46792830b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #5 0x41f8bd in _start (/fsprob/build/fsprob+0x41f8bd)

  Uninitialized value was created by an allocation of 'path_stat' in the stack frame of function '_ZN5boost10filesystem6detail6statusERKNS0_4pathEPNS_6system10error_codeE'
    #0 0x4d0d90 in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*) /root/.conan/data/boost/1.75.0/_/_/source/source_subfolder/libs/filesystem/src/operations.cpp:2572

SUMMARY: MemorySanitizer: use-of-uninitialized-value /root/.conan/data/boost/1.75.0/_/_/source/source_subfolder/libs/filesystem/src/operations.cpp:2603:7 in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)
Exiting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions