Skip to content

Double-free of exported global string on program exit #59765

Closed
@mordante

Description

@mordante

The following code is a reduction of a c++20 module application that crashes.
The easiest way to reproduce the crash is by using ASAN.
When the application terminates, it gives a double-free error.

data.cppm

module;
#include <string>                                                               
export module data;
export std::string global;

main.cpp

import data;
int main() { global = "A long string that does not fit in the SSO buffer"; }

Metadata

Metadata

Assignees

Labels

clang:codegenIR generation bugs: mangling, exceptions, etc.clang:modulesC++20 modules and Clang Header ModulescrashPrefer [crash-on-valid] or [crash-on-invalid]

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions