Solved Segmentation fault while open a text file
-
@HenrikSt.
@HenrikSt. said in Segmentation fault while open a text file:
From where did you install? C: Standard path
I meant from standard online installer or from some obscure place?
Or even a self-compiled version?Tools is the compiler tool chain.
Is it MinGW or a MSVS version? -
Online installer from qt.io
MinGw
-
@HenrikSt.
I guess you are using Qt creator as IDE, right?
When you create a new Application, it will crash after compilation and linking?
Goto "Tools"->"Options"->"Build&Run", check there the different tabs look out for warnings or errors.
-
No, it is only crashing when I want to open a file into QTextEdit. I use the Application Example from Qt and my own written Application. Both crashes when I want to load a file :/
Yes, I am using Qt Creater IDE
Other applications are running well...
-
@HenrikSt.
And what is the exact Application example which is also crashing?
-
-
Any idea why it crashes while opening a file?
-
@HenrikSt.
I have just loaded the project file C:\Qt\Examples\Qt-5.7\widgets\mainwindows\application\application.pro
as it is already on my machine. Compiled with MinGW and linked with Qt 5.7.1, all standard as from installation through online installer.
I have a win 10 64 bit running.I did a compilation as debug and release. Both I can start from inside of creator with run command.
-
@HenrikSt. said in Segmentation fault while open a text file:
Any idea why it crashes while opening a file?
The release if I have simply opened one of the make files and it did not crash. It was loaded into application.
Is something wrong with the file you are trying to load?
You are starting the application directly from Qt creator? -
I don't think so because I saved the file with 'Application Example' and wanted to load that...
Yes, with Qt Creater.
In the error stands something like Dllnowunload
Is there a DLL missing?I am using Windows 10 Insider. Is that the problem maybe?
-
@HenrikSt. said in Segmentation fault while open a text file:
I am using Windows 10 Insider. Is that the problem maybe?
Perhaps.
I thought you may have started directly and dlls are missing. However, you started from creator. There should be all in place.
AFAIK the normal file dialog from windows is started from Qt. Therefore, the dialog looks always the same as with other application on your windows.
Perhaps there is a change of the interface causing the crash. However, I know idea if this is really the case, but it looks like. -
What is your idea?
-
@HenrikSt.
The only idea I have is trying with an official standard version of Windows 10.
I guess that MS has messed around with their dlls and something is broken for Qt and possibly other apps.As a last resort you may try to update Qt to latest 5.8.0 version. If you are lucky it may work there.
-
I already suggested to use the non-native dialog. Additionally your crash is probably related to you holding a
QObject
in aQSharedPointer
, get us the whole stack trace so we can investigate further. I advise against usingQSharedPointer
withQObject
s exactly for this very same reason - object lifetime is uncontrollable. -
He has the same effect with one of the Qt examples.
However, you are certainly right about non-native dialog.
-
@koahnig said in Segmentation fault while open a text file:
However, you are certainly right about non-native dialog.
Perhaps, but my prime culprit is the shared pointer (notice line 11 in the call stack from his screenshot).
-
So, have you an open file example with non native dialog?
-
@HenrikSt. said in Segmentation fault while open a text file:
So, have you an open file example with non native dialog?
Again, I ask you post the stack trace before digging into that. I don't think your segafault is related to the actual dialog at all, especially since you said you get it with a class from the examples. And I will raise the point again, do you use
QSharedPointer
and if yes how? -
I don't think so that I used that
-
I will reset my PC. I think that the error is there. After that I will inform you!