Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need for Speed games crash after a while since 1.13. version #15788

Closed
5 tasks done
jgbor opened this issue Aug 5, 2022 · 46 comments · Fixed by #15990
Closed
5 tasks done

Need for Speed games crash after a while since 1.13. version #15788

jgbor opened this issue Aug 5, 2022 · 46 comments · Fixed by #15990
Labels
GE emulation Backend-independent GPU issues
Milestone

Comments

@jgbor
Copy link

jgbor commented Aug 5, 2022

Game or games this happens in

Need for Speed Underground Rivals, Need for Speed Carbon: Own the City

What area of the game / PPSSPP

I can't finish races longer than 2.5-3 minutes because the app crashes on Android. The games ran fine in 1.12.3 but since the 1.13 update I have this problem. I've tried the latest git versions and the issue is still there. When I reinstall 1.12.3 again the games work fine again.

What should happen

It shouldn't crash.

Logs

No response

Platform

Android

Mobile phone model or graphics card

Samsung Galax A52s 5G

PPSSPP version affected

v1.13.1

Last working version

v1.12.3

Graphics backend (3D API)

OpenGL / GLES

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try without any cheats and without loading any save states.
  • Include logs or screenshots of issue.
@anr2me
Copy link
Collaborator

anr2me commented Aug 5, 2022

Btw, are you using texture upscaling / texture replacement / shader?

@jgbor
Copy link
Author

jgbor commented Aug 5, 2022

No, I don't. Upscale level and Texture shader are turned off.

@hrydgard
Copy link
Owner

hrydgard commented Aug 5, 2022

Ugh. This might be related to #15783 .. will investigate.

@hrydgard hrydgard added this to the v1.14.0 milestone Aug 5, 2022
@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Aug 5, 2022
@ghost
Copy link

ghost commented Aug 5, 2022

Can confirm this issue also happen on my phone, playing NFS Carbon Own The City sometimes crashing.

@hrydgard
Copy link
Owner

hrydgard commented Aug 5, 2022

Could you get some adb logs? As always, here's my recommended command line:

 adb logcat -s AndroidRuntime DEBUG PPSSPPNativeActivity PPSSPP NativeGLView NativeRenderer NativeSurfaceView PowerSaveModeReceiver InputDeviceState PpssppActivity

@ghost
Copy link

ghost commented Aug 5, 2022

