User forums > Using Code::Blocks

Segmentation fault in code::blocks generated code

(1/2) > >>

fenixk19:
Hello. I've already written to nightly builds forum, but nobody answered me. I'm experiencing the following problem. My program fails with segmentation fault while constructing main wxFrame on Create function.

--- Code: ---   //(*Initialize(RSWorldEditorFrame)
   // ... menu declarations
    Create(parent, id, _("name"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, _T("id"));
   // ... other initialization

--- End code ---

Here is the call stack:
#0 0x2b73fd0a0c82   _int_malloc() (/lib/libc.so.6:??)
#1 0x2b73fd0a2636   calloc() (/lib/libc.so.6:??)
#2 0x2b73feac5892   IA__g_malloc0(n_bytes=16) (gmem.c:150)
#3 0x2b73fe8755db   type_add_flags_W(node=0x7240a0, flags=G_TYPE_FLAG_ABSTRACT) (gtype.c:2912)
#4 0x2b73fe879330   IA__g_type_register_static(parent_type=<value optimized out>, type_name=0x2b73ff22b99d "GtkObject", info=0x2b73ff4b6be0, flags=G_TYPE_FLAG_ABSTRACT) (gtype.c:2263)
#5 0x2b73ff090ef6   IA__gtk_object_get_type() (gtkobject.c:99)
#6 0x2b73ff17108c   IA__gtk_widget_get_type() (gtkwidget.c:293)
#7 0x2b73fefea01f   IA__gtk_container_get_type() (gtkcontainer.c:137)
#8 0x2b73fefb1470   IA__gtk_bin_get_type() (gtkbin.c:43)
#9 0x2b73ff17d7e0   IA__gtk_window_get_type() (gtkwindow.c:311)
#10 0x2b73ff18258d   IA__gtk_window_new(type=GTK_WINDOW_TOPLEVEL) (gtkwindow.c:1071)
#11 0x2b73fb95290a   wxTopLevelWindowGTK::Create(this=0x722dd0, parent=0x0, id=-1, title=@0x7fffb0332620, pos=@0x69e468, sizeOrig=@0x6a0bc8, style=541072960, name=@0x7fffb0332610) (../src/gtk/toplevel.cpp:501)
#12 0x2b73fb9b7783   wxFrame::Create(this=0x722dd0, parent=0x0, id=-1, title=@0x7fffb0332620, pos=@0x69e468, sizeOrig=@0x6a0bc8, style=541072960, name=@0x7fffb0332610) (../src/gtk/frame.cpp:198)
#13 0x41427e   RSWorldEditorFrame(this=0x722dd0, parent=0x0, app_dir=@0x7fffb0332b20, id=-1) (/media/d/Documents and Settings/Phoenix/Мои документы/My_app/RSWorldEditor/RSWorldEditorMain.cpp:122)
#14 0x411cb2   RSWorldEditorApp::OnInit(this=0x6d8420) (/media/d/Documents and Settings/Phoenix/Мои документы/My_app/RSWorldEditor/RSWorldEditorApp.cpp:36)
#15 0x411dfe   wxAppConsole::CallOnInit(this=0x6d8420) (/usr/include/wx-2.8/wx/app.h:76)
#16 0x2b73fc361687   wxEntry(argc=@0x2b73fc67c410, argv=0x6c5d90) (../src/common/init.cpp:433)
#17 0x2b73fc361786   wxEntry(argc=@0x7fffb0332c3c, argv=0x7fffb0332d28) (../src/common/init.cpp:461)
#18 0x411d64   main(argc=1, argv=0x7fffb0332d28) (/media/d/Documents and Settings/Phoenix/Мои документы/My_app/RSWorldEditor/RSWorldEditorApp.cpp:17)

P.S. My system is Xubuntu 7.04. wxGtk is 2.8.4. Code::Blocks is 4410(build from svn)

dje:
Hi !

Are you sure you build a frame in a wxAppConsole ?

Maybe you should check your application type with a right click on project, Properties, Build targets tab and ensure type is a GUI application and not a Console application.

Dje

fenixk19:
Yes, this app is GUI application, not console.

dje:
Sorry, no other idea.
I don't know if the provided code/stack are sufficient to solve the problem...

Dje

byo:

--- Quote from: fenixk19 on August 26, 2007, 09:08:05 pm ---Hello. I've already written to nightly builds forum, but nobody answered me.

--- End quote ---

Hmm, I've sent you a private message, so you'd better check "My messages" ;).

This problem looks really strange. First, there's not much that should cause crash on calloc function and second: it looks like internal gtk's problem rather than wrong generated code.

One thing that probably should also be taken into consideration - try to copy this project into other path, into some local directory in /home - avoid any spaces and non-english characters. Not standard paths can really cause some annoying bugs (although it looks like they shouldn't affect anything). And also try to fully rebuild project. If that won't help, maybe reinstalling wxGTK would help.

Regards
   BYO

Navigation

[0] Message Index

[#] Next page

Go to full version