iAI icon indicating copy to clipboard operation
iAI copied to clipboard

AddData in ProfileData.cc crashes computeFunctionsPointsToSet using CFLSteens

Open blipper opened this issue 3 years ago • 3 comments

Bug description

Analyzing a program with https://github.com/gperftools/gperftools/blob/master/src/profiledata.cc#L261 's ProfileData::Add crashes Phasar

0x00007fbed345c24000:26:26.056282 - [WARNING] Large number of pointers detected - Perf is O(N^2) here: 140 for ProfileData::Add(int, void const* const*) WARNING: Logging before InitGoogle() is written to STDERR F0418 22:15:46.428914 3693092 logging.cc:107] assert.h assertion failed at third_party/llvm/llvm-project/llvm/lib/Analysis/CFLGraph.h:205 in void llvm::cflaa::CFLGraphBuilderllvm::CFLSteensAAResult::GetEdgesVisitor::addNode(llvm::Value *, llvm::cflaa::AliasAttrs) [CFLAA = llvm::CFLSteensAAResult]: Val != nullptr && Val->getType()->isPointerTy() *** Check failure stack trace: *** @ 0x7fbeeebf0c3b absl::logging_internal::LogMessage::DieIfFatal() @ 0x7fbeeebef8a7 absl::logging_internal::LogMessage::SendToLog() @ 0x7fbeeebed8c0 absl::logging_internal::LogMessage::Flush() @ 0x7fbeeebf20c9 absl::logging_internal::LogMessageFatal::~LogMessageFatal() @ 0x7fbeeebe940e __assert_fail @ 0x7fc0465ba0ab llvm::cflaa::CFLGraphBuilder<>::GetEdgesVisitor::addNode() @ 0x7fc0465b9ad3 llvm::InstVisitor<>::visit() @ 0x7fc0465b92f4 llvm::cflaa::CFLGraphBuilder<>::buildGraphFrom() @ 0x7fc0465b1da6 llvm::CFLSteensAAResult::buildSetsFrom() @ 0x7fc0465b3761 llvm::CFLSteensAAResult::scan() @ 0x7fc0465b406b llvm::CFLSteensAAResult::ensureCached() @ 0x7fc0465b4711 llvm::CFLSteensAAResult::query() @ 0x7fc05475b71f llvm::CFLSteensAAResult::alias() @ 0x7fc05475b505 llvm::AAResults::Model<>::alias() @ 0x7fc04647ef6e llvm::AAResults::alias() @ 0x7fc04647e7b5 llvm::AAResults::alias() @ 0x7fc05477fb5b psr::LLVMPointsToSet::computeFunctionsPointsToSet() @ 0x7fc05477cc9f psr::LLVMPointsToSet::computeValuesPointsToSet() @ 0x7fc054788aa9 psr::LLVMPointsToSet::LLVMPointsToSet() @ 0x7fc05501f5e6 psr::AnalysisController::AnalysisController() @ 0x7fc055d688ef main @ 0x7fbed34ecbbd __libc_start_main @ 0x5602cec2baa9 _start

Steps to reproduce

Analyze any program with this function

blipper avatar Apr 18 '21 22:04 blipper

@blipper is this still an issue?

MMory avatar May 06 '22 14:05 MMory

Good to find this issues. @MMory Yes I have fallen into this too. This crash happens also on one of my projects.

vulder avatar Nov 08 '22 09:11 vulder

I was able to reproduce this issue and create a minimal example. imho this is an LLVM bug and I need to raise an issue there.

MMory avatar Dec 01 '22 11:12 MMory