mold
mold copied to clipboard
Simple program seg faults with Intel compiler
A user of mine has a small test program the seg faults when compiling with the Intel classic compiler (icpc) and linking with mold. It runs OK when compiled with gcc and the new Clang-based Intel compiler.
#include <stdio.h>
#include <set>
namespace MemorySpace {
enum MemorySpace_enum : int {
host = 1
};
using type = MemorySpace_enum;
std::set<MemorySpace::type> active_memory_spaces;
}
int main()
{
MemorySpace::active_memory_spaces.emplace(MemorySpace::host);
printf("WORKED\n");
}
[lee218@rzwhippet17:20221212_mold]$ /usr/tce/packages/intel-classic/intel-classic-2021.6.0/bin/icpc -B/collab/usr/global/tools/mold/toss_4_x86_64_ib/mold-1.7.1-x86_64-linux/bin -o ic19molderr.exe ic19molderr.C
[lee218@rzwhippet17:20221212_mold]$ ic19molderr.exe
Segmentation fault (core dumped)
[lee218@rzwhippet17:20221212_mold]$ uname -a
Linux rzwhippet17 4.18.0-372.32.1.1toss.t4.x86_64 #1 SMP Tue Oct 25 15:54:22 PDT 2022 x86_64 x86_64 x86_64 GNU/Linux
Can you rebuild your program with -Wl,--repro and share the resulting ic19molderr.exe.tar with me? That tar file will contain all input object files so that I can reproduce your issue on my machine.
the reproducer file is 95MB and Github appears to have a 25MB restriction. Do you have an email address that I can use to share a OneDrive link to the file? Otherwise you may need to download the Intel classic compiler and try yourself. Note that the compiler does not require a license.
Is it that large after compassion? If not, please try to compress it with gzip or something.
Good idea, it was able to compress to 22MB. Please see the attached and remove the .txt extension
Can you try to recompile your binary with -fuse-init-array? Does it fix the problem?
This does not appear to a valid option for the Intel compiler:
@.***:20221212_mold]$ /usr/tce/packages/intel-classic/intel-classic-2021.6.0/bin/icpc -B/collab/usr/global/tools/mold/toss_4_x86_64_ib/mold-1.7.1-x86_64-linux/bin -o ic19molderr.exe ic19molderr.C -fuse-init-array icpc: command line warning #10148: option '-fuse-init-array' not supported
From: Rui Ueyama @.> Sent: Tuesday, December 13, 2022 9:50 PM To: rui314/mold @.> Cc: Lee, Greg @.>; Author @.> Subject: Re: [rui314/mold] Simple program seg faults with Intel compiler (Issue #914)
Can you try to recompile your binary with -fuse-init-array? Does it fix the problem?
— Reply to this email directly, view it on GitHubhttps://urldefense.us/v3/__https://github.com/rui314/mold/issues/914*issuecomment-1350433271__;Iw!!G2kpM7uM-TzIFchu!n0DOAel2fT0I1AsWSyY41-6hEW1thlox3b8Pqo9TTQZnoqH2nJW8FCwb4FuZFmwriA$, or unsubscribehttps://urldefense.us/v3/__https://github.com/notifications/unsubscribe-auth/AA3ZFC4N3P7GSXORC7CQGYLWNFNZTANCNFSM6AAAAAAS4MOQTE__;!!G2kpM7uM-TzIFchu!n0DOAel2fT0I1AsWSyY41-6hEW1thlox3b8Pqo9TTQZnoqH2nJW8FCwb4FvO01TEEg$. You are receiving this because you authored the thread.Message ID: @.***>