Problems with ruby 1.8.6 on uClinux

After watching David G.'s RubyConf2008 presentation “Ruby for
Embedded Applications” (OpenEmbedded, ruby 1.8.5, Sinatra), I’ve
decided to try to use Ruby for my application. Our board has Blackfin
processor and we are using uClinux distribution. I was able to
successfully build and install ruby-1.8.6-p287. I’ve applied Brian
Candler’s patch (http://redmine.ruby-lang.org/issues/show/720). It’s
almost working. I had to free a lot of RAM (30MB) as I was getting
errors when ruby was trying to allocate memory. I was even able to
serve a simple web application with WEBrick and Ramaze, but it would
occasionally crash the Kernel. Now I have to make a decision if it’s
worth to pursue it any further. I would appreciate if someone, who has
experience with running Ruby on embedded systems (preferably with
Blackfin processor), will share his experience to help me make a
decision.

Thanks.

Yuri Klubakov wrote:

I was even able to
serve a simple web application with WEBrick and Ramaze, but it would
occasionally crash the Kernel.

No userland application should be able to crash the kernel - not even
one running as root. So if this is happening, then you have an
underlying O/S problem which you need to resolve. You are lucky that
Ruby provides you with a way to replicate it :slight_smile:

Once that’s done, you can take a view on how well Ruby works on your
platform.

FWIW, I have used ruby-1.8.6p36 very successfully on MIPS (Asus) and x86
(Soekris) embedded hardware, both under OpenWrt. The Asus box had 32MB
RAM, the Soekris 64MB. No crashes.

I see OpenWrt has moved its ruby package forward to 1.8.6p287, but I’ve
not tried that. I am still suspicious of later changes made in the 1.8.6
branch, and would suggest p114 as a safer choice.

On Thu, Mar 5, 2009 at 6:25 AM, Brian C. [email protected]
wrote:

Yuri Klubakov wrote:

I was even able to
serve a simple web application with WEBrick and Ramaze, but it would
occasionally crash the Kernel.

No userland application should be able to crash the kernel - not even
one running as root. So if this is happening, then you have an
underlying O/S problem which you need to resolve. You are lucky that
Ruby provides you with a way to replicate it :slight_smile:

I know that it’s not supposed to happen. Blackfin processor does not
have MMU (memory management unit). I’m not a linux expert, but may be
without MMU kernel is not as protected as with it. In my tests I was
running an application as root. I’ll try to run it under different
account.

Once that’s done, you can take a view on how well Ruby works on your
platform.

FWIW, I have used ruby-1.8.6p36 very successfully on MIPS (Asus) and x86
(Soekris) embedded hardware, both under OpenWrt. The Asus box had 32MB
RAM, the Soekris 64MB. No crashes.

Thanks for the encouraging information.

I see OpenWrt has moved its ruby package forward to 1.8.6p287, but I’ve
not tried that. I am still suspicious of later changes made in the 1.8.6
branch, and would suggest p114 as a safer choice.

I had problems configuring ruby-1.8.6p287 for Blackfin processor. In
the end, I’ve replaced config.sub with the one that comes with
ruby-1.9.1, and everything went smoothly. It should not be the cause
of my problems. Right? I’ll also try p114 as you’ve suggested.

Brian C. wrote:

I see OpenWrt has moved its ruby package forward to 1.8.6p287, but I’ve
not tried that. I am still suspicious of later changes made in the 1.8.6
branch, and would suggest p114 as a safer choice.

We’ve been using ruby 1.8.6p114 on OpenWRT for about a year (not the
package from OpenWRT, but a custom built one), and it works well for
various networking tasks. Very stable, AFAICT. Didn’t try p287.

Building native extensions is difficult, though, at least it is in our
cross-compile setup. I never did get native sqlite3-ruby to build, and
ended up just opening a pipe to the sqlite executable.