Author Topic: cb crashes very often on embedded system  (Read 12647 times)

Offline seahawkibiza

  • Multiple posting newcomer
  • *
  • Posts: 28
cb crashes very often on embedded system
« on: April 02, 2015, 03:05:20 pm »
Hello,

I use cb on the Bananian Pi to compile a wxWidgets project. (Developt under Windows, the Code is running well).
But in this systems cb crashes as follow:

1. cb closes without any error-message. I think, it´s related with some GUI-Operations (mouse-clicks, copy-paste), but i´m not sure. (because crashes very often but not at the same steps.)
2. On resources wxSmith: the system goes in 100% cpu, if I will show a Notebook. Other parts of wxSmith I can see.

My system is this:

System: Banana Pi
Linux: debian wheezy as bananian
GUI: LXDE
wxWidgets 2.9.4, compiled with Opengl
cb 13.12 from the tar-ball, compiles with --contrib-plugins=ALL,-FileManager

Some hints?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: cb crashes very often on embedded system
« Reply #1 on: April 02, 2015, 03:37:46 pm »
Code Completion would be my wild guess as the plugin causing the problem.

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: cb crashes very often on embedded system
« Reply #2 on: April 02, 2015, 05:50:54 pm »
Also are you sure you're not getting low on memory in this system?
Use top/htop/free or something like it to monitor the free memory on the system while CB is running.
(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 seahawkibiza

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: cb crashes very often on embedded system
« Reply #3 on: April 02, 2015, 08:19:45 pm »
I setup the whole system new. Then I will report what happens...
I write down the setup of the system as follow:

apt-get install gcc g++ make git-core vim bzip2
apt-get install libtool autoconf automake
apt-get install pkg-config
apt-get install zip unzip
apt-get install gtk-3.0-dev
apt-get install mesa-common-dev
apt-get install freeglut3-dev
apt-get install libboost-thread-dev
apt-get install libhunspell-dev
apt-get install task-lxde-desktop


cd /
ldconfig
apt-get autoremove  //to remove unnecesasary libs
ldconfig

mkdir /devel

cd ~/devel

mkdir build_wx

cd build_wx

../configure --prefix=/opt/wx --enable-xrc --enable-unicode --with-opengl
make -j3 && make -j3 install

export PATH=/usr/bin:/opt/wx/bin:$PATH 

Add /opt/wx/lib to /etc/ld.so.conf (nano /etc/ld.so.conf), then run:

ldconfig

echo `wx-config --prefix`/share/aclocal >> /usr/share/aclocal/dirlist

cd ~/devel

tar xbf codeblocks_13.12-1.tar.gz
cd codeblocks_13.12-1

 ./bootstrap
 ./configure --with-contrib-plugins=all,-FileManager
make -j3 && make -j3 install


touch /etc/X11/Xsession.d/90environment
nano /etc/X11/Xsession.d/90environment
add:
export PATH=/usr/bin:/opt/wx/bin:$PATH
xset s off
xset -dpms
xset -s noblank

reboot

//Setup for Codeblocks:

Compiler>sonstige Optionen> ´wx-config --cflags´
Linker>sonstige Optionen> ´wx-config --libs --gl-libs´ -lGL -lglut

Offline seahawkibiza

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: cb crashes very often on embedded system
« Reply #4 on: April 03, 2015, 11:32:07 am »
So, I rebuild all. code blocks compiles my application nice. during the compile (takes round about 25min) I used free to have a look to the memory, but still 300MB free.
the core is a 1.1GHZ dual core.

Problem: now its more complicated. before was only frozen if I click on resources to show the wxsmith designs, now it crashes without a warning and closes the cb.
if I start cb again, only one file is displayed correctly. all other filewindows are a grey window. I can still compile, it works fine, but the vertical scrollers are missed and if I open a other file from the project tree its grey.

I think, its a problem with the grafic driver or lib, but how can I test thus out?

« Last Edit: April 03, 2015, 11:35:14 am by seahawkibiza »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: cb crashes very often on embedded system
« Reply #5 on: April 03, 2015, 10:33:40 pm »
(learn cross compile, it will save you a lot time ;) (25min for one application oO) )

Use a svn checkout of c::b, because there are fixed a LOT bugs since the 13.12 release...

greetings

Offline seahawkibiza

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: cb crashes very often on embedded system
« Reply #6 on: April 04, 2015, 01:25:55 am »
und er Windows i need also 15min to compile. Its a big app....

