Author Topic: Crash after opening an XPM file.  (Read 11079 times)

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Crash after opening an XPM file.
« on: October 27, 2010, 02:38:36 pm »
Codeblock crashes when I open an XPM file. If I uninstall code completion plugin, I am able to open the xpm within codeblocks without problems.

CB r6770,
WinXP SP3,
mingw-tdm-5.4.1
wx2.8.11

Has anybody this problem too?


Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Crash after opening an XPM file.
« Reply #1 on: October 27, 2010, 03:00:45 pm »
Could you post the XPM file in here?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Crash after opening an XPM file.
« Reply #2 on: October 27, 2010, 03:03:30 pm »
Could you post the XPM file in here?
It does not crash here with 6771 (linux and winxp), but it is also not parsed.
The veraiable name included should be in global variables I think.
Searching for it in the symbols-browser gives no result.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Crash after opening an XPM file.
« Reply #3 on: October 27, 2010, 03:36:57 pm »
Could you post the XPM file in here?
It does not crash here with 6771 (linux and winxp), but it is also not parsed.
The veraiable name included should be in global variables I think.
Searching for it in the symbols-browser gives no result.
Yes, It should not parsed, because only need parsing for C/C++ files.
 :D

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Crash after opening an XPM file.
« Reply #4 on: October 27, 2010, 03:46:36 pm »
An xpm-file is defacto a very simple c-headerfile including the declaration of a static variable, that can be included and used as all other headers.
So I think it should also be parsed (at least if it's not xpm2 or xpm3).
http://en.wikipedia.org/wiki/X_PixMap

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Crash after opening an XPM file.
« Reply #5 on: October 27, 2010, 07:47:39 pm »
Updated to r6771, still crashes after opening an xpm file.
I attached a XPM file and the call-stack (gdb 7.2) from the crash.
« Last Edit: October 27, 2010, 07:52:44 pm by danselmi »

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Crash after opening an XPM file.
« Reply #6 on: October 27, 2010, 09:20:02 pm »
So it must not be a xpm! A simple txt will do to give a crash if the file does not belong to a project. (Jens, the xpm you tried is from an open project, right?) The following patch stops cb crashing:
Code
Index: nativeparser.cpp
===================================================================
--- nativeparser.cpp (revision 6773)
+++ nativeparser.cpp (working copy)
@@ -3368,7 +3368,7 @@
         SwitchParser(project, parser);
     }
 
-    if (m_ClassBrowser && parser->ClassBrowserOptions().displayFilter == bdfFile)
+    if (m_ClassBrowser && parser && parser->ClassBrowserOptions().displayFilter == bdfFile)
     {
         // check header and implementation file swap, if yes, don't need to rebuild browser tree
         m_ClassBrowser->UpdateView(true);
Don't know if it is the right way!

The other thing is that: IMHO an xpm should be parsed.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Crash after opening an XPM file.
« Reply #7 on: October 27, 2010, 09:27:27 pm »
Yes it was in a project.
It crashes witha a single xpm or with another file, that is not a source or header-file, sources or headers are parsed correctly.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Crash after opening an XPM file.
« Reply #8 on: October 27, 2010, 09:37:01 pm »
The other thing is that: IMHO an xpm should be parsed.
Isn't that the case if you put the XPM extension under C/C++ source files?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Crash after opening an XPM file.
« Reply #9 on: October 27, 2010, 10:21:33 pm »
The other thing is that: IMHO an xpm should be parsed.
Isn't that the case if you put the XPM extension under C/C++ source files?
I just tried: xpms are highlighted now, but CC doesn't know the name (xy_xpm) of the string.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Crash after opening an XPM file.
« Reply #10 on: October 28, 2010, 02:08:20 am »
Fixed, thank guys!  :D