Regards to Building of wxRuby 2.0.1

Hello All,

In regards to Ron’s post, I have reviewed the gem created by the build
process, and attempted to use it, and it is as you said, with Ruby 1.9.2
p0,
when attempting to run most of the examples, it will cause a segfault,
with
a ruby backtrace, and debugging info, suggesting something has gone
wrong.
I’ve also attempted to build against Ruby 1.8.7 p302, and it seems that
it
has issues with rb_intern2 not being found for some reason. I just
joined
#wxruby on irc.freenode.net, if you are still available, we can research
what is going on, and figure out a solution to this problem.

After doing a complete wipe clean of the code, and re-swigging and
compiling
of the code, it looks as though Ruby 1.8.7 p302 has the same issue as
Ruby
1.9.2 p0. In the fact that aside from a few configuration errors on our
part, with the removal of wxMediaCtrl from the Debian/Ubuntu repository
version, that after getting the errors fixed, there’s an issue with
libpixman, in the function pixman_image_composite32, running through the
GDB
backtrace.

I am therefore going to attempt to custom build wxWidgets myself, in
static
form, and build wxRuby’s so file in static mode, to see if the errors
progress, or fix. It may be solvable by using wxWidget’s internal
graphics
libraries over the system’s libraries, but I won’t know for certain till
I
run the compile. I’m getting things setup now, to see what happens, and
will post on my progress once I get a version built.

L8ers,

Mario

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In regards to Ron’s post, I have reviewed the gem created by the build
process, and attempted to use it, and it is as you said, with Ruby
1.9.2 p0,
when attempting to run most of the examples, it will cause a segfault

Seems as if you’re refering to me, but I’m not Ron. :wink:

Am 28.10.2010 07:45, schrieb Mario S.:

