Skip to content

rcp nullptr assertion failure with global constants #2057

@oliverlee

Description

@oliverlee

Here's a simplified example:

#include <symengine/expression.h>

const auto a = ::SymEngine::Expression{1};
const auto b = -a;
const auto c = -a;

auto main() -> int
{}

output:

SYMENGINE_ASSERT failed: external/symengine/symengine/symengine_rcp.h
function operator->(), line number 147 at
ptr_ != nullptr

This is with release 0.12 and the following settings:

/* Define if you want to enable ASSERT testing in SymEngine */
#define WITH_SYMENGINE_ASSERT

/* Define if you want to enable SYMENGINE_RCP support in SymEngine */
#define WITH_SYMENGINE_RCP

/* Define if you want to enable SYMENGINE_THREAD_SAFE support in SymEngine */
#define WITH_SYMENGINE_THREAD_SAFE

/* Define if you want to enable BOOST support in SymEngine */
#define HAVE_SYMENGINE_BOOST

/* Define if you want to enable PTHREAD support in SymEngine */
#define HAVE_SYMENGINE_PTHREAD

/* Define if the C++ compiler supports default constructors */
#define HAVE_DEFAULT_CONSTRUCTORS

/* Define if the C++ compiler supports noexcept specifier */
#define HAVE_SYMENGINE_NOEXCEPT

/* Define if the C++ compiler supports std::is_constructible */
#define HAVE_SYMENGINE_IS_CONSTRUCTIBLE

/* Define if the C++ compiler supports std::unordered_map<>::reserve() */
#define HAVE_SYMENGINE_RESERVE

/* Define if the C++ compiler has std::to_string */
#define HAVE_SYMENGINE_STD_TO_STRING

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