www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8133] New: regression(2.059): D shared lib on OSX fails in 2.059, worked in 2.058

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

           Summary: regression(2.059): D shared lib on OSX fails in 2.059,
                    worked in 2.058
           Product: D
           Version: D2
          Platform: All
        OS/Version: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: thelastmammoth gmail.com


--- Comment #0 from thelastmammoth gmail.com 2012-05-23 01:26:10 PDT ---
The simplest possible shared lib in D (see details below) worked in 2.058 but
fails in 2.059.
I submitted a related (lib instead of dylib) bug report (Issue 7995) which was
fixed by pull request #205 from jacob-carlborg/7995. However the code fragment
below (shared lib) still fails even after applying that fix (which was pushed
to master). 


cat main.c:
   extern int fun();
   int main(){return fun();}
cat fun.d:
   module fun;
   static import core.runtime;
   extern (C) export int fun() {
       core.runtime.Runtime.initialize();
    return 0;
   }
dmd -shared fun.d -oflibfun.dylib
gcc -o main main.c -L. -lfun
gdb ./main
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x000000010000ce6c in __tls_get_addr ()
(gdb) where
#0  0x000000010000ce6c in __tls_get_addr ()
#1  0x000000010000bddb in thread_attachThis ()
#2  0x000000010000bc6c in thread_init ()
#3  0x000000010000d36a in gc_init ()
#4  0x0000000100014035 in rt_init ()
#5  0x000000010000a5f7 in
D4core7runtime7Runtime10initializeFDFC6object9ThrowableZvZb ()
#6  0x0000000100003ead in fun ()
#7  0x0000000100000f1f in main ()

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 23 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8133


Jacob Carlborg <doob me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doob me.com


--- Comment #1 from Jacob Carlborg <doob me.com> 2012-05-23 02:26:07 PDT ---
That was revert, for some reason. I never got a good explanation from Walter:

https://github.com/D-Programming-Language/druntime/pull/205#issuecomment-5675090

The 2.059 release has the same behavior as the latest commit with the pull
request applied so I don't understand what Walter is talking about.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 23 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8133



--- Comment #2 from Jacob Carlborg <doob me.com> 2012-05-23 02:28:23 PDT ---
(In reply to comment #1)

 The 2.059 release has the same behavior as the latest commit with the pull
 request applied so I don't understand what Walter is talking about.
That should have been: Walter's example from the comment to the pull request has the same behavior using the 2.059 release as the latest commit with the pull request applied. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 23 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8133



--- Comment #3 from thelastmammoth gmail.com 2012-05-23 13:53:03 PDT ---
(In reply to comment #2)
 (In reply to comment #1)
 
 The 2.059 release has the same behavior as the latest commit with the pull
 request applied so I don't understand what Walter is talking about.
That should have been: Walter's example from the comment to the pull request has the same behavior using the 2.059 release as the latest commit with the pull request applied.
I see. Indeed the fix you had supplied did fix both Issue 7995 and this current Issue 8133 (I had pulled in the meantime the master which reverted to before your fix). It would be really great if Walter could accept your pull request once again as it is a real blocker not to be able to build shared libs. I also don't really understand his concern in his comment. Perhaps you could bug him again? A unittest with such test cases would prevent further regressions. Also, I really think it should be made clear on the dlang website in release notes what is currently supported in each version. For example, diverse forums complain that support for shared libs on OSX is not working yet with the D runtime, but 2.058 or your fix seem to support those. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 23 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8133



--- Comment #4 from Jacob Carlborg <doob me.com> 2012-05-23 23:23:08 PDT ---
(In reply to comment #3)

 I see. Indeed the fix you had supplied did fix both Issue 7995 and this current
 Issue 8133 (I had pulled in the meantime the master which reverted to before
 your fix).
 
 It would be really great if Walter could accept your pull request once again as
 it is a real blocker not to be able to build shared libs. I also don't really
 understand his concern in his comment. Perhaps you could bug him again? A
 unittest with such test cases would prevent further regressions.
I've done that. Apparently the exit status program was incorrect. I'll give it another shot.
 Also, I really think it should be made clear on the dlang website in release
 notes what is currently supported in each version. For example, diverse forums
 complain that support for shared libs on OSX is not working yet with the D
 runtime, but 2.058 or your fix seem to support those.
No, shared libraries are still not completely supported on Posix. There's problem with module constructs, exception handling tables and TLS data. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 23 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8133


dawg dawgfoto.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dawg dawgfoto.de
         Resolution|                            |DUPLICATE


--- Comment #5 from dawg dawgfoto.de 2012-06-02 03:32:07 PDT ---
*** This issue has been marked as a duplicate of issue 7995 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 02 2012