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 on start on v3.2.0 #184

Closed
noerw opened this issue Sep 13, 2017 · 27 comments
Closed

Crash on start on v3.2.0 #184

noerw opened this issue Sep 13, 2017 · 27 comments

Comments

@noerw
Copy link

noerw commented Sep 13, 2017

First, thanks for the great work in this app!

After updating to 3.1.1 the redmoon-tile in the "swipe down drawer" stopped working.
After the update to 3.1.2 I cannot launch the app at all.

How could retrieve the relevant crash logs for you?

Moto Z, Android 7.1.1, kernel 3.18.31

@smichel17 smichel17 added the bug label Sep 13, 2017
@smichel17
Copy link
Member

Hi there, thanks for the report! Both issues are actually fixed already (see #176 and #180) and will be in the next release, which I'm planning to do tonight or tomorrow, plus whatever delay there is for F-Droid to distribute it.

@noerw
Copy link
Author

noerw commented Sep 13, 2017

woops, should have checked closed issues. thanks!

@smichel17
Copy link
Member

No worries. I should really create an issue template reminding people to do that :)

@smichel17
Copy link
Member

(I'll leave this issue open until release so other people see it)

@smichel17 smichel17 added this to the v3.2.0 milestone Sep 14, 2017
@barbaMimmo
Copy link

Hello, I love this app but I can't start it anymore after I upgraded on F-Droid from v 3.0.0 to 3.1.1.
Versions which followed recently didn't solve the problem. Now with 3.2.0 it seems to start again correctly (it starts to colour the screen in red, while the previous crashed immediaely), but it actually chrashes in less than 1 second. :-(
I have a Sony Xperia M2 running Android 4.4.4 and no root at all.
How could I help you providing with more useful data about the crash sequence?
It happens both when the system starts, as when I call the app up from home screen.
Thank you for the amazing work.
Mimmo

@smichel17
Copy link
Member

@barbaMimmo is pause in secure apps enabled? If so, does disabling it stop the app from crashing?

@barbaMimmo
Copy link

@smichel17 I can't tell, unless there's a way to get into the app's configuration without launching it (i.e., a config file somewhere which I could modify or at least look at).
Anyway, I seem to remember that it was switched on previously.

Errata corrige: the crash-on-launch problem arose as soon as I upgraded to v 3.1.0, and then remained with subsequent upgrades.

I did not change anything in the preferences before the upgrade.
Sadly, something wrong with the way F-Droid manages regressions prevents me from succeeding in installing a previous version of RedMoon (this happens with all apps, not only yours).

Please note that I emptied all the cache and also wiped cache partition with no change.

I really hope I could get R.M. running again, since it's absolutely needed in a smartphone like mine, where minimum backlight it far too bright for evening/night use!

@smichel17
Copy link
Member

@barbaMimmo Oh, I misread you the first time missed the part where it also crashes on launch. Hrmph, thought I fixed all those. Let me see if I can replicate in an emulator as that's the easiest for me to troubleshoot -- if I can't, I'll ask you to get a logcat if possible.

@smichel17 smichel17 changed the title problems since v3.1.1 Crash on start on v3.2.0 Sep 17, 2017
@smichel17
Copy link
Member

smichel17 commented Sep 17, 2017

@barbaMimmo Okay, I can't reproduce on a clean install. I'm interested whether a clean install would fix your issue, but I'm also interested in why you're crashing right now, and if a clean install fixes the issue, then I won't be able to get any more data to troubleshoot.

Could you try downloading a debug version of Red Moon? It'll install alongside the f-droid version. You can get it from here: http://smichel.me/files/red-moon/ It's the one from 9/14. (Note: http link. Https will also work, but my cert is expired so you'll have to click past that warning, sorry).

edit: also, if a faster back-and-forth would be helpful, you can ping me in chat, links in the readme.

@barbaMimmo
Copy link

Ok, this is interesting, ao if doesn't bother other readers I'd prefer to keep the conversation here. I installed the debug version you suggested, and it works perfectly.
Even with "pause in secure apps" activated, I can close, terminate, and restart it without problems.
It's switched on right now.

The only remaining issue is that RM continues to terminate itself (without error message) from time to time when I'm browsing the Internet (on IceCatMobile 47) and it never reactivates itself unless I restart it manually from apps list.
This one I think it's a different problem, which should go to a different post in this section. I thought it was solved in latest release, but it's still the same on my buggy beloved smartphone.

Interesting to say: both so-called bugs have exactly the same behaviour also on my Samsung Galaxy Tab 2 7.0 tablet with same Android 4.4.4 version, no bootloader unlock, no root).

If you gave me basic instructions on how to file a logcat (or send it to you), I will be glad to do.

(meanwhile I was writing here, RM terminated itself as usually without and I'm now without red filter again... If I restart the debug version it runs smoothly for a while unless I do too heavy operations on Android such as surging the Internet)

Thanks for your patience in listening to my specific issues :-)

@smichel17 smichel17 modified the milestones: v3.2.0, planned Sep 17, 2017
@ldutra
Copy link

ldutra commented Sep 17, 2017

Same issue here, in a Samsung Galaxy note pro 12,2. Gone away on fresh install.

@smichel17
Copy link
Member

smichel17 commented Sep 17, 2017

Android has a tool to get logs from a device called logcat, and people call the log it produces, "a logcat". The easiest way to get a logcat is by connecting your phone to a computer and running the adb (android debug bridge) tool on the computer. To do that:

One time only:

Each time you want to get a logcat:

  • Open a terminal and cd to the directory you put the platform tools in.
  • Run adb logcat in the terminal
    • A bunch of log output will show up on your screen
  • Reproduce the crash
  • Copy the new log output to however you want to share it

There's some additional tricks to get the log output to show only logs from RM instead of all apps on the system, but let's take things one step at a time. Let me know if you run into issues and I'll help if I can.

@barbaMimmo
Copy link

Hello, yesterday I downloaded official platform-tools, but then I got into troubles when trying to use Adb on my PC (Windows XP SP3, administrator account). It always terminates itself, any command I give (e.g.: adb devices, adb shell), even if the phone is not yet connected or with it attached in debug mode (drivers already correctly installed). The error message is: "adb.exe was closed due to the command ctrl+c".
I obviously didn't press anything (and I use Dos commands since Dos 6.0).
Fastboot instead, which is in the same folder, works perfectly.
Am I simply unlucky?
Sorry for filling this thread with RM-unrelated issues.
The debug version I am running runs well, only seldom crashes on launch. Timers didn't work last night and this morning.

@smichel17
Copy link
Member

Sorry for filling this thread with RM-unrelated issues.

No worries, the original report of this thread was fixed in 3.2.0 so the thread is yours now, others can unsubscribe if they're getting too many notifications or something.

The error message

That is quite odd. Wonder if it's an XP thing. Is there another device you can use/borrow to test on?

@barbaMimmo
Copy link

Hello, I managed to have Adb working.
I found AN older version from 2015 from a developer's site. It's now clear that the most recent one by Google from 2017 doesn't work on Windows XP.
I have prepared a txt file with several crashes recorded in it. It's 173 kB. How could I provide you with it?

@smichel17
Copy link
Member

You could use a github gist and paste the link here, or email it to me (address is in the app)

@barbaMimmo
Copy link

Emailed ;-)

@smichel17
Copy link
Member

Got it, thanks. I'll have time to take a look in a few hours :)

@smichel17
Copy link
Member

smichel17 commented Sep 20, 2017

@barbaMimmo Alright, there's two separate bugs:

  1. The crash on your f-droid version is indeed related to updating profiles, probably caused by v3.1.2 crashes on start #180; I'm surprised it is still happening in v3.2.0. My best guess is that the previous crash (v3.1.2 crashes on start #180) corrupted your profiles. We could try to spend time figuring out how they were corrupted and recovering them, but that would be a lot of effort, not to mention the bug causing it is already fixed. Instead, I'd suggest going to Settings > Apps > Red Moon > Clear data to reset your saved profiles and settings, then recreating them.

  2. The debug version crash is more interesting. Any time we change the filter color (ie, when animating on), we need to update its layout. That method will fail if you try to do it when the filter is not actually shown -- that's what's happening here. The weird thing is, we already guard against this*, and it's impossible to try to relayout unless we've tried to show the filter. It seems like the system call to show the filter is failing. The most likely cause is a Sony-specific issue about which there is no documentation besides this. But you say Red Moon has worked for you on this device in the past, and if this actually is a Sony issue, it should be happening every time you try to start the filter, not once every so often.

*there is a way that the guard could fail, but it would happen when turning the filter off, and your log shows that the crash happened when it was turning on.

