www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1693] New: D DLLs do not support exceptions

reply d-bugmail puremagic.com writes:

           Summary: D DLLs do not support exceptions
           Product: D
           Version: 1.023
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: daniel.keep+d.puremagic.com gmail.com

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.

Nov 25 2007
parent d-bugmail puremagic.com writes:

------- Comment #1 from daniel.keep+d.puremagic.com gmail.com  2007-11-25 08:34
Created an attachment (id=210)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=210&action=view)
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.

Nov 25 2007