WARNING: silent data corruption possible from PL/ruby 0.5.0 (after Ruby upgrade)

From: Peter Much <pmc(at)citylink(dot)dinoex(dot)sub(dot)org>
To: pgsql-bugs(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org, ts(at)moulon(dot)inra(dot)fr
Subject: WARNING: silent data corruption possible from PL/ruby 0.5.0 (after Ruby upgrade)
Date: 2009-05-06 19:41:22
Message-ID: 20090506194120.GA42693@gate.oper.dinoex.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-05-06 19:47:46 Re: Bug (8.4beta): FailedAssertion("!(bms_is_subset(relids, qualscope))", File: "initsplan.c", Line: 915)
Previous Message Tom Lane 2009-05-06 18:07:37 Re: Bug (8.4beta): FailedAssertion("!(bms_is_subset(relids, qualscope))", File: "initsplan.c", Line: 915)

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2009-05-06 19:45:54 Re: [GENERAL] how to select temp table
Previous Message Merlin Moncure 2009-05-06 19:39:05 Re: Postgres partially hang after inactivity