RPM

RPM5 embedded Ruby shall handle exception from Ruby code gracefully

Bug #635890 reported by Eric MSP Veith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RPM
In Progress
Medium
Eric MSP Veith

Bug Description

The current implementation of embedded Ruby in rpmio/rpmruby.c does not handle errors gracefully, i.e., errors in the Ruby code (e.g. from an %expand{ruby ...}) will probably kill RPM. The Ruby API allows safely wrapping and catching exceptions, e.g. by using rb_string_protect.

Revision history for this message
Jeff Johnson (n3npq) wrote :

Not a complaint ... BUT ...

Can we identify the need to handle exceptions/signals in a blueprint
before tracking bugs on vaporware? I'd like to get the rpm-embed-ruby blueprint targeted
at some milestone somehow.

In other words, a forward looking "feature" would be
    There's a need to handle exceptions/signals with embedded ruby ...
instead of the defect
    The current implementation of embedded Ruby in rpmio/rpmruby.c does not handle errors

Absolutely there has been no attempt to handle exceptions attempted yet.

Note that blueprints can also be linked to bugs if you wish.

There's no clear answer ... just I'd like to see forward looking feature approaches
rather than backward defect/bug fixing.

tags: added: rpm-embed-ruby
Revision history for this message
Jeff Johnson (n3npq) wrote :

> Fact is, there's rpmio/rpmruby.[ch] on HEAD. Fact is also, this one doesn't
> handle errors on the Ruby source code (%expand).

If you can enumerate the plain vanilla exceptions that ruby "expects",
that would help starting to devise a framework for throw/catch that
wraps every crossover from rpm <-> ruby.

Basically what is needed is to think of the embedded ruby interpreter
as an eval on steroids, and to wire up an exception handling
framework that never exits.

The other issue is one of design: macro expansions do don have any
well-defined error pathway except through expansion values.
.
All I'm saying is that the analogue of a macro expansion in shell is essentially
   ( run_some_command 2>&1 )
I'e an expansion is started and "errors" are handled in-band as if they were
the results of the expansion.

And (again analogous to the shell) what is needed is a trap call (i.e a
primitive form of exception handling).

SHort answer: Could you list the common ruby exceptions that need handling?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.