WARNING: silent data corruption possible from PL/ruby 0.5.0 (after Ruby upgrade) - Mailing list pgsql-general

From Peter Much
Subject WARNING: silent data corruption possible from PL/ruby 0.5.0 (after Ruby upgrade)
Date
Msg-id 20090506194120.GA42693@gate.oper.dinoex.org
Whole thread Raw
List pgsql-general
Dear all,

since upgrading Ruby from 1.8.6.287 to 1.8.7.72, and recompiling
PL/ruby 0.5.0, functions written in PL/ruby may ignore their
given parameters and instead compute with undefined values,
providing nonsense results.

The test-suite provided with PL/ruby will show the problem.

Upgrading to PL/ruby 0.5.3 does not solve the problem, but that
version seems to detect the problem and raise an error.

I have figured out how the problem appears, but do not understand
why it appears or where exactly the cause is.
The problem seems related to the way PL/ruby uses a Ruby function
named rb_block_call. That function will only be used when detected
during compilation of PL/ruby. While this was not the case with
Ruby 1.8.6, it is with Ruby 1.8.7.
So, a workaround to get the applications operative is simply to
suppress the detection of that function.

It is unclear if the actual problem is in Ruby or in PL/ruby. It it
also unclear what this function rb_block_call is good for or why
it did appear with Ruby 1.8.7.

The author of PL/ruby has been contacted, but did not answer.

Further details can be found in that bug report:
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/134300


rgds,
PMc

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Is thre a way?
Next
From: Richard Sickler
Date:
Subject: Question on pg_xlog and pg_control placement