I spent the past eight hours figuring out why my built phantomjs2 kept segfaulting. The root cause of the segfault was the usage of NSString constants; I'm not completely sure why this happened, but I'm guessing the compiled string constant has an isa member pointing to the wrong memory location. Once I rewrite the link reference in phantomjs, from nix-built CF to system CF, everything works.
The problem can be fixed by rewriting/removing the duplicate links, but I think a more viable long-term solution is in order to avoid future confusing bugs.
I spent the past eight hours figuring out why my built phantomjs2 kept segfaulting. The root cause of the segfault was the usage of NSString constants; I'm not completely sure why this happened, but I'm guessing the compiled string constant has an
isamember pointing to the wrong memory location. Once I rewrite the link reference in phantomjs, from nix-built CF to system CF, everything works.The problem can be fixed by rewriting/removing the duplicate links, but I think a more viable long-term solution is in order to avoid future confusing bugs.