Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Console app gets segfault running in qt creator. But, it works fine running from terminal.
I have a Qt console application that has been running fine for serveral months. Recently, I've added some new classes and processing. Now, when I run the code with the run or debug buttons in Qt, I get a segfault error. If I run it from the command line directly, it runs fine.
I've traced it down to a call to a third-party sdk. If I take that call out, it runs fine in both the terminal and in Qt.
Any suggestions what I can look at to try to understand why it crashes running in Qt creator but not in a terminal window?
What does the crash stack trace tell you ?
The application window has the following:
IPSdevice: kApi/Utils/kUtils.cpp:963: kStatus xkDefaultAssert(const kChar*, k32u): Assertion `0' failed.
16:28:02: The program has unexpectedly finished.
16:28:02: The process was ended forcefully.
16:28:02: /home/inplant/scannerRD/builds/debug/InPlantScanner/IPSdevice/IPSdevice crashed.
I'm not sure how to get more stack trace than that in Qt Creator when running interactively.
Note: kApi is a third-party library. And it works fine if I run the application in a terminal window.
Are you also running a debug build from the command line ?
@SGaist Yes. I run the exact same binary on the command line as in Qt creator.
Did you modify your PATH environment variable at some point ?
@SGaist I found a call into the sdk on which the error was happening. I re-wrote that section and it seems to be working. I'm not sure what it was, but I have been able to resolve it. Thank you!
alexltz last edited by
@dwilliams Hi, i have the same problem, how did you re-write it to solve the problem?