News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Crash after opening an XPM file.

Started by danselmi, October 27, 2010, 02:38:36 PM

Previous topic - Next topic

danselmi

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?

spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

Loaden


Jenna

Quote from: Loaden on October 27, 2010, 03:00:45 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.

Loaden

Quote from: jens on October 27, 2010, 03:03:30 PM
Quote from: Loaden on October 27, 2010, 03:00:45 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

Jenna

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

danselmi

#5
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.
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

danselmi

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:
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.
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

Jenna

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.

MortenMacFly

Quote from: danselmi on October 27, 2010, 09:20:02 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

danselmi

Quote from: MortenMacFly on October 27, 2010, 09:37:01 PM
Quote from: danselmi on October 27, 2010, 09:20:02 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.
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

Loaden