View Issue Details

IDProjectCategoryView StatusLast Update
0001833Far ManagerFindFilespublic2011-08-25 08:07
ReporterMaximus Assigned ToDrKnS  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.0 
Fixed in Version3.0 
Summary0001833: Поиск файлов - не ThreadSafe
DescriptionВо время выполнения в фоновом потоке
> Far.exe!ArchiveSearch(void * hDlg, const wchar_t * ArcName) Line 2425 C++
     Far.exe!DoScanTree(void * hDlg, UnicodeString & strRoot) Line 2635 + 0x15 bytes C++
     Far.exe!DoPrepareFileList(void * hDlg) Line 2830 + 0xd bytes C++
     Far.exe!ThreadRoutine(void * Param) Line 2887 + 0x33 bytes C++

в главном потоке продолжает крутиться ProcessMainLoop
> Far.exe!console::ReadInput(_INPUT_RECORD * Buffer, unsigned long Length, unsigned long & NumberOfEventsRead) Line 274 + 0x1d bytes C++
     Far.exe!GetInputRecord(_INPUT_RECORD * rec, bool ExcludeMacro, bool ProcessMouse, bool AllowSynchro) Line 1137 + 0x14 bytes C++
     Far.exe!Manager::ProcessMainLoop() Line 702 + 0x12 bytes C++
     Far.exe!Manager::ExecuteModal(Frame * Executed) Line 338 C++
     Far.exe!Dialog::Process() Line 4317 C++
     Far.exe!FindFilesProcess(Vars & v) Line 3012 C++
     Far.exe!FindFiles::FindFiles() Line 3425 + 0x9 bytes C++
     Far.exe!FilePanels::ProcessKey(int Key) Line 672 C++

что приводит к печальным последствиям...
TagsNo tags attached.
Build2167

Activities

Maximus

2011-07-21 21:22

reporter  

FindFile.110721.diff (1,121 bytes)   
Index: findfile.cpp
===================================================================
--- findfile.cpp	(revision 6465)
+++ findfile.cpp	(working copy)
@@ -1538,6 +1538,7 @@
 
 INT_PTR WINAPI FindDlgProc(HANDLE hDlg, int Msg, int Param1, void* Param2)
 {
+	CriticalSectionLock Lock(PluginCS);
 	Vars* v = reinterpret_cast<Vars*>(SendDlgMessage(hDlg, DM_GETDLGDATA, 0, 0));
 	Dialog* Dlg=static_cast<Dialog*>(hDlg);
 	VMenu *ListBox=Dlg->GetAllItem()[FD_LISTBOX]->ListPtr;
@@ -2422,12 +2423,17 @@
 	int SavePluginsOutput=DisablePluginsOutput;
 	DisablePluginsOutput=TRUE;
 	string strArcName = ArcName;
-	HANDLE hArc=CtrlObject->Plugins.OpenFilePlugin(strArcName, OPM_FIND, OFP_SEARCH);
+	HANDLE hArc;
+	{
+		CriticalSectionLock Lock(PluginCS);
+		hArc = CtrlObject->Plugins.OpenFilePlugin(strArcName, OPM_FIND, OFP_SEARCH);
+	}
 	DisablePluginsOutput=SavePluginsOutput;
 
 	if (hArc==(HANDLE)-2)
 	{
-		StopEvent.Set();
+		// �� ������������ �����, ���� ���������� �������� �� ��������� ������ ���
+		//StopEvent.Set();
 		_ALGO(SysLog(L"return: hArc==(HANDLE)-2"));
 		return;
 	}
FindFile.110721.diff (1,121 bytes)   

Maximus

2011-07-21 21:23

reporter   bugnote:0007292

Ну, хотя бы так

Issue History

Date Modified Username Field Change
2011-07-11 14:41 Maximus New Issue
2011-07-21 21:22 Maximus File Added: FindFile.110721.diff
2011-07-21 21:23 Maximus Note Added: 0007292
2011-08-25 08:07 DrKnS Build => 2167
2011-08-25 08:07 DrKnS Status new => closed
2011-08-25 08:07 DrKnS Assigned To => DrKnS
2011-08-25 08:07 DrKnS Resolution open => fixed
2011-08-25 08:07 DrKnS Fixed in Version => 3.0