@barbaMimmo
Copy link

Hello,
I was glad to receive the results of your investigations.
I simply deleted app data as you suggested, and so both F-Droid and Debug version of RM now run smoothly again. Even when I start both of them and enable their filters, they superimpose correctly a double-intensity layer as expected without crashing.
So, the hypothesized bug seems to be something related to the way Android 4.4.4 manages apps' preferences.

Did you notice I filed also one event of a crash-on-start from another F-Droid app called "Amaze" in that logcat? Well, there must be something similar in the origin of that bug, since as soon as I cleared data for it too, Amaze opened up smoothly again! But you can bet there were no personal profile nor complicated user's setting in that file manager... As like for RM Debug, where I didn't make new profiles at all since I installed it.

Something seems to get corrupt in apps' data when the system is restarted, or such situations.
Not definitely a Sony- or Samsung-related issue I think, because the only thing my two devices have in common is the Android version... And in both them, clearing RM app data solved the crash-on-launch problem.

Now, that we (you) solved this prejudicial enigma, another one remains, and it would better require opening another thread: in both my devices, since many many versions of RM ago, the filter deactivates and the app unloads from memory (not from cached apps) after just a few minutes or even just seconds of web browsing or any other "medium-heavy" operation. This one could be an os- or device-related problem as well, since again it (still, sadly) happens on both my Sony smartphone and my Samsung tablet, and also on another device I tried with same OS.
Would you please consider opening such thread, so I can participate in the discussion?

Please let me know if you needed more logcats.
Thanks for all your efforts!

   Mimmo

@barbaMimmo
Copy link

Eureka!
I must tell you what I just discovered...
There IS a bug I can clearly reproduce.

