- edited description
Segfault when logger enabled
Hi
I have a very strange behaviour when using QsLog. When the logger is disabled all is well, but once it is enabled I get a segfault on the line following the QsLog macro.
my code is here https://github.com/mistic100/UMWP-Autochanger/tree/master/src must be run with "--log" argument
here I get a segfault on line 56 of main.cpp
if I comment line 53 I get a segfault on line 282 on settings.cpp (the next QsLog call)
I'll try to make an SSCCE during the week, but if you have an idea :)
Comments (6)
-
reporter -
repo owner - changed status to open
Hi, I am taking a look now at the issue. Just to confirm: it looks like you're using the latest version with threading not activated.
-
repo owner I compiled a minimal version of your main.cpp with QsLog linked as a DLL but without including the project-specific and Windows files and it works for me, but I tried it on a different OS, and unfortunately I can't easily test on Windows this week.
An idea: Do you really need to link QsLog as a DLL? Are you trying to use QsLog across different binaries? e.g same logger instance from a DLL and an exe. If not, try including QsLog.pri directly in your pro and remove references like:
- DEFINES += QSLOG_IS_SHARED_LIBRARY_IMPORT
- LIBS += -L$$PWD/QsLog/build-QsLogShared
- LIBS += -lQsLog2
- QsLog/QsLogSharedLibrary.pro
from your pro files. Of course it should work even when linking it as DLL, but I'm trying to exclude dynamic linking as a reason.
-
reporter Yes it's the last version.
What is threading ? (your doc is very sparse)
So I tried what you suggested : not using QsLog as a DLL, and it's works ! Thank you
-
repo owner In case you have a large volume of logging, by using threading you can avoid that the UI freezes or lags. If your app runs fine without this option, you probably don't need it.
I am glad to hear it works, I will try in the mean time to reproduce the errors with the DLL configuration.
-
repo owner - changed status to invalid
Can't seem to reproduce this on Linux, Mac or Windows. Please reopen if you think it's still relevant.
- Log in to comment