clkao / plv8js-migrated

Automatically exported from code.google.com/p/plv8js
Other
0 stars 0 forks source link

segfault in plv8.so when missing setof return #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

DO $$ plv8.return_next(new Object()); $$ language plv8;

What is the expected output? What do you see instead?

EXPECTED: plv8.elog ERROR. Should never segfault.

ACTUAL:

The connection to the server was lost. Attempting reset: Failed.

segmentation fault in dmesg logs:

[  836.548994] postgres[4843]: segfault at 125af081 ip ad7b25c8 sp bff39d50 
error 4 in plv8.so[ad7ab000+78000]

Database goes into recovery mode for other queries.

What version of the product are you using? On what operating system?

plv8 1.4.2

Please provide any additional information below.

This works:

CREATE TYPE rec3 AS (); CREATE OR REPLACE FUNCTION hello() RETURNS SETOF rec3 
AS $$  plv8.return_next( new Object() ); $$ language plv8;
select * from hello();
--
(1 row)

this segfaults:

CREATE TYPE rec3 AS (); CREATE OR REPLACE FUNCTION hello() RETURNS rec3 AS $$  
plv8.return_next( new Object() ); $$ language plv8;

Original issue reported on code.google.com by rnga...@gmail.com on 14 Apr 2014 at 3:01

GoogleCodeExporter commented 9 years ago
For what it's worth, I was able to reproduce this.

Original comment by mac...@heroku.com on 28 Apr 2014 at 5:32

GoogleCodeExporter commented 9 years ago
This is fixed in master and r1.4.  Thanks for the report.

Original comment by umi.tan...@gmail.com on 20 May 2014 at 6:09