rt+180) (BuildId: 8607e22d19978fe368fdf8f39b0835df)
08-03 22:21:50.936 16779 16779 F DEBUG   :       #01 pc 00000000006d157c  /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+668) (BuildId: 46df93bc978921840e5b428398c66a57)
08-03 22:21:50.936 16779 16779 F DEBUG   :       #02 pc 000000000001695c  /apex/com.android.art/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+76) (BuildId: 9f4607980f83ec2c0b58f670a86f3032)
08-03 22:21:50.936 16779 16779 F DEBUG   :       #03 pc 0000000000006e3c  /system/lib64/liblog.so (__android_log_assert+308) (BuildId: 4bf503e0fe23453edefbec31204eaaa4)
08-03 22:21:50.936 16779 16779 F DEBUG   :       #04 pc 00000000006e6264  /data/app/~~FWBceOSzh4oKapIeCuOApw==/org.ppsspp.ppsspp-x1254fcFRHLOWsSH7y5JTg==/lib/arm64/libppsspp_jni.so (HandleAssert(char const*, char const*, int, char const*, char const*, ...)+280) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
08-03 22:21:50.936 16779 16779 F DEBUG   :       #05 pc 0000000000bfd254  /data/app/~~FWBceOSzh4oKapIeCuOApw==/org.ppsspp.ppsspp-x1254fcFRHLOWsSH7y5JTg==/lib/arm64/libppsspp_jni.so (Draw::OpenGLContext::ApplySamplers()+304) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
08-03 22:21:50.936 16779 16779 F DEBUG   :       #06 pc 0000000000bfda54  /data/app/~~FWBceOSzh4oKapIeCuOApw==/org.ppsspp.ppsspp-x1254fcFRHLOWsSH7y5JTg==/lib/arm64/libppsspp_jni.so (Draw::OpenGLContext::DrawUP(void const*, int)+232) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
08-03 22:21:50.936 16779 16779 F DEBUG   :       #07 pc 00000000005d1c3c  /data/app/~~FWBceOSzh4oKapIeCuOApw==/org.ppsspp.ppsspp-x1254fcFRHLOWsSH7y5JTg==/lib/arm64/libppsspp_jni.so (FramebufferManagerCommon::DrawStrip2D(Draw::Texture*, Draw2DVertex*, int, bool)+1072) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
08-03 22:21:50.937 16779 16779 F DEBUG   :       #08 pc 00000000005dcce8  /data/app/~~FWBceOSzh4oKapIeCuOApw==/org.ppsspp.ppsspp-x1254fcFRHLOWsSH7y5JTg==/lib/arm64/libppsspp_jni.so (FramebufferManagerCommon::DrawActiveTexture(float, float, float, float, float, float, float, float, float, float, int, int)+464) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
08-03 22:21:50.937 16779 16779 F DEBUG   :       #09 pc 00000000005dc854  /data/app/~~FWBceOSzh4oKapIeCuOApw==/org.ppsspp.ppsspp-x1254fcFRHLOWsSH7y5JTg==/lib/arm64/libppsspp_jni.so (FramebufferManagerCommon::DrawPixels(VirtualFramebuffer*, int, int, unsigned char const*, GEBufferFormat, int, int, int)+656) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
08-03 22:21:50.937 16779 16779 F DEBUG   :       #10 pc 00000000005dc37c  /data/app/~~FWBceOSzh4oKapIeCuOApw==/org.ppsspp.ppsspp-x1254fcFRHLOWsSH7y5JTg==/lib/arm64/libppsspp_jni.so (FramebufferManagerCommon::UpdateFromMemory(unsigned int, int, bool)+480) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
08-03 22:21:50.937 16779 16779 F DEBUG   :       #11 pc 00000000004e82d4  /data/app/~~FWBceOSzh4oKapIeCuOApw==/org.ppsspp.ppsspp-x1254fcFRHLOWsSH7y5JTg==/lib/arm64/libppsspp_jni.so (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
08-03 22:21:50.937 16779 16779 F DEBUG   :       #12 pc 0000000000469a88  /data/app/~~FWBceOSzh4oKapIeCuOApw==/org.ppsspp.ppsspp-x1254fcFRHLOWsSH7y5JTg==/lib/arm64/libppsspp_jni.so (CallSyscallWithoutFlags(HLEFunction const*)+52) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
08-03 22:21:50.937 16779 16779 F DEBUG   :       #13 pc 00000000000cdf54  <anonymous:73e4e8b000>
08-05 19:22:25.637  8101  8101 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-05 19:22:25.638  8101  8101 F DEBUG   : Build fingerprint: 'Redmi/merlin_global/merlin:12/SP1A.210812.016/V13.0.1.0.SJOMIXM:user/release-keys'
08-05 19:22:25.638  8101  8101 F DEBUG   : Revision: '0'
08-05 19:22:25.638  8101  8101 F DEBUG   : ABI: 'arm64'
08-05 19:22:25.638  8101  8101 F DEBUG   : Timestamp: 2022-08-05 19:22:24.522714860+0800
08-05 19:22:25.638  8101  8101 F DEBUG   : Process uptime: 0s
08-05 19:22:25.638  8101  8101 F DEBUG   : Cmdline: org.ppsspp.ppsspp
08-05 19:22:25.638  8101  8101 F DEBUG   : pid: 7679, tid: 7877, name: AndroidRender  >>> org.ppsspp.ppsspp <<<
08-05 19:22:25.638  8101  8101 F DEBUG   : uid: 10001
08-05 19:22:25.639  8101  8101 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xf8fcf8fef5fb25
08-05 19:22:25.639  8101  8101 F DEBUG   :     x0  fef8fcf8fef5faf5  x1  b4000073e1686c10  x2  0000007414601248  x3  b4000074115af240
08-05 19:22:25.639  8101  8101 F DEBUG   :     x4  b4000074115af2c0  x5  0000000000000004  x6  0000007423b5d360  x7  0000007423b5d3b0
08-05 19:22:25.639  8101  8101 F DEBUG   :     x8  0000000000000000  x9  0000000000000002  x10 0000000000000001  x11 0000000000000000
08-05 19:22:25.639  8101  8101 F DEBUG   :     x12 0000000000000000  x13 0000007423b5d270  x14 00000074113c6030  x15 0000000000000000
08-05 19:22:25.639  8101  8101 F DEBUG   :     x16 000000747c1401e8  x17 00000075328f0e80  x18 0000007414132000  x19 fef8fcf8fef5faf5
08-05 19:22:25.639  8101  8101 F DEBUG   :     x20 b4000073e6397338  x21 0000000000000003  x22 0000000000000090  x23 b4000074115ba3b0
08-05 19:22:25.639  8101  8101 F DEBUG   :     x24 00000000ffffffff  x25 0000000000000008  x26 b400007490dfefa8  x27 0000007414601498
08-05 19:22:25.640  8101  8101 F DEBUG   :     x28 00000074146014e0  x29 0000007414601370
08-05 19:22:25.640  8101  8101 F DEBUG   :     lr  000000747a7005c8  sp  0000007414601140  pc  000000747a7039b0  pst 0000000080000000
08-05 19:22:25.640  8101  8101 F DEBUG   : backtrace:
08-05 19:22:25.640  8101  8101 F DEBUG   :       #00 pc 0000000000afc9b0  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.640  8101  8101 F DEBUG   :       #01 pc 0000000000af95c4  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.640  8101  8101 F DEBUG   :       #02 pc 0000000000a7f048  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.640  8101  8101 F DEBUG   :       #03 pc 0000000000a75c00  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.640  8101  8101 F DEBUG   :       #04 pc 0000000000a78218  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.641  8101  8101 F DEBUG   :       #05 pc 0000000000a74fac  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.641  8101  8101 F DEBUG   :       #06 pc 00000000007d10f4  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.641  8101  8101 F DEBUG   :       #07 pc 00000000007d4df0  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.641  8101  8101 F DEBUG   :       #08 pc 00000000007cc1c0  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.641  8101  8101 F DEBUG   :       #09 pc 00000000007d5424  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.641  8101  8101 F DEBUG   :       #10 pc 00000000007ab2f0  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.641  8101  8101 F DEBUG   :       #11 pc 00000000007aa75c  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.641  8101  8101 F DEBUG   :       #12 pc 00000000007916b4  /vendor/lib64/egl/libGLES_mali.so (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.641  8101  8101 F DEBUG   :       #13 pc 0000000000791fb0  /vendor/lib64/egl/libGLES_mali.so (eglDestroyContext+544) (BuildId: 02396a3d0d676a0093388761a6e6d647)
08-05 19:22:25.642  8101  8101 F DEBUG   :       #14 pc 000000000001f258  /system/lib64/libEGL.so (android::eglDestroyContextImpl(void*, void*)+64) (BuildId: e4c959f69a3920ec52c6ca8453faee2a)
08-05 19:22:25.642  8101  8101 F DEBUG   :       #15 pc 00000000000c01f0  /system/lib64/libandroid_runtime.so (android::jni_eglDestroyContext(_JNIEnv*, _jobject*, _jobject*, _jobject*)+104) (BuildId: 4d382d5fe57157171c89b1a516b32348)
08-05 19:22:25.642  8101  8101 F DEBUG   :       #16 pc 00000000001ca204  /system/framework/arm64/boot-framework.oat (art_jni_trampoline+132) (BuildId: e2cf04e00d91f2d48ea728d276ef8014c098a8ed)
08-05 19:22:25.642  8101  8101 F DEBUG   :       #17 pc 000000000020b53c  /apex/com.android.art/lib64/libart.so (nterp_helper+9292) (BuildId: 46df93bc978921840e5b428398c66a57)
08-05 19:22:25.642  8101  8101 F DEBUG   :       #18 pc 000000000040536c  /system/framework/framework.jar (android.opengl.GLSurfaceView$DefaultContextFactory.destroyContext+0)
08-05 19:22:25.642  8101  8101 F DEBUG   :       #19 pc 000000000020ae64  /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: 46df93bc978921840e5b428398c66a57)
08-05 19:22:25.642  8101  8101 F DEBUG   :       #20 pc 000000000040588a  /system/framework/framework.jar (android.opengl.GLSurfaceView$EglHelper.finish+122)
08-05 19:22:25.642  8101  8101 F DEBUG   :       #21 pc 000000000020a044  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 46df93bc978921840e5b428398c66a57)
08-05 19:22:25.643  8101  8101 F DEBUG   :       #22 pc 000000000040701c  /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.stopEglContextLocked+12)
08-05 19:22:25.643  8101  8101 F DEBUG   :       #23 pc 0000000002003e04  /memfd:jit-cache (deleted) (android.opengl.GLSurfaceView$GLThread.guardedRun+1636)
08-05 19:22:25.643  8101  8101 F DEBUG   :       #24 pc 000000000020a044  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 46df93bc978921840e5b428398c66a57)
08-05 19:22:25.643  8101  8101 F DEBUG   :       #25 pc 0000000000406f62  /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.run+114)
08-05 19:22:25.643  8101  8101 F DEBUG   :       #26 pc 00000000002ca764  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 46df93bc978921840e5b428398c66a57)
08-05 19:22:25.643  8101  8101 F DEBUG   :       #27 pc 000000000030e980  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+156) (BuildId: 46df93bc978921840e5b428398c66a57)
08-05 19:22:25.643  8101  8101 F DEBUG   :       #28 pc 00000000003c1db4  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+380) (BuildId: 46df93bc978921840e5b428398c66a57)
08-05 19:22:25.644  8101  8101 F DEBUG   :       #29 pc 00000000004578ec  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+992) (BuildId: 46df93bc978921840e5b428398c66a57)
08-05 19:22:25.644  8101  8101 F DEBUG   :       #30 pc 00000000000ecb58  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 8607e22d19978fe368fdf8f39b0835df)
08-05 19:22:25.644  8101  8101 F DEBUG   :       #31 pc 000000000008ae88  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 8607e22d19978fe368fdf8f39b0835df)
08-05 19:29:18.972  8369  8369 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-05 19:29:18.972  8369  8369 F DEBUG   : Build fingerprint: 'Redmi/merlin_global/merlin:12/SP1A.210812.016/V13.0.1.0.SJOMIXM:user/release-keys'
08-05 19:29:18.972  8369  8369 F DEBUG   : Revision: '0'
08-05 19:29:18.972  8369  8369 F DEBUG   : ABI: 'arm64'
08-05 19:29:18.972  8369  8369 F DEBUG   : Timestamp: 2022-08-05 19:29:18.730528116+0800
08-05 19:29:18.972  8369  8369 F DEBUG   : Process uptime: 0s
08-05 19:29:18.972  8369  8369 F DEBUG   : Cmdline: org.ppsspp.ppsspp
08-05 19:29:18.972  8369  8369 F DEBUG   : pid: 8122, tid: 8336, name: Binder:8122_5  >>> org.ppsspp.ppsspp <<<
08-05 19:29:18.972  8369  8369 F DEBUG   : uid: 10001
08-05 19:29:18.972  8369  8369 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
08-05 19:29:18.972  8369  8369 F DEBUG   : Cause: null pointer dereference
08-05 19:29:18.972  8369  8369 F DEBUG   :     x0  0000000000000000  x1  00000000c0306201  x2  0000007427bf79f8  x3  0000000000000001
08-05 19:29:18.972  8369  8369 F DEBUG   :     x4  000000752faee168  x5  00000074130ce180  x6  00000073df9d3f70  x7  00000073dfacb280
08-05 19:29:18.972  8369  8369 F DEBUG   :     x8  0000000000000000  x9  0000000000000000  x10 0000007427bf7990  x11 0000007427bf7960
08-05 19:29:18.972  8369  8369 F DEBUG   :     x12 ffffff80ffffffd0  x13 0000007490c78ec0  x14 0000007552c1e030  x15 0000000000000008
08-05 19:29:18.972  8369  8369 F DEBUG   :     x16 000000752fb35f08  x17 00000075328960a8  x18 0000007417412000  x19 b400007552d05ca8
08-05 19:29:18.972  8369  8369 F DEBUG   :     x20 b400007552d05c00  x21 b400007552d05d20  x22 0000000000000000  x23 00000000c0306201
08-05 19:29:18.972  8369  8369 F DEBUG   :     x24 0000007427bf8000  x25 00000000fffffff7  x26 0000007427bf7ff8  x27 00000000000fe000
08-05 19:29:18.972  8369  8369 F DEBUG   :     x28 00000000000fc000  x29 0000007427bf7a30
08-05 19:29:18.972  8369  8369 F DEBUG   :     lr  000000752faeaab8  sp  0000007427bf79e0  pc  000000752faeaa98  pst 0000000060001000
08-05 19:29:18.972  8369  8369 F DEBUG   : backtrace:
08-05 19:29:18.972  8369  8369 F DEBUG   :       #00 pc 0000000000045a98  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+264) (BuildId: dc38dfac79b2af149703d59b5dc5efb8)
08-05 19:29:18.972  8369  8369 F DEBUG   :       #01 pc 0000000000045d98  /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24) (BuildId: dc38dfac79b2af149703d59b5dc5efb8)
08-05 19:29:18.972  8369  8369 F DEBUG   :       #02 pc 000000000004669c  /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+68) (BuildId: dc38dfac79b2af149703d59b5dc5efb8)
08-05 19:29:18.972  8369  8369 F DEBUG   :       #03 pc 000000000006cb88  /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24) (BuildId: dc38dfac79b2af149703d59b5dc5efb8)
08-05 19:29:18.972  8369  8369 F DEBUG   :       #04 pc 000000000001223c  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+260) (BuildId: b7ee1d804b55d13885daae561a68958e)
08-05 19:29:18.972  8369  8369 F DEBUG   :       #05 pc 00000000000bc5dc  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140) (BuildId: 4d382d5fe57157171c89b1a516b32348)
08-05 19:29:18.972  8369  8369 F DEBUG   :       #06 pc 0000000000011acc  /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+404) (BuildId: b7ee1d804b55d13885daae561a68958e)
08-05 19:29:18.972  8369  8369 F DEBUG   :       #07 pc 00000000000ecb58  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 8607e22d19978fe368fdf8f39b0835df)
08-05 19:29:18.972  8369  8369 F DEBUG   :       #08 pc 000000000008ae88  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 8607e22d19978fe368fdf8f39b0835df)
08-05 21:05:41.691 16698 17090 E AndroidRuntime: FATAL EXCEPTION: McsHandler
08-05 21:05:41.691 16698 17090 E AndroidRuntime: Process: com.mgoogle.android.gms:persistent, PID: 16698
08-05 21:05:41.691 16698 17090 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.NetworkInfo.getTypeName()' on a null object reference
08-05 21:05:41.691 16698 17090 E AndroidRuntime: 	at org.microg.gms.gcm.McsService.connect(Unknown Source:46)
08-05 21:05:41.691 16698 17090 E AndroidRuntime: 	at org.microg.gms.gcm.McsService.handleMessage(Unknown Source:279)
08-05 21:05:41.691 16698 17090 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
08-05 21:05:41.691 16698 17090 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:210)
08-05 21:05:41.691 16698 17090 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:299)
08-05 21:05:41.691 16698 17090 E AndroidRuntime: 	at org.microg.gms.gcm.McsService$HandlerThread.run(Unknown Source:85)
--------- beginning of main
08-05 22:06:34.391  7501  7501 I PPSSPPNativeActivity: onPause
08-05 22:06:34.559  7501  7501 I PPSSPPNativeActivity: onPause completed
08-05 22:06:35.132  7501  7501 I PPSSPPNativeActivity: onStop - do nothing special

@hrydgard
Copy link
Owner

hrydgard commented Aug 5, 2022

 (HandleAssert(char const*, char const*, int, char const*, char const*, ...)+280) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
 (Draw::OpenGLContext::ApplySamplers()+304) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
 (Draw::OpenGLContext::DrawUP(void const*, int)+232) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)
 (FramebufferManagerCommon::DrawStrip2D(Draw::Texture*, Draw2DVertex*, int, bool)+1072) (BuildId: eac9b2128cc262f76463f29228d77431849d3b69)

Hm, that is really strange, don't know how that assert could be hit on that path, but apparently it can... Maybe indeed running out of memory, causing strange issues.

@hrydgard
Copy link
Owner

hrydgard commented Sep 1, 2022

Tried and failed to reproduce this on the latest build, I played two races in NFS Most Wanted with OpenGL and one with Vulkan just because, with no issues. Is it still happening?

@ghost
Copy link

ghost commented Sep 1, 2022

Cannot reproduce the crash on my Redmi 10c Snapdragon 680 Adreno 610

@jgbor
Copy link
Author

jgbor commented Sep 1, 2022

Carbon doesn't crash but it has a graphics issue when you use N2O and go fast like the #15940 issue with Most Wanted
Underground still crashes but it does not have the graphics glitch

@jgbor
Copy link
Author

jgbor commented Sep 1, 2022

This is the log from the crash

09-01 19:44:14.995 11982 11982 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-01 19:44:14.995 11982 11982 F DEBUG : Build fingerprint: 'samsung/a52sxqeea/a52sxq:12/SP1A.210812.016/A528BXXU1CVG7:user/release-keys'
09-01 19:44:14.995 11982 11982 F DEBUG : Revision: '3'
09-01 19:44:14.995 11982 11982 F DEBUG : ABI: 'arm64'
09-01 19:44:14.995 11982 11982 F DEBUG : Processor: '6'
09-01 19:44:14.995 11982 11982 F DEBUG : Timestamp: 2022-09-01 19:44:14.467687750+0200
09-01 19:44:14.995 11982 11982 F DEBUG : Process uptime: 228s
09-01 19:44:14.995 11982 11982 F DEBUG : Cmdline: org.ppsspp.ppsspp
09-01 19:44:14.995 11982 11982 F DEBUG : pid: 11181, tid: 11331, name: Emu >>> org.ppsspp.ppsspp <<<
09-01 19:44:14.995 11982 11982 F DEBUG : uid: 10423
09-01 19:44:14.995 11982 11982 F DEBUG : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7997eba000
09-01 19:44:14.995 11982 11982 F DEBUG : x0 b400007c1a5a27b4 x1 0000000000000000 x2 0000000000000000 x3 b400007c1a5a2830
09-01 19:44:14.995 11982 11982 F DEBUG : x4 b400007c1a5a0a3c x5 b400007c1a5a0060 x6 0000000000000000 x7 0000000000000000
09-01 19:44:14.995 11982 11982 F DEBUG : x8 0000000000000004 x9 0000000000000003 x10 b400007c1a5a30b6 x11 0000000000000bae
09-01 19:44:14.995 11982 11982 F DEBUG : x12 0000000000000bc8 x13 b400007997eb9e88 x14 0000000000000175 x15 0000000000000002
09-01 19:44:14.995 11982 11982 F DEBUG : x16 00000079951156e8 x17 0000007cb93e83d0 x18 0000000000000003 x19 b400007cc0234e00
09-01 19:44:14.995 11982 11982 F DEBUG : x20 0000000000000080 x21 0000000000000001 x22 b400007c1a5a0060 x23 b400007c1a5a1f90
09-01 19:44:14.995 11982 11982 F DEBUG : x24 0000000000001e78 x25 0000007994ecd534 x26 0000000000000002 x27 0000000000000020
09-01 19:44:14.995 11982 11982 F DEBUG : x28 b400007c1a5a0118 x29 0000007981a30450
09-01 19:44:14.995 11982 11982 F DEBUG : lr 0000007994b5969c sp 0000007981a30290 pc 0000007994b5995c pst 0000000080001000
09-01 19:44:14.995 11982 11982 F DEBUG : backtrace:
09-01 19:44:14.995 11982 11982 F DEBUG : #00 pc 0000000000b2095c /data/app/~~0-3DfwXSzNaWw2osxYTwYQ==/org.ppsspp.ppsspp-6m67s-ODyplLQiW6ZtvWdg==/lib/arm64/libppsspp_jni.so (ff_atrac3p_decode_channel_unit+10156) (BuildId: b6da1fdf5de5d4d748b5166b200949c0e0a1dc15)

