Android Zombie process insight

Hi

One of the issues that bugged me about the Gui version was that the libsyncthing.so would end up turning into unkillable zombie process. So I started using the cli version on AndOs which work much better than the Gui wip one.

Anyway the cli version works nice but I realized one thing that might entail something fishy about the Android ST binary. If the binary stays open long enough (maybe couple hours at least) it turns into a zombie process with cli too. So it is neither killable nor stoppable and it eats up fair enough of cpu like %30 steadily.

I think that at this point I am sure that this kind of issue is the binary`s problem not the Gui versions. The Gui version suffers from couple other issues at least for me.

The memory usage is around 42 mb so maybe not a memory leak related? But the cpu usage is between %30 to %40 in general. Maybe threading issues? And I see the it looks dead (disconnected) to other nodes. So it is definitely not responding.

I am sorry to say that I am not an AndOs expert and that is the best insight I could provide about it atm.

Let me know if anyone needs further testing regarding this issue.

What is so interesting is that this seems to be happening only on one of my 2 devices (both arm devices). The other one had it running for a day or so without any such issue. Pretty weird.

On the other hand both of these devices had issues syncing when i tried the Gui version. Not sure why the real issues always has to be so convoluted :wink:

Enable some logging (https://forum.syncthing.net/t/how-do-i-debug-various-issues/815), see what’s going on. If it’s using CPU, something must be happening. You can also hit it with a SIGQUIT and it’ll exit with a stack trace for all running routines, best if you redirect stderr to a file first though.

calmh

When it is stuck, sigquit does not kill, neither any other method. I cant kill it as “root”, sending kill -s SIGQUIT pid does not help. I cant even get a log from adb since it is running as root(I assume). I have to investigate it a bit further.

The process is stuck, because the web server becomes unavail as well.

What is weird is that even terminating the terminal that it is running on does not kill the process. I wonder if that is a terminal implementation issue. However the zombie process was a problem with the GUI version as in almost the same way.

I wonder if you could enable some web based log output for easier use on android where copying sharing will be much easier.

Other people have reported this zombie process before. I think it was on Android ST github.

How would web based log output help when the process doesn’t respond to any external stimuli? Sounds like you want to just redirect log output, as I linked to above.

@calmh

Well I cant get any log output either from logcat or from STTRACE=all . I do not see any output that is why I was asking for something in the web gui section. Maybe we could see the last things it outputted, the site wont go down when the server is responding, at least it does not until one reloads the page.

I meant something like this:

root@x86:/ # /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -home /data/data/com.nutomic.syncthingandroid/files > /data/data/com.nutomic.syncthingandroid/log                  
...
root@x86:/ # cat /data/data/com.nutomic.syncthingandroid/log
[GGKTE] 15:37:26 INFO: syncthing v0.9.9 (go1.3.1 linux-386 android) felix@T420 2014-08-27 08:20:44 UTC
[GGKTE] 15:37:26 INFO: My ID: GGKTE44-JM3RYS3-TJG5DXJ-OGDLDK4-R4SEP2G-FECGTY3-PCJRYVM-QE5IPQ4
[GGKTE] 15:37:26 INFO: Starting web GUI on http://127.0.0.1:8080/
[GGKTE] 15:37:26 WARNING: Unexpected repository ID "camera" sent from node "GGKTE44-JM3RYS3-TJG5DXJ-OGDLDK4-R4SEP2G-FECGTY3-PCJRYVM-QE5IPQ4"; ensure that the repository exists and that this node is selected under "Share With" in the repository configuration.
[GGKTE] 15:37:26 INFO: Performing initial repository scan
[GGKTE] 15:37:27 INFO: Created UPnP port mapping - external port 5484
...

Ok

I got the log 2:30 min of log with STTRACE=all. Eventually it cut off so I do not know what to look for, it is a big file and the end of the log file does not show any crash.

What portion should I try to paste here? It is like 90.000 lines at the moment.

Btw one thing I am seeing in the ActivityManager log is this

“Invalid packageName /data…/libsyncthing.so”

Which is interesting because it is there in the memory, acting like a persistant untouchable process. Not sure what it is referring to.

There is another event in the Events around the time it crashed. which says or gives the flag “sf_frame_dur” for libsyncthing.so

I don’t know Android, as should be obvious by now, but could this be a framework of Android protecting itself by noting a process it doesn’t recognize that’s using a lot of resources and sending it a stop signal or similar?