Opened 6 years ago

Closed 6 years ago

#57737 closed defect (fixed)

clang-3.9 built with clang-3.4 segfaults, but built with clang-3.7 works correctly

Reported by: kencu (Ken) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: clang-3.9

Description (last modified by kencu (Ken))

Noticed when building newer clang versions on Leopard:

Date/Time:       2018-11-29 16:54:34.484 -0800
OS Version:      Mac OS X Server 10.5.8 (9L34)
Report Version:  6
Anonymous UUID:  8AD195D0-D2E5-4A89-A13F-9829EBFB058B

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000001
Crashed Thread:  0

Thread 0 Crashed:
0   libLLVM.dylib                 	0x023066a5 llvm::SmallPtrSetImplBase::Grow(unsigned int) + 93
1   libLLVM.dylib                 	0x02306643 llvm::SmallPtrSetImplBase::insert_imp_big(void const*) + 139
2   clang                         	0x003dbe67 llvm::SmallPtrSetImplBase::insert_imp(void const*) + 131
3   clang                         	0x005a7740 llvm::SmallPtrSetImpl<clang::Decl*>::insert(clang::Decl*) + 32
4   clang                         	0x006b3b05 clang::Sema::PushOnScopeChains(clang::NamedDecl*, clang::Scope*, bool) + 459

rebuilding clang-3.9 with clang-3.7 results in a functionally working system.

Attachments (2)

clang_3.9 build with clang-3.4 bus error 2018-11-29-165434_LeopardIntelServerVM.crash (4.9 KB) - added by kencu (Ken) 6 years ago.
clang-3.9-built-with-clang-3.4.main.log.zip (230.2 KB) - added by kencu (Ken) 6 years ago.
build log clang-3.9 with clang-3.4

Download all attachments as: .zip

Change History (8)

comment:1 Changed 6 years ago by kencu (Ken)

Description: modified (diff)

comment:2 Changed 6 years ago by kencu (Ken)

Port: clang-3.9 added; llvm-3.9 removed
Summary: llvm-3.9 built with clang-3.4 segfaults when used with clang-3.9, but llvm-3.9 built with clang-3.7 works correctlyclang-3.9 built with clang-3.4 segfaults, but built with clang-3.7 works correctly

comment:3 Changed 6 years ago by kencu (Ken)

Description: modified (diff)

comment:4 Changed 6 years ago by kencu (Ken)

I rebuilt clang-3.9 with clang-3.4 and will attach the full build log, for any interest there may be there. Still segfaults with any use.

$ /opt/local/bin/clang-mp-3.9 -c ken_os_version_check_clang-6.c
clang: error: unable to execute command: Bus error
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.9.1 (tags/RELEASE_391/final)
Target: i386-apple-darwin9.8.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-3.9/bin
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/JS/JSmhNUB9HNSSCVaN+wE+XU+++TI/-Tmp-/ken_os_version_check_clang-6-af0b3d.c
clang: note: diagnostic msg: /var/folders/JS/JSmhNUB9HNSSCVaN+wE+XU+++TI/-Tmp-/ken_os_version_check_clang-6-af0b3d.sh
clang: note: diagnostic msg: 

The blacklisting in the clang-3.9 Portfile already excludes clang-3.4, but as all the compilers are blacklisted, it winds up circling back to gcc-4.2 on Leopard, which of course fails as it is not c++11. (That's how I came to attempt to build it with clang-3.4.)

I'm not 100% certain we can automate this fully, but we could add clang-3.7 as a fallback compiler in the clang-3.9 Portfile.

The LibcxxOnOlderSystems instructions already lead people to clang-3.4 and then clang-3.7, and then beyond, so if they follow those instructions, they should be good.

Last edited 6 years ago by kencu (Ken) (previous) (diff)

Changed 6 years ago by kencu (Ken)

build log clang-3.9 with clang-3.4

comment:5 Changed 6 years ago by kencu (Ken)

I wanted to document this here so I could refer to it in the future if needed. clang-3.4 is already blacklisted in building clang-3.9, so this can be closed.

comment:6 Changed 6 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.