@hrydgard
Copy link
Owner

hrydgard commented Sep 1, 2022

got any more lines after "backtrace" at the end? that's the interesting part..

that it's ffmpeg-related is interesting though, weird..

Which mode are you playing? Just quick race?

@jgbor
Copy link
Author

jgbor commented Sep 1, 2022

Unfortunately, there's no more lines after that.

I played the "career" mode, a lap knockout race

@jgbor
Copy link
Author

jgbor commented Sep 1, 2022

I tried to get another log but again, only one line after the backtrace one. It was a circuit race now. The crash happens around two and a half minutes every time in a race (middle/end of second lap depends on the track).

@hrydgard
Copy link
Owner

hrydgard commented Sep 1, 2022

Hm. is it the same point in the music? same song?

@jgbor
Copy link
Author

jgbor commented Sep 1, 2022

Actually yes, it's the end of the same song: Mudvayne - Determined
It crashes in the music player as well. I tried some other songs in the game but there are no problems with those.

@hrydgard
Copy link
Owner

hrydgard commented Sep 1, 2022

Cool, now we're getting somewhere tracking this down :)

To clarify, that's in Underground Rivals I guess?

@jgbor
Copy link
Author

jgbor commented Sep 1, 2022

Yes

@unknownbrackets
Copy link
Collaborator

Does the same song not crash in an older version? Or was it just that this particular song wasn't playing before?

-[Unknown]

@jgbor
Copy link
Author

jgbor commented Sep 2, 2022

It doesn't crash in 1.12.3. Since 1.13 the song crashes the game. Should I check the dev builds between the two versions?

@hrydgard
Copy link
Owner

hrydgard commented Sep 2, 2022

please do, this is very strange.

Maybe some memory corruption, or changed error code leading to a different call sequence, or something...

@jgbor
Copy link
Author

jgbor commented Sep 2, 2022

Ok, I won't have time today but I hope I'll be able to do it tomorrow.

@jgbor
Copy link
Author

jgbor commented Sep 2, 2022

Ok, I won't have time today but I hope I'll be able to do it tomorrow.

I had a free hour now, so I tried to find where the issue started:

In the v1.12.3-8-gc75784351 build the song works fine, the app doesn't crash. However in the next build (v1.12.3-10-g1cd520ae3), it does crash. I think the target Android change from 11 to 12 did something that causes the problem. (I have Android 12 on my phone)

@hrydgard
Copy link
Owner

hrydgard commented Sep 2, 2022

Wow, that is surprising! No idea what that could be. Possibly some linking/ABI thing? But thanks so much for narrowing it down!

@unknownbrackets
Copy link
Collaborator

Could #15001 have affected the NDK / system libraries used?

