Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2021-04-13 09:56:17



Reply to topic  [ 4 posts ] 
1.26.8.0/windows crash on logout 
Author Message

Joined: 2010-04-07 23:10:41
Posts: 14
Location: Moscow, Russia
Reply with quote
The new 1.26.8.0 viewer crashes on logout. Floating windows positions and sizes, inventory sort order, and maybe many other small settings are not saved. 1.26.6.20 works fine.

Code:
Cool VL Viewer 1.26.8 (0) Apr 20 2013 11:55:01 (Cool VL Viewer)
RestrainedLove viewer v2.08.03.29
Release Notes

You are at 263033.3, 231533.7, 61.7 in Soyeonpyeongdo located at sim10228.agni.lindenlab.com (216.82.49.150:13016)
Second Life RC BlueSteel 13.04.12.273874
Release Notes

CPU: AMD Phenom(tm) II X2 545 Processor (3008.46 MHz)
Memory: 3200 MB
OS Version: Microsoft Windows XP Service Pack 3 (Build 2600) compatibility mode. real ver: 6.0 (Build 2900)
Graphics Card Vendor: NVIDIA Corporation
Graphics Card: GeForce GT 220/PCIe/SSE2/3DNOW!
Windows Graphics Driver Version: 6.14.0013.1422
OpenGL Version: 3.3.0

libcurl Version: libcurl/7.21.1 OpenSSL/0.9.8q zlib/1.2.5 c-ares/1.7.1
J2C Decoder Version: KDU
Audio Driver Version: FMOD version 3.750000
Qt Webkit Version: 4.7.1 (version number hard-coded)
Packets Lost: 0/2637 (0.0%)

Built with MSVC version 1600

Compile flags used for this build:
-DNDEBUG -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 /O2 /Oi /arch:SSE2 /MD /MP /D_SECURE_SCL=0 /D_HAS_ITERATOR_DEBUGGING=0 /DWIN32 /D_WINDOWS /W3 /EHsc /GR /Oy- /GS /arch:SSE2 /fp:fast /TP /W2 /Zc:forScope /Zc:wchar_t- /c /nologo /DLL_WINDOWS=1 /DDOM_DYNAMIC /DUNICODE /D_UNICODE /DWINVER=0x0501 /D_WIN32_WINNT=0x0501 /DLL_USE_OLDFILESTREAMS=1 /DCARES_STATICLIB /DCARES_STATICLIB /DLIB_NDOF=1


I've attached both .dmp and .log files, now copying a few last lines of the log here.

Code:
2013-04-22T11:17:16Z INFO: viewer_windows_exception_handler: Entering Windows Exception Handler...
2013-04-22T11:17:30Z INFO: LLAppViewer::handleViewerCrash: Handle viewer crash entry.
2013-04-22T11:17:30Z INFO: LLMemory::logMemoryInfo: System memory information: Max physical memory: 2536052KB - Allocated physical memory: 202888KB - Available physical memory: 2536052KB - Allocated virtual memory: 194672KB
2013-04-22T11:17:30Z INFO: LLAppViewer::handleViewerCrash: Creating crash marker file C:\Documents and Settings\slobin\Application Data\SecondLife\logs\CoolVLViewer.error_marker
2013-04-22T11:17:30Z INFO: LLAppViewer::handleViewerCrash: Created marker file C:\Documents and Settings\slobin\Application Data\SecondLife\logs\CoolVLViewer.error_marker
2013-04-22T11:17:30Z INFO: LLAppViewer::handleViewerCrash: Handle viewer crash generating stats log.
2013-04-22T11:17:30Z INFO: LLAppViewer::writeDebugInfo: Opening debug file C:\Documents and Settings\slobin\Application Data\SecondLife\logs\debug_info.log


Retreating to 1.26.2.20 so far...


Attachments:
Cyril.Svoboda.log.zip [12.44 KiB]
Downloaded 87 times
Cyril.Svoboda.dmp.zip [18.91 KiB]
Downloaded 90 times
2013-04-22 11:36:11
Profile WWW

Joined: 2011-12-12 04:09:46
Posts: 82
Reply with quote
I was just going to report the same thing.


Attachments:
crash.zip [35.65 KiB]
Downloaded 82 times
2013-04-22 12:57:35
Profile

Joined: 2009-03-17 18:42:51
Posts: 4559
Reply with quote
Wow, that's no doubt a school case for programming classes... The crash doesn't occur under Linux, because gcc inlines the faulty code while VS2010 apparently doesn't... For the programmers among you, here is the fault (in indra/llcommon/llrefcount.h):

In the former releases, the code was:
Code:
class LL_COMMON_API LLRefCount
{
.../...
   inline S32 unref() const
   {
      llassert(mRef >= 1);
      if (--mRef == 0)
      {
         delete this;
         return 0;
      }
      return mRef;
   }
.../...
private:
   mutable S32   mRef;
}


Which I optimized in:
Code:
class LL_COMMON_API LLRefCount
{
.../...
   inline S32 unref() const
   {
      llassert(mRef >= 1);
      if (--mRef == 0)
      {
         delete this;
      }
      return mRef;
   }
.../...
private:
   mutable S32   mRef;
}


Problem is: mRef gets dereferenced when "delete this;" is executed, so "return mRef;" causes a crash since it points to a freed memory emplacement. The crash doesn't happen with gcc-compiled viewers because gcc inlines the whole class (and mRef is always valid). While "inline" is used, it is only an informative directive that the compiler can ignore, and VS2010 ignored it...

I replaced this faulty code with this one, for the next releases:
Code:
class LL_COMMON_API LLRefCount
{
.../...
   LL_FORCE_INLINE S32 unref() const
   {
      llassert(mRef >= 1);
      if (--mRef == 0)
      {
         delete this;
         // Don't "optimize out" the following line: mRef is dereferenced
         // after "delete this"...
         return 0;
      }
      return mRef;
   }
.../...
private:
   mutable S32   mRef;
}


LL_FORCE_INLINE is a custom macro that expands into a compiler-specific directive, forcing the said compiler to inline the code. Note that I kept "return 0", because depending how the memory for mRef is reserved by the compiler, it could be freed or not by "delete this;", even in an otherwise fully inlined class...

Anyway, I will publish new releases ASAP, because while this bug doesn't affect at all Linux builds, it does hit hard Windows ones, and can cause crashes all over the viewer code, in many different situations, and not only on logout.


2013-04-22 14:35:38
Profile WWW

Joined: 2012-02-09 21:01:50
Posts: 284
Reply with quote
Aha! Thanks for finding that. Deleting the 4 crash folders I collected since saturday. ;)


2013-04-22 17:52:56
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.