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
ekke
Posts: 1,563
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone
Accepted Solution

added PIM and now app exits slow

I added PIM (Notebooks) to one of my apps

now closing the app took around 6 seconds

(time from closing the minimized app until the app-Icon isn't dimmed anymore)

 

any idea what could cause this ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: added PIM and now app exits slow

Check your logs/log file for a segfault, and check the logs/ folder for a .core file. It takes around that long for it to write a core file and during that time the icon is dimmed.

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
ekke
Posts: 1,563
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: added PIM and now app exits slow


peter9477 wrote:
Check your logs/log file for a segfault, and check the logs/ folder for a .core file. It takes around that long for it to write a core file and during that time the icon is dimmed.
thx Peter
the logfile contains only these 2 lines:
slogger2 buffer handle not initialized. ../../lgmon_api.c, logEvent(), around line 578!
free malloc object that is not allocated:../../dlist.c:1096

 don't know what the 2nd line means

and yes: there's a .core file

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: added PIM and now app exits slow

The first is ignorable (reported elsewhere, spurious) and the second is probably the Very Bad Thing which is making it core-dump. You should get a new .core file each time this happens (not sure when they get removed) so you can verify it's a real crash and not a leftover from earlier. (The log file is definitely not leftover, as it gets cleared at each new run.)

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
ekke
Posts: 1,563
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: added PIM and now app exits slow


peter9477 wrote:
The first is ignorable (reported elsewhere, spurious)

I know about this and ignore normaly


peter9477 wrote:
 the second is probably the Very Bad Thing which is making it core-dump. You should get a new .core file each time this happens (not sure when they get removed) so you can verify it's a real crash and not a leftover from earlier. (The log file is definitely not leftover, as it gets cleared at each new run.)

yes - happens every time

at the very end of my application

these are the very last lines of my app:

void ApplicationUI::onManualExit() {
	AbstractPane *root = Application::instance()->scene();
	root->setProperty("exit", true);
	qDebug() << "this is the end my friend";
	Application::instance()->exit();
}

it's a manual exit where I clear effects and notification from Hub

this worked fine before I added pim notebook permission and lib

here are the logs from slog2info:

default   9000  this is the end my friend
0  -----ONLINE-----
webkit*     0  All WebKit threads for this process have been shut down.
default      0  QNXApplicationEngineImpl::Destroying cover window
default      0  QNXPpsSubscriptionServer::PPS Thread: FINISHED
default      0  QNXApplicationEngineImpl::Server Thread: FINISHED
default      0  QNXApplicationEngineImpl::run(EXIT)
default   9000  BpsEventManagerDependReal::setEventFilter - thread has no event dispatcher 

 so I know, that it happens directly in exit()

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
ekke
Posts: 1,563
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: added PIM and now app exits slow

same failure with auto-exit

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: added PIM and now app exits slow

It occurs to me that whatever activity you might be triggering with setting the exit property to true, it may need a bit of time to execute. Is any of it asynchronous in nature? If so, instantly calling exit() right after that might mean it's not letting that execute fully, and maybe that triggers a problem.

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
ekke
Posts: 1,563
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: added PIM and now app exits slow


peter9477 wrote:
It occurs to me that whatever activity you might be triggering with setting the exit property to true, it may need a bit of time to execute. Is any of it asynchronous in nature? If so, instantly calling exit() right after that might mean it's not letting that execute fully, and maybe that triggers a problem.

I removed that code and did a normal auto exit without calling this

same happens

really curious

 

BTW: the code at manual exit was:

xxx.clearEffectsForAll()
xxx.deleteAllFromInbox()

where xxx was an instance of Notification

I'm calling this to clear all from the Hub if the app was closed without reacting on notifications

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: added PIM and now app exits slow

Try an experiment then. Add a singleShot QTimer with a one second (or 3, or whatever) delay, and start that timer instead of calling Application.exit() where you do. Then in the timeout handler for the QTimer, do the actual exit.

If the problem goes away, you know it's a race condition of some sort. If it doesn't, you know the damage is from something else and will have to start working backwards somehow, to a state where it didn't fail before.

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
ekke
Posts: 1,563
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: added PIM and now app exits slow

same happens:

 

removes notifications from hub

then waits the 3000 ms

calls the slot

and at exit() fails

 

from log next what happens is

:Destroying cover window

 perhpas something with the cover

 

thx Peter for all your tips - have to find out what causes this

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner