clkao / plv8js-migrated

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

plv8 Segmentation fault #99

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Server crash when there is a syntax error in a query:

2014-06-16 11:41:42.477 CEST,,,13614,,535f4339.352e,23,,2014-04-29 08:14:17 
CEST,,0,LOG,00000,"server process (PID 22672) was terminated by signal 11: 
Segmentation fault","Failed process was running: DO $$ 
plv8.elog(NOTICE, 'this', 'is', 'inline', 'code');
var plan = plv8.prepare( 'SELECT id, guid, name as name_custom FROM d_project 
WHERE name ilike ''%''$1''%''', ['text'] );
var cursor = plan.cursor( ['trib'] );
var sum = 0, row;

while (row = cursor.fetch()) {
  plv8.elog(NOTICE, json_result[0].id, json_result[0].guid, json_result[0].name );
}
cursor.close();
plan.free();
$$ LANGUAGE plv8;",,,,,,,,""

2014-06-16 14:28:10.408 CEST,,,994,,539ebe3c.3e2,3,,2014-06-16 11:51:56 
CEST,,0,LOG,00000,"server process (PID 23641) was terminated by signal 11: 
Segmentation fault","Failed process was running: DO $$ 
  var records = plv8.execute( ""SELECT id, guid, name as name_custom FROM d_project WHERE name ilike '%name%'"" );

  var data = [];
  records.forEach( function ( rec, i, arr ) {

    data.push( rec.data );

  } );

  data.forEach( function ( id, guid, name_custom ) {

    plv8.elog(NOTICE, data[0], data[1], data[2 );

  } );

$$ LANGUAGE plv8;",,,,,,,,""

CentOS release 6.5 (Final)
"PostgreSQL 9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 
20120313 (Red Hat 4.4.7-4), 64-bit"

Original issue reported on code.google.com by oleg.i...@gmail.com on 16 Jun 2014 at 2:43