www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10440] New: shared library on osx: worked in 2.062, fails in 2.063 / 2.063.2

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

           Summary: shared library on osx: worked in 2.062, fails in 2.063
                    / 2.063.2
           Product: D
           Version: D2
          Platform: All
        OS/Version: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thelastmammoth gmail.com



--foo.d
module foo;
extern(C) void foo1(){}

--main.d
module main;
pragma(lib,"foo");
extern(C) void foo1();
void main(){foo1;}

dmd -oflibfoo.dylib -shared foo.d;
dmd -L-L. main.d
./main

--output:
2.062:OK
2.063(and 2.063.2):NG

gdb ./main
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x00000001000184fc in sections_osx_onAddImage ()

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 21 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10440


Maxim Fomin <maxim maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim maxim-fomin.ru
         OS/Version|Mac OS X                    |All



---
I noticed that shared libraries don't work in similar way in linux too,
approximately after 2.063 release. This is quite sad, because this is the way
dynamic linking was working in linux since 2011 autumn (or earlier).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10440


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |code dawg.eu
         Resolution|                            |INVALID



This never worked correctly as there is no shared library support on OSX.
Something that previously caused a silent misbehavior was made explicit
therefor it now crashes.
https://github.com/D-Programming-Language/druntime/commit/0e10e7e96c8a1d6c12bc45b143bab9364cd72755#L3L94
https://github.com/D-Programming-Language/druntime/commit/0e10e7e96c8a1d6c12bc45b143bab9364cd72755#L8R70

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





 This never worked correctly as there is no shared library support on OSX.
 Something that previously caused a silent misbehavior was made explicit
 therefor it now crashes.
 https://github.com/D-Programming-Language/druntime/commit/0e10e7e96c8a1d6c12bc45b143bab9364cd72755#L3L94
 https://github.com/D-Programming-Language/druntime/commit/0e10e7e96c8a1d6c12bc45b143bab9364cd72755#L8R70
 This never worked correctly as there is no shared library support on OSX.
 Something that previously caused a silent misbehavior was made explicit
 therefor it now crashes.
 https://github.com/D-Programming-Language/druntime/commit/0e10e7e96c8a1d6c12bc45b143bab9364cd72755#L3L94
 https://github.com/D-Programming-Language/druntime/commit/0e10e7e96c8a1d6c12bc45b143bab9364cd72755#L8R70
I still worked for a number of scenarios on which I relied on. Can you please put back the old behavior enabled by a version(use_unsafe_shared_library_osx) switch ? that way people can still use shared libraries on OSX (at their own risk) until the problem is addressed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 23 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10440


thelastmammoth gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


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




---

 This never worked correctly as there is no shared library support on OSX.
 Something that previously caused a silent misbehavior was made explicit
 therefor it now crashes.
 https://github.com/D-Programming-Language/druntime/commit/0e10e7e96c8a1d6c12bc45b143bab9364cd72755#L3L94
 https://github.com/D-Programming-Language/druntime/commit/0e10e7e96c8a1d6c12bc45b143bab9364cd72755#L8R70
This does not explain crashes in linux where dynamic linking worked. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 23 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10440





 This does not explain crashes in linux where dynamic linking worked.
Please open a separate bug for this. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 24 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10440




Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/5fc0480d13705c57daadf067801d630d1b9cd629
fix Issue 10440

- print a warning and ignore shared library sections

https://github.com/D-Programming-Language/druntime/commit/4caca8b4a2f77d0a2df7c3fa833397ac694143ee


fix Issue 10440

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 06 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10440


Martin Nowak <code dawg.eu> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 06 2013