diff options
| author | obscurestar <none@none> | 2014-01-26 02:56:23 -0800 | 
|---|---|---|
| committer | obscurestar <none@none> | 2014-01-26 02:56:23 -0800 | 
| commit | 262f8b84737587fd5c2de38c34ff7a5594cca174 (patch) | |
| tree | f29dde4cf5ad996bcacb0b16b5852bba02704daa | |
| parent | 33b0ae6ebf8a085a8795a9e5b02455fb7ebf0e6f (diff) | |
Was not using correct name for results of file search.
| -rwxr-xr-x | indra/llcommon/llapp.cpp | 21 | ||||
| -rwxr-xr-x | indra/llcrashlogger/llcrashlogger.cpp | 10 | ||||
| -rwxr-xr-x | indra/newview/llappviewer.cpp | 11 | ||||
| -rw-r--r-- | indra/win_crash_logger/llcrashloggerwindows.cpp | 18 | ||||
| -rw-r--r-- | indra/win_crash_logger/llcrashloggerwindows.h | 4 | 
5 files changed, 34 insertions, 30 deletions
| diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 7ef4e7fb92..2c5da5d2a7 100755 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -900,21 +900,26 @@ bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_  	// heap allocations in a crash handler.  	// path format: <dump_dir>/<minidump_id>.dmp -	int dirPathLength = strlen(minidump_desc.path()); +	 +	//HACK:  *path points to the buffer in getMiniDumpFilename which has already allocated space +	//to avoid doing allocation during crash. +	char * path = LLApp::instance()->getMiniDumpFilename(); +	int dir_path_len = strlen(path);  	// The path must not be truncated. -	llassert((dirPathLength + 5) <= LLApp::MAX_MINDUMP_PATH_LENGTH); +	S32 remaining =  LLApp::MAX_MINDUMP_PATH_LENGTH - dir_path_len; + +	llassert( (remaining - strlen(minidump_desc.path())) > 5); -	char * path = LLApp::instance()->getMiniDumpFilename(); -	S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH; -	strncpy(path, minidump_desc.path(), remaining); -	remaining -= dirPathLength; -	path += dirPathLength; -	if (remaining > 0 && dirPathLength > 0 && path[-1] != '/') +	path += dir_path_len; + +	if (dir_path_len > 0 && path[-1] != '/')  	{  		*path++ = '/';  		--remaining;  	} + +	strncpy(path, minidump_desc.path(), remaining);  	llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl;  	LLApp::runErrorHandler(); diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 073685caff..bd34caf241 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -312,7 +312,7 @@ void LLCrashLogger::gatherFiles()          vec file_vec = gDirUtilp->getFilesInDir(pathname);          for(vec::const_iterator iter=file_vec.begin(); iter!=file_vec.end(); ++iter)          { -            if ( ( iter->length() > 30 ) && (iter->rfind(".log") != (iter->length()-4) ) ) +            if ( ( iter->length() > 30 ) && (iter->rfind(".dmp") == (iter->length()-4) ) )              {                  std::string fullname = pathname + *iter;                  std::ifstream fdat( fullname.c_str(), std::ifstream::binary); @@ -320,12 +320,16 @@ void LLCrashLogger::gatherFiles()                  {                      char buf[5];                      fdat.read(buf,4); -                    fdat.close(); +                    fdat.close();                        if (!strncmp(buf,"MDMP",4))                      {                          minidump_path = *iter; -                        has_minidump = readMinidump(minidump_path); +                        has_minidump = readMinidump(fullname);  						mDebugLog["MinidumpPath"] = fullname; +						if (has_minidump)  +						{ +							break; +						}                      }                  }              } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5c0368df19..537142ebde 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3376,7 +3376,7 @@ void getFileList()  	for(vec::const_iterator iter=file_vec.begin(); iter!=file_vec.end(); ++iter)  	{  		filenames << *iter << " "; -		if ( ( iter->length() > 30 ) && (iter->rfind(".log") != (iter->length()-4) ) ) +		if ( ( iter->length() > 30 ) && (iter->rfind(".dmp") == (iter->length()-4) ) )  		{  			std::string fullname = pathname + *iter;  			std::ifstream fdat( fullname.c_str(), std::ifstream::binary); @@ -3388,6 +3388,7 @@ void getFileList()  				if (!strncmp(buf,"MDMP",4))  				{  					gDebugInfo["Dynamic"]["MinidumpPath"] = fullname; +					break;  				}  			}  		} @@ -3504,15 +3505,21 @@ void LLAppViewer::handleViewerCrash()  		LL_WARNS("MarkerFile") << "No gDirUtilp with which to create error marker file name" << LL_ENDL;  	}		 +#ifdef LL_WINDOWS //SPATTERS Wild guess that filename for Breakpad is not being returned due to sleep cycle in Crash Reporter. +	Sleep(2000); +#endif   	char *minidump_file = pApp->getMiniDumpFilename();  	if(minidump_file && minidump_file[0] != 0)  	{  		gDebugInfo["Dynamic"]["MinidumpPath"] = minidump_file; +		//SPATTERS another possibility is that when using OOP it must be initiated by a wrapping program so that when the +		//viewer crashes, we are from a sibling thread than as a child.   Might be able to request minidump at this point +		//as a work-around.  	}  #ifdef LL_WINDOWS -	else +	else  //SPATTERS there is no else here in the older code  	{  		getFileList();  	} diff --git a/indra/win_crash_logger/llcrashloggerwindows.cpp b/indra/win_crash_logger/llcrashloggerwindows.cpp index 30c9cf551b..cd9b351fdb 100644 --- a/indra/win_crash_logger/llcrashloggerwindows.cpp +++ b/indra/win_crash_logger/llcrashloggerwindows.cpp @@ -333,13 +333,11 @@ void LLCrashLoggerWindows::OnClientExited(void* context,  	sInstance->mClientsConnected--;  } -/* +  void LLCrashLoggerWindows::OnClientDumpRequest(void* context,  	const google_breakpad::ClientInfo* client_info,  	const std::wstring* file_path)   { -	ProcessingLock lock; -  	if (!file_path)   	{  		llwarns << "dump with no file path" << llendl; @@ -359,18 +357,8 @@ void LLCrashLoggerWindows::OnClientDumpRequest(void* context,  	}  	DWORD pid = client_info->pid(); - - -// Send the crash dump using a worker thread. This operation has retry -// logic in case there is no internet connection at the time. -DumpJobInfo* dump_job = new DumpJobInfo(pid, self, map, -dump_location.value()); -if (!::QueueUserWorkItem(&CrashService::AsyncSendDump, -dump_job, WT_EXECUTELONGFUNCTION)) { -LOG(ERROR) << "could not queue job";  } -} -*/ +  bool LLCrashLoggerWindows::initCrashServer()  { @@ -397,7 +385,7 @@ bool LLCrashLoggerWindows::initCrashServer()  	mCrashHandler = new CrashGenerationServer( wpipe_name,  		NULL,    		&LLCrashLoggerWindows::OnClientConnected, this, -		NULL, NULL,	// 	&LLCrashLoggerWindows::OnClientDumpRequest, this, +		/*NULL, NULL,    */ &LLCrashLoggerWindows::OnClientDumpRequest, this,   		&LLCrashLoggerWindows::OnClientExited, this,   		NULL, NULL,   		true, &wdump_path); diff --git a/indra/win_crash_logger/llcrashloggerwindows.h b/indra/win_crash_logger/llcrashloggerwindows.h index 85cafd54c8..1812e2737e 100644 --- a/indra/win_crash_logger/llcrashloggerwindows.h +++ b/indra/win_crash_logger/llcrashloggerwindows.h @@ -68,10 +68,10 @@ private:  	static void OnClientConnected(void* context,   					const google_breakpad::ClientInfo* client_info); - 	/*static void OnClientDumpRequest( + 	static void OnClientDumpRequest(   					void* context,   					const google_breakpad::ClientInfo* client_info, - 					const std::wstring* file_path);*/ + 					const std::wstring* file_path);   	static void OnClientExited(void* context,  		 			const google_breakpad::ClientInfo* client_info); | 
