Forum: Ruby Problems with ruby 1.8.6 on uClinux

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4e58f89c0d0a51e00c998d5bf603847f?d=identicon&s=25 Yuri Klubakov (Guest)
on 2009-03-04 22:43
(Received via mailing list)
After watching David Goodlad'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.
753dcb78b3a3651127665da4bed3c782?d=identicon&s=25 Brian Candler (candlerb)
on 2009-03-05 12:27
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 :-)

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.
4e58f89c0d0a51e00c998d5bf603847f?d=identicon&s=25 Yuri Klubakov (Guest)
on 2009-03-05 21:05
(Received via mailing list)
On Thu, Mar 5, 2009 at 6:25 AM, Brian Candler <b.candler@pobox.com>
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 :-)

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.
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2009-03-05 22:13
(Received via mailing list)
Brian Candler 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.
This topic is locked and can not be replied to.