Bug 17289 – With Xcode 8.3 linker, warnings of "pointer not aligned"
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2017-04-01T00:37:50Z
Last change time
2019-03-01T17:09:21Z
Keywords
wrong-code
Assigned to
No Owner
Creator
Steven Schveighoffer
Comments
Comment #0 by schveiguy — 2017-04-01T00:37:50Z
Just updated to Xcode 8.3 and tried to build D libraries. I get a whole bunch of messages that look similar to this:
ld: warning: pointer not aligned at address 0x10003A8BB (_D11TypeInfo_Pv6__initZ + 0 from testpointernotaligned.o)
Code that reproduces this:
import std.typecons;
struct X
{
RefCounted!(int*) x;
}
void main()
{
}
RefCounted seems to trigger it. Not sure what triggers it or not, but always seems to be the initializer that has the issue.
This happens on compilers back to 2.069.0. It does not happen on 2.068.2.
Note that the program compiles and runs, but this warning should not happen.
Comment #1 by jrdemail2000-dlang — 2017-04-01T03:26:10Z
Seeing the same behavior. Occurs in most of my programs. DMD64 D Compiler v2.073.1; Xcode 8.3, Build version 8E162. Does not occur with LDC.
Comment #2 by jrdemail2000-dlang — 2017-04-01T20:01:39Z
I saw that stack overflow article, However, it seems that it's an unrelated software (firebase from google) which happens to cause the same issue as dmd. At first I thought it said that Xcode 8.3 was to blame.
Hey, maybe they are secretly using D under the hood :)
Comment #4 by schveiguy — 2017-04-21T00:27:09Z
I'm upping the importance on this. I literally get 20 pages of linker warnings whenever I build. This seriously impedes any workflow I can have while using dmd.
Comment #5 by bugzilla — 2017-04-22T10:00:29Z
> address 0x10003A8BB
Well, 0xB, i.e. 11, is certainly not aligned.
I believe this counts as a regression and should be patched to the main website ASAP. It's fixed on master. But I believe anyone trying D on OSX for the first time from the website will have 1000 screens of linker errors when they try to compile anything. Horrible user experience.
Comment #9 by jrdemail2000-dlang — 2017-05-13T19:11:26Z
(In reply to Zach the Mystic from comment #8)
> I believe this counts as a regression and should be patched to the main
> website ASAP. It's fixed on master. But I believe anyone trying D on OSX for
> the first time from the website will have 1000 screens of linker errors when
> they try to compile anything. Horrible user experience.
I agree, the warnings are both alarming and a real nuisance. It would be worth including this in a 2.074.1 patch release.
Comment #10 by reachzach — 2017-05-13T19:58:01Z
I guess I'll reopen this issue to make the point, now that I have an ally. Again, I believe this is in effect a horrible regression, and the fix should be patched to the main website ASAP.
Comment #11 by schveiguy — 2017-05-14T13:33:27Z
Please, don't reopen bugs based on whether the fix is in a released compiler.
I agree the warnings are jarring and bad, and this should go into 2.074.1. But the fix is already merged, and that's what the bug tracker should track. If you want to make a difference here, create a PR to cherry pick the fix into the stable branch so it's included when 2.074.1 beta process commences.
Comment #12 by dlang-bugzilla — 2017-05-14T18:00:14Z
(In reply to Zach the Mystic from comment #8)
> I believe this counts as a regression and should be patched to the main
> website ASAP.
Since the breaking change was in Xcode, it would be a regression in Xcode as well, no? I'm not sure about the idea of D being required to treat regressions in others' software with urgency.
Comment #13 by reachzach — 2017-05-14T21:18:19Z
(In reply to Vladimir Panteleev from comment #12)
> Since the breaking change was in Xcode, it would be a regression in Xcode as
> well, no? I'm not sure about the idea of D being required to treat
> regressions in others' software with urgency.
If you're running a business, you wouldn't tell your customers, "Our supplier crashed their truck, so we're not required to serve you." A good business focuses on the customer. Maybe someone should bring this up with Apple and Xcode, true. But Walter was able to fix it with a three line change to dmd, and it's D users who are hurting.
Comment #14 by reachzach — 2017-05-14T21:55:34Z
(In reply to Steven Schveighoffer from comment #11)
> Please, don't reopen bugs based on whether the fix is in a released compiler.
>
> I agree the warnings are jarring and bad, and this should go into 2.074.1.
> But the fix is already merged, and that's what the bug tracker should track.
> If you want to make a difference here, create a PR to cherry pick the fix
> into the stable branch so it's included when 2.074.1 beta process commences.
Okay, makes sense. Cherry picking pull:
https://github.com/dlang/dmd/pull/6789
Comment #15 by dlang-bugzilla — 2017-05-14T21:57:46Z
(In reply to Zach the Mystic from comment #13)
> If you're running a business, you wouldn't tell your customers, "Our
> supplier crashed their truck, so we're not required to serve you."
Bad analogy. It is your choice to use Apple products, your choice to update Xcode, and your choice to (instead of using a workaround) attempt to escalate the issue, here, on D's bugtracker, even though the breaking change was in Xcode, not D.
> A good business focuses on the customer.
Well... would you like a refund? Luckily for us, D is not a business, it's an open-source project.
> and it's D users who are hurting.
1. Only Apple users.
2. "Hurting"? Isn't it just warnings?
> and the fix should be patched to the main website ASAP.
We are not going to make an exception for our release process for a LINKER WARNING.
All in all, I definitely don't see any reason to treat this issue with the urgency you demand, and I don't think the tone of your communication is of any help to anyone.
There are multiple workarounds available at your disposal:
- Build D from git
- Use a nightly version of D (https://nightlies.dlang.org/dmd-nightly/)
- Filter out the linker warnings locally
- Downgrade Xcode
- Use a different operating system
Considering the fix was already merged, please make use of one of the workarounds above and stop exaggerating the problem.
Comment #16 by reachzach — 2017-05-14T22:52:31Z
(In reply to Vladimir Panteleev from comment #15)
> (In reply to Zach the Mystic from comment #13)
> > If you're running a business, you wouldn't tell your customers, "Our
> > supplier crashed their truck, so we're not required to serve you."
>
> Bad analogy. It is your choice to use Apple products, your choice to update
> Xcode, and your choice to (instead of using a workaround) attempt to
> escalate the issue, here, on D's bugtracker, even though the breaking change
> was in Xcode, not D.
>
> > A good business focuses on the customer.
>
> Well... would you like a refund? Luckily for us, D is not a business, it's
> an open-source project.
>
> > and it's D users who are hurting.
>
> 1. Only Apple users.
> 2. "Hurting"? Isn't it just warnings?
It's thousands of pages of warnings for one compile, using the out-of-the-box experience of how to download and try D, as described on the main website. If you get dub and type 'dub run dscanner', for example, thousands of pages of warnings. Also, it never finished building for me and I had to press Ctrl-C on the terminal. I'm focusing on the new user who decides to try D one day. Whose only sin, apparently, is that he bought a mac. Or that he chose to use D, for some reason.
> > and the fix should be patched to the main website ASAP.
>
> We are not going to make an exception for our release process for a LINKER
> WARNING.
What's wrong with Steven Schveighoffer's suggestion about including it in the next release for the stable branch? That seemed like a good compromise.
I do think your focus is wrong, and that you should consider thinking of D as a product that you can help to deliver to customers, whether they pay for it or not. Something that you can be proud to be associated with. But that's a philosophical issue, and a hard one, and a long conversation.
Comment #17 by dlang-bugzilla — 2017-05-14T23:01:04Z
(In reply to Zach the Mystic from comment #16)
> It's thousands of pages of warnings for one compile, using the
> out-of-the-box experience of how to download and try D, as described on the
> main website. If you get dub and type 'dub run dscanner', for example,
> thousands of pages of warnings. Also, it never finished building for me and
> I had to press Ctrl-C on the terminal. I'm focusing on the new user who
> decides to try D one day. Whose only sin, apparently, is that he bought a
> mac. Or that he chose to use D, for some reason.
Fair enough.
> What's wrong with Steven Schveighoffer's suggestion about including it in
> the next release for the stable branch? That seemed like a good compromise.
I think that's completely fine. However, we don't know when the next release (major or minor) will occur, and Martin (our current release manager) hasn't been seen online the past few days.
Comment #18 by schveiguy — 2017-05-15T20:09:01Z
(In reply to Vladimir Panteleev from comment #15)
> (In reply to Zach the Mystic from comment #13)
> > If you're running a business, you wouldn't tell your customers, "Our
> > supplier crashed their truck, so we're not required to serve you."
>
> Bad analogy. It is your choice to use Apple products, your choice to update
> Xcode, and your choice to (instead of using a workaround) attempt to
> escalate the issue, here, on D's bugtracker, even though the breaking change
> was in Xcode, not D.
AFAIK, this is not a regression in Xcode, but a new warning for a bad situation that was previously unreported.
The code still builds, but the pointers that dmd generates in the object files were misaligned.
It is a regression of DMD, because older versions of DMD did not generate misaligned data.
I think we can fix in the stable branch, and move on here.
Comment #19 by github-bugzilla — 2017-05-23T06:35:02Z
dlang/dmd pull request #9401 "fix issue 17289 - macos/32 With Xcode 8.3 linker, warnings of "pointer not aligned"" was merged into master:
- a44118acd47181d93a69372fb5c15d4d2d2fae9b by Rainer Schuetze:
fix issue 17289 - macos/32 With Xcode 8.3 linker, warnings of "pointer not aligned"
force alignment of pointers in DATA
https://github.com/dlang/dmd/pull/9401