Author Topic: using code profiler in C - crash! (svn 7071)  (Read 14698 times)

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
using code profiler in C - crash! (svn 7071)
« on: March 28, 2011, 03:58:39 pm »
Dear,

I'm using codeblocks svn7071 in my Fedora 14 x86_64 system.
When I using the 'code profiler' plugin in a simple C program, it crashes!

But when I try it in a simple C++ program, it works  :x

Please be kindly to view the attached pictures.

Then I removed the wxGTK which I've built from wxWidgets website svn (wxGTK-2.8.12), and reinstall Fedora 14 official wxGTK-2.8.11-3, and I can not start my codeblocks, I think maybe wxGTK has changed, so I decided to recombine the codeblocks based on official wxGTK-2.8.11-3. But unfortunately I got errors as follows:
Quote


=====
My system:
[David@Ocean ~]$ uname -a
Linux Ocean 2.6.35.11-83.fc14.x86_64 #1 SMP Mon Feb 7 07:06:44 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

=====
wxWidgets:
[David@Ocean ~]$ rpm -qa | grep wx
wxGTK-gl-2.8.11-3.fc14.x86_64
wxGTK-2.8.11-3.fc14.x86_64
wxGTK-media-2.8.11-3.fc14.x86_64
wxBase-2.8.11-3.fc14.x86_64
wxGTK-devel-2.8.11-3.fc14.x86_64


Build CodeBlocks svn7071 encounter errors
=====
....
....
g++ -DHAVE_CONFIG_H -I. -I../../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12    -I../../../../../src/include -I../../../../../src/sdk/wxscintilla/include -I../../../../../src/plugins/contrib/codesnippets -I../../../../../src/plugins/contrib/codesnippets/Search -I../../../../../src/plugins/contrib/codesnippets/editor -I../../../../../src/include/mozilla_chardet  -Ulinux -Uunix  -O2 -ffast-math -DCB_AUTOCONF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -c -o codesnippetstreectrl.o `test -f './../codesnippetstreectrl.cpp' || echo './'`./../codesnippetstreectrl.cpp
g++ -DHAVE_CONFIG_H -I. -I../../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12    -I../../../../../src/include -I../../../../../src/sdk/wxscintilla/include -I../../../../../src/plugins/contrib/codesnippets -I../../../../../src/plugins/contrib/codesnippets/Search -I../../../../../src/plugins/contrib/codesnippets/editor -I../../../../../src/include/mozilla_chardet  -Ulinux -Uunix  -O2 -ffast-math -DCB_AUTOCONF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -c -o codesnippetswindow.o `test -f './../codesnippetswindow.cpp' || echo './'`./../codesnippetswindow.cpp
./../codesnippetstreectrl.cpp: In constructor 'CodeSnippetsTreeCtrl::CodeSnippetsTreeCtrl(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int)':
./../codesnippetstreectrl.cpp:97:39: error: conversion from 'int' to 'const wxTreeItemId' is ambiguous
/usr/include/wx-2.8/wx/treebase.h:75:5: note: candidates are: wxTreeItemId::wxTreeItemId(long int)
/usr/include/wx-2.8/wx/treebase.h:59:5: note:                 wxTreeItemId::wxTreeItemId(void*)
./../codesnippetstreectrl.cpp: In member function 'void CodeSnippetsTreeCtrl::EndInternalTreeItemDrag()':
./../codesnippetstreectrl.cpp:1073:23: error: conversion from 'int' to 'const wxTreeItemId' is ambiguous
/usr/include/wx-2.8/wx/treebase.h:75:5: note: candidates are: wxTreeItemId::wxTreeItemId(long int)
/usr/include/wx-2.8/wx/treebase.h:59:5: note:                 wxTreeItemId::wxTreeItemId(void*)
./../codesnippetstreectrl.cpp:1074:21: error: conversion from 'int' to 'const wxTreeItemId' is ambiguous
/usr/include/wx-2.8/wx/treebase.h:75:5: note: candidates are: wxTreeItemId::wxTreeItemId(long int)
/usr/include/wx-2.8/wx/treebase.h:59:5: note:                 wxTreeItemId::wxTreeItemId(void*)
./../codesnippetstreectrl.cpp: In member function 'void CodeSnippetsTreeCtrl::FinishExternalDrag()':
./../codesnippetstreectrl.cpp:1294:23: error: conversion from 'int' to 'const wxTreeItemId' is ambiguous
/usr/include/wx-2.8/wx/treebase.h:75:5: note: candidates are: wxTreeItemId::wxTreeItemId(long int)
/usr/include/wx-2.8/wx/treebase.h:59:5: note:                 wxTreeItemId::wxTreeItemId(void*)
./../codesnippetstreectrl.cpp:1295:21: error: conversion from 'int' to 'const wxTreeItemId' is ambiguous
/usr/include/wx-2.8/wx/treebase.h:75:5: note: candidates are: wxTreeItemId::wxTreeItemId(long int)
/usr/include/wx-2.8/wx/treebase.h:59:5: note:                 wxTreeItemId::wxTreeItemId(void*)
./../codesnippetstreectrl.cpp: In member function 'void CodeSnippetsTreeCtrl::OnEndTreeItemDrag(wxTreeEvent&)':
./../codesnippetstreectrl.cpp:1406:21: error: conversion from 'int' to 'const wxTreeItemId' is ambiguous
/usr/include/wx-2.8/wx/treebase.h:75:5: note: candidates are: wxTreeItemId::wxTreeItemId(long int)
/usr/include/wx-2.8/wx/treebase.h:59:5: note:                 wxTreeItemId::wxTreeItemId(void*)
make[5]: *** [codesnippetstreectrl.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: Leaving directory `/home/David/rpmbuild/BUILD/codeblocks/src/plugins/contrib/codesnippets/resources'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/David/rpmbuild/BUILD/codeblocks/src/plugins/contrib/codesnippets'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/David/rpmbuild/BUILD/codeblocks/src/plugins/contrib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/David/rpmbuild/BUILD/codeblocks/src/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/David/rpmbuild/BUILD/codeblocks/src'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.b5yWq5 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.b5yWq5 (%build)
[David@Ocean SPECS]$


Maybe there some problems in 'code profiler' plugin ??

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: using code profiler in C - crash! (svn 7071)
« Reply #1 on: March 28, 2011, 04:02:18 pm »
Sorry, I can not upload the picture (90.2 KB), I tried for several times, but I got:

--------
An Error Has Occurred!
The upload folder is full. Please try a smaller file and/or contact an administrator.
--------

?  What happened?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: using code profiler in C - crash! (svn 7071)
« Reply #2 on: March 28, 2011, 04:06:54 pm »
Please Re-Read my last message on your wxWidgets build problem!!!!

Note: I am now considering you to be a spam bot!!!
« Last Edit: March 28, 2011, 04:15:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: using code profiler in C - crash! (svn 7071)
« Reply #3 on: March 28, 2011, 04:29:59 pm »
Please Re-Read my last message on your wxWidgets build problem!!!!

Note: I am now considering you to be a spam bot!!!

No, I'm not a spam bot!

when I use CB on wxGTK-2.8.12, problem happens, not on wx2.9!!!
I do know on wx2.9 some strange problems may happen, you've told me. I know this. But it is still wx2.8, just wx2.8.12!!!

I don't understand, why codeblocks developers do not want to hear or listening something even it is a little bit new ?!

In China, there's a word "If you stop going ahead, you will regress."
I do not want to give you a lesson, for I'm only a very very junior code lover. But I or someone like me (very very junior code lover or coder) want to know some new things and try to understand and using them, why you skilled advanced professional developers don't ??!!
You don't like new and fresh things? even they can give you new idea and eyesight ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: using code profiler in C - crash! (svn 7071)
« Reply #4 on: March 28, 2011, 04:39:02 pm »
I've seen this problem on Centos 5.5, so wangdong1226 is not a spambot :)
I've a patch for it but, I've no time to discuss it with the others or to test it on anything else than CentOS.

A workaround is to use --with-contrib-plugins=all,-CodeSnipets (see ./configure --help for details)

p.s. Don't attach images on the forum, use a picpaste service like imageshank, photobucket, etc. The attachment space is limited and the admins wipe at random, when there is no space left on the device.
(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 wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: using code profiler in C - crash! (svn 7071)
« Reply #5 on: March 28, 2011, 04:43:12 pm »
I've seen this problem on Centos 5.5, so wangdong1226 is not a spambot :)
I've a patch for it but, I've no time to discuss it with the others or to test it on anything else than CentOS.

A workaround is to use --with-contrib-plugins=all,-CodeSnipets (see ./configure --help for details)

p.s. Don't attach images on the forum, use a picpaste service like imageshank, photobucket, etc. The attachment space is limited and the admins wipe at random, when there is no space left on the device.

Thank you very much for your kindness, oBFusCATed.
I'll try acc. to your guide.

Best regards.
David.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: using code profiler in C - crash! (svn 7071)
« Reply #6 on: March 28, 2011, 05:08:00 pm »
Please Re-Read my last message on your wxWidgets build problem!!!!

Note: I am now considering you to be a spam bot!!!

No, I'm not a spam bot!

when I use CB on wxGTK-2.8.12, problem happens, not on wx2.9!!!
I do know on wx2.9 some strange problems may happen, you've told me. I know this. But it is still wx2.8, just wx2.8.12!!!

I don't understand, why codeblocks developers do not want to hear or listening something even it is a little bit new ?!

In China, there's a word "If you stop going ahead, you will regress."
I do not want to give you a lesson, for I'm only a very very junior code lover. But I or someone like me (very very junior code lover or coder) want to know some new things and try to understand and using them, why you skilled advanced professional developers don't ??!!
You don't like new and fresh things? even they can give you new idea and eyesight ?

I disagree
http://forums.codeblocks.org/index.php/topic,14289.msg96177.html#msg96177

Bye
Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: using code profiler in C - crash! (svn 7071)
« Reply #7 on: March 28, 2011, 07:50:22 pm »
wangdong1226 can you try this patch:

Code
Index: src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp
===================================================================
--- src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp   (revision 7071)
+++ src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp   (working copy)
@@ -94,8 +94,6 @@
     m_mimeDatabase = 0;
     m_bBeginInternalDrag = false;
     m_LastXmlModifiedTime = time_t(0);            //2009/03/15
-    m_itemAtKeyUp = m_itemAtKeyDown = 0;
-
 
     m_pSnippetsTreeCtrl = this;
     GetConfig()->SetSnippetsTreeCtrl(this);
@@ -1070,11 +1068,7 @@
     }
 
     delete pDoc; pDoc = 0;
-    m_itemAtKeyDown = 0;
-    m_itemAtKeyUp = 0;
-
-    return;
-
+    m_itemAtKeyDown = m_itemAtKeyUp = wxTreeItemId();
 }//OnEndTreeItemDrag
 // ----------------------------------------------------------------------------
 void CodeSnippetsTreeCtrl::OnEnterWindow(wxMouseEvent& event)
@@ -1291,9 +1285,7 @@
     delete textData; //wxTextDataObject
     delete fileData; //wxFileDataObject
     m_TreeText = wxEmptyString;
-    m_itemAtKeyDown = 0;
-    m_itemAtKeyUp = 0;
-
+    m_itemAtKeyDown = m_itemAtKeyUp = wxTreeItemId();
 }
 //// ----------------------------------------------------------------------------
 //void CodeSnippetsTreeCtrl::OnMouseMotionEvent(wxMouseEvent& event)
@@ -1403,7 +1395,7 @@
     m_MouseUpX = event.GetPoint().x;
     m_MouseUpY = event.GetPoint().y;
 
-    m_itemAtKeyUp = 0;
+    m_itemAtKeyUp = wxTreeItemId();
     int hitFlags = 0;
     wxTreeItemId id = HitTest(wxPoint(m_MouseUpX, m_MouseUpY), hitFlags);
     if (id.IsOk() and (hitFlags & (wxTREE_HITTEST_ONITEMICON | wxTREE_HITTEST_ONITEMLABEL )))
(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 wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: using code profiler in C - crash! (svn 7071)
« Reply #8 on: March 29, 2011, 02:21:10 am »
I disagree
http://forums.codeblocks.org/index.php/topic,14289.msg96177.html#msg96177

Bye
Tim S.

Dear Tim S,
I did edit the wxGTK.spec file and removed the "--enable-compat24 \" parameter of the "%configure" command.


I'll try oBFusCATed's patch for codeblocks svn 7071 on wxGTK-2.8.12 and on wxGTK-2.8.11-3, and submit report later.

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: using code profiler in C - crash! (svn 7071)
« Reply #9 on: March 29, 2011, 09:43:18 am »
the patch seems good in XP. I've recombined codeblocks based on new released official wxWidgets2.8.12.

Then I'll try in my Fedora 14 system; after finished I'll submit the report.


Best regards.
David.

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: using code profiler in C - crash! (svn 7071)
« Reply #10 on: March 29, 2011, 04:25:50 pm »
Dear oBFusCATed,

Sadly, this patch can not work when code profiler in C language. (code profiler works for C++ language as before).

 :(

I've installed new released wxWidgets 2.8.12 (wxGTK-2.8.12, wxBase-2.8.12, wx......)  in my Fedora 14 x86_64 system.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: using code profiler in C - crash! (svn 7071)
« Reply #11 on: March 29, 2011, 04:41:07 pm »
This is not a code profiler patch!
It should fix the compilation of the code snippets plugin, when wxGTK is installed from the official package in Fedora/CentoOS.
Is this the case?

Anyone against this patch? Pecan?
(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 wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: using code profiler in C - crash! (svn 7071)
« Reply #12 on: March 30, 2011, 04:44:09 am »
This is not a code profiler patch!
It should fix the compilation of the code snippets plugin, when wxGTK is installed from the official package in Fedora/CentoOS.
Is this the case?

Anyone against this patch? Pecan?

OK, I'll test it again and submit the report then.

BTW, if I want to use official released wxWidgets 2.8.12, how to fix the code profiler problem when used in C language ?  (in C++, code profiler works well).
Any suggestion or solution?


Best regards.
David.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: using code profiler in C - crash! (svn 7071)
« Reply #13 on: March 30, 2011, 03:18:20 pm »
This is not a code profiler patch!
It should fix the compilation of the code snippets plugin, when wxGTK is installed from the official package in Fedora/CentoOS.
Is this the case?

Anyone against this patch? Pecan?

I don't understand how assigning 0 to a variable causes this problem.
There are a number of tests in the code to see if m_itemAtKeyDown and m_itemAtKeyUp are empty. Simply removing initialization of the variables is a dangerous answer.
Can they guarantee that the assignment of an empty wxTreeItemId() is going to be 0 for all variations and flavors of wxWidgets?

Could someone please show us the error message.
« Last Edit: March 30, 2011, 03:32:14 pm by Pecan »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: using code profiler in C - crash! (svn 7071)
« Reply #14 on: March 30, 2011, 03:27:45 pm »
@Pecan:

I have already told wangdong1226 that wxWidgets can NOT be compiled with 2.4 compatible option on 64 bit system.
To reproduce the issue, I would guess you have to do what wangdong1226 did and use the Fedora RPM that has WXWIN_COMPATIBILITY_2_4 set to 1 in setup.h

Tim S.
« Last Edit: March 30, 2011, 03:34:41 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org