Android Question Intermittent crash - how to analyze?

ValDog

Active Member
Licensed User
Longtime User
Occasionally my app crashes with just a "Unfortunately, <app> has stopped" message. Nothing shows in the filtered log to give me any clue. I presume the issue is memory related because of the behavior. Looking at the unfiltered log is confusing (USB debugging) - not at all obvious where the fault lies. Is there any way to put markers in the unfiltered log to localize the fault?
 

ValDog

Active Member
Licensed User
Longtime User
The best way is to monitor the logs while the crash happens. In most cases the error will be in the filtered logs as well.
Tried this and here is an excerpt from the unfiltered log - any hints as to what may be happening?

Successfully inserted 1 locations
Cancelling scheduled uploads
Not calling LocationReporter, hasMoved: false, elapsed millis: 1783911, request: Stationary(3600000)
Scheduling next upload for 1816089ms from now
Tombstone written to: /data/tombstones/tombstone_00
getTasks: caller 10084 does not hold GET_TASKS; limiting output
WIN DEATH: Window{15fa1a48 u0 b4a.gsight2/b4a.gsight2.main}
Remote Listener died: android.location.IGpsStatusListener$Stub$Proxy@286245e9
Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
channel '15fa1a48 b4a.gsight2/b4a.gsight2.main (server)' ~ Consumer closed input channel or an error occurred. events=0x9
channel '15fa1a48 b4a.gsight2/b4a.gsight2.main (server)' ~ Channel is unrecoverably broken and will be disposed!
channel '259f17ed PopupWindow:1a13d037 (server)' ~ Consumer closed input channel or an error occurred. events=0x9
channel '259f17ed PopupWindow:1a13d037 (server)' ~ Channel is unrecoverably broken and will be disposed!
Attempted to unregister already unregistered input channel '15fa1a48 b4a.gsight2/b4a.gsight2.main (server)'
Force-removing child win Window{259f17ed u0 PopupWindow:1a13d037} from container Window{15fa1a48 u0 b4a.gsight2/b4a.gsight2.main}
Attempted to unregister already unregistered input channel '259f17ed PopupWindow:1a13d037 (server)'
Process 17212 exited due to signal (11)
Process b4a.gsight2 (pid 17212) has died
Scheduling restart of crashed service b4a.gsight2/.starter in 1000ms
Force removing ActivityRecord{18d402cd u0 b4a.gsight2/.main t363}: app died, no saved state
Failed looking up window
java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@3f77a604 does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8539)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8530)
at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1142)
at android.os.BinderProxy.sendDeathNotice(Binder.java:551)
WIN DEATH: null
Error in monitored listener.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
getTasks: caller 10084 does not hold GET_TASKS; limiting output
MAybe it is this line which is saying there is a missing permission for getTasks.
 
Upvote 0

ValDog

Active Member
Licensed User
Longtime User
MAybe it is this line which is saying there is a missing permission for getTasks.
I added the following line to my manifest:

"AddPermission(android.permission.GET_TASKS)"


Crashed again - here is another excerpt:

