News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Segmentation fault in nativeparser.cpp

Started by christobal, February 12, 2013, 08:53:19 AM

Previous topic - Next topic

ollydbg

Quote from: oBFusCATed on March 16, 2013, 04:43:59 PM
Quote from: ollydbg on March 16, 2013, 10:28:13 AM
Then, I guess compiler destroyed before cc, so crash happens.
Probably you can add an event which notifies all plugins that the unload process has started, so they can clean themselves and they can untangle some of the dependencies.
I'm not fully understand this idea.
Do you mean, if cc received a "unload start" event, it will not call some function of compiler plugin?
Can you be more specific?
Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Grad

Quote from: ollydbg on March 16, 2013, 10:28:13 AM
The crash happens like below steps(I guess):
1, app started
2, both cc and compiler plugin loaded correctly
3, user open a cbp project
4, cc start parsing (after some timer delay) and query compiler search path from compiler plugin(this internally call gcc command line)
5, user click the "close" button of the app

I had the same with older (slower) XP systems. The CC was using the log which wasn't there any more (at shutdown).
I have solved this with the appShutDown flag in OnRelease and use this same flag as argument in the ClearParsers.
In the deleteParser and RemoveProjectFromParser I use this flag to turn off the logging.

I had no problems since with shutting down.

(But the logging has nothing to do with compiler so that's strange).

ollydbg

Quote from: Grad on March 18, 2013, 02:25:47 PM
The CC was using the log which wasn't there any more (at shutdown).
I have solved this with the appShutDown flag in OnRelease and use this same flag as argument in the ClearParsers.
In the deleteParser and RemoveProjectFromParser I use this flag to turn off the logging.

I had no problems since with shutting down.

(But the logging has nothing to do with compiler so that's strange).
Can you show us the patches? Thanks.

@ALL:
About the logging in CC, why not use a wx standard log functions? It already supports messages from muti-threads.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.