sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Crash: invalid pthread_t passed to pthread_getcpuclockid when using GSYVideoPlayer (ijk mode) after upgrading to sentry-android-gradle-plugin 5.11.0

Open hurist opened this issue 3 months ago • 6 comments

Environment

self-hosted (https://develop.sentry.dev/self-hosted/)

Steps to Reproduce

Describe the bug

After upgrading to sentry-android-gradle-plugin 5.11.0, our app started crashing when using GSYVideoPlayer (version 11.1.0) in ijk mode.

The crash happens inside ART’s sampling profiler thread with the following message:

invalid pthread_t 0x6a3e8e4730 passed to pthread_getcpuclockid
Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 25681 (Sampling Profil), pid 22954 (com.httest.f1)
Softversion: PD2405B_A_15.0.25.40.W10.V000L1
Time: 2025-09-17 10:22:15
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'vivo/PD2405M/PD2405:15/AP3A.240905.015.A1_V000L1/compiler08272107:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2025-09-17 10:22:15.434576066+0800
Process uptime: 62s
Cmdline: com.httest.f1
pid: 22954, tid: 25681, name: Sampling Profil  >>> com.httest.f1 <<<
uid: 10674
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'invalid pthread_t 0x6a3e8e4730 passed to pthread_getcpuclockid'
    x0  0000000000000000  x1  0000000000006451  x2  0000000000000006  x3  0000006a83ee4250
    x4  6f1f2f3236336437  x5  6f1f2f3236336437  x6  6f1f2f3236336437  x7  7f7f7f7f7f7f7f7f
    x8  00000000000000f0  x9  0000007013c71878  x10 0000000000000001  x11 0000007013d085d0
    x12 0000000068ca1b56  x13 000000007fffffff  x14 00000000091c85be  x15 0000056efbafce68
    x16 0000007013d74d58  x17 0000007013d5c000  x18 0000006a30ce0000  x19 00000000000059aa
    x20 0000000000006451  x21 00000000ffffffff  x22 b400006b7000e430  x23 0000006a83ee4a80
    x24 b400006b80287370  x25 b400006b200bd6f0  x26 b400006b200bf610  x27 00000000000026ac
    x28 0000000000000000  x29 0000006a83ee42d0
    lr  0000007013cf0948  sp  0000006a83ee4230  pc  0000007013cf0974  pst 0000000000001000
10 total frames
backtrace:
      #00 pc 00000000000a9974  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 592f445e153f1fd45b880b26f0715c0b)
      getsentry/sentry#1 pc 00000000000bc9b4  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_internal_find(long, char const*)+196) (BuildId: 592f445e153f1fd45b880b26f0715c0b)
      getsentry/sentry#2 pc 00000000000bc8c8  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_internal_gettid(long, char const*)+8) (BuildId: 592f445e153f1fd45b880b26f0715c0b)
      getsentry/sentry#3 pc 00000000000bc6b8  /apex/com.android.runtime/lib64/bionic/libc.so (pthread_getcpuclockid+24) (BuildId: 592f445e153f1fd45b880b26f0715c0b)
      getsentry/sentry#4 pc 00000000008bd038  /apex/com.android.art/lib64/libart.so (art::Thread::GetCpuMicroTime() const+40) (BuildId: 16b37ef712c5fee7ceda016b2e3b9c9a)
      getsentry/sentry#5 pc 00000000008df75c  /apex/com.android.art/lib64/libart.so (art::GetSample(art::Thread*, void*) (.__uniq.52483287290921479263723184702455367361)+284) (BuildId: 16b37ef712c5fee7ceda016b2e3b9c9a)
      getsentry/sentry#6 pc 00000000008d9f28  /apex/com.android.art/lib64/libart.so (art::ThreadList::ForEach(void (*)(art::Thread*, void*), void*)+56) (BuildId: 16b37ef712c5fee7ceda016b2e3b9c9a)
      getsentry/sentry#7 pc 00000000008df474  /apex/com.android.art/lib64/libart.so (art::Trace::RunSamplingThread(void*)+356) (BuildId: 16b37ef712c5fee7ceda016b2e3b9c9a)
      getsentry/sentry#8 pc 00000000000bc3fc  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+220) (BuildId: 592f445e153f1fd45b880b26f0715c0b)
      getsentry/sentry#9 pc 00000000000ad680  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 592f445e153f1fd45b880b26f0715c0b)
dumped - all
handle_request: return status is fail
BBinder_init Processname  <pre-initialized>  
BBinder_init hasGetProcessName  <pre-initialized>

To Reproduce

Steps to reproduce the behavior:

Add GSYVideoPlayer 11.1.0 to project, configured in ijk mode.

Upgrade sentry-android-gradle-plugin to 5.11.0.

Run app and play a video.

App crashes within seconds.

Environment

Sentry Android Gradle Plugin: 5.11.0

GSYVideoPlayer: 11.1.0 (ijk mode)

Android version: 15 (AP3A.240905.015.A1)

Device: vivo PD2405B

Reproducibility: ~100% when profiling enabled

Additional context

Disabling profiling (profilesSampleRate = 0.0) avoids the crash.

Older versions of Sentry SDK did not have this issue.

GSY (ijk mode) spawns multiple native pthreads for FFmpeg; it seems Sentry’s sampling profiler races with thread teardown, passing an invalid pthread_t to pthread_getcpuclockid.

Workarounds tried

Turning off performance profiling avoids the crash.

Reverting to an older Sentry version avoids the crash.

Request

Please confirm whether this is a known issue in the sampling profiler integration with native pthreads (ijkplayer/GSY), and if there’s a fix planned or recommended workaround.

Expected Result

App should not crash when profiling is enabled.

Actual Result

App crashes within seconds.

Product Area

Other

Link

No response

DSN

No response

Version

No response

hurist avatar Sep 17 '25 02:09 hurist

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] avatar Sep 17 '25 02:09 getsantry[bot]

cc @stefanosiano

philprime avatar Sep 23 '25 12:09 philprime

hi @hurist! Yes, it's a known issue sadly, that likely comes from native libraries not detatching native threads correctly. Would you mind sharing a reproducible example with us? That would greatly help to reproduce it and fix it Also, what happens if you clear cache/data of your app? Does it continue to crash consistently?

stefanosiano avatar Sep 23 '25 14:09 stefanosiano

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Nov 05 '25 08:11 getsantry[bot]