Looking around that function, we might consider backporting this (not sure if it'd help):
FFmpeg/FFmpeg@de5102f

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Sep 3, 2022

That looks like a good find, and something we should definitely backport whether it helps or not. Argh, and rebuild all the binaries... Maybe just for Android to start with.

@hrydgard
Copy link
Owner

hrydgard commented Sep 7, 2022

Just a note that I have a repro of this crash now, only on Android 12 phones indeed.

If #15969 turns out to be too much work or not fruitful, I'll just rebuild ffmpeg once again, with the patch... Let's see.

@unknownbrackets
Copy link
Collaborator

We don't know if that patch even helps yet, though, right?

I'd guess it's something with memory allocation behavior that the crash is Android 12 specific then? Or maybe the memory tagging thing? Presumably whatever bad memory access is happening elsewhere, just not crashing for some reason.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Sep 8, 2022

We don't yet, but I'll try to confirm today.

@hrydgard
Copy link
Owner

hrydgard commented Sep 8, 2022

Managed to rebuild FFMPEG with the patch, it still crashes. However, I was able to increase the amount of debug info, so I managed to get a better stack trace.

The fault address is not close to sp so it's likely to be an out-of-bounds on the heap. The function is pretty huge after inlining so I'm gonna have to see if I can get addr2line or similar working (or first just build without optimization...)

signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x79bc7dc000
    x0  0000007c52372964  x1  0000000000000000  x2  0000000000000000  x3  0000007c523729e0
    x4  0000007c52370bec  x5  0000007c52370210  x6  0000000000000000  x7  0000000000000000
    x8  0000000000000004  x9  0000000000000002  x10 0000000000000baa  x11 00000079bc7dbe88
    x12 0000000000000bc8  x13 0000000000000175  x14 0000000000001e78  x15 00000079da1f1300
    x16 00000079da00c2a0  x17 0000007ceee93b20  x18 00000079c2d7e000  x19 0000000000000040
    x20 0000007cf2fa6e00  x21 0000000000000001  x22 0000000000000080  x23 0000007c52373264
    x24 0000000000000018  x25 0000000000000018  x26 0000007c52372264  x27 0000000000000018
    x28 0000007c523702c8  x29 0000007c52372140
    lr  00000079d94ccfa0  sp  00000079c38f00b0  pc  00000079d94cd24c  pst 0000000080000000
backtrace:
      #00 pc 000000000186224c  libppsspp_jni.so (ff_atrac3p_decode_channel_unit+11500) (BuildId: 7958d177fd520f2e2e47b97d499d14b503dee7f2)
      #01 pc 00000000016bced8  libppsspp_jni.so (BuildId: 7958d177fd520f2e2e47b97d499d14b503dee7f2)
      #02 pc 000000000184297c  libppsspp_jni.so (avcodec_decode_audio4+316) (BuildId: 7958d177fd520f2e2e47b97d499d14b503dee7f2)
      #03 pc 0000000000ae2d98  libppsspp_jni.so (Atrac::DecodePacket()+92) (BuildId: 7958d177fd520f2e2e47b97d499d14b503dee7f2)
      #04 pc 0000000000ae20e8  libppsspp_jni.so (_AtracDecodeData(int, unsigned char*, unsigned int, unsigned int*, unsigned int*, int*)+620) (BuildId: 7958d177fd520f2e2e47b97d499d14b503dee7f2)
      #05 pc 0000000000ae5098  libppsspp_jni.so (BuildId: 7958d177fd520f2e2e47b97d499d14b503dee7f2)
      #06 pc 0000000000ae3fac  libppsspp_jni.so (BuildId: 7958d177fd520f2e2e47b97d499d14b503dee7f2)
      #07 pc 0000000000ac3f34  libppsspp_jni.so (CallSyscallWithoutFlags(HLEFunction const*)+80) (BuildId: 7958d177fd520f2e2e47b97d499d14b503dee7f2)

@hrydgard
Copy link
Owner

hrydgard commented Sep 8, 2022

OK, some results (from another run, slightly different addrs):

C:\dev\ppsspp>C:\Android\sdk\ndk\...\14531q1l\obj\arm64-v8a\libppsspp_jni.so 0000000001864260
get_bits
C:\dev\ppsspp\ffmpeg/libavcodec/get_bits.h:265

C:\dev\ppsspp>C:\Android\sdk\ndk\...\14531q1l\obj\arm64-v8a\libppsspp_jni.so 0000000001864264
get_bits
C:\dev\ppsspp\ffmpeg/libavcodec/get_bits.h:265

C:\dev\ppsspp>C:\Android\sdk\ndk\...\14531q1l\obj\arm64-v8a\libppsspp_jni.so 0000000001864284
decode_spectrum
C:\dev\ppsspp\ffmpeg/libavcodec/atrac3plus.c:907

C:\dev\ppsspp>C:\Android\sdk\ndk\...\14531q1l\obj\arm64-v8a\libppsspp_jni.so 0000000001864280
get_bits
C:\dev\ppsspp\ffmpeg/libavcodec/get_bits.h:266

Looks like there's inlining going on, even though I built ffmpeg with -O0, maybe LTO?

Anyway, it seems that we're just running out of bound of the get_bits buffer. No idea why this only would happen on Android. It happens at the very end of playing the song, which makes sense.

@hrydgard
Copy link
Owner

hrydgard commented Sep 8, 2022

Hm, there's a macro, CONFIG_SAFE_BITSTREAM_READER ... Nope :(

The crash is at the end of decode_spectrum, line 907:

        if (ctx->used_quant_units > 2) {
            num_specs = atrac3p_subband_to_num_powgrps[ctx->num_coded_subbands - 1];
            for (i = 0; i < num_specs; i++)
                chan->power_levs[i] = get_bits(gb, 4);   //  << line 907
        }

@hrydgard
Copy link
Owner

hrydgard commented Sep 8, 2022

Think I might have to add some extra get_bits_left checks

@hrydgard
Copy link
Owner

hrydgard commented Sep 8, 2022

Yeah, confirmed that I can fix the crash with:


    uint8_t *bigger_data = malloc(avpkt->size + 1024 * 1024);
    memset(bigger_data, 0, avpkt->size + 1024 * 1024);
    memcpy(bigger_data, avpkt->data, avpkt->size);

    if ((ret = init_get_bits8(&ctx->gb, bigger_data, avpkt->size)) < 0)
        return ret;

in atrac3p_decode_frame.

Now, this is of course horrible, but shows clearly that it's running out of bits unchecked. I added some manual checks for bits_remaining but doesn't seem to do the trick :/

@hrydgard
Copy link
Owner

hrydgard commented Sep 8, 2022

After messing around a bit with trying to limit the bits read in various ways, I've decided that it's not worth the time for now, I'm just gonna do a hack like the one above for the time being, and rebuild the ARM64 binaries only. This will fix the crash. Can be revisited at any time later. I'll definitely do the cmake setup at some point though.

@hrydgard
Copy link
Owner

hrydgard commented Sep 9, 2022

@unknownbrackets pointed out that we're in control of the buffer, so made a PPSSPP-side fix instead, avoiding all the ffmpeg recompilation mess: #15990

@jgbor
Copy link
Author

jgbor commented Sep 9, 2022

Thanks for your work!

@hrydgard hrydgard reopened this Sep 9, 2022
@hrydgard
Copy link
Owner

hrydgard commented Sep 9, 2022

So it turns out that this was enough for Need for Speed, but I have a similar crash in Ratchet & Clank: Size Matters that still persists. Will dig into it.

It's using atrac3, not atrac3plus. Still I would have though the fix would be the same....

Actually I think I got it...

@hrydgard
Copy link
Owner

hrydgard commented Sep 9, 2022

Yup that did it.

@anr2me
Copy link
Collaborator

anr2me commented Sep 9, 2022

Btw, could the out of bound/bits issue also related to the ATRAC_STATUS_STREAMED_LOOP_FROM_END issue occurred on #7601 and some other games, causing them to try to loop corrupted/random data that can't be decoded (ie. showing Error decoding audio in the logs)?

@hrydgard
Copy link
Owner

hrydgard commented Sep 9, 2022

Could possibly be related in some way, hard to tell

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Sep 10, 2022

I don't think that's likely. The real problem is what this TODO says:

	if (atrac->bufferState_ == ATRAC_STATUS_ALL_DATA_LOADED || atrac->bufferState_ == ATRAC_STATUS_HALFWAY_BUFFER) {
		// This says, don't use the dataBuf_ array, use the PSP RAM.
		// This way, games can load data async into the buffer, and it still works.
		// TODO: Support this always, even for streaming.
		atrac->ignoreDataBuf_ = true;
	}

In short, from the original implementation of sceAtrac in PPSSPP (I think from JPCSP even?), PPSSPP tries to "reconstruct" the buffer in RAM. It's actually all about the buffer this fix made longer by a bit. That entire buffer is really a bad idea to begin with. It caused this issue, and it also causes that #7601 issue.

What happens is, the game performs these steps:

  1. Create Atrac object.
  2. Load some of the file's data into RAM.
  3. Notify Atrac library about file data.
  4. Decode some of the data to PCM.
  5. Repeat from step 2 as needed.

Seems simple, right? The problem is, you can actually switch steps 2 and 3 above on a PSP, and games sometimes (by accident, I think) do. As long as you do step 2 before the new data is decoded, it really doesn't matter on a PSP. Everything works out.

However, PPSSPP's code makes the assumption that the moment it's notified about the file data, it's time to copy that data from RAM into its reconstructed version of the entire .at3 file (the "dataBuf" buffer.) So that means, if the game accidentally swaps steps 2 and 3 - it loads corrupt data into the dataBuf. Even after the game loads correct data into RAM, PPSSPP ignores it - it only cares about that corrupt dataBuf data at this point.

That might even be the actual cause of this issue: it could be the data at the end of the buffer was simply corrupt, and that's why FFmpeg ran over the end of the file trying to decode it. Maybe the game had not quite finished reading the file, but notified early because it was at the end. No one noticed the bug on a PSP, because it didn't matter - the data was loaded by the time that part of the song played, anyway.

For now, we've simply added more space at the end of the file, so that FFmpeg won't crash. This doesn't fix the underlying issue of trying to decode corrupt data, which can only really be solved by decoding packets at the right time directly from PSP RAM.

-[Unknown]

@hrydgard
Copy link
Owner

Right, that buffering is an abomination aging from the time when we only had a full-file atrac3 decoder, IIRC...

It definitely needs a rewrite to decode properly on the fly directly from PSP RAM indeed, which wouldn't have had this problem.

Only problem is finding motivation to work on it, because it's not easy...

@unknownbrackets unknownbrackets modified the milestones: v1.14.0, v1.13.2 Sep 10, 2022
@anr2me
Copy link
Collaborator

anr2me commented Sep 10, 2022

What happens is, the game performs these steps:

Create Atrac object.

  1. Load some of the file's data into RAM.
  2. Notify Atrac library about file data.
  3. Decode some of the data to PCM.
  4. Repeat from step 2 as needed.

Btw, is this notification is using a callback?

I remembered something similar happened on networking callback, where the game calling a syscall that can trigger a callback but the callback handler is checking a boolean var, and skips processing the callback if that boolean wasn't initialized yet.
The game ended stuck (waiting for the callback handler to process it) if the callback occurred too soon because that boolean var is being initialized later after using that syscall.

I guess the game dev had a bad habit of initializing stuff later after using a syscall that can use that stuff, which isn't fail-safe.

@unknownbrackets
Copy link
Collaborator

No, just a call to sceAtracAddStreamData(). There's no callbacks involved in Atrac.

In some cases, like if you setup the network init with thread priority set to worse than the current thread, and if the processing ought to happen on the thread, it's totally deterministic that it won't run until you yield, on the PSP.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants