Closed llvmbot closed 2 years ago
changed the description
This doesn't crash any more. May have been fixed as a part of llvm/llvm-project#19327 .
$ ./trace_log-76f2bf.sh
../../base/trace_event/trace_log.cc:815:29: warning: Dereference of null smart pointer 'thread_sharedchunk' of type 'std::unique_ptr'
TraceEvent trace_event = thread_sharedchunk->AddTraceEvent(&event_index);
^
../../base/trace_event/trace_log.cc:1115:10: note: Calling 'TraceLog::AddTraceEventWithThreadIdAndTimestamp'
return AddTraceEventWithThreadIdAndTimestamp(
^~~~~~~~~~
../../base/trace_event/trace_log.cc:1181:7: note: Assuming the condition is false
if (!category_group_enabled)
^~~~~~~~
../../base/trace_event/trace_log.cc:1181:3: note: Taking false branch
if (!*category_group_enabled)
^
../../base/trace_event/trace_log.cc:1187:3: note: Taking false branch
if (thread_is_in_traceevent.Get())
^
../../base/trace_event/trace_log.cc:1192:3: note: Assuming 'name' is non-null
DCHECK(name);
^~~~
../../base/logging.h:814:36: note: expanded from macro 'DCHECK'
LAZY_STREAM(LOG_STREAM(DCHECK), !ANALYZER_ASSUME_TRUE(condition)) \
../../base/logging.h:312:67: note: expanded from macro 'ANALYZER_ASSUME_TRUE'
#define ANALYZER_ASSUME_TRUE(val) (::logging::AnalysisAssumeTrue(!!(val)))
^
../../base/logging.h:402:5: note: expanded from macro 'LAZY_STREAM'
!(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
^~~~~~~~~
../../base/trace_event/trace_log.cc:1192:3: note: '?' condition is true
../../base/logging.h:814:3: note: expanded from macro 'DCHECK'
LAZY_STREAM(LOG_STREAM(DCHECK), !ANALYZER_ASSUME_TRUE(condition)) \
^
../../base/logging.h:402:3: note: expanded from macro 'LAZY_STREAM'
!(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
^
../../base/trace_event/trace_log.cc:1193:3: note: '?' condition is true
DCHECK(!timestamp.is_null());
^
../../base/logging.h:814:3: note: expanded from macro 'DCHECK'
LAZY_STREAM(LOG_STREAM(DCHECK), !ANALYZER_ASSUME_TRUE(condition)) \
^
../../base/logging.h:402:3: note: expanded from macro 'LAZY_STREAM'
!(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
^
../../base/trace_event/trace_log.cc:1195:7: note: Assuming the condition is false
if (flags & TRACE_EVENT_FLAG_MANGLE_ID) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/trace_event/trace_log.cc:1195:3: note: Taking false branch
if (flags & TRACE_EVENT_FLAG_MANGLE_ID) {
^
../../base/trace_event/trace_log.cc:1206:7: note: Assuming the condition is true
if (*category_group_enabled & RECORDING_MODE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/trace_event/trace_log.cc:1206:3: note: Taking true branch
if (*category_group_enabled & RECORDING_MODE) {
^
../../base/trace_event/trace_log.cc:1215:7: note: Assuming the condition is false
if (thread_id == static_cast<int>(PlatformThread::CurrentId())) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/trace_event/trace_log.cc:1215:3: note: Taking false branch
if (thread_id == static_cast<int>(PlatformThread::CurrentId())) {
^
../../base/trace_event/trace_log.cc:1262:7: note: Assuming the condition is false
if (*category_group_enabled & TraceCategory::ENABLED_FOR_FILTERING) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/trace_event/trace_log.cc:1262:3: note: Taking false branch
if (*category_group_enabled & TraceCategory::ENABLED_FOR_FILTERING) {
^
../../base/trace_event/trace_log.cc:1282:7: note: Left side of '&&' is true
if ((*category_group_enabled & TraceCategory::ENABLED_FOR_RECORDING) &&
^
../../base/trace_event/trace_log.cc:1282:3: note: Taking true branch
if ((*category_group_enabled & TraceCategory::ENABLED_FOR_RECORDING) &&
^
../../base/trace_event/trace_log.cc:1287:9: note: Assuming 'thread_local_event_buffer' is null
if (thread_local_event_buffer) {
^~~~~~~~~~~~~~~~~~~~~~~~~
../../base/trace_event/trace_log.cc:1287:5: note: Taking false branch
if (thread_local_event_buffer) {
^
../../base/trace_event/trace_log.cc:1291:21: note: Calling 'TraceLog::AddEventToThreadSharedChunkWhileLocked'
trace_event = AddEventToThreadSharedChunkWhileLocked(&handle, true);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/trace_event/trace_log.cc:800:7: note: Left side of '&&' is true
if (thread_shared_chunk_ && thread_shared_chunk_->IsFull()) {
^
../../base/trace_event/trace_log.cc:800:3: note: Taking true branch
if (thread_shared_chunk_ && thread_shared_chunk_->IsFull()) {
^
../../base/trace_event/trace_log.cc:802:33: note: Smart pointer 'thread_shared_chunk_' of type 'std::unique_ptr' is reset to null when moved from
std::move(thread_shared_chunk_));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/trace_event/trace_log.cc:805:3: note: Taking false branch
if (!thread_shared_chunk_) {
^
../../base/trace_event/trace_log.cc:811:3: note: Taking false branch
if (!thread_shared_chunk_)
^
../../base/trace_event/trace_log.cc:815:29: note: Dereference of null smart pointer 'thread_shared_chunk_' of type 'std::unique_ptr'
TraceEvent* trace_event = thread_shared_chunk_->AddTraceEvent(&event_index);
^~~~~~~~~~~~~~~~~~~~
1 warning generated.
LLVM version: clang version 5.0.0 (trunk 296321) Platform: Linux; target: Linux
assigned to @tkremenek
Extended Description
Encountered this failure while analyzing base/trace_event/trace_log.cc in the Chromium codebase. Link: https://cs.chromium.org/chromium/src/base/trace_event/trace_log.cc?q=base/trace_event/trace_log.cc&dr