{"action":"created","issue":{"url":"https://api.github.com/repos/gap-system/gap/issues/397","labels_url":"https://api.github.com/repos/gap-system/gap/issues/397/labels{/name}","comments_url":"https://api.github.com/repos/gap-system/gap/issues/397/comments","events_url":"https://api.github.com/repos/gap-system/gap/issues/397/events","html_url":"https://github.com/gap-system/gap/issues/397","id":121803811,"number":397,"title":"Segfault after quitting from a break loop","user":{"login":"alex-konovalov","id":5751387,"avatar_url":"https://avatars.githubusercontent.com/u/5751387?v=3","gravatar_id":"","url":"https://api.github.com/users/alex-konovalov","html_url":"https://github.com/alex-konovalov","followers_url":"https://api.github.com/users/alex-konovalov/followers","following_url":"https://api.github.com/users/alex-konovalov/following{/other_user}","gists_url":"https://api.github.com/users/alex-konovalov/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-konovalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-konovalov/subscriptions","organizations_url":"https://api.github.com/users/alex-konovalov/orgs","repos_url":"https://api.github.com/users/alex-konovalov/repos","events_url":"https://api.github.com/users/alex-konovalov/events{/privacy}","received_events_url":"https://api.github.com/users/alex-konovalov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-11T22:23:20Z","updated_at":"2015-12-12T11:20:25Z","closed_at":null,"body":"The following code leads to an error, as documented:\r\n\r\nEvalString( \"DeclareGlobalFunction( \\\"a\\\" );\" );\r\n\r\nHowever, exiting the break loop and executing it again leads to a different error, and exiting the 2nd break loop lead to a segmentation fault:\r\n\r\n```\r\ngap> EvalString( \"DeclareGlobalFunction( \\\"a\\\" );\" );\r\nError, Function call: <func> must return a value\r\nnot in any function at line 1 of stream\r\nError, Could not evaluate string.\r\n called from\r\n<function \"EvalString\">( <arguments> )\r\n called from read-eval loop at line 8 of *stdin*\r\nyou can 'quit;' to quit to outer loop, or\r\nyou can 'return;' to continue\r\nbrk> quit;\r\ngap> EvalString( \"DeclareGlobalFunction( \\\"a\\\" );\" );\r\nError, BIND_GLOBAL: variable `a' must be unbound called from\r\nBIND_GLOBAL( name, NEW_OPERATION_ARGS( name ) \r\n ); at /Users/alexk/GITREPS/gap/lib/oper.g:1746 called from\r\n<function \"DeclareGlobalFunction\">( <arguments> )\r\n called from read-eval loop at line 1 of stream\r\nyou can 'quit;' to quit to outer loop, or\r\nyou can 'return;' to continue\r\nbrk> quit;\r\nSegmentation fault: 11\r\n```"},"comment":{"url":"https://api.github.com/repos/gap-system/gap/issues/comments/164139754","html_url":"https://github.com/gap-system/gap/issues/397#issuecomment-164139754","issue_url":"https://api.github.com/repos/gap-system/gap/issues/397","id":164139754,"user":{"login":"ChrisJefferson","id":811527,"avatar_url":"https://avatars.githubusercontent.com/u/811527?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisJefferson","html_url":"https://github.com/ChrisJefferson","followers_url":"https://api.github.com/users/ChrisJefferson/followers","following_url":"https://api.github.com/users/ChrisJefferson/following{/other_user}","gists_url":"https://api.github.com/users/ChrisJefferson/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisJefferson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisJefferson/subscriptions","organizations_url":"https://api.github.com/users/ChrisJefferson/orgs","repos_url":"https://api.github.com/users/ChrisJefferson/repos","events_url":"https://api.github.com/users/ChrisJefferson/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisJefferson/received_events","type":"User","site_admin":false},"created_at":"2015-12-12T11:20:25Z","updated_at":"2015-12-12T11:20:25Z","body":"Turns out this is coming from a strange source:\r\n\r\n```\r\nf := function() return 1/0; end;\r\n\r\na := \"_q:=f();;\";\r\nstream := InputTextString(a);\r\nRead(stream);\r\n```\r\n\r\nThis also crashes. If you put any extra character at the end of the string `a`, it doesn't crash, so I think it's something to do with the parser, and double-semi-colon."}}