{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/11235","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/11235/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11235/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/11235/events","html_url":"https://github.com/JuliaLang/julia/pull/11235","id":75355284,"number":11235,"title":"WIP: ByteVec string implementation","user":{"login":"StefanKarpinski","id":153596,"avatar_url":"https://avatars.githubusercontent.com/u/153596?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanKarpinski","html_url":"https://github.com/StefanKarpinski","followers_url":"https://api.github.com/users/StefanKarpinski/followers","following_url":"https://api.github.com/users/StefanKarpinski/following{/other_user}","gists_url":"https://api.github.com/users/StefanKarpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKarpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKarpinski/subscriptions","organizations_url":"https://api.github.com/users/StefanKarpinski/orgs","repos_url":"https://api.github.com/users/StefanKarpinski/repos","events_url":"https://api.github.com/users/StefanKarpinski/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKarpinski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-11T20:57:19Z","updated_at":"2015-05-23T20:52:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/11235","html_url":"https://github.com/JuliaLang/julia/pull/11235","diff_url":"https://github.com/JuliaLang/julia/pull/11235.diff","patch_url":"https://github.com/JuliaLang/julia/pull/11235.patch"},"body":"@JeffBezanson, @Keno, @vtjnash, I'm having trouble debugging what's going on here – I'm pushing it in an incomplete state with lots of debugging output in hopes someone can help figure out what's going on here. So this croaks during system image build as soon as it hits code that uses a Regex:\r\n\r\n```jl\r\nlibc.jl\r\n\"A\"\r\nASCIIString\r\nInt128(0xffffffffffffffeb0000000106c75770)\r\nInt128(0x7c6a7c417c612825295e7c5d255e5b28)\r\n()\r\n\"B\"\r\nASCIIString\r\nInt128(0x7c6a7c417c612825295e7c5d255e5b28)\r\n\"C\"\r\nASCIIString\r\nInt128(0x7c6a7c417c612825295e7c5d255e5b28)\r\n\"D\"\r\nInt128(0x7c6a7c417c612825295e7c5d255e5b28)\r\n\r\nsignal (11): Segmentation fault: 11\r\nlength at bytevec.jl:18\r\nprint_to_string at string.jl:24\r\ncompile at pcre.jl:95\r\n```\r\n\r\nWhat you can see here is that it's hitting the `r\"...\"` macro just fine here:\r\n\r\nhttps://github.com/JuliaLang/julia/blob/251202fa8f8445053f66fd/base/regex.jl#L72-L78\r\n\r\nAt this point, `pattern` is an `ASCIIString` with a data field of `0xffffffffffffffeb0000000106c75770`, as expected – it's a negative length and a pointer to the actual string data, which starts with `0x7c6a7c417c612825295e7c5d255e5b28` – or in other words, the data `([^%]|^)%(a|A|j|`, which is the initial part of a regex pattern that gets passed to the `r_str` macro. So far so good. This in turn invokes the `Regex` constructor, here:\r\n\r\nhttps://github.com/JuliaLang/julia/blob/251202fa8f8445053f66fd/base/regex.jl#L18-L32\r\n\r\nBut now, surprisingly, `pattern` is no longer `0xffffffffffffffeb0000000106c75770` but seems to be the value that this used to point to – i.e. `0x7c6a7c417c612825295e7c5d255e5b28`. I have no idea how this is happening, since the same value of `pattern` is passed from the macro to the constructor function. Any ideas?"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/104943984","html_url":"https://github.com/JuliaLang/julia/pull/11235#issuecomment-104943984","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11235","id":104943984,"user":{"login":"simonster","id":470884,"avatar_url":"https://avatars.githubusercontent.com/u/470884?v=3","gravatar_id":"","url":"https://api.github.com/users/simonster","html_url":"https://github.com/simonster","followers_url":"https://api.github.com/users/simonster/followers","following_url":"https://api.github.com/users/simonster/following{/other_user}","gists_url":"https://api.github.com/users/simonster/gists{/gist_id}","starred_url":"https://api.github.com/users/simonster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonster/subscriptions","organizations_url":"https://api.github.com/users/simonster/orgs","repos_url":"https://api.github.com/users/simonster/repos","events_url":"https://api.github.com/users/simonster/events{/privacy}","received_events_url":"https://api.github.com/users/simonster/received_events","type":"User","site_admin":false},"created_at":"2015-05-23T20:52:01Z","updated_at":"2015-05-23T20:52:01Z","body":"This blog post may be of some interest: https://blog.mozilla.org/ejpbruel/2012/02/06/how-strings-are-implemented-in-spidermonkey-2/"}}