Ticket #1610 (closed bug: fixed)

Opened 12 years ago

Last modified 10 years ago

Parrot_compile_string does not properly catch errors thrown by causing IMCC syntax errors

Reported by: dukeleto Owned by: whiteknight
Priority: major Milestone:
Component: imcc Version: 2.3.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all

Description

Parrot_compile_string is supposed to fill an error_string with error messages, which it does in certain cases, but if an IMCC syntax error occurs, the exception bubbles up out of Parrot_compile_string. This currently causes PL/Parrot to coredump PostgreSQL for stored procedures that have incorrect syntax.

chromatic++ suggested installing a C exception handler with Parrot_ex_add_c_handler into Parrot_compile_string, but I have not been able to get it to work yet.

Attachments

yyerror.patch Download (80.5 KB) - added by plobsing 12 years ago.

Change History

  Changed 12 years ago by dukeleto

TODO test added in r46304

in reply to: ↑ description ; follow-up: ↓ 3   Changed 12 years ago by plobsing

  • owner set to plobsing
  • component changed from embed/extend to imcc

chromatic++ suggested installing a C exception handler with Parrot_ex_add_c_handler into Parrot_compile_string, but I have not been able to get it to work yet.

That likely won't work. IMCC spits errors directly to STDERR. I ran into this same issue adding tests for TT #126 (see r46484).

in reply to: ↑ 2   Changed 12 years ago by plobsing

Replying to plobsing:

chromatic++ suggested installing a C exception handler with Parrot_ex_add_c_handler into Parrot_compile_string, but I have not been able to get it to work yet.

That likely won't work. IMCC spits errors directly to STDERR. I ran into this same issue adding tests for TT #126 (see r46484).

s/126/162/ # oops

Changed 12 years ago by plobsing

in reply to: ↑ description   Changed 12 years ago by plobsing

Replying to dukeleto:

Parrot_compile_string is supposed to fill an error_string with error messages, which it does in certain cases, but if an IMCC syntax error occurs, the exception bubbles up out of Parrot_compile_string. This currently causes PL/Parrot to coredump PostgreSQL for stored procedures that have incorrect syntax. chromatic++ suggested installing a C exception handler with Parrot_ex_add_c_handler into Parrot_compile_string, but I have not been able to get it to work yet.

Here's a patch that fixes this issue slightly by changing IMCC's yyerror to not fprintf(stderr,...).

It changes the format of error messages slightly, causing some tests to fail.

follow-up: ↓ 6   Changed 11 years ago by whiteknight

  • owner changed from plobsing to whiteknight

Parrot_compile_string does not return error information in the *error parameter any more. IMCC now throws proper exceptions which need to be caught. I suspect that this ticket should be closed as invalid, although I will keep it open for now to ensure PL/Parrot gets fixed up with the new system.

in reply to: ↑ 5   Changed 11 years ago by jkeenan

dukeleto:

Replying to whiteknight:

I suspect that this ticket should be closed as invalid, although I will keep it open for now to ensure PL/Parrot gets fixed up with the new system.

Can you comment on the PL/Parrot aspect of this statement?

Thank you very much.

kid51

  Changed 10 years ago by whiteknight

  • status changed from new to closed
  • resolution set to fixed

I'm closing this ticket now. If PL/Parrot or any other ecosystem project needs help upgrading to the new style of this function (it's been this way for some weeks now), I can help.

Note: See TracTickets for help on using tickets.