Not calling LocationReporter, hasMoved: false, elapsed millis: 2539869, request: Stationary(3600000)
Scheduling next upload for 1060131ms from now
getTasks: caller 10084 does not hold GET_TASKS; limiting output
getTasks: caller 10084 does not hold GET_TASKS; limiting output
not Base app: Adding window Window{28e77af8 u0 b4a.gsight2/b4a.gsight2.main} at 4 of 17
getTasks: caller 10084 does not hold GET_TASKS; limiting output
getTasks: caller 10084 does not hold GET_TASKS; limiting output
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@2560a40d attribute=null, token = android.os.BinderProxy@2e27da74
InsertMaps (first query out of 1): INSERT INTO [System] ([CurrEventID], [CurrEventDescrip], [AlertFlag], [AlarmFlag], [Action1Flag], [Action2Flag], [Action3Flag], [Action1Level], [Action2Level], [Action3Level], [Action1Msg], [Action2Msg], [Action3Msg], [AlertLevel], [AlarmLevel], [RadLevelMaxLimit], [DevRadLevelMaxLimit], [RadAAUnits], [SpecLib], [RRDataCollInt], [PctChgVar], [ScanAvgTime], [LowDevVoltage], [VoltChkInterval], [RollTimeInterval], [RateGraph], [GPSMinTime], [MapDefaultZoomLevelIndex], [MapLineWidthIndex], [MapLineColorIndex], [MapLineOpacity], [GMapLineOpacity], [DispMapScaleControl], [DispMapMarkers], [DispMapPolylne], [UseAccess], [MapType], [OnlineMap], [MapSelection], [GraphType], [SpecGraphType], [DefScanMode], [DispCumData], [UseGPS], [ScanUnitsDef], [MarkerSOIRadius], [ProbeType], [QuickStartScan], [AccNucLib], [AccAnalMode], [AccECal], [AccBT], [AccDailySrcCk], [AccDataStg], [AccDLDataStore], [AccAccessLevels], [AccGSTables], [AccClrFD], [AccRRTables], [AccClrRR], [AccEditEIDs], [AccAddUser], [AccDelUser], [SCRefTolerance]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Finishing task with all activities already finished
Duplicate finish request for ActivityRecord{337d9467 u0 b4a.gsight2/.main t365 f}
getTasks: caller 10084 does not hold GET_TASKS; limiting output
** Activity (main) Pause, UserClosed = true **
Finishing task with all activities already finished
Duplicate finish request for ActivityRecord{337d9467 u0 b4a.gsight2/.main t365 f}
mpl state size = 5584
calData from inv_save_mpl_states, size=2
cal data size to write = 5584
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
WIN DEATH: Window{353f8b9d u0 b4a.gsight2/b4a.gsight2.main}
proxy_gps_stop()
proxy_gps_status_cb()
Bytes written = 5584
mpl state size = 5584
calData from inv_save_mpl_states, size=2
cal data size to write = 5584
Bytes written = 5584
 
Upvote 0

ValDog

Active Member
Licensed User
Longtime User
MAybe it is this line which is saying there is a missing permission for getTasks.
I am seeing this line repeatedly in my unfiltered log - even when most apps on my Nexus 7 are shut down. I can't figure out how to find the application name based on the 10084 uid. Anyone?
 
Upvote 0

ValDog

Active Member
Licensed User
Longtime User
There is no clear error in these logs. We can see that you called DBUtils.InsertMaps and then Activity.Finish (or pressed on the back key).

Do you call ExitApplication in your app somewhere?
Yes, I do use ExitApplication in a few places - I guess I shouldn't, but I don't think they are seen in the sequence of steps I take that create the (intermittant) crash - I'll remove those instances and see if I still get this crash.

Update: I've removed ExitApplication calls - still getting crashes. I've attached the entire log this time - perhaps you can see something else going on that leads to these crashes. This is really problematic... BTW, my app is named GSight2, and the crashes seem to occur when I am bringing up Popup menus.
 

Attachments

  • logcat.txt
    46.3 KB · Views: 336
Last edited:
Upvote 0

ValDog

Active Member
Licensed User
Longtime User
Can you post the code that shows those menus? Are there modal dialogs?

Use CallSubDelayed to call a sub that will then show the dialogs.
I've attached my GSight.b4a and Starter.bas files. Within GSight.b4a Activity_Create calls LoadMain, which loads the main dialog. btnOptions_Click opens a popup menu based on the AHQuickAction lib. Selecting (AC_Click) "Data Transfer" opens popup menu (PopMenu1) based on StdActionBarHelper lib. Selecting "Transfer File" (PopupMenu1_MenuItemClick) from this menu loads a list (InputList1) of files. Selecting one of the listed files then loads popup menu (PopMenu2) also based on StdActionBarHelper lib. This is when the app crashes - before PopMenu2 can come up. I emphasize that this behavior is intermittent, and so far today it is behaving correctly. I'm hopeful that some of my tweaking has corrected the issue, but I am not holding my breath. I'd appreciate any insights you may have.
 

Attachments

  • Starter.txt
    20.4 KB · Views: 212
  • GSight.txt
    41 KB · Views: 234
Upvote 0

ValDog

Active Member
Licensed User
Longtime User
Thanks Erel!
Erel, thanks - but how do I use CallSubDelayed when I am using the following syntax for loading the popup menus:

PopupMenu1.Initialize("PopupMenu1", lblUser)
PopupMenu1.AddMenuItem(0, 0, "Transfer file")
PopupMenu1.AddMenuItem(1, 1, "Export Field Data")
PopupMenu1.AddMenuItem(2, 2, "Export Samples Data")
PopupMenu1.Show
 
Upvote 0
Top