Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-32339

In my newly created project, using QBarSet yields strange behavior that is indicative of memory corruption

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 15.0.0
    • C/C++/Obj-C++ Support
    • None
    • Fedora 41 KDE spin
    • Linux/Wayland

      I will be attaching my entire project to this issue, so that you can better inspect it.

      Long story short: I made a new CMakeLists Qt Desktop project for myself in which I allocate a QBarSet object on the heap, I call the count method on it, I inject 3 double values into it and then I call the count method once again.

      Both calls give me an output of 0, when, normally, it should give me an output of 0 elements followed by 3 (since I previously injected 3 values into it).

      This indicates some level of memory corruption, from somewhere. Running Valgrind on the project also seems to indicate memory corruption, since it tells me that I'm doing an illegal read.

      The code seems legal and innocuous. There should be no undefined behavior (or at least none that I can find myself).

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

            Unassigned Unassigned
            meyou A A
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes