Skip to content

Bus error when parsing EventPipeProviderConfiguration #2067

Closed
@swift-kim

Description

@swift-kim

Target platform: Tizen armel (32bit ARM processes on 64bit HW)

SIGBUS is raised at the following line if bufferCursor points to an unaligned address.

uint64_t keywords = 0;
if (!TryParse(bufferCursor, bufferLen, keywords))
return false;

Thread 7 "dotnet-launcher" received signal SIGBUS, Bus error.
(gdb) bt
#0  EventPipeProtocolHelper::TryParseProviderConfiguration (bufferCursor=@0xf0843aa0: 0xf360bb05 "\377\377\377\377", bufferLen=@0xf0843a9c: 102, result=...)
    at /usr/src/debug/coreclr-3.0.0/src/vm/eventpipeprotocolhelper.cpp:160
#1  0xf5412174 in EventPipeCollectTracing2CommandPayload::TryParse (lpBuffer=0xf360baf8 "", BufferSize=@0xf0843ad2: 115) at /usr/src/debug/coreclr-3.0.0/src/vm/eventpipeprotocolhelper.cpp:70
#2  0xf54127ca in DiagnosticsIpc::IpcMessage::TryParsePayloadImpl<EventPipeCollectTracing2CommandPayload, 0> (this=0xf0843b30) at /usr/src/debug/coreclr-3.0.0/src/vm/diagnosticsprotocol.h:519
#3  DiagnosticsIpc::IpcMessage::TryParsePayload<EventPipeCollectTracing2CommandPayload> (this=0xf0843b30) at /usr/src/debug/coreclr-3.0.0/src/vm/diagnosticsprotocol.h:293
#4  EventPipeProtocolHelper::CollectTracing2 (message=..., pStream=0xf3608bf0) at /usr/src/debug/coreclr-3.0.0/src/vm/eventpipeprotocolhelper.cpp:265
#5  0xf5406bf8 in DiagnosticsServerThread (lpThreadParameter=0xf7a3aa18) at /usr/src/debug/coreclr-3.0.0/src/vm/diagnosticserver.cpp:76
#6  0xf565c726 in CorUnix::CPalThread::ThreadEntry (pvParam=0xf7a3f248) at /usr/src/debug/coreclr-3.0.0/src/pal/src/thread/thread.cpp:1807
#7  0xf7315f04 in start_thread (arg=0xf0844180) at pthread_create.c:335
#8  0xf708c7d8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:86 from /lib/libc.so.6
  • It tries to parse 8 bytes (uint64_t) from 0xf360bb05 (unaligned) but it seems it's not allowed for this platform.
  • Reading a 4-byte (uint32_t) value is completely okay.
  • The cursor points at an odd number address because TryParseRundownRequested() increases it by a boolean size.
  • To reproduce the error, just run dotnet-counters monitor with default providers. However I couldn't reproduce on non-Tizen armel machine.

/cc @jkotas @alpencolt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions