{"comment":{"created_at":"2011-10-24T12:40:29Z","body":"Having another look, I think that at least the segfault is specific to ByteBuffer. It keeps track of the strstart pointer, however it appears that this may actually change over the lifetime of the string. That seems to be what move_one_buffer in string_gc.c is doing. The segfaults all look like memory corruption of some sort, and trying to access a buffer that got moved would probably cause that.","updated_at":"2011-10-24T12:40:29Z","url":"https://api.github.com/repos/parrot/parrot/issues/comments/2502889","id":2502889,"user":{"avatar_url":"https://secure.gravatar.com/avatar/5999d5d26089eb4019867dc7705c41a9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5999d5d26089eb4019867dc7705c41a9","url":"https://api.github.com/users/jnthn","id":50259,"login":"jnthn"}},"action":"created","issue":{"number":182,"created_at":"2011-10-23T17:58:15Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"This program reliably segfaults for me:\r\n\r\n    .sub bb\r\n        $P0 = new 'ByteBuffer'\r\n        $P0 = 100\r\n        $I0 = 0\r\n      loop:\r\n        $I1 = $I0 + 1\r\n        $P0[$I0] = $I1\r\n        inc $I0\r\n        unless $I0 == 100 goto loop\r\n        .return ($P0)\r\n    .end\r\n\r\n    .sub main :main\r\n        $P0 = new 'ByteBuffer'\r\n        $P0 = 1\r\n        $P0[0] = 1\r\n        $I0 = 0\r\n    loop:\r\n        $P1 = 'bb'()\r\n        $S0 = $P0.'get_string'('binary')\r\n        $S1 = $P1.'get_string'('binary')\r\n        $S0 = concat $S0, $S1\r\n        $P0 = new 'ByteBuffer'\r\n        $P0 = $S0\r\n        inc $I0\r\n        unless $I0 == 10000 goto loop\r\n    .end\r\n\r\nIt does so in the function move_one_buffer in string_gc.c\r\n\r\nAlso rather worrying is that - even though the longest buffer string it should ever construct is 10000 * 100 bytes (and I guess it segfaults before it gets there) - at the point it segfaults it has eaten 2.7 GB of RAM!\r\n","comments":7,"title":"Segfault + seemingly crazy memory gobbling","updated_at":"2011-10-24T12:40:29Z","url":"https://api.github.com/repos/parrot/parrot/issues/182","id":2027818,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/5999d5d26089eb4019867dc7705c41a9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5999d5d26089eb4019867dc7705c41a9","url":"https://api.github.com/users/jnthn","id":50259,"login":"jnthn"},"html_url":"https://github.com/parrot/parrot/issues/182","labels":[{"name":"bug","url":"https://api.github.com/repos/parrot/parrot/labels/bug","color":"e10c02"}],"state":"open"},"legacy":{"issue_id":2027818,"comment_id":2502889}}