https://issues.dlang.org/show_bug.cgi?id=13573
Issue ID: 13573 Summary: std.net.curl doesn't handle exceptions in callbacks Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: Phobos Assignee: nob...@puremagic.com Reporter: c...@dawg.eu cat > bug.d << CODE import std.net.curl; void main() { auto http = HTTP("dlang.org/non-existing-url"); http.onReceiveStatusLine = (HTTP.StatusLine s) { if (s.code != 200) throw new Exception("Request failed."); }; http.method = HTTP.Method.head; http.perform(); } CODE dmd -L-lcurl -run bug ---- This program segfaults because the D exception handling cannot unwind through the C stack of libcurl. What's needed here is either a nothrow requirement on the callbacks or an exception catch/rethrow mechanism. --