Bug 19660 – 'export' keyword on OSX/Linux globals causing segfaults

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2019-02-08T10:11:46Z
Last change time
2021-10-13T13:17:26Z
Keywords
dll, pull
Assigned to
No Owner
Creator
Daniel X

Attachments

IDFilenameSummaryContent-TypeSize
1732exportbug.zipminimal example (Mac/Windows)application/x-zip-compressed1695

Comments

Comment #0 by redapple82570 — 2019-02-08T10:11:46Z
Created attachment 1732 minimal example (Mac/Windows) [DMD 2.084.0 on macOS 10.12] The presence of 'export' on a global dynlib/DLL variable: eg. "extern (C) export extern __gshared int someValue;" ... is causing inconsistent behavior between Mac/PC: keyword is required for linking against DLL on Windows, but causes runtime segfaults* on Mac. Removing 'export' solves Mac crashes but then Windows linking fails. * initially this issue was discovered due to the globals having incorrect values. But the attached example is segfaulting. LDC2 (1.14.0-beta1) does NOT exhibit the same issue.
Comment #1 by redapple82570 — 2019-05-19T09:18:22Z
DMD 2.086.0 still exhibiting the same issue.
Comment #2 by tim.dlang — 2021-10-12T09:51:30Z
The same issue exists on Linux, too.
Comment #3 by dlang-bot — 2021-10-12T09:54:51Z
@tim-dlang created dlang/dmd pull request #13159 "fix Issue 19660: 'export' keyword on OSX/Linux globals causing segfaults" fixing this issue: - fix Issue 19660: 'export' keyword on OSX/Linux globals causing segfaults https://github.com/dlang/dmd/pull/13159
Comment #4 by dlang-bot — 2021-10-13T00:04:44Z
dlang/dmd pull request #13159 "fix Issue 19660: 'export' keyword on OSX/Linux globals causing segfaults" was merged into stable: - ce23ea8b75c2cbc098cae626488f8eee0344d078 by Tim Schendekehl: fix Issue 19660: 'export' keyword on OSX/Linux globals causing segfaults https://github.com/dlang/dmd/pull/13159
Comment #5 by dlang-bot — 2021-10-13T13:17:26Z
dlang/dmd pull request #13164 "Merge stable" was merged into master: - 7c421ded8c4747bca9f1ad728642fd18becd1745 by Tim Schendekehl: fix Issue 19660: 'export' keyword on OSX/Linux globals causing segfaults https://github.com/dlang/dmd/pull/13164