Author Topic: using code profiler in C - crash! (svn 7071)  (Read 14555 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: 7582
    • 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: 7582
    • 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: 2750
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: 7582
    • 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: using code profiler in C - crash! (svn 7071)
« Reply #15 on: March 30, 2011, 03:34:43 pm »
Pecan:
wxTreeItemId() and wxTreeItemId(0) should be equivalent, as far as I can see in the wxTreeItemId's code.
And the docs/header file say that the user is not allowed to call the latter.
The user may call only IsOk and probably to default construct an object.

See here for the source of wxTreeItemId: http://svn.wxwidgets.org/viewvc/wx/wxWidgets/branches/WX_2_8_BRANCH/include/wx/treebase.h?view=markup

Also look at the first post for the errors.
As you can see, the compiler sees two constructors:
wxTreeItemId(void*) and wxTreeItemId(long), this is ambiguous on 64bit machines, because sizeof(void*) == sizeof(long) and sizeof(int) != sizeof(long).
So id = 0, requires a cast and the compiler have two equally valid options.

Stahta01:
Why not? The binary wxGTK package for CentoOS 5.5  is compiled with this option and with my patch C::B works without problems.
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: using code profiler in C - crash! (svn 7071)
« Reply #16 on: March 30, 2011, 03:41:35 pm »
Code
#if WXWIN_COMPATIBILITY_2_4
74 // deprecated: only for compatibility, don't work on 64 bit archs
75 wxTreeItemId(long item) { m_pItem = wxUIntToPtr(item); }
76 operator long() const { return (long)wxPtrToUInt(m_pItem); }
77 #else // !WXWIN_COMPATIBILITY_2_4

I can read and I am guessing the wx devs know what is right about their code.

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 #17 on: March 30, 2011, 04:06:02 pm »
OK, And have you seen some lines above it that the only methods allowed are the default constructor
(it is not written as allowed, but I guess it is, I will write a bug report for it thought:) ) and the IsOk?
And wxTreeItemId(void *) is not one of them, so the C::B's usage is wrong (I'll contact wx guys to
hear what they think about it).

Can someone test my patch and verify that CodeSnippets is working with it. I don't use it and can't do so, unfortunately.
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: using code profiler in C - crash! (svn 7071)
« Reply #18 on: March 30, 2011, 09:18:48 pm »
OK, And have you seen some lines above it that the only methods allowed are the default constructor
(it is not written as allowed, but I guess it is, I will write a bug report for it thought:) ) and the IsOk?
And wxTreeItemId(void *) is not one of them, so the C::B's usage is wrong (I'll contact wx guys to
hear what they think about it).

Can someone test my patch and verify that CodeSnippets is working with it. I don't use it and can't do so, unfortunately.
I don't use it also.

About the constructor:
Quote from: http://docs.wxwidgets.org/2.8/wx_wxtreeitemid.html#wxtreeitemidconstr
wxTreeItemId::wxTreeItemId

wxTreeItemId()

Default constructor. wxTreemItemIds are not meant to be constructed explicitly by the user; they are returned by the wxTreeCtrl functions instead.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: using code profiler in C - crash! (svn 7071)
« Reply #19 on: March 30, 2011, 09:37:22 pm »
Jens you are correct, here is the explanation from the #wxwidgets in irc.freenode.com

Quote
(2011-03-30 22:25:13) obfuscated: hi, can I do something like "class Something { wxTreeItemId storeForLater; }; " or this is not allowed?
(2011-03-30 22:26:46) DavidGH: obfuscated: You can't reliably do that, as a wxTreeItemId isn't guaranteed to live for long
(2011-03-30 22:27:13) DavidGH: As soon as a tree is recreated, or (I think) an item inserted, the old ids become invalid
(2011-03-30 22:27:36) obfuscated: so, how do you store something like a pointer to an item?
(2011-03-30 22:28:05) DavidGH: You don't. You search the tree each time you want it
(2011-03-30 22:28:52) DavidGH: Of course it depends on your situation: if you are certain that the tree won't be altered in the course of your function...
(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 #20 on: March 31, 2011, 12:22:55 pm »
Dear oBFusCATed,

Sorry for my late test report. I'm a little bit busy these days. :)

I've reinstalled the Fedora official wxGTK-2.8.11-3  (official Fedora releasw wxGTK has "--enable-compat24 \" in its rpm .spec file ). Then I re-combined the codeblocks-svn7074 with your patch.

I got errors, please view as follows:
Quote

---------------
......
......
libtool: compile:  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 Search/DirectoryParamsPanel.cpp  -fPIC -DPIC -o .libs/DirectoryParamsPanel.o
/bin/sh ../../../../libtool  --tag=CXX   --mode=compile 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 InsertIndexManager.lo `test -f 'Search/InsertIndexManager.cpp' || echo './'`Search/InsertIndexManager.cpp
libtool: compile:  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 Search/InsertIndexManager.cpp  -fPIC -DPIC -o .libs/InsertIndexManager.o
codesnippets.cpp: In constructor 'CodeSnippets::CodeSnippets()':
codesnippets.cpp:109:52: 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*)
codesnippets.cpp: In member function 'void CodeSnippets::OnPrjTreeMouseLeftDownEvent(wxMouseEvent&)':
codesnippets.cpp:1243:30: 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*)
codesnippets.cpp:1244:28: 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*)
codesnippets.cpp: In member function 'void CodeSnippets::OnPrjTreeMouseLeftUpEvent(wxMouseEvent&)':
codesnippets.cpp:1273:28: 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*)
codesnippets.cpp: In member function 'void CodeSnippets::DoPrjTreeExternalDrag(wxTreeCtrl*)':
codesnippets.cpp:1449:30: 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*)
codesnippets.cpp:1450:28: 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]: *** [codesnippets.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
Search/InsertIndexManager.cpp: In member function 'long int InsertIndexManager::GetInsertionIndex(const wxString&, long int)':
Search/InsertIndexManager.cpp:24:7: warning: 'index' may be used uninitialized in this function
make[5]: Leaving directory `/home/David/rpmbuild/BUILD/codeblocks/src/plugins/contrib/codesnippets'
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.lzgOx1 (%build)


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



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


[David@Ocean SPECS]$ 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
[David@Ocean SPECS]$
--------------

Temporarily solution:

1).
Just as stahta01 (Tim S) has told me before (http://forums.codeblocks.org/index.php/topic,14289.msg96177.html#msg96177).
Quote
Try building wxWidgets without using "--enable-compat24"
.
This can solve the Fedora official wxGTK2.8.11-3 conflicts with CodeBlocks-svn7047 problem.

or

2).
Re-build wxGTK using the official released wxWidgets2.8.12 source; then install corresponding produced wxGTK and wxBase files; then re-build CodeBlocks-svn7047.


Best regards.
David.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: using code profiler in C - crash! (svn 7071)
« Reply #21 on: March 31, 2011, 12:27:20 pm »
Are you sure the patch have been applied?
(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 #22 on: March 31, 2011, 01:48:38 pm »
Yes, I'm sure.

Maybe you do not want to see this; but I did patched acc. to your patch file, and I got errors during compiling.
« Last Edit: March 31, 2011, 01:52:36 pm by wangdong1226 »