Uploaded image for project: 'Snowstorm'
  1. Snowstorm
  2. STORM-330

Viewer crash in llassert(mCurrentDiscardLevel >= 0) when changing draw distance

    XMLWordPrintableJSON

Details

    • Defect
    • Status: Closed
    • Severe
    • Resolution: Incomplete
    • None
    • Sprint 6, Viewer 2.3.0
    • None
    • Windows XP
    • Resolution Verified

    Description

      Repro:

      • Launch viewer and log in
      • Move to your avatar to a place on the edge of the region where you get a good view of the nearby region
      • Open the Pref panel, go to the Graphic tab, click Advanced, increase the Draw Distance (from 64 to 128 for instance)
      • Click OK
        -> the view crash while redrawing the nearby stuff that are now coming into view
        Expected: no crash...

      Reason: the code reaches llassert(mCurrentDiscardLevel >= 0) and crashes, the invalid texture should be tested upstream and handled adequately I think.

      Issue: When changing the draw distance, LLViewerWindow::restartDisplay() is called which, eventually, calls restoreGL() which iterates on all textures. Here's the code:

      void LLImageGL::restoreGL()
      {
      for (std::set<LLImageGL*>::iterator iter = sImageList.begin();
      iter != sImageList.end(); iter++)
      {
      LLImageGL* glimage = *iter;
      if(glimage->getTexName())

      { llerrs << "tex name is not 0." << llendl ; }

      if (glimage->mSaveData.notNull())
      {
      if (glimage->getComponents() && glimage->mSaveData->getComponents())

      { glimage->createGLTexture(glimage->mCurrentDiscardLevel, glimage->mSaveData, 0, TRUE, glimage->getCategory()); stop_glerror(); }

      glimage->mSaveData = NULL; // deletes data
      }
      }
      }

      The problem is that some of the textures are not valid and have an mCurrentDiscardLevel == -1. When createGLTexture() is called on the first of those textures, this leads to the assert and, as expected, crashes the app.

      Attachments

        Activity

          People

            merov.linden Merov Linden
            merov.linden Merov Linden
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 2 hours Remaining Estimate - 2 hours
                2h
                Logged:
                Time Spent - 2 hours Remaining Estimate - 2 hours
                2h