Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

A reproducible crash of CC

(1/5) > >>

Loaden:
Both under Linux or Windows, there is no way to find the cause.
Updated source code to the CB's HEAD, and then apply the patch.
Then opening any project CB will crash. :(

Loaden:
I think I find the reason: call TRACE in a sub thread is not allowed!
And this maybe the final reason of all the random crash!

Loaden:
I think we can't call: Manager::Get()->GetLogManager()->DebugLog(...) or Manager::Get()->GetLogManager()->Log(...) in any sub thread.
So, We need rewrite CC's Logger.
Any comments?

ollydbg:
Good catch loaden!!!

looking at the code in include\logmanager.h

It seems the DebugLog function internally call:


--- Code: ---void LogInternal(const wxString& msg, int i, Logger::level lv) { if ((i>=0) && (i<=(int)max_logs) && (slot[i].log!=&g_null_log)) slot[i].log->Append(msg, lv); };
--- End code ---

I can't find critical section or other resource locker there.

MortenMacFly:
Remember, the trace macro was actually only for debug purposes. I know, we mis-use it. :lol:

However, please don't mess with LogManager. That's not something to change. instead, we should always use events to report CC infos from threads to the plugin "main loop" itself. So instead of calling Log(...) directly, fire a custom event (implemented inside the CC plugin) and handle the call outside the thread.

Navigation

[0] Message Index

[#] Next page

Go to full version