Skip to content
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

in g++, asan fails to detect a memory leak #1774

Closed
mmomtchev opened this issue Jul 30, 2024 · 4 comments
Closed

in g++, asan fails to detect a memory leak #1774

mmomtchev opened this issue Jul 30, 2024 · 4 comments
Labels

Comments

@mmomtchev
Copy link

I am not very sure if this belongs here or with g++, but here it is:

#include <iostream>
#include <vector>

class Object {
public:
  Object() = default;

private:
  int data;
};

int main() {
  auto *list = new std::vector<Object>;
  std::cout << list << std::endl;
  return 0;
}

Compile with

g++ -g -O0 -o test_asan -fsanitize=address,leak test_asan.cc

No leak detected

Compile with

clang++ -g -O0 -o test_asan -fsanitize=address,leak test_asan.cc

Leak detected

Tried with both g++ 11.4 and 13.2 (Ubuntu 22.04 and Ubuntu 24.04).

@ramosian-glider
Copy link
Member

Reproducible with trunk GCC: https://godbolt.org/z/xebMW6qT1

@mmomtchev
Copy link
Author

I would be interested in working on this issue, however I am currently in the middle of a huge judicial scandal which involves Google, sexual elements and corruption in the French and EU justice systems. People are posting simultaneously in issues that I have been opening to intimidate me. Yours is simultaneous with swig/swig#2167 in the SWIG project. I am the author of SWIG JSE which currently cannot be merged because the SWIG project has made it clear that they had conditions linked to this criminal affair. Do you have such conditions too? Is working on this project subject to agreeing to corruption in the justice system?

@ramosian-glider
Copy link
Member

This is a forum for technical discussions. Please abstain from accusations and topics that do not directly relate to sanitizers.

@mmomtchev
Copy link
Author

Well, don't post messages directly related to these affairs in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants