Git Product home page Git Product logo

Comments (10)

hejops avatar hejops commented on July 26, 2024

I get the same issue.

from open_flood.

GunshipPenguin avatar GunshipPenguin commented on July 26, 2024

I believe I'm aware of the bug causing the crash you mentioned, although I haven't managed to track down the cause exactly. Could you provide me with a stacktrace?

from open_flood.

Jibec avatar Jibec commented on July 26, 2024

same issue here, it's easy to reproduce : play the game in 24*24 with 3 color which is quite easy.
The last or "before last" moves always crash.

from open_flood.

GunshipPenguin avatar GunshipPenguin commented on July 26, 2024

I can't be fully sure of the crash that's happening on your devices because I don't have a stacktrace, but I'm fairly sure that this is a stackoverflow error due to seeing almost exactly the same problem on my friend's phone.

Because I can't replicate this error on my phone, can one of you try building the app from the iterative_floodfill branch, installing it to your device and seeing if that solves the problem. I've replaced the recursive flood fill algorithm with an iterative one on that branch, which should solve the problem.

from open_flood.

hashar avatar hashar commented on July 26, 2024

I have reproduced it thanks to the instruction above. 24x24 grid with 3 colors. One of the very last move caused the application to quit and the Android popup Application "Open Flood" as stopped (rough translation from french) and the OK button.

I had adb logcat running and that is definitely a stack overflow:

02-24 21:27:10.322 I/Keyboard.Facilitator(  544): onFinishInput()
02-24 21:27:40.377 I/dalvikvm(19021): threadid=1: stack overflow on call to Lcom/gunshippenguin/openflood/Game;.floodFill:VIIII
02-24 21:27:40.377 I/dalvikvm(19021):   method requires 28+20+20=68 bytes, fp is 0x40eb2334 (52 left)
02-24 21:27:40.377 I/dalvikvm(19021):   expanding stack end (0x40eb2300 to 0x40eb2000)
02-24 21:27:40.377 I/dalvikvm(19021): Shrank stack (to 0x40eb2300, curFrame is 0x40eb7ec4)
02-24 21:27:40.377 D/AndroidRuntime(19021): Shutting down VM
02-24 21:27:40.377 W/dalvikvm(19021): threadid=1: thread exiting with uncaught exception (group=0x41d60930)
02-24 21:27:40.455 D/dalvikvm(19021): GC_CONCURRENT freed 266K, 3% free 9726K/10024K, paused 4ms+6ms, total 30ms
02-24 21:27:40.478 E/AndroidRuntime(19021): FATAL EXCEPTION: main
02-24 21:27:40.478 E/AndroidRuntime(19021): java.lang.StackOverflowError
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:79)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:79)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:79)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:79)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:79)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:77)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:79)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.floodFill(Game.java:78)
02-24 21:27:40.478 E/AndroidRuntime(19021):     at com.gunshippenguin.openflood.Game.fl
02-24 21:27:40.502 D/dalvikvm(19021): GC_CONCURRENT freed 768K, 8% free 9463K/10268K, paused 2ms+3ms, total 23ms
02-24 21:27:40.502 D/dalvikvm(19021): WAIT_FOR_CONCURRENT_GC blocked 17ms
02-24 21:27:40.517 W/ActivityManager(  391):   Force finishing activity com.gunshippenguin.openflood/.GameActivity
02-24 21:27:41.064 W/ActivityManager(  391): Activity pause timeout for ActivityRecord{42a82630 u0 com.gunshippenguin.openflood/.GameActivity}
02-24 21:27:41.705 I/ActivityManager(  391): No longer want com.android.vending (pid 18495): empty #17
02-24 21:27:51.705 W/ActivityManager(  391): Activity destroy timeout for ActivityRecord{42a82630 u0 com.gunshippenguin.openflood/.GameActivity}
02-24 21:27:59.994 I/ActivityManager(  391): No longer want com.google.android.gsf.login (pid 18190): empty #17
02-24 21:28:10.322 I/Keyboard.Facilitator.LanguageModelFlusher(  544): run()
02-24 21:28:10.322 I/Keyboard.Facilitator(  544): flushDynamicLanguageModels()
02-24 21:29:03.994 D/dalvikvm(13192): GC_CONCURRENT freed 389K, 6% free 9668K/10208K, paused 4ms+3ms, total 33ms
02-24 21:29:03.994 D/dalvikvm(13192): WAIT_FOR_CONCURRENT_GC blocked 17ms

My setup is irrelevant but:

Phone: Google Galaxy Nexus, rather old phone
Android: 4.2.1 stock one, updated OTA by provider somehow
open_flood: 1.1.0 from F-Droid repository added on Feb 12 2016

floodFill() being a recursive function which lacks some harness to prevent it from overflowing the stack. Most probably it is going too deep.

from open_flood.

Jibec avatar Jibec commented on July 26, 2024

If you give an apk, I can test, but I don't know anything about compilation for android.
I see hashar has a french configuration, same as I.

from open_flood.

hashar avatar hashar commented on July 26, 2024

On large boards with mostly the same color, the recursive algorithm goes to deep and the poor Android stack ends up filled.

The other filling algorithm would not suffer from that.b It does not fill the stack. So imho it is already fixed. Need testing of the new algo.

from open_flood.

GunshipPenguin avatar GunshipPenguin commented on July 26, 2024

I have merged the iterative_floodfill branch into master. The algorithm that I replaced the old recursive one with is pretty simple, works fine on my phone, and fixed this problem on another phone that I tested. I will be releasing 1.1.1 shortly which will contain the new algorithm.

If anybody finds any problems with the new algorithm, please open a new issue.

from open_flood.

hashar avatar hashar commented on July 26, 2024

F-Droid has pushed 1.1.1 (their page) which comes with the new iterative algorithm. That definitely fixed the uses cases mentioned on this issue.

Well done @GunshipPenguin

from open_flood.

Jibec avatar Jibec commented on July 26, 2024

same here, I confirm it's working fine with 1.1.1
Thanks @GunshipPenguin

from open_flood.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.