{"action":"created","issue":{"url":"https://api.github.com/repos/orangeduck/mpc/issues/58","repository_url":"https://api.github.com/repos/orangeduck/mpc","labels_url":"https://api.github.com/repos/orangeduck/mpc/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/orangeduck/mpc/issues/58/comments","events_url":"https://api.github.com/repos/orangeduck/mpc/issues/58/events","html_url":"https://github.com/orangeduck/mpc/issues/58","id":169102826,"node_id":"MDU6SXNzdWUxNjkxMDI4MjY=","number":58,"title":"SIGSEGV when creating grammar.","user":{"login":"JeromSar","id":1307863,"node_id":"MDQ6VXNlcjEzMDc4NjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1307863?v=4","gravatar_id":"","url":"https://api.github.com/users/JeromSar","html_url":"https://github.com/JeromSar","followers_url":"https://api.github.com/users/JeromSar/followers","following_url":"https://api.github.com/users/JeromSar/following{/other_user}","gists_url":"https://api.github.com/users/JeromSar/gists{/gist_id}","starred_url":"https://api.github.com/users/JeromSar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeromSar/subscriptions","organizations_url":"https://api.github.com/users/JeromSar/orgs","repos_url":"https://api.github.com/users/JeromSar/repos","events_url":"https://api.github.com/users/JeromSar/events{/privacy}","received_events_url":"https://api.github.com/users/JeromSar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-03T10:49:48Z","updated_at":"2018-09-15T18:59:32Z","closed_at":"2016-08-03T10:54:08Z","author_association":"NONE","body":"Hi,\n\nI've been expanding lispy (from your book, which is awesome, btw), to include support for doubles. However, when I finished my implementation, I suddenly get SIGSEGV errors when creating the grammar. Is there something I'm doing wrong?\n\nI'm using the latest (master) version on the repo.\n\nGrammar:\n\n``` c\n#define GRAMMAR \"                                          \\\n                                                           \\\n      long     : /-?[0-9]+/ ;                              \\\n      double   : /-?[0-9]+\\\\.?[0-9]+/;                     \\\n      symbol   : /[a-zA-Z0-9_+\\\\-*\\\\/\\\\\\\\=<>!&\\\\|\\\\:]+/ ;  \\\n      string   : /\\\"(\\\\\\\\.|[^\\\"])*\\\"/ ;                    \\\n      comment  : /;[^\\\\r\\\\n]*/ ;                           \\\n      sexpr    : '(' <expr>* ')' ;                         \\\n      qexpr    : '{' <expr>* '}' ;                         \\\n      expr     : <number>  | <symbol> | <string>           \\\n               | <comment> | <sexpr>  | <qexpr> ;          \\\n      lispy    : /^/ <expr>* /$/ ;                         \\\n                                                           \\\n   \"\n\nstatic mpc_parser_t* number_l;\nstatic mpc_parser_t* number_d;\nstatic mpc_parser_t* symbol;\nstatic mpc_parser_t* string;\nstatic mpc_parser_t* comment;\nstatic mpc_parser_t* sexpr;\nstatic mpc_parser_t* qexpr;\nstatic mpc_parser_t* expr;\nstatic mpc_parser_t* lispy;\n\nmpc_parser_t* grammar_create() {\n  number_l = mpc_new(\"long\");\n  number_d = mpc_new(\"double\");\n  symbol = mpc_new(\"symbol\");\n  string = mpc_new(\"string\");\n  comment = mpc_new(\"comment\");\n  sexpr = mpc_new(\"sexpr\");\n  qexpr = mpc_new(\"qexpr\");\n  expr = mpc_new(\"expr\");\n  lispy = mpc_new(\"lispy\");\n\n  mpca_lang(MPCA_LANG_DEFAULT, GRAMMAR,  \n    number_l, number_d, symbol, string, comment,\n    sexpr, qexpr, expr, lispy);\n\n  return lispy;\n}\n```\n\nGDB backtrace:\n\n```\nProgram received signal SIGSEGV, Segmentation fault.\n0x74538eb4 in strcmp () from C:\\WINDOWS\\SysWOW64\\msvcrt.dll\n(gdb) backtrace\n#0  0x74538eb4 in strcmp () from C:\\WINDOWS\\SysWOW64\\msvcrt.dll\n#1  0x0040de42 in mpca_grammar_find_parser ()\n#2  0x0040de74 in mpcaf_grammar_id ()\n#3  0x004081f5 in mpc_parse_apply_to ()\n#4  0x00408607 in mpc_parse_run ()\n#5  0x00408d22 in mpc_parse_run ()\n#6  0x00408e6d in mpc_parse_run ()\n#7  0x00408a66 in mpc_parse_run ()\n#8  0x00408e6d in mpc_parse_run ()\n#9  0x00408e6d in mpc_parse_run ()\n#10 0x0040891a in mpc_parse_run ()\n#11 0x004086d8 in mpc_parse_run ()\n#12 0x00408e6d in mpc_parse_run ()\n#13 0x00408e6d in mpc_parse_run ()\n#14 0x004085db in mpc_parse_run ()\n#15 0x00408feb in mpc_parse_input ()\n#16 0x0040e8df in mpca_lang_st ()\n#17 0x0040ea59 in mpca_lang ()\n#18 0x00403e5c in grammar_create ()\n#19 0x00401451 in main ()\n(gdb)\n```\n"},"comment":{"url":"https://api.github.com/repos/orangeduck/mpc/issues/comments/421617129","html_url":"https://github.com/orangeduck/mpc/issues/58#issuecomment-421617129","issue_url":"https://api.github.com/repos/orangeduck/mpc/issues/58","id":421617129,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTYxNzEyOQ==","user":{"login":"yrizk","id":5533858,"node_id":"MDQ6VXNlcjU1MzM4NTg=","avatar_url":"https://avatars2.githubusercontent.com/u/5533858?v=4","gravatar_id":"","url":"https://api.github.com/users/yrizk","html_url":"https://github.com/yrizk","followers_url":"https://api.github.com/users/yrizk/followers","following_url":"https://api.github.com/users/yrizk/following{/other_user}","gists_url":"https://api.github.com/users/yrizk/gists{/gist_id}","starred_url":"https://api.github.com/users/yrizk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yrizk/subscriptions","organizations_url":"https://api.github.com/users/yrizk/orgs","repos_url":"https://api.github.com/users/yrizk/repos","events_url":"https://api.github.com/users/yrizk/events{/privacy}","received_events_url":"https://api.github.com/users/yrizk/received_events","type":"User","site_admin":false},"created_at":"2018-09-15T18:59:32Z","updated_at":"2018-09-15T18:59:32Z","author_association":"NONE","body":"mind telling us what the issue was? I'm running to the same error on linux."}}
{"actor":{"display_login":"yrizk"}}