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


--- Comment #0 from thelastmammoth gmail.com 2013-06-21 20:05:17 PDT ---
--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


--- Comment #1 from Maxim Fomin <maxim maxim-fomin.ru> 2013-06-21 22:41:27 PDT
---
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


--- Comment #2 from Martin Nowak <code dawg.eu> 2013-06-23 17:19:21 PDT ---
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



--- Comment #3 from thelastmammoth gmail.com 2013-06-23 19:00:49 PDT ---
(In reply to comment #2)
 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
(In reply to comment #2)
 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



--- Comment #4 from Maxim Fomin <maxim maxim-fomin.ru> 2013-06-23 20:08:43 PDT
---
(In reply to comment #2)
 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



--- Comment #5 from Martin Nowak <code dawg.eu> 2013-06-24 06:18:33 PDT ---
(In reply to comment #4)
 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



--- Comment #6 from github-bugzilla puremagic.com 2013-07-06 13:19:50 PDT ---
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
Merge pull request #531 from dawgfoto/fix10440

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