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

Using QDateTime with QTimeZone specified asserts in debug build

    XMLWordPrintable

Details

    • Windows
    • 5d228beb52 (qt/qtbase/dev) 84ab463aa3 (qt/qtbase/6.3) 5d228beb52 (qt/tqtc-qtbase/dev) 84ab463aa3 (qt/tqtc-qtbase/6.3) 16e970aa81 (qt/tqtc-qtbase/5.15) 4db05007d7 (qt/qtbase/6.2.3) 4db05007d7 (qt/tqtc-qtbase/6.2.3) 44006dedde (qt/qtbase/6.2)

    Description

      When using QDateTime with QTimeZone specified, there is an assertion in debug build:

      ASSERT: "d->ref.loadRelaxed() == 1" in file \Users\qt\work\qt\qtbase\src\corelib\time\qdatetime.cpp, line 3158
      

      This started happening somewhere between Qt 5.15 and 6.0. Does not reproduce with 5.15.8 but reproduces with Qt 6.0.4 (and 6.2.2).

      Can be reproduced with running the attached sample.

      QDateTime first(QDate(2014, 3, 30), QTime(0, 0, 0), QTimeZone("Europe/Helsinki"));
      QDateTime second = first.addDays(1);
      

      Release mode works ok.

      Stack trace:

      1  qt_message_fatal            qlogging.cpp         1869 0x7ff8f6e0e732 
      2  QMessageLogger::fatal       qlogging.cpp         891  0x7ff8f6e0cb26 
      3  qt_assert                   qglobal.cpp          3291 0x7ff8f6df8d8d 
      4  QDateTime::Data::operator-> qdatetime.cpp        3251 0x7ff8f7242dc7 
      5  massageAdjustedDateTime     qdatetime.cpp        4241 0x7ff8f723cf85 
      6  QDateTime::addDays          qdatetime.cpp        4273 0x7ff8f72334d0 
      7  main                        main.cpp             8    0x7ff7249e16b1 
      8  WinMain                     qtentrypoint_win.cpp 97   0x7ff7249e3e50 
      9  invoke_main                 exe_common.inl       107  0x7ff7249e1b22 
      10 __scrt_common_main_seh      exe_common.inl       288  0x7ff7249e19ce 
      11 __scrt_common_main          exe_common.inl       331  0x7ff7249e188e 
      12 WinMainCRTStartup           exe_winmain.cpp      17   0x7ff7249e1bbe 
      13 BaseThreadInitThunk         KERNEL32                  0x7ff974567034 
      14 RtlUserThreadStart          ntdll                     0x7ff9762c2651 
      

      Attachments

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

        Activity

          People

            Eddy Edward Welbourne
            jussi_witick Jussi Witick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes