godot: Crash on android release build using Timer and yield

Godot version:

Godot 3.0.6 official

OS/device including version:

MacOSX 10.13.6 Android 7.1.2

Issue description:

I have random placed crashes in release android build. When I run debug apk there are no error which looks like the crashed one.

As I can see the crash occurred when timer is fired. I only use timers in such construction: yield(tm.create_timer(1.5), 'timeout') Where tm is a global singleton Node with method:

func create_timer(timeout):
    var timer = Timer.new()
    timer.set_name('CreateTimer')
    timer.set_wait_time(timeout)
    timer.connect("timeout", timer, "queue_free")
    add_child(timer)
    timer.start()
    return timer

I think, that sometimes object which called yield is removed from scene tree and then application is crashed. But I don’t know why I have no errors about this in debug mode.

My be I can check if node still exist? I know about is_instance_valid function but I don’t know how to use it in my case.

Crash log:

09-26 09:17:43.903: A/libc(1781): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x41300000 in tid 1801 (GLThread 10992)
09-26 09:17:43.903: A/libc(1781): [ 09-26 09:17:43.904   470:  470 W/         ]
09-26 09:17:43.903: A/libc(1781): debuggerd: handling request: pid=1781 uid=10306 gid=10306 tid=1801
09-26 09:17:44.028: A/DEBUG(1839): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-26 09:17:44.028: A/DEBUG(1839): Build fingerprint: 'Xiaomi/rosy/rosy:7.1.2/N2G47H/V9.6.3.0.NDAMIFD:user/release-keys'
09-26 09:17:44.029: A/DEBUG(1839): Revision: '0'
09-26 09:17:44.029: A/DEBUG(1839): ABI: 'arm'
09-26 09:17:44.029: A/DEBUG(1839): pid: 1781, tid: 1801, name: GLThread 10992  >>> free.line.games.match.three.puzzle.galaxy.adventure.android <<<
09-26 09:17:44.029: A/DEBUG(1839): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x41300000
09-26 09:17:44.029: A/DEBUG(1839):     r0 41300000  r1 c87ae8d8  r2 00000000  r3 00000045
09-26 09:17:44.029: A/DEBUG(1839):     r4 c912d580  r5 e0954328  r6 c87c1d20  r7 c87ae8d8
09-26 09:17:44.029: A/DEBUG(1839):     r8 e09543c0  r9 00000001  sl e09544c4  fp e0954728
09-26 09:17:44.029: A/DEBUG(1839):     ip e9f33860  sp e0954308  lr ccbffeb0  pc ccc4d824  cpsr 200f0010
09-26 09:17:44.107: A/DEBUG(1839): backtrace:
09-26 09:17:44.108: A/DEBUG(1839):     #00 pc 012d6824  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN10StringNameC2ERKS_+72)
09-26 09:17:44.108: A/DEBUG(1839):     #01 pc 01288eac  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN6Object4callERK10StringNamePPK7VariantiRNS3_9CallErrorE+388)
09-26 09:17:44.108: A/DEBUG(1839):     #02 pc 013534c8  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN7Variant8call_ptrERK10StringNamePPKS_iPS_RNS_9CallErrorE+92)
09-26 09:17:44.108: A/DEBUG(1839):     #03 pc 002d250c  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN16GDScriptFunction4callEP16GDScriptInstancePPK7VariantiRNS2_9CallErrorEPNS_9CallStateE+6332)
09-26 09:17:44.108: A/DEBUG(1839):     #04 pc 002dcc0c  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN21GDScriptFunctionState16_signal_callbackEPPK7VariantiRNS0_9CallErrorE+320)
09-26 09:17:44.108: A/DEBUG(1839):     #05 pc 002e127c  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN16MethodBindVarArgI21GDScriptFunctionStateE4callEP6ObjectPPK7VariantiRNS4_9CallErrorE+52)
09-26 09:17:44.108: A/DEBUG(1839):     #06 pc 01288ef4  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN6Object4callERK10StringNamePPK7VariantiRNS3_9CallErrorE+460)
09-26 09:17:44.108: A/DEBUG(1839):     #07 pc 0128aac4  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN6Object11emit_signalERK10StringNamePPK7Varianti+1128)
09-26 09:17:44.108: A/DEBUG(1839):     #08 pc 012891f0  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN6Object11emit_signalERK10StringNameRK7VariantS5_S5_S5_S5_+144)
09-26 09:17:44.108: A/DEBUG(1839):     #09 pc 00722664  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN5Timer13_notificationEi+584)
09-26 09:17:44.108: A/DEBUG(1839):     #10 pc 00724740  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN5Timer14_notificationvEib+92)
09-26 09:17:44.108: A/DEBUG(1839):     #11 pc 012861d8  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN6Object12notificationEib+24)
09-26 09:17:44.108: A/DEBUG(1839):     #12 pc 00700f70  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN9SceneTree19_notify_group_pauseERK10StringNamei+828)
09-26 09:17:44.109: A/DEBUG(1839):     #13 pc 0070155c  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN9SceneTree4idleEf+496)
09-26 09:17:44.109: A/DEBUG(1839):     #14 pc 000cd368  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN4Main9iterationEv+920)
09-26 09:17:44.109: A/DEBUG(1839):     #15 pc 00092620  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (Java_org_godotengine_godot_GodotLib_step+212)
09-26 09:17:44.109: A/DEBUG(1839):     #16 pc 00233e85  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/oat/arm/base.odex (offset 0x221000)

Steps to reproduce:

Minimal reproduction project:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Poke @RandomShaper (not saying it’s your job to fix it, but seems within your area of expertise 😄).

No problem! I’ll try to fix this as well as other bugs Juan assigned to me.

I changed create_timer function to:

func create_timer(timeout):
    return get_tree().create_timer(timeout)

The crash log also changed:

09-26 11:02:43.895: A/libc(15149): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x5b5b5a in tid 15230 (GLThread 11108)
09-26 11:02:43.895: A/libc(15149): [ 09-26 11:02:43.901   470:  470 W/         ]
09-26 11:02:43.895: A/libc(15149): debuggerd: handling request: pid=15149 uid=10309 gid=10309 tid=15230
09-26 11:02:44.201: A/DEBUG(15259): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-26 11:02:44.202: A/DEBUG(15259): Build fingerprint: 'Xiaomi/rosy/rosy:7.1.2/N2G47H/V9.6.3.0.NDAMIFD:user/release-keys'
09-26 11:02:44.202: A/DEBUG(15259): Revision: '0'
09-26 11:02:44.202: A/DEBUG(15259): ABI: 'arm'
09-26 11:02:44.202: A/DEBUG(15259): pid: 15149, tid: 15230, name: GLThread 11108  >>> free.line.games.match.three.puzzle.galaxy.adventure.android <<<
09-26 11:02:44.202: A/DEBUG(15259): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5b5b5a
09-26 11:02:44.202: A/DEBUG(15259):     r0 005b5b5b  r1 c6749d82  r2 cd444e44  r3 c7eee980
09-26 11:02:44.203: A/DEBUG(15259):     r4 00000006  r5 c62f0520  r6 00000092  r7 c635e000
09-26 11:02:44.203: A/DEBUG(15259):     r8 c6296878  r9 e0954950  sl 00000000  fp e09548b0
09-26 11:02:44.203: A/DEBUG(15259):     ip 00000010  sp e09545c0  lr cbc47ce4  pc 005b5b5a  cpsr 600f0030
09-26 11:02:44.266: A/DEBUG(15259): backtrace:
09-26 11:02:44.267: A/DEBUG(15259):     #00 pc 005b5b5a  <unknown>
09-26 11:02:44.267: A/DEBUG(15259):     #01 pc 002d0ce0  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN16GDScriptFunction4callEP16GDScriptInstancePPK7VariantiRNS2_9CallErrorEPNS_9CallStateE+144)
09-26 11:02:44.267: A/DEBUG(15259):     #02 pc 002dcc0c  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN21GDScriptFunctionState16_signal_callbackEPPK7VariantiRNS0_9CallErrorE+320)
09-26 11:02:44.267: A/DEBUG(15259):     #03 pc 002e127c  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN16MethodBindVarArgI21GDScriptFunctionStateE4callEP6ObjectPPK7VariantiRNS4_9CallErrorE+52)
09-26 11:02:44.267: A/DEBUG(15259):     #04 pc 01288ef4  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN6Object4callERK10StringNamePPK7VariantiRNS3_9CallErrorE+460)
09-26 11:02:44.267: A/DEBUG(15259):     #05 pc 0128aac4  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN6Object11emit_signalERK10StringNamePPK7Varianti+1128)
09-26 11:02:44.267: A/DEBUG(15259):     #06 pc 012891f0  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN6Object11emit_signalERK10StringNameRK7VariantS5_S5_S5_S5_+144)
09-26 11:02:44.267: A/DEBUG(15259):     #07 pc 007019c0  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN9SceneTree4idleEf+1620)
09-26 11:02:44.267: A/DEBUG(15259):     #08 pc 000cd368  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (_ZN4Main9iterationEv+920)
09-26 11:02:44.267: A/DEBUG(15259):     #09 pc 00092620  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/lib/arm/libgodot_android.so (Java_org_godotengine_godot_GodotLib_step+212)
09-26 11:02:44.267: A/DEBUG(15259):     #10 pc 00233e85  /data/app/free.line.games.match.three.puzzle.galaxy.adventure.android-1/oat/arm/base.odex (offset 0x221000)

The debug android build still have no errors like this.