-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang windows segfault #195
Comments
I am unable to reproduce so far, but I have only tested clang-16. While I try with clang-19, would you mind posting the content of |
I tried clang-19 (the exact same version as you) on Windows and still running OK. I think I'm going to need more info:
Another possibility is that you are using a different set of build options between the compiled snitch library and your test application. This shouldn't happen in normal use, but perhaps there's an issue with your build setup. |
My bad for closing and reopening. I didn't mean to spam you, I accidentally clicked the close button somehow. I am using the library via cmake and fetch_content "cacheVariables": {
"CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_CXX_STANDARD": "23",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"BUILD_TESTING": "ON"
} project(
collection_tests
LANGUAGES CXX
)
include(FetchContent)
FetchContent_Declare(
snitch
GIT_REPOSITORY https://github.com/snitch-org/snitch.git
GIT_TAG v1.2.5
SYSTEM
)
FetchContent_MakeAvailable(snitch)
add_executable(collection_tests)
target_link_libraries(collection_tests PRIVATE ad::collections snitch::snitch)
target_sources(collection_tests PRIVATE "src/vector.cpp")
add_test(NAME collection_tests COMMAND collection_tests) Here is my snitch_config.hpp #ifndef SNITCH_CONFIG_HPP
#define SNITCH_CONFIG_HPP
#include <version> // for C++ feature check macros
// These are defined from build-time configuration.
// clang-format off
#define SNITCH_VERSION "1.2.5"
#define SNITCH_FULL_VERSION "1.2.5.86d18cb"
#define SNITCH_VERSION_MAJOR 1
#define SNITCH_VERSION_MINOR 2
#define SNITCH_VERSION_PATCH 5
#if !defined(SNITCH_MAX_TEST_CASES)
# define SNITCH_MAX_TEST_CASES 5000
#endif
#if !defined(SNITCH_MAX_NESTED_SECTIONS)
# define SNITCH_MAX_NESTED_SECTIONS 8
#endif
#if !defined(SNITCH_MAX_EXPR_LENGTH)
# define SNITCH_MAX_EXPR_LENGTH 1024
#endif
#if !defined(SNITCH_MAX_MESSAGE_LENGTH)
# define SNITCH_MAX_MESSAGE_LENGTH 1024
#endif
#if !defined(SNITCH_MAX_TEST_NAME_LENGTH)
# define SNITCH_MAX_TEST_NAME_LENGTH 1024
#endif
#if !defined(SNITCH_MAX_TAG_LENGTH)
# define SNITCH_MAX_TAG_LENGTH 256
#endif
#if !defined(SNITCH_MAX_CAPTURES)
# define SNITCH_MAX_CAPTURES 8
#endif
#if !defined(SNITCH_MAX_CAPTURE_LENGTH)
# define SNITCH_MAX_CAPTURE_LENGTH 256
#endif
#if !defined(SNITCH_MAX_UNIQUE_TAGS)
# define SNITCH_MAX_UNIQUE_TAGS 1024
#endif
#if !defined(SNITCH_MAX_COMMAND_LINE_ARGS)
# define SNITCH_MAX_COMMAND_LINE_ARGS 1024
#endif
#if !defined(SNITCH_MAX_REGISTERED_REPORTERS)
# define SNITCH_MAX_REGISTERED_REPORTERS 8
#endif
#if !defined(SNITCH_MAX_PATH_LENGTH)
# define SNITCH_MAX_PATH_LENGTH 1024
#endif
#if !defined(SNITCH_DEFINE_MAIN)
#define SNITCH_DEFINE_MAIN 1
#endif
#if !defined(SNITCH_WITH_EXCEPTIONS)
#define SNITCH_WITH_EXCEPTIONS 1
#endif
#if !defined(SNITCH_WITH_TIMINGS)
#define SNITCH_WITH_TIMINGS 1
#endif
#if !defined(SNITCH_WITH_SHORTHAND_MACROS)
#define SNITCH_WITH_SHORTHAND_MACROS 1
#endif
#if !defined(SNITCH_DEFAULT_WITH_COLOR)
#define SNITCH_DEFAULT_WITH_COLOR 1
#endif
#if !defined(SNITCH_CONSTEXPR_FLOAT_USE_BITCAST)
#define SNITCH_CONSTEXPR_FLOAT_USE_BITCAST 1
#endif
#if !defined(SNITCH_APPEND_TO_CHARS)
#define SNITCH_APPEND_TO_CHARS 1
#endif
#if !defined(SNITCH_DECOMPOSE_SUCCESSFUL_ASSERTIONS)
#define SNITCH_DECOMPOSE_SUCCESSFUL_ASSERTIONS 0
#endif
#if !defined(SNITCH_WITH_ALL_REPORTERS)
#define SNITCH_WITH_ALL_REPORTERS 1
#endif
#if !defined(SNITCH_WITH_TEAMCITY_REPORTER)
#define SNITCH_WITH_TEAMCITY_REPORTER 0
#endif
#if !defined(SNITCH_WITH_CATCH2_REPORTER)
#define SNITCH_WITH_CATCH2_REPORTER 0
#endif
#if !defined(SNITCH_WITH_MULTITHREADING)
#define SNITCH_WITH_MULTITHREADING 1
#endif
#if !defined(SNITCH_SHARED_LIBRARY)
#define SNITCH_SHARED_LIBRARY 0
#endif
// clang-format on
#if defined(_MSC_VER)
# if defined(_KERNEL_MODE) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS)
# define SNITCH_EXCEPTIONS_NOT_AVAILABLE
# endif
#elif defined(__clang__) || defined(__GNUC__)
# if !defined(__EXCEPTIONS)
# define SNITCH_EXCEPTIONS_NOT_AVAILABLE
# endif
#endif
#if defined(SNITCH_EXCEPTIONS_NOT_AVAILABLE)
# undef SNITCH_WITH_EXCEPTIONS
# define SNITCH_WITH_EXCEPTIONS 0
#endif
#if SNITCH_WITH_MULTITHREADING
# define SNITCH_THREAD_LOCAL thread_local
#else
# define SNITCH_THREAD_LOCAL
#endif
#if !defined(__cpp_lib_bit_cast)
# undef SNITCH_CONSTEXPR_FLOAT_USE_BITCAST
# define SNITCH_CONSTEXPR_FLOAT_USE_BITCAST 0
#endif
#if (!defined(__cpp_lib_to_chars)) || (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE <= 11) || \
(defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 14000) || \
(defined(_MSC_VER) && _MSC_VER <= 1924)
# undef SNITCH_APPEND_TO_CHARS
# define SNITCH_APPEND_TO_CHARS 0
#endif
#if SNITCH_SHARED_LIBRARY
# if defined(_MSC_VER)
# if defined(SNITCH_EXPORTS)
# define SNITCH_EXPORT __declspec(dllexport)
# else
# define SNITCH_EXPORT __declspec(dllimport)
# endif
# elif defined(__clang__) || defined(__GNUC__)
# define SNITCH_EXPORT [[gnu::visibility("default")]]
# else
# define SNITCH_EXPORT
# endif
#else
# define SNITCH_EXPORT
#endif
#endif |
No worries! And thanks for the extra information. I used the minimal example code from your first post, the CMake file from your latest post, clang for Windows 19.1.0, and used CMake to configure the build like so:
I checked that the Here's the executable I obtain from this: standalone.zip; are you able to run it and see if it also runs fine on your end? If this runs fine, then it's got something to do with your build environment. It could be a difference in the MSVC build tools; I use v14.39.33519. You should be able to tell which one you're using by inspecting your If this does not run fine, then it's got something to do with your execution environment. That's going to be harder; could be the MSVC runtime (I use v14.42.34433.0, as read from the Details tab in the properties of |
Getting a segfault with a minimal test setup on windows with clang 19. Same code compiles and runs with g++ 14.2.
Minimal example
LLDB output and backtrace
The text was updated successfully, but these errors were encountered: