Author Topic: Crashing on editor  (Read 13238 times)

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Crashing on editor
« on: April 16, 2014, 01:17:13 pm »
The attached is my entire CB settings from the Roaming folder in AppData, as soon as I open a file from my project the entire application just hangs :(
The memory usage just keeps going up according to the process manager and I have no idea what is causing it any help restoring normal behavior would be appreciated
« Last Edit: April 16, 2014, 02:04:03 pm by awsdert »

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Crashing on editor
« Reply #1 on: April 16, 2014, 03:42:52 pm »
Gave up waiting, I deleted the folder and restarted my settings from scratch :(

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Crashing on editor
« Reply #2 on: April 16, 2014, 06:37:22 pm »
Waiting for what?

Just an idea: You can diff you two default.conf file and then you can get a clue what might cause it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Crashing on editor
« Reply #3 on: April 17, 2014, 02:44:47 pm »
Waiting for a reply, I've never actually tried using diff before, could you point me to a guide please?

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Crashing on editor
« Reply #4 on: April 17, 2014, 03:14:47 pm »
You can use Notepad++ for a visual compare. Just open the 2 files in question and push Alt+D.

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Crashing on editor
« Reply #5 on: April 17, 2014, 05:22:52 pm »
Is there a way to do all text files in a directory?

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Crashing on editor
« Reply #6 on: April 18, 2014, 12:09:24 am »
I don't think diff will be reasonable for 3 or more files. I mean diff relative to which file? Just comparing your previous and current 'default.conf' file might give you a clue.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Crashing on editor
« Reply #7 on: April 18, 2014, 12:58:52 am »
There are various tools you can use. It depends on the OS you're using. Search the internet you'll find plenty of information.
But you only need to compare the default.conf files.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Crashing on editor
« Reply #8 on: April 18, 2014, 07:38:23 am »
Oh ok, never really played with those files before so I didn't realise it was just 1 main file.
I'll check it out tomorrow in the evening, I have stuff going on up until then.

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Crashing on editor
« Reply #9 on: April 20, 2014, 09:37:05 am »
Okay did a bit of file renaming to keep files in the same directory then used this site to get the attached result.
I still can't figure out the cause.

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Crashing on editor
« Reply #10 on: April 21, 2014, 08:27:25 am »
Found the cause, it was the parser. I noticed after opening a project it started a thread for the parser so I tried turning off process complex macros and it stopped freezing.

On another note why are threads doing the job of something that should be passed to an executable?
An executable can write the info to a temporary file that the thread can then read WITHOUT freezing up.
Can just use a simple bool at start of each file to confirm weather it is ready for thread to use, in mean time thread can use old file.
E.g.
parser.exe FILE_PATH~parserINDEX~
where INDEX refers to 0 - 9 (when hit 9 just reset to 0)
parserThread:
Code
FILE *useParserFile = oldParserFile;
// oldParserFile will use INDEX - 1 or 9 if INDEX = 0
bool nxtParser = false;
fseek( nxtParserFile, 0, SEEK_SET );
fread( nxtParserFile, &nxtParser, 1, 1 );
if ( nxtParser )
  useParserFile = nxtParserFile;
if ( !useParserFile )
  return;
// Continue as normal
« Last Edit: April 22, 2014, 08:44:43 am by awsdert »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Crashing on editor
« Reply #11 on: April 21, 2014, 09:41:13 am »
Hi, awsdert, thanks for the research. If the parser (thread) get crashed, then the whole C::B process get crashed. So, I think it it better to fix the bug in the parser (thread), especially in handling macro expansion. Because there are a lot of recursive calls when we do the macro expansion when you have “handle complex macros" option enabled.

Can you supply a simple project which can lead the crash? 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.

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Crashing on editor
« Reply #12 on: April 22, 2014, 08:42:01 am »
This is a project I only just recently started and it crashed on that one (let alone my custom framework project), it should be small enough.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Crashing on editor
« Reply #13 on: April 22, 2014, 09:58:20 am »
This is a project I only just recently started and it crashed on that one (let alone my custom framework project), it should be small enough.
It does not crash on my computer. I see that your project use MSVC compiler, but I don't have such compiler in my computer. I guess the parser hangs when it try to parse the header files from your MSVC compiler suite. I'm not sure how to help you further, since I don't have those include files from MSVC.  :-[
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.

Offline awsdert

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Crashing on editor
« Reply #14 on: April 22, 2014, 11:20:55 am »
Why not install VS2013, copy the VC folder elsewhere, uninstall VS and use the copied folder?

Edit:  Just retried the complex macro setting and CB didn't freeze, perhaps it had something todo with my global paths? but if so the parser should have recognised that and skipped them. Seems I've lost a step somewhere that caused the parser to freeze the ui, but it is definitely safe to say part of the problem lies in the parser because th ui only ever freezed when I opened a file or click somewhere on a pre-opened file.

Edit: Deliberately broke VC tool chain path and there was no freeze either, dunno what else the missing step could be.
« Last Edit: April 22, 2014, 11:42:12 am by awsdert »