Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Strange issue makes app unresponsive, except for back button menus

I have an issue that i was not able to trace, and which seems to be linked with OS misbehavior as well, all in all quite strange.

 

How to trigger it: I have no idea. We had different hypotheses, but the issue is not reproducable.

 

What happens:

No clicks are executed, with the exception of the back button. Peek is also possible, and a long click opens a context menu (if present). The context menu can be expanded, but triggering actions does not do anything.

I can show the application menu by swiping down, but pressing the actions does not do anything.

 

When i close the application the app symbol stays greyed out forever, and the target navigator shows that the application is actually running. However, it is not shown in the "active apps view".

On a long press on the main screen there is no delete icon.

 

The last log entry is "Application shrinks to thumbnail" which we log ourselves when the app signals thumbnail().

 

To resolve this situation i can either send a SIGTERM to the application process or reboot the device.

 

Did somebody see something similar happen?

 

As i don't know how to reproduce the issue i am hesistant to log something in JIRA.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Strange issue makes app unresponsive, except for back button menus

Sounds very odd, but I'll point out that based on what you describe, the "system" is fully functional but only your own code's functionality is broken at that point.

The things you can still do are all things handled by Cascades, up until the point where your own code would respond at which point nothing works.

That was probably obvious, but I thought I'd point it out anyway. I realize it helps nothing, and that the actual cause may be unrelated to your own code. If event delivery were somehow broken, then your code would be sitting idle even if it were not itself broken.

Can you see repeated log messages as you thumbnail/fullscreen the app, or have you not had a chance to try that because you can't really reproduce this?

What about adding a QTimer with a fairly long period, and a "heartbeat" message that you simply log, to help the next time this occurs? At least that would prove to you that the event loop is functional, and that some parts of your code are active and responding, since that would eliminate many possible explanations.

Also, consider looking into "pidin". You can type "use pidin" to learn more, or read the docs about it http://developer.blackberry.com/native/reference/bb10/com.qnx.doc.neutrino.utilities/topic/p/pidin.h...

Using that, with appropriate options (and there are many) you can probably check the state of each thread when it's experiencing this problem, as well as many other possibly useful things.

Of course, you have to reproduce it again first, but I assume you have seen it more than once at this point...

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Strange issue makes app unresponsive, except for back button menus

Hi, not going to help you much, sorry, but whenever I've seen this happening it's usually because of some kind of memory corruption or the app getting stuck in a loop trying to free up resources on shutdown.

 

On going through the process of wiping out all memory leaks in order to pass B4BB this behaviour subsequently went away.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Strange issue makes app unresponsive, except for back button menus

pidin sounds interesting, i will surely use that if i can get into that state again.

regarding memory management: i think i have cleared up everything, but you never can be sure. i should have asked somebody at the bbjam how you can trace memory leaks, but so far i don't know how to use special tools for that.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Strange issue makes app unresponsive, except for back button menus

I know what you mean some of the cascades componants took me by surprise for when to delete, deleteLater, leave alone etc.

 

I just used the momentic qnx memory analysis tool which worked well for me, mind you I haven't passed that section on B4BB yet. :smileyhappy:


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Strange issue makes app unresponsive, except for back button menus

we have found something with pidin!
there was a worker thread that was just "fire and forget", and it seems whoever implemented it (like, for example, me...) forget to emit the finished() signal as well.

now i know about QtConcurrent:run and would have used that.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
hendrik
Posts: 63
Registered: ‎09-10-2009
My Device: Z10, Bold 9700
My Carrier: O2 Germany

Re: Strange issue makes app unresponsive, except for back button menus


peter9477 wrote:
Also, consider looking into "pidin". You can type "use pidin" to learn more, or read the docs about it http://developer.blackberry.com/native/reference/bb10/com.qnx.doc.neutrino.utilities/topic/p/pidin.h...

Using that, with appropriate options (and there are many) you can probably check the state of each thread when it's experiencing this problem, as well as many other possibly useful things.

Thanks, pidin looks like a very promising tool. We haven't looked at each individual thread yet, but noticed yesterday that the number of running threads increased over time... not good. :smileywink:

We have fixed this already, it could have been the root of the problem.

----

My Twitter: @hendrik_dev
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Strange issue makes app unresponsive, except for back button menus

further analysis: clearing the qthread did not help.

currently we suspect the WebView. We use one to display attachments and very long log entries (like an xml trace).
Currently it is a qml member and we set the url property and change its visible property to true.

pidin threads seems to indicate that the webview is not removed when we close the page it is in.

i am currently looking to get more information out of pidin as i am not familiar with it, it seems that the main application thread is locked in CONDVAR state.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
ansarint
Posts: 39
Registered: ‎02-22-2013
My Device: blacberry torch 2012

Re: Strange issue makes app unresponsive, except for back button menus

Thanks>>>>>:smileyhappy:

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Strange issue makes app unresponsive, except for back button menus

It seems we have found the issue.
I had some debug output in the destructor of an object that listed its children in a loop.
I am not sure how it works internally, but my guess would be that the children were killed by the destructor why the iteration was accessing them.
What is still strange is that there was no segfault or any other visible sign that something went wrong, only that the app became unresponsive with the exception of the parts that were handled by the framework, like back-button and applicationmenu.

we will monitor this, but currently i feel positive to have found it so that we can finally submit an update in bbworld.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter