Unsolved Process killed by signal
-
Hello Hilk,
following are answers to your questions
Q) Why such an old qt-version? Are you limited to that or could you upgrade ?
Ans) I am using this version of qt because in my embedded hardware I have pre-installed library for qt5.7.1 and it has all components I needed to develop my application.
Q) is it constantly 10 minutes ? Or can it differ vastly ?
Ans) It is crashing after 10 minutes (+- 2 minutes).
Q) What do you use to develop, QtCreator?
Ans ) Yes I use Qt creator 4.4.1and many thanks for your time
-
@saurabh162
alright,if it's predictably crashing after a certain amount of time, it could be memory leak issue, or some object that gets destroyed and you try to still access it.
Without a proper debug and code shown it's near impossible to say.
Since you're using QtCreator.
Use that to debug your application.
Set your project to debug build and run it. Its the play button with the "bug" on it.
Let it run until it crashes and than you should be able to see exactly where the issue isYou can post the stack trace and/or screenshots if you're having problem at that stage, I'm sure someone can and will help ;-).
-
Hello Hilk,
Thank you and I will do it and will update you :)
-
Hello Hilk,
I am testing my application from last 5-6 days but could not able to generate crash again.
One thing I have changed in my code, is ensuring that I handle all bytes generated by Hardware on serial port.
Previously I was missing handling some bytes received by Beaglebone black (BBB) from Hardware. May be above change has solved QT application crash problem. But I am not sure.
But many thanks for your help.
Regards
Saurabh -
hi @saurabh162
if it now doesn't crash, now that you're using a Debug build, make sure you initialize all pointers (with null ptr) and all your variables.That's 99% of the time why a program crashes in release, but does not in debug mode.
-
Hello Hilk,
Thank you, yes I will take care of it.
-
Hello @J-Hilk,
One more question I am sending and receiving data using serial port both from Qt main application and Qt timer slot (triggered at interval of 1 second).
Whether this can also cause crash in application. May be when I try to access Serial port buffer both in Main application and slot of Qt Timer at same time.
Please note: Both my Main application and timer slot is running in same thread.
thank you ..:)
-
@saurabh162 said in Process killed by signal:
Hello @J-Hilk,
One more question I am sending and receiving data using serial port both from Qt main application and Qt timer slot (triggered at interval of 1 second).
Whether this can also cause crash in application. May be when I try to access Serial port buffer both in Main application and slot of Qt Timer at same time.
Please note: Both my Main application and timer slot is running in same thread.
Hi,
as long as you don't manually spin the event loop, you're fine. The main application and the timer run in the same thread. That means the Slot evoked by the timer will be executed once the event loop returns, so all functions in your application should have returned as well.
IF you don't manually spin the event loop somewhere. -
Hello @J-Hilk
Q) Can you please explain me what do you mean by manually spinning the event loop ?
Whether it means exiting from event loop, for example by calling exit() member function ?Thank you ..!!
-
@saurabh162 I rather not :P it's bad design to do it, and way to many people do it.
But, there are 2 common ways to do it in Qt, I'm going to list them, so you may not use them, if possible.
a) Calling QCoreApplication::processEvents() and b) creating a new QEventLoop and calling start() on it.If you're doing neither, then should be fine.