Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved qFormatLogMessage and backtrace on win32 / msvc2013

    General and Desktop
    win32 msvc2013 backtrace logging qt5.5.1
    2
    2
    1421
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      BenV666 last edited by

      Hej folks,

      I was just tinkering with my message handler and ran into something that I didn't expect. In my main.cpp I install my own message handler (which works fine) that also writes the log output to a file.
      When toying with various log format settings I figured "let's see what backtrace does", so I now have this:
      qSetMessagePattern(msgPrefix + msgType + "%{file}:%{function}:%{line} - %{message}%{if-warning}%{backtrace}%{endif}%{if-fatal}%{backtrace}%{endif}");

      However, now when I do a qWarning() << "Test!"; the whole program crashes with an exception due to a read access violation at 0x0 at the qFormatLogMessage() call.
      QT Bug, or did I mess something up? :)
      (if backtrace isn't supported on windows, that's fine, but then I'd expect empty output instead of a program crash)

      I'm running QT5.5.1 on windows 8.1 compiling with MSVC2013 in 32 bit mode.

      Regards,

      Wouter.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        Do you have by any change QT_FATAL_WARNINGS defined ?

        If not, can you try the same thing with the 5.6 beta ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post