And I can cross compile. this is not the question. but I must debug on the target, because I have some problems... and debug under cb its very simple.


Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: cb crashes very often on embedded system
« Reply #7 on: April 04, 2015, 02:02:52 am »
And I can cross compile. this is not the question. but I must debug on the target, because I have some problems... and debug under cb its very simple.
If there is a gdb-server available for your hardware, you can use remote-debugging to debug your native code. Meaning cb runs on your pc and gdb-server runs on your hardware making the connection between the debugger and the target program through LAN or whatever connection gdb-server supports. Isn't that an option for you?

Offline seahawkibiza

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: cb crashes very often on embedded system
« Reply #8 on: April 04, 2015, 10:17:21 am »
Yes, this I will try. this could be a nice solution.

But to solve the problems on thus hardware I'm a step closer. its only the wxsmith plugin.
I think, some things are wrong. I have the same 13.12 cb on windows, with the same wxwidgets 2.9.4, but it seems on Linux is something different in wxsmith .....

A new project setup in cb works nice. I.e. a small test program.
also I can play with wxsmith.

but if I try to use my sources and will add all frames and dialogs it crashes.
I think, I must search the correct way to convert the source from the windows project to Linux.

« Last Edit: April 04, 2015, 10:21:20 am by seahawkibiza »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: cb crashes very often on embedded system
« Reply #9 on: April 04, 2015, 06:43:02 pm »
Have you tried to use a never source code of c::b? There where a lot bugs in 13.12... Especially with wx2.9

Offline seahawkibiza

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: cb crashes very often on embedded system
« Reply #10 on: April 06, 2015, 11:16:42 am »
Ok, i tried the newest build from the svn. its not posible to compile with wxWidgets 2.9.4
Also the available patches dont work.
with wxwidgets last stable versión works fine.

the only problem is that i need wxwidgets in a versión before 3.0, because I have own lexer for scintilla, and since 3.0 all is different....


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: cb crashes very often on embedded system
« Reply #11 on: April 06, 2015, 12:13:44 pm »
Use wx2.8.12 if possible.
C::B is not fully compatible with wx > 3.0, it compiles and most stuff works, but it's by far not as stable as with 2.8.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: cb crashes very often on embedded system
« Reply #12 on: April 06, 2015, 03:20:56 pm »
the only problem is that i need wxwidgets in a versión before 3.0, because I have own lexer for scintilla, and since 3.0 all is different....
CB doesn't use the wxSTC component, so if you're using the lexer with cb then you're not dependant on wxWidgets.
If you're using wxSTC in your projects then you can have multiple versions of wx installed and use the appropriate one for building different projects.
(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 seahawkibiza

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: cb crashes very often on embedded system
« Reply #13 on: April 07, 2015, 03:52:33 pm »
Ok, so I´ve tried severall installations.
To test I changed meanwhile to a Debian Wheezy, NVideo-Grafics, Intel 686 dual core, wxWidgets build on gtk+-2.0,
but also I made the same tests on Bananian Pi, but between this 2 systems I detect no difference (only the speed :-) )

I tried:
CB from SVN last build, with wxWidgets last stable 3.0.2
CB from SVN last build, with wxWidgets prelast stable 2.8.x
CB from SVN last build, with wxWidgets 2.9.4
CB 3.12 from tarball, with wxWidgets last stable 3.0.2
CB 3.12 from tarball, with wxWidgets prestable 2.8.x
CB 3.12 from tarball, with wxWidgets 2.9.4

Following happens:
Only on the first build (CB from svn, wxWidgets 3.0.2) I can open the project in CB and cann use wxSmith to edit the Ressouces.
On the other builds CB frozen, hangs, crashes with the Ressources, especially the Notebook-Pages.

So I decided to use this configuration.

Then I build the wxWidgets 2.9.4 for my project with:
--with-opengl --enable-unicode --enable-debug --enable-debug_info

I can compile and link my project fine. I can edit the resosources.

To remember:
On Windows, CB 3.12, wxWidgets 2.9.4 rns the project very nice (on different platforms by a lot of customers)

But on booth linux systems comes now the followig error:

../src/gtk/window.cpp(2698): assert "m_widget" failed in DoSetSize(): invalid window
(followed by a lot of similiar messages with a Sig fault error at the end)

Occured in the constructor of the mainframe,
FlexGridSizer1->Add
PageProg->SetSizer(FlexGridSizer1)
FlexGridSizer1->Fit(PageProg) 
<-- here occurs the Error.

This code is the code produced by wxSmith.

What can be the reason?


Offline seahawkibiza

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: cb crashes very often on embedded system
« Reply #14 on: April 07, 2015, 08:19:17 pm »
Ok, problems are solved.

I compiled CB from svn, last version with wxWidgets 2.8.x (last stable).
Then I compiled wxWidgets 2.8.x again in a other folder with all debug_infos, opengl, etc..

This now is working fine. On all my platforms including Banana Pi.

Only the openGL makes trouble, but this is a other problem :-)