Sometimes our users having an app crash due to sudden inaccessibility of database:
1) android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14)
or
2) java.lang.RuntimeException: Could not read input channel file descriptors from parcel.
or
3) android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. # Open Cursors=1 (# cursors opened by this proc=1)
And I noticed that in that moment I can't even extract logcat:
07-17 16:57:20.722 E/APP ( 2301): 2019-07-17_16:57:20.598+0300 [FileUtils] logcat extraction error
07-17 16:57:20.722 E/APP ( 2301): java.io.IOException: Error running exec(). Command: [logcat, -d, -v, time] Working Directory: null Environment: null
07-17 16:57:20.722 E/APP ( 2301): at java.lang.ProcessManager.exec(ProcessManager.java:211)
07-17 16:57:20.722 E/APP ( 2301): at java.lang.Runtime.exec(Runtime.java:174)
07-17 16:57:20.722 E/APP ( 2301): at java.lang.Runtime.exec(Runtime.java:247)
07-17 16:57:20.722 E/APP ( 2301): at java.lang.Runtime.exec(Runtime.java:190)
....
07-17 16:57:20.722 E/APP ( 2301): Caused by: java.io.IOException: Too many open files
07-17 16:57:20.722 E/APP ( 2301): at java.lang.ProcessManager.exec(Native Method)
07-17 16:57:20.722 E/APP ( 2301): at java.lang.ProcessManager.exec(ProcessManager.java:209)
07-17 16:57:20.722 E/APP ( 2301): ... 8 more
So I'm getting a question - is it possible to get in runtime (on user's device) a list of all opened file descriptors in my process (and pull it to logcat, for example)?
P.S. I failed to run a process to write logcat to file. But getting a dump app.hprof file working... Although I haven't found anything special here.