You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. export ASAN_OPTIONS=print_stats=1
2. Run programs under Linux. When generating error reports, asan stucks.
What is the expected output? What do you see instead?
Generates error reports and exit the program.
What version of the product are you using? On what operating system?
I run under GCC 4.9.
I check http://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/sanitizer_common and
find it not fixed.
Please provide any additional information below.
In asan_report.cc
class ScopedInErrorReport {
public:
ScopedInErrorReport() {
...
ASAN_ON_ERROR();
// Make sure the registry and sanitizer report mutexes are locked while
// we're printing an error report.
// We can lock them only here to avoid self-deadlock in case of
// recursive reports.
asanThreadRegistry().Lock(); //@@@@@lock once
CommonSanitizerReportMutex.Lock();
reporting_thread_tid = GetCurrentTidOrInvalid();
Printf("===================================================="
"=============\n");
}
// Destructor is NORETURN, as functions that report errors are.
NORETURN ~ScopedInErrorReport() {
// Make sure the current thread is announced.
DescribeThread(GetCurrentThread());
// Print memory stats.
if (flags()->print_stats)
__asan_print_accumulated_stats(); //@@@@@lock twice
if (error_report_callback) {
error_report_callback(error_message_buffer);
}
Report("ABORTING\n");
Die();
}
};
Since __asan_print_accumulated_stats() indirectly calls GetAccumulatedStats(&stats),
and
static void GetAccumulatedStats(AsanStats *stats) {
stats->Clear();
{
ThreadRegistryLock l(&asanThreadRegistry()); //the twice lock
asanThreadRegistry()
.RunCallbackForEachThreadLocked(MergeThreadStats, stats);
}
...
}
Reported by xiaoyur347 on 2014-05-06 01:19:38
The text was updated successfully, but these errors were encountered:
Confirmed, thanks for the report.
The fix will need to be different (introduce GetAccumulatedStatsUnlocked or some such)
and it will need tests.
Feel free to send such patch to llvm-commits (not here, see https://code.google.com/p/address-sanitizer/wiki/HowToContribute)
or let us handle
it some time later.
Reported by konstantin.s.serebryany on 2014-05-06 13:51:28
Originally reported on Google Code with ID 306
Reported by
xiaoyur347
on 2014-05-06 01:19:38The text was updated successfully, but these errors were encountered: