can anybody suggest the way to find hang and Crash issue in auto start based qt application ?
-
@Qt-embedded-developer said in can anybody suggest the way to find hang and Crash issue in auto start based qt application ?:
@JoeCFD i have generated core dump file.
You mean as I suggested you do but you didn't respond to?
I don't know what command you are using to show the core dump file. A core dump file is a large binary file, usually named
core
. Once you have it you need to rungdb /path/to/your/executable /path/to/the/core/file
and then type into
gdb
commandbt
to see the backtrace.In order to generate a usable
core
file in a known place you must Google forcore dump
against whatever distro of Linux you are using. In the old days it just put acore
for you to use in the current directory, nowadays you potentially have to do all sorts of stuff to tell Linux you want it to save the file (e.g. seeulimit
and/proc/sys/kernel/core_pattern
orsysctl kernel.core_pattern
).@JonB Thanks now i got understand. i will try to generate core dump file and after that i will follow your steps.
i my log last line is :
could not parse float to string NA;
-
@JonB Thanks now i got understand. i will try to generate core dump file and after that i will follow your steps.
i my log last line is :
could not parse float to string NA;
@Qt-embedded-developer
So that looks the reason. You can look at the backtrace now from the core if you need to.could not parse float to string NA;
Is that your own message? I cannot imagine this is a "proper" message. One does not "parse" floats, one parses strings. Sounds like something about a float/string is not in the right format.
-
@Qt-embedded-developer
So that looks the reason. You can look at the backtrace now from the core if you need to.could not parse float to string NA;
Is that your own message? I cannot imagine this is a "proper" message. One does not "parse" floats, one parses strings. Sounds like something about a float/string is not in the right format.
@JonB i am getting the below output when check back trace
(gdb) bt #0 StatusController::slotPollingRequested (this=0x55fe909f49d0) at ../../appDir/appDirComponents/controllers/statuscontroller.cpp:516 #1 0x000055fe8fe92047 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, bool (StatusController::*)()>::call(bool (StatusController::*)(), StatusController*, void**) ( f=(bool (StatusController::*)(StatusController * const)) 0x55fe8fe72b7c <StatusController::slotPollingRequested()>, o=0x55fe909f49d0, arg=0x7ffc9a501b60) at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:152 #2 0x000055fe8fe91bb4 in QtPrivate::FunctionPointer<bool (StatusController::*)()>::call<QtPrivate::List<>, void>(bool (StatusController::*)(), StatusController*, void**) ( f=(bool (StatusController::*)(StatusController * const)) 0x55fe8fe72b7c <StatusController::slotPollingRequested()>, o=0x55fe909f49d0, arg=0x7ffc9a501b60) at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:185 #3 0x000055fe8fe9107c in QtPrivate::QSlotObject<bool (StatusController::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x55fe90a0c850, r=0x55fe909f49d0, a=0x7ffc9a501b60, ret=0x0) at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:418
-
@JonB i am getting the below output when check back trace
(gdb) bt #0 StatusController::slotPollingRequested (this=0x55fe909f49d0) at ../../appDir/appDirComponents/controllers/statuscontroller.cpp:516 #1 0x000055fe8fe92047 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, bool (StatusController::*)()>::call(bool (StatusController::*)(), StatusController*, void**) ( f=(bool (StatusController::*)(StatusController * const)) 0x55fe8fe72b7c <StatusController::slotPollingRequested()>, o=0x55fe909f49d0, arg=0x7ffc9a501b60) at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:152 #2 0x000055fe8fe91bb4 in QtPrivate::FunctionPointer<bool (StatusController::*)()>::call<QtPrivate::List<>, void>(bool (StatusController::*)(), StatusController*, void**) ( f=(bool (StatusController::*)(StatusController * const)) 0x55fe8fe72b7c <StatusController::slotPollingRequested()>, o=0x55fe909f49d0, arg=0x7ffc9a501b60) at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:185 #3 0x000055fe8fe9107c in QtPrivate::QSlotObject<bool (StatusController::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x55fe90a0c850, r=0x55fe909f49d0, a=0x7ffc9a501b60, ret=0x0) at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:418
@Qt-embedded-developer
And? It tells you the file and line number in your code where it crashes, so.... -
-
@Qt-embedded-developer
And? It tells you the file and line number in your code where it crashes, so....@JonB i have resolved this above problem. but still app crash.
and in this time bt shows nothing.
i have check memory using top command and at that time remaining free memory was quiet low
i.e. from 4000 mb, remaining free memory is 100 mb.
So is there another way to find this type of crash ?
-
@JonB i have resolved this above problem. but still app crash.
and in this time bt shows nothing.
i have check memory using top command and at that time remaining free memory was quiet low
i.e. from 4000 mb, remaining free memory is 100 mb.
So is there another way to find this type of crash ?
@Qt-embedded-developer said in can anybody suggest the way to find hang and Crash issue in auto start based qt application ?:
So is there another way to find this type of crash ?
If you suspect that you have a memory leak use Valgrind to analyse your app (QtCreator supports it).
-
@Qt-embedded-developer said in can anybody suggest the way to find hang and Crash issue in auto start based qt application ?:
So is there another way to find this type of crash ?
If you suspect that you have a memory leak use Valgrind to analyse your app (QtCreator supports it).
-
@Qt-embedded-developer
Then maybe you don't have any memory leak, maybe your code (or other stuff on machine) uses up a lot of memory without a "leak". But that does not mean it has to use that much memory, valgrind etc. can only tell you if you leak, not that (perhaps, perhaps not) your algorithm might be improved....In general, make sure you free objects as soon as you don't need them again. Just as an example: suppose you create some large images in memory. So long as valgrind does not detect you have "lost" the pointer to it, so you will still be able to free it later, it can't complain. But if you keep them all in memory at the same time you will be using a lot of room....
-
@Qt-embedded-developer
Then maybe you don't have any memory leak, maybe your code (or other stuff on machine) uses up a lot of memory without a "leak". But that does not mean it has to use that much memory, valgrind etc. can only tell you if you leak, not that (perhaps, perhaps not) your algorithm might be improved....In general, make sure you free objects as soon as you don't need them again. Just as an example: suppose you create some large images in memory. So long as valgrind does not detect you have "lost" the pointer to it, so you will still be able to free it later, it can't complain. But if you keep them all in memory at the same time you will be using a lot of room....
@JonB may be yes because i also seen that memory is usually increase slowly with time on particular 2 screen
1] screen that update 42 parameters every 1 second using qAbstractlist model
2] screen that show live data on graph screen . where at a time in one thread 4 data get shown on graph screen.
-
@JonB may be yes because i also seen that memory is usually increase slowly with time on particular 2 screen
1] screen that update 42 parameters every 1 second using qAbstractlist model
2] screen that show live data on graph screen . where at a time in one thread 4 data get shown on graph screen.
@Qt-embedded-developer
I appended an extra paragraph to my previous before I saw your reply.Neither of what you mention is something we can tell you about. Qt in itself will not "leak" nor "hang onto things" which you have freed. Your own code and whether it behaves "best" is a different matter....
4 data get shown on graph screen
Whatever this means, for example if you plot enough points (millions? billions?) without removing some you will eventually keep using more and more memory....
-
@Qt-embedded-developer
I appended an extra paragraph to my previous before I saw your reply.Neither of what you mention is something we can tell you about. Qt in itself will not "leak" nor "hang onto things" which you have freed. Your own code and whether it behaves "best" is a different matter....
4 data get shown on graph screen
Whatever this means, for example if you plot enough points (millions? billions?) without removing some you will eventually keep using more and more memory....
@JonB I have found that my code has issue due passing value using pointer.
so passing by value have resolved the Crash issue.
Now my error list is not passed by pointer its passed directly.
This issue identified by GDB. As well as valgrind tool also helps.