Just cleared app data.
Into RM setting, under "hardbuttons backlight" (or whatever it is in English I don't know, mine is in Italian) choose: "use shade level from filter".
Now, enable the filter.
RM crashes.
You have to clear app data again to get back into it, since it now crashes on launch.

Note: in this state, it actually crashes only 3 times on launch, then starts correctly again but with the filter disabled, allowing you to change the painful setting to any other value ("managed by the system" or "turn off") and eventually re-enabling the filter without other problems.

My devices have no hardware buttons backlighted, so I tried that setting for mere curiosity. It could be the main reason for the crash of the debug version also, but not the F-droid one since I didn't change that value before 3.2.0: for that version it must have been a profile corruption to cause the unlaunchability.

Now, let's think about the other big problem I mentioned, of RM unloading itself from memory (with "pause in secure apps" off or on, no change) and disappearing from in-use-apps list with no error message when the user is surfing the Internet or similar!

Bye

 Mimmo

@raatmarien
Copy link
Member

Great that you figured out what caused it! Just want to chime in that I can sort off replicate this bug. When I set it to use dim level from filter, Red Moon crashes when I try to enable the filter (although it doesn't crash at startup like it does for you).

@smichel17 maybe some devices don't accept intermediate values for button backlights? That's just a guess since I don't actually know how this setting is implemented.

@smichel17
Copy link
Member

Let's track the hardware button issue separately, in #190.

Did you notice I filed also one event of a crash-on-start from another F-Droid app called "Amaze" in that logcat?

It was crashing from a separate issue, where it tried to display an item that didn't exist. Probably an off by one error or, as you mention, corrupted storage.

For the crash, I'm making a change to fix the case where our safety check could fail. I don't think that will fix the issue, but who knows, let's see.

Android will occasionally unload processes from memory when the system is low on memory. Red Moon runs as a foreground service, which means it will not be killed this way unless the system is absolutely out of memory for anything except the open app. Thus, if low memory is the reason for being killed, I am not sure what else to do about this -- maybe try to restart if it's killed this way; maybe try to reduce our already-small memory footprint?

@barbaMimmo
Copy link

Yes, there must be a big problem of memory management in my devices, even if I have really few processes in background but the browser and the keyboard and some 4 system services.
With even no other processes not even in cache, it still happens. Probably IceCatMobile literally invades the ram, don't know.

But I'd like to talk about this as a possible enhancement, if you opened a dedicated thread.
E.g., insted of just trying to reduce the memory usage by RM, you could maybe think of a recursive auto-reload of it when it goes offloaded, as long as the user set the filter as desired. One service which behaves that way is "Bluetooth Share": it often gets unloaded, but auto-restarts after a little while, unless you disable it from fast-settings or settings-management.
Would that enhancement require root access?

At least, could you keep something like a static notification on the bar, which woul allow the user restart the filter from notification bar without getting back into the home to press on the RM icon?

Oh, and another thing: why don't you keep a notification active even when the filter is manually paused? Now, to re-enable it you have to go back into RM settings, which is uncomfortable.

Lastly, still talking about enhancement, there's the fact RM doesn't correctly restore backlight settings which were previously selected on the system. I noticed this problem got worse after one release, don't remember which one. Now it only seldom restores them after it pauses (i.e. when morning hour comes and it auto-pauses). Of course, it never restores previous backlight levels and auto-compensate setting when it the system unloads it from memory.
If it stored "user configured system backlight settings previous to filter enabling" somehow permanently for each session, could it then correctly remember them when it got restarted, even if it got unload from memory?

Sorry for the messy ideas, I hope you got the meaning within them. It's my fault to have absolutely no programming skills, so I can't explain things clearly.

@smichel17
Copy link
Member

smichel17 commented Sep 21, 2017

This thread is becoming very long and hard to keep track of; I would like to keep it focused on the title issue, where Red Moon crashes on start.

Could you create new issues for the others? I know there's no existing issue about the memory one; for the other two, check if there are existing issues about them, first.

To discuss everything all together, the chat room is a better place.

@smichel17
Copy link
Member

I was briefly able to reproduce the crash. Then I uninstalled, to install an earlier version and see if I could reproduce it there. The earlier version did not crash. After reinstalling the same version I was just on, it no longer crashes. I guess it must be related to a corrupted state, somehow.

@barbaMimmo Can you see if clearing the app data fixes this crash?

@barbaMimmo
Copy link

Well, I think the discussion could continue on #190 since the problem was quite identified.
If you're talking about that particular bug, yes, it is the same for me on a fresh install and on an upgrade. Please note that the debug version I am still running was a fresh install.

Clearing app data only allows you to get back into a reinitialized RM and make your own settings, and it will then run nicely again... unless you change that parameter which causes it to crash. It would then trigger the vicious circle of crash-on-launch which repeates for 1-3 launches circa, depending on how immediately you try to restart RM from its icon.

It is definitely related to "use dim level for hard buttons settings" if we talk about a fresh install of last versions.

Previous conditions we described here was surely due to a corrupted user profile settings which happened during upgrade to version 3.1.0 and never before. We solved it clearing app data, in fact.

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

No branches or pull requests

5 participants