You may laugh, but I already tried that. Even with a self-compiled
wxWidgets in static mode (exact build options I used can be found in the
wxRuby wiki at
http://wxruby.rubyforge.org/wiki/wiki.pl?HowToBuildWxWidgets ) I got the
segfault. I compiled wxWidgets to the /opt/wxWidgets dir and tried to
run files like this:

$ export LD_LIBRARY_PATH=/opt/wxWidgets/lib
$ export PATH=/opt/wxWidgets/bin:$PATH
$ ruby -dw

However, I might have done something wrong as it was the first time I
compiled wxWidgets.

Sadly enough, I’m not a C++ developer and don’t have any knowledge of
SWIG. I’ve done some C programming, but I think I can’t be of much help.
If it’s any help I’ve joined the #wxruby IRC channel for now, but I
don’t have much time.

Sorry for the late answer, but normally I’m not at home until 17pm.
Except on weekends, of course. Just for information: My time zone is UTC

  • 2 as I’m living in Germany, next week it will be UTC + 1 when daylight
    saving time ends.

Vale,
Marvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMyYOMAAoJEGrS0YjAWTKV4XsH/0l98tbKX4Lq8o/bNDN85snW
xMX+dYVdcWtgqDCT8i+IRJZyD7+c7UDPFaej1sYseqbVBppMxx5r2FhZpbxVWity
2mBklu9zVK8/3r9LtufUcBQB+hTzsEallRuhZcz2yUQHQ1sb/7TELC0E7tJCYby3
rVu3LMktAv65KfuqZbXXZuiYUMwHjxgYAfxjZQVomODDSmBZWZQmuPe5qcPmUhGN
4i5bN/d0RdXNZnJoVP4tTJDGJQxFXyUOzon55m95lwILqsN7JW1pb7Wb/Zi8snnP
fxjLKtljJQOHbP2wYrvrc79OgucYva5bEiPEYEU7VaCaM2wJMOetV56pKXApvdU=
=0e2/
-----END PGP SIGNATURE-----

Alright, after running through various self-compilation tests, and
switching
between 1.8.7 p302 and 1.9.2 p0, I’ve ended up with the same results,
pixmap_image_composite32() for some reason is causing a segfault in
wxRuby,
no matter the circumstances. I’ve had it crop up in a good portion of
the
examples, and been trying to backtrace the issues to their problems.
Sadly,
it seems that it doesn’t matter which class is being used, and it
doesn’t
matter which example is being tried out, it will still cause the same
problems. Sometimes it’ll wait till the user does an action, such as
menu
click, or it will crash immediately after the start of the run.

And it always crashes on pixmap_image_composite32(). From what I’ve
found
of the libpixman library, it’s a drawing function that will basically
blit
an image with a composite form from src, to destination. So it is some
kind
of drawing function, but somehow it’s crashing. And I’ve tested with
various C++ Examples provided with wxWidgets, and they all seem to
operate
perfectly fine. I’m currently at a lost as to what is causing this.

Mario S. wrote in post #957800:

perfectly fine. I’m currently at a lost as to what is causing this.

I’m sure it’s not good for your sanity, but I just found out that our
beloved problem isn’t limited to Ubuntu. Yesterday I decided to give
Arch Linux a try and today I wanted to do some developing with wxRuby,
but nope. Here’s what I did:

  • Compiled Ruby 1.9.2-p0 to /opt/rubies/ruby-1.9.2-p0
  • Compiled wxRuby on top of Arch’s distro wxWidgets
  • Installed the wxruby-ruby19 gem I just compiled

And now the expected segfault:

[email protected] =>
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/samples/minimal
$ ruby -dw minimal.rb
Exception LoadError' at <internal:lib/rubygems/custom_require>:29 - no such file to load -- rubygems/defaults/operating_system ExceptionLoadError’ at internal:lib/rubygems/custom_require:37 - no
such file to load – rubygems/defaults/operating_system
Exception LoadError' at <internal:lib/rubygems/custom_require>:29 - no such file to load -- rubygems/defaults/ruby ExceptionLoadError’ at internal:lib/rubygems/custom_require:37 - no
such file to load – rubygems/defaults/ruby
Exception `LoadError’ at internal:lib/rubygems/custom_require:29 - no
such file to load – wx
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so:
warning: method redefined; discarding old get_alpha_data
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so:
warning: method redefined; discarding old get_rgb_data
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/data_object_simple.rb:3:
warning: method redefined; discarding old get_data_size
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/data_object.rb:3:
warning: method redefined; discarding old get_preferred_format
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/data_object.rb:7:
warning: method redefined; discarding old get_format_count
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/data_object.rb:11:
warning: method redefined; discarding old get_data_size
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/app.rb:30:
warning: method redefined; discarding old on_assert_failure
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/validator.rb:4:
warning: method redefined; discarding old clone
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/clientdc.rb:8:
warning: method redefined; discarding old initialize
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/paintdc.rb:7:
warning: method redefined; discarding old initialize

(wxruby:2101): Gtk-WARNING **: Error parsing gtk-icon-sizes string:
‘panel-menu=24,24
panel=20,20
gtk-button=18,18
gtk-large-toolbar=24,24’
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/app.rb:16:
[BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

– control frame ----------
c:0006 p:---- s:0017 b:0017 l:000016 d:000016 CFUNC :on_run
c:0005 p:---- s:0015 b:0015 l:000014 d:000014 CFUNC :main_loop
c:0004 p:0053 s:0012 b:0012 l:000011 d:000011 METHOD
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/app.rb:16
c:0003 p:0062 s:0006 b:0006 l:001658 d:002148 EVAL minimal.rb:73
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001658 d:001658 TOP

– Ruby level backtrace information

minimal.rb:73:in <main>' /opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/app.rb:16:inrun’
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/app.rb:16:in
main_loop' /opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wx/classes/app.rb:16:inon_run’

– C level backtrace information

/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(rb_vm_bugreport+0x5f)
[0x7ffac492b30f]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(+0x627c4) [0x7ffac480b7c4]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(rb_bug+0xb3)
[0x7ffac480c6f3]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(+0x115715) [0x7ffac48be715]
/lib/libpthread.so.0(+0xf1c0) [0x7ffac459b1c0]
/usr/lib/libpixman-1.so.0(pixman_image_composite32+0x45d)
[0x7ffab7f08a1d]
/usr/lib/libcairo.so.2(+0x3a0a1) [0x7ffabb9560a1]
/usr/lib/libcairo.so.2(+0x645cc) [0x7ffabb9805cc]
/usr/lib/libcairo.so.2(+0x65a7c) [0x7ffabb981a7c]
/usr/lib/libcairo.so.2(+0x4822b) [0x7ffabb96422b]
/usr/lib/libcairo.so.2(+0x4ada0) [0x7ffabb966da0]
/usr/lib/libcairo.so.2(+0x49ec3) [0x7ffabb965ec3]
/usr/lib/libcairo.so.2(+0x4a9a2) [0x7ffabb9669a2]
/usr/lib/libcairo.so.2(+0x4b771) [0x7ffabb967771]
/usr/lib/libcairo.so.2(+0x47e13) [0x7ffabb963e13]
/usr/lib/libcairo.so.2(+0x2162d) [0x7ffabb93d62d]
/usr/lib/libcairo.so.2(cairo_fill_preserve+0x20) [0x7ffabb934220]
/usr/lib/libcairo.so.2(cairo_fill+0x9) [0x7ffabb934239]
/usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so(+0x14a5e)
[0x7ffab6223a5e]
/usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so(+0x18fa9)
[0x7ffab6227fa9]
/usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so(+0x947f)
[0x7ffab621847f]
/usr/lib/libgtk-x11-2.0.so.0(+0x8d01b) [0x7ffabfb4a01b]
/usr/lib/libgtk-x11-2.0.so.0(+0x8d24f) [0x7ffabfb4a24f]
/usr/lib/libgtk-x11-2.0.so.0(+0x136258) [0x7ffabfbf3258]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0xa9) [0x7ffabf5cbe09]
/usr/lib/libgobject-2.0.so.0(+0x1ef78) [0x7ffabf5dcf78]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x625)
[0x7ffabf5e6345]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x83) [0x7ffabf5e6773]
/usr/lib/libgtk-x11-2.0.so.0(+0x2516ef) [0x7ffabfd0e6ef]
/usr/lib/libgtk-x11-2.0.so.0(gtk_container_propagate_expose+0x1c6)
[0x7ffabfb75c96]
/usr/lib/libgtk-x11-2.0.so.0(+0x8399b) [0x7ffabfb4099b]
/usr/lib/libgtk-x11-2.0.so.0(+0xb7804) [0x7ffabfb74804]
/usr/lib/libgtk-x11-2.0.so.0(+0x136258) [0x7ffabfbf3258]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0xa9) [0x7ffabf5cbe09]
/usr/lib/libgobject-2.0.so.0(+0x1ef78) [0x7ffabf5dcf78]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x625)
[0x7ffabf5e6345]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x83) [0x7ffabf5e6773]
/usr/lib/libgtk-x11-2.0.so.0(+0x2516ef) [0x7ffabfd0e6ef]
/usr/lib/libgtk-x11-2.0.so.0(gtk_container_propagate_expose+0x1c6)
[0x7ffabfb75c96]
/usr/lib/libgtk-x11-2.0.so.0(+0x8399b) [0x7ffabfb4099b]
/usr/lib/libgtk-x11-2.0.so.0(+0xb7804) [0x7ffabfb74804]
/usr/lib/libgtk-x11-2.0.so.0(+0x136258) [0x7ffabfbf3258]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0xa9) [0x7ffabf5cbe09]
/usr/lib/libgobject-2.0.so.0(+0x1ef78) [0x7ffabf5dcf78]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x625)
[0x7ffabf5e6345]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x83) [0x7ffabf5e6773]
/usr/lib/libgtk-x11-2.0.so.0(+0x2516ef) [0x7ffabfd0e6ef]
/usr/lib/libgtk-x11-2.0.so.0(gtk_container_propagate_expose+0x1c6)
[0x7ffabfb75c96]
/usr/lib/libgtk-x11-2.0.so.0(+0xb7804) [0x7ffabfb74804]
/usr/lib/libgtk-x11-2.0.so.0(+0x136258) [0x7ffabfbf3258]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x15e) [0x7ffabf5cbebe]
/usr/lib/libgobject-2.0.so.0(+0x1ef78) [0x7ffabf5dcf78]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x625)
[0x7ffabf5e6345]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x83) [0x7ffabf5e6773]
/usr/lib/libgtk-x11-2.0.so.0(+0x2516ef) [0x7ffabfd0e6ef]
/usr/lib/libgtk-x11-2.0.so.0(gtk_main_do_event+0x58a) [0x7ffabfbf1a7a]
/usr/lib/libgdk-x11-2.0.so.0(+0x42cf2) [0x7ffabf84ecf2]
/usr/lib/libgdk-x11-2.0.so.0(+0x3dc1b) [0x7ffabf849c1b]
/usr/lib/libgdk-x11-2.0.so.0(gdk_window_process_all_updates+0x129)
[0x7ffabf84be39]
/usr/lib/libgtk-x11-2.0.so.0(+0xb74b1) [0x7ffabfb744b1]
/usr/lib/libgdk-x11-2.0.so.0(+0x1d366) [0x7ffabf829366]
/usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x1f3)
[0x7ffabf013bf3]
/usr/lib/libglib-2.0.so.0(+0x423d0) [0x7ffabf0143d0]
/usr/lib/libglib-2.0.so.0(g_main_loop_run+0x182) [0x7ffabf014a42]
/usr/lib/libgtk-x11-2.0.so.0(gtk_main+0xa7) [0x7ffabfbf07c7]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN11wxEventLoop3RunEv+0x48)
[0x7ffac0b4e478]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN9wxAppBase8MainLoopEv+0x4b)
[0x7ffac0bcb84b]
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so(+0x20f170)
[0x7ffac263e170]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(+0x17957e) [0x7ffac492257e]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(rb_funcall+0xb2)
[0x7ffac49230f2]
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so(_ZN16SwigDirector_App5OnRunEv+0x2d)
[0x7ffac263eb5d]
/usr/lib/libwx_baseu-2.8.so.0(_Z7wxEntryRiPPw+0x6a) [0x7ffac06a5cfa]
/opt/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so(+0x20f060)
[0x7ffac263e060]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(+0x17c1ee) [0x7ffac49251ee]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(+0x171dd6) [0x7ffac491add6]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(+0x178213) [0x7ffac4921213]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(rb_iseq_eval_main+0xb1)
[0x7ffac4926671]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(+0x68b4a) [0x7ffac4811b4a]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(ruby_exec_node+0x1d)
[0x7ffac4812aad]
/opt/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9(ruby_run_node+0x1e)
[0x7ffac4814d1e]
ruby(main+0x4b) [0x40099b]
/lib/libc.so.6(__libc_start_main+0xfd) [0x7ffac3988c4d]
ruby() [0x400889]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension
libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

The issue is definitely related to libpixman’s version and not to
Ubuntu’s modifications I conclude. But that means, if the other distros
update their libpixman, wxRuby won’t work ony any of them… :frowning:

This is the pixman lib Arch uses:

[email protected] => ~
$ LANG=en_US.utf8 pacman -Qi pixman
Name : pixman
Version : 0.18.4-1
URL : http://xorg.freedesktop.org
Licenses : custom
Groups : None
Provides : None
Depends On : glibc
Optional Deps : None
Required By : cairo xorg-server
Conflicts With : None
Replaces : None
Installed Size : 480.00 K
Packager : Jan de Groot [email protected]
Architecture : x86_64
Build Date : Tue 17 Aug 2010 08:59:48 AM CEST
Install Date : Sun 14 Nov 2010 11:17:47 AM CET
Install Reason : Installed as a dependency for another package
Install Script : No
Description : Pixman library

ruby -v, just for completeness:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

uname -a:
Linux pegasus 2.6.35-ARCH #1 SMP PREEMPT Sat Oct 30 21:22:26 CEST 2010
x86_64 Intel® Pentium® 4 CPU 3.00GHz GenuineIntel GNU/Linux

Vale,
Marvin

I have great news!!

Today I upgraded my Arch Linux, and now wxRuby works just fine! :smiley:

===================================
[email protected] => ~
$ export LANG=en_US.utf8
[email protected] => ~
$ pacman -Qi pixman
Name : pixman
Version : 0.20.0-1
URL : http://xorg.freedesktop.org
Licenses : custom
Groups : None
Provides : None
Depends On : glibc
Optional Deps : None
Required By : cairo xorg-server
Conflicts With : None
Replaces : None
Installed Size : 528.00 K
Packager : Jan de Groot [email protected]
Architecture : x86_64
Build Date : Mon 01 Nov 2010 11:25:44 PM CET
Install Date : Sat 20 Nov 2010 01:12:04 PM CET
Install Reason : Installed as a dependency for another package
Install Script : No
Description : Pixman library

[email protected] => ~
$ pacman -Qi wxgtk
Name : wxgtk
Version : 2.8.11-2
URL : http://wxwidgets.org
Licenses : custom:wxWindows
Groups : None
Provides : None
Depends On : gtk2 gstreamer0.10-base libgl libxxf86vm
Optional Deps : None
Required By : None
Conflicts With : None
Replaces : None
Installed Size : 20292.00 K
Packager : Eric B. [email protected]
Architecture : x86_64
Build Date : Mon 15 Nov 2010 10:32:17 PM CET
Install Date : Sat 20 Nov 2010 01:12:12 PM CET
Install Reason : Explicitly installed
Install Script : No
Description : GTK+ implementation of wxWidgets API for GUI

[email protected] => ~
$ uname -a
Linux pegasus 2.6.35-ARCH #1 SMP PREEMPT Sat Oct 30 21:22:26 CEST 2010
x86_64 Intel® Pentium® 4 CPU 3.00GHz GenuineIntel GNU/Linux
[email protected] => ~
$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
[email protected] => ~
$ gem list wxruby-ruby19

*** LOCAL GEMS ***

wxruby-ruby19 (2.0.1 x86_64-linux)
[email protected] => ~
$

===================================

Even the bidgemo runs fine! I’ll kick my Ubuntu Maverick and just leave
a small Ubuntu Lucid installation for security reasons - I’m quite new
to Arch, probably I break something.

Yay, I’m excited!

Vale,
Marvin

And it gets even better - on Arch the precompiled wxruby-ruby19 gem from
the RubyGems Index works - I really gonna miss the compilation… :slight_smile:

Vale,
Marvin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs