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. Debug Error,qstringview.h Line:179,ASSERT:"len>=0" in file
Forum Updated to NodeBB v4.3 + New Features

Debug Error,qstringview.h Line:179,ASSERT:"len>=0" in file

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 640 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.
  • F Offline
    F Offline
    fredmarks
    wrote on last edited by
    #1

    My .exe sometime take this Debug Error and stop running. No everytime.How to solve it?
    debugerror.png

    JonBJ 1 Reply Last reply
    0
    • F fredmarks

      My .exe sometime take this Debug Error and stop running. No everytime.How to solve it?
      debugerror.png

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @fredmarks
      Your code is doing something wrong with a string. If this happens on a development machine with VS installed, do as it says at the end, click Retry, it should take you into debugger at the fault, look in the stack view pane to see where in your code it was called from.

      Otherwise you can try/hope it goes wrong when you repeatedly run it under debugger.

      There is no "magic wand" for errors which are "No everytime". It might stem from an uninitialized variable which shows up in different ways, or in certain circumstances.

      If I had to guess the ASSERT comes from the line at https://codebrowser.dev/qt5/qtbase/src/corelib/text/qstringview.h.html#175

          Q_DECL_CONSTEXPR QStringView(const Char *str, qsizetype len)
              : m_size((Q_ASSERT(len >= 0), Q_ASSERT(str || !len), len)),
      

      A QStringView is being created from a const Char * where the passed-in len is negative. Qt may be calling this indirectly from other code, but if you do create QStringViews look at that.

      1 Reply Last reply
      1

      • Login

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