Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72478

Documentation for qInstallMessageHandler is missing nullptr check

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P5: Not important
    • 5.12.1, 5.12.2
    • 5.10.1, 5.11
    • Documentation
    • None
    • Linux/X11
    • 3e4f8aa8f434d791b3dfe9450bad85b82406d4b3 (qt/qtbase/5.12)

    Description

      I do not know if this is a missing in the doc, or a problem in QProcess.

      In short if the QProcess is destroyed BEFORE the end of the process the QMessageLogContext is populated with NULLPTR for file and function

       

      context @0x55593eaf7ba8 QMessageLogContext &
      category "default" char*
      file 0x0 char*
      function 0x0 char*
      line 0 int
      version 2 int

       

      And this will trigger an error when calling the fprintf function.
      I fixed adding a

       

      auto file = context.file;
      if (context.file == nullptr) {
       file = "NO FILE FOUND";
      }
       
      

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            RoyBellingan Roy Bellingan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes