News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

using code profiler in C - crash! (svn 7071)

Started by wangdong1226, March 28, 2011, 03:58:39 PM

Previous topic - Next topic

wangdong1226

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 ??

wangdong1226

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?

stahta01

#2
Please Re-Read my last message on your wxWidgets build problem!!!!

Note: I am now considering you to be a spam bot!!!
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

wangdong1226

Quote from: stahta01 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!!!

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 ?

oBFusCATed

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!]

wangdong1226

Quote from: oBFusCATed 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.

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

Best regards.
David.

stahta01

Quote from: wangdong1226 on March 28, 2011, 04:29:59 PM
Quote from: stahta01 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!!!

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.next.codeblocks.org/index.php/topic,14289.msg96177.html#msg96177

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

oBFusCATed

wangdong1226 can you try this patch:


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!]

wangdong1226

Quote from: stahta01 on March 28, 2011, 05:08:00 PM
I disagree
http://forums.next.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.

wangdong1226

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.

wangdong1226

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.

oBFusCATed

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!]

wangdong1226

Quote from: oBFusCATed 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?

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.

Pecan

#13
Quote from: oBFusCATed 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?

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.

stahta01

#14
@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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]