Skip to content

bad_alloc crash on throw with -D_GLIBCXX_USE_CXX11_ABI=0 flag #1058

Closed
@renkun-ken

Description

@renkun-ken

When Rcpp code is built with -D_GLIBCXX_USE_CXX11_ABI=0 flag, any throw or stop will cause memory-not-mapped crash with std::bad_alloc.

A minimal reproducible example:

Sys.setenv(PKG_CPPFLAGS = "-D_GLIBCXX_USE_CXX11_ABI=0")

f <- Rcpp::cppFunction('
void test() {
  stop("error");
}')

f()
 *** caught segfault ***
address 0x7b64060, cause 'memory not mapped'

Traceback:
 1: .Call(<pointer: 0x7fd9b3810da0>)
 2: f()

Some third-party libs are built with C++11 ABI disabled. This problem makes it hard to use these libs with Rcpp.

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