Skip to content

Raising Parse_error in ocamlyacc parser action can induce segfault #10080

@InnocentusLime

Description

@InnocentusLime

Hello!
I was writing a big project which used ocamlyacc and ocamllex to generate some parsers and I've just got it to segfault. Judging by the backtrace printed by GDB, the problems is somewhere deep in the ocamlyacc

#0  0x00005555555d2d14 in caml_apply2 ()
#1  0x0000555555601ca2 in camlStdlib__parsing__loop_295 () at parsing.ml:142
#2  0x0000555555601af9 in camlStdlib__parsing__yyparse_290 () at parsing.ml:164
#3  0x00005555555d3f54 in camlDune__exe__Top__read_command_terminal_304 () at bin/top.ml:20
#4  0x00005555555d4d4c in camlDune__exe__Top__top_level_main_547 () at bin/top.ml:157
#5  0x00005555555d3a70 in camlDune__exe__Main__launch_1078 () at bin/main.ml:156
#6  0x00005555555d3c8f in camlDune__exe__Main__entry () at bin/main.ml:172
#7  0x00005555555d09e9 in caml_program ()
#8  0x0000555555641e90 in caml_start_program ()
#9  0x0000555555642285 in caml_startup_common ()
#10 0x00005555556422cf in caml_startup ()
#11 0x00005555555d0662 in main ()

If it can help, I will send the whole project together with steps to reproduce it

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions