Skip to content

Profiling problem on armv7l #105070

@o-lek

Description

@o-lek

Hello!

I've got a segmentation fault while profiling Tizen Xamarin-based Application with

a profiler based on SampleProfiler using ICorProfiler API:

https://github.com/dotnet/samples/tree/main/core/profiling

The segmentation fault always occurs here:

GCX_PREEMP_THREAD_EXISTS(pThread);

Thread 1 "Alarm.dll" received signal SIGSEGV, Segmentation fault.

StubHelpers::ProfilerBeginTransitionCallback (pSecretParam=3040227328, pThread=0x0, unsafe_pThis=)

at /usr/src/debug/coreclr-8.0.0-0.arm/src/coreclr/vm/stubhelpers.cpp:555

555 GCX_PREEMP_THREAD_EXISTS(pThread);

(gdb) bt

#0 StubHelpers::ProfilerBeginTransitionCallback (pSecretParam=3040227328, pThread=0x0, unsafe_pThis=)

at /usr/src/debug/coreclr-8.0.0-0.arm/src/coreclr/vm/stubhelpers.cpp:555

#1 0xb49836ec in ?? ()

Backtrace stopped: previous frame identical to this frame (corrupt stack?)

(gdb)

This can be reproduced on armel (armv7l) machine on release/7.0 and release/8.0 branches, not release/6.0

So, I've found that PR #69761 eliminates the null-checking code for some reason:

https://github.com/dotnet/runtime/pull/69761/files#diff-c10abbd9bedf89c7a6ea5ace199b19ac17564e0e1e8583cd22b05546d18e0789L658-L659:~:text=%7D-,GCX_PREEMP_THREAD_EXISTS,-(pThread)%3B

Can you please describe why that change was made and why segfault can happen now?

cc @dotnet/samsung

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions