www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 315] New: Exception handling is broken for delegates on Linux

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=315

           Summary: Exception handling is broken for delegates on Linux
           Product: D
           Version: 0.165
          Platform: PC
               URL: http://www.digitalmars.com/pnews/read.php?server=news.di
                    gitalmars.com&group=digitalmars.D.bugs&artnum=7180
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: juanjo comellas.com.ar


There is a code generation bug on Linux that was found by Mikola Lysenko that
has been present since DMD 0.150 . The link associated to this bug report has
an example that shows this problem and an explanation of the problem. The
following paragraph has been copied verbatim from the original report:

As of version 0.150, the offsets of the code within a delegate's function
handler are not correctly calculated.  All of them seem to be set relative to
the address of the first delegate declared within the scope.  This results in
the following code breaking. The Windows version does not have this problem.


-- 
Aug 28 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=315


juanjo comellas.com.ar changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |juanjo comellas.com.ar





I'm attaching a copy of the original bug report to make it easy for people
checking this bug:

 As of version 0.150, the offsets of the code within a delegate's function 
 handler are not correctly calculated.  All of them seem to be set relative to 
 the address of the first delegate declared within the scope.  This results in 
 the following code breaking.  The windows version does not have this problem. 

 #class Tester 






 #unittest 














































































































 The catch block in the second delegate never gets invoked.  On a Linux 
machine. 
 My output is as follows: 

 Starting test 
 test1 
 initial test. 
 pass 
 test2 
 test3 
 Error: AssertError Failure test(117) 

 While on windows, it passes with: 

 Starting test 
 test1 
 initial test. 
 pass 
 test2 
 Never called. 
 test3 
 Passed! 


 -Mik 


-- 
Sep 03 2006
prev sibling next sibling parent reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=315


shro8822 uidaho.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shro8822 uidaho.edu





another case

<code>
import std.stdio;

void main()
{
        {
                scope(exit) writef("a\n");
        }

        scope(exit) writef("b\n");
}
<code>

output:

a
b
b


-- 
Sep 25 2006
parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-09-25:
 http://d.puremagic.com/issues/show_bug.cgi?id=315
 another case

<code>
 import std.stdio;

 void main()
 {
         {
                 scope(exit) writef("a\n");
         }

         scope(exit) writef("b\n");
 }
<code>

 output:

 a
 b
 b
Added to DStress as http://dstress.kuehne.cn/run/s/scope_15_A.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFHOBWLK5blCcjpWoRAixTAJ9MvZnBso4t7IPuLMlhFM6Ngrs0yACggj3y myqAYD8Shd12YShVf/PYt/s= =CUfw -----END PGP SIGNATURE-----
Sep 29 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=315


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed DMD 0.168


-- 
Oct 04 2006