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

Crash in material manager #5211

Open
deveee opened this issue Nov 18, 2024 · 1 comment
Open

Crash in material manager #5211

deveee opened this issue Nov 18, 2024 · 1 comment
Milestone

Comments

@deveee
Copy link
Member

deveee commented Nov 18, 2024

From google play console, STK 1.5-beta1

addr2line shows

#0 string_utils.cpp:88
#1 material_manager.cpp:446
#2 particle_kind.cpp:230

Full backtace

  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 24518 >>> org.supertuxkart.stk_beta <<<

backtrace:
  #00  pc 0x0000000000d66014  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (StringUtils::getBasename(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&)+88) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #01  pc 0x0000000000aa8fe0  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (MaterialManager::hasMaterial(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&)+446) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #02  pc 0x0000000000aab804  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (ParticleKind::getMaterial() const+230) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #03  pc 0x0000000000aa9eac  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (ParticleEmitter::setParticleType(ParticleKind const*)+193) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #04  pc 0x0000000000bb55e8  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (KartGFX::updateTerrain(ParticleKind const*)+405) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #05  pc 0x0000000000bb1170  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (Kart::handleMaterialGFX(float)+2076) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #06  pc 0x0000000000bb3254  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (Kart::updateGraphics(float)+3397) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #07  pc 0x0000000000c09f94  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (World::updateGraphics(float)+1120) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #08  pc 0x0000000000becdb4  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (LinearWorld::updateGraphics(float)+306) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #09  pc 0x00000000009eedec  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (MainLoop::run()+569) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #10  pc 0x00000000009ea450  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libmain.so (android_main(int, char**)+2591) (BuildId: 4fce2e98f252f98e398ac1d82a4ae863f0481505)
  #11  pc 0x0000000000083140  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/split_config.arm64_v8a.apk!libSDL2.so (Java_org_libsdl_app_SDLActivity_nativeRunMain+803) (BuildId: 807fab39398966d8350e1585a880c5e1f3b42b70)
  #12  pc 0x000000000030bb54  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+148)
  #13  pc 0x000000000077e908  /apex/com.android.art/lib64/libart.so (nterp_helper+152)
  #14  pc 0x00000000000170a8  /data/app/~~6owHFE0eO6Trz2DBBmInBA==/org.supertuxkart.stk_beta-a8FNuVjqz4ScK_HKPie8tA==/base.apk (org.libsdl.app.SDLMain.run+144)
  #15  pc 0x00000000003e0df0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (java.lang.Thread.run+64)
  #16  pc 0x0000000000362774  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
  #17  pc 0x000000000034def0  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+132)
  #18  pc 0x0000000000943e28  /apex/com.android.art/lib64/libart.so (art::detail::ShortyTraits<(char)86>::Type art::ArtMethod::InvokeInstance<(char)86>(art::Thread*, art::ObjPtr<art::mirror::Object>, art::detail::ShortyTraits<>::Type...)+60)
  #19  pc 0x000000000063ebd4  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1344)
  #20  pc 0x000000000063e684  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallbackWithUffdGc(void*)+8)
  #21  pc 0x00000000000faecc  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204)
  #22  pc 0x000000000008e1f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
@Alayan-stk-2 Alayan-stk-2 added this to the 1.5 milestone Dec 20, 2024
@Alayan-stk-2
Copy link
Collaborator

    std::string getBasename(const std::string& filename)
    {
        for(int i = int(filename.size()) - 1; i >= 0; --i)
        {
>>>>>  if (filename[i]=='/' || filename[i]=='\\')
            {
                return filename.substr(i+1);
            }
        }
        return filename;
    }   // getBasename

For this to crash, you'd need either a negative value for i (impossible, i>= 0 is tested) or a too high value for i (but i is initialized at filename.size() - 1, which should not be). The [] operator is a valid way to access a std::string's characters.

Puzzling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants