Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qFormatLogMessage and backtrace on win32 / msvc2013
QtWS25 Last Chance

qFormatLogMessage and backtrace on win32 / msvc2013

Scheduled Pinned Locked Moved Unsolved General and Desktop
win32msvc2013backtraceloggingqt5.5.1
2 Posts 2 Posters 1.7k Views
  • 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 Offline
    B Offline
    BenV666
    wrote on 16 Dec 2015, 10:01 last edited by
    #1

    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
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Dec 2015, 23:24 last edited by
      #2

      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
      0

      2/2

      16 Dec 2015, 23:24

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved