D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1693 - D DLLs do not support exceptions
Summary: D DLLs do not support exceptions
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: spec, wrong-code
Depends on:
Blocks:
 
Reported: 2007-11-25 08:32 UTC by Daniel Keep
Modified: 2014-02-24 15:32 UTC (History)
1 user (show)

See Also:


Attachments
Test case (1.85 KB, application/octet-stream)
2007-11-25 08:34 UTC, Daniel Keep
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Daniel Keep 2007-11-25 08:32:30 UTC
If an exception crosses the boundary between a DLL and its host, it causes the program to crash out to a system dialog.  This effectively makes D-based DLLs useless, unless you wrap every single call in try/catch.  This throws a rather large stick in the spokes of getting Phobos into a DLL.

At a minimum, the web page on doing DLLs in D should be updated to explicitly state this limitation.

Will attach a complete test case presently.
Comment 1 Daniel Keep 2007-11-25 08:34:52 UTC
Created attachment 210 [details]
Test case

Compile using build.cmd, then execute host.exe.  It should get as far as printing "Hello, from plugin2!" before crashing.  Commenting out "throw new Exception..." from plugin.d and recompiling causes the crash to disappear.
Comment 2 SHOO 2011-11-26 23:58:26 UTC
*** Issue 7020 has been marked as a duplicate of this issue. ***