Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERL-294: OTP / HiPE broken with GCC 6.2 and --enable-default-pie #3221

Closed
OTP-Maintainer opened this issue Nov 4, 2016 · 3 comments
Closed
Assignees
Labels
bug Issue is reported as a bug priority:medium team:VM Assigned to OTP team VM
Milestone

Comments

@OTP-Maintainer
Copy link

Original reporter: weisslj
Affected version: Not Specified
Fixed in version: OTP-19.2
Component: dialyzer
Migrated from: https://bugs.erlang.org/browse/ERL-294


See my original report in http://erlang.org/pipermail/erlang-questions/2016-November/090753.html

GCC 6.2 with  {{--enable-default-pie}}, which is enabled e.g. in the Debian Testing package, breaks HiPE (and Dialyzer, if it uses HiPE):

{code:erlang}
{'EXIT',{badarg,[{hipe_bifs,patch_call,
                            [1103888528,94502719669968,[]],
                            []},
                 {hipe_unified_loader,patch_call_insn,3,
                                      [{file,"hipe_unified_loader.erl"},{line,508}]},
                 {hipe_unified_loader,patch_bif_call_list,4,
                                      [{file,"hipe_unified_loader.erl"},{line,494}]},
                 {hipe_unified_loader,patch_call,5,
                                      [{file,"hipe_unified_loader.erl"},{line,485}]},
                 {hipe_unified_loader,patch,5,
                                      [{file,"hipe_unified_loader.erl"},{line,462}]},
                 {hipe_unified_loader,load_common,4,
                                      [{file,"hipe_unified_loader.erl"},{line,215}]},
                 {hipe_unified_loader,load_native_code,3,
                                      [{file,"hipe_unified_loader.erl"},{line,111}]},
                 {code_server,try_load_module_2,6,
                              [{file,"code_server.erl"},{line,1131}]}]}}
{code}

Compiling Erlang/OTP with CFLAGS and LDFLAGS set to "-no-pie -fno-pie" solves the problem. The bug affects current stable version 19.1.5 and the current master branch ([214aba4|https://github.com/erlang/otp/commit/214aba4]).
@OTP-Maintainer
Copy link
Author

kostis said:

Actually, it affects all versions.

As replied in the erlang-questions mailing list, adding {{no-pie}} in the flags is probably the easiest and safest solution to this problem.

If there are no objections, can somebody from the OTP team (Sverker?) please do that?

@OTP-Maintainer
Copy link
Author

weisslj said:

Maybe it would be good to add it in the maint-19 branch, as some distributions are already affected:

* https://bugzilla.redhat.com/show_bug.cgi?id=1295663
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842998

@OTP-Maintainer
Copy link
Author

sverker said:

A proposed fix is available for testing: https://github.com/erlang/otp/pull/1239


@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug team:VM Assigned to OTP team VM priority:medium labels Feb 10, 2021
@OTP-Maintainer OTP-Maintainer added this to the OTP-19.2 milestone Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:medium team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants