[LLVMdev] ld: Assertion failed: (memberIndex != 0), function makeObjectFileForMember

473 views
Skip to first unread message

David Garsha

unread,
Oct 22, 2013, 6:24:05 PM10/22/13
to llv...@cs.uiuc.edu
Hi,

I'm encountering the following assertion when linking an Xcode project with Xcode 4.6.3 (4H1503). The project has dependencies on, and links against, an Objective-C static library Xcode project, and a C++ static library Xcode project. All are using using LLVM 4.2.

ld: Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /SourceCache/ld64/ld64-136/src/ld/parsers/archive_file.cpp, line 354.

0 0x10fa41098 __assert_rtn + 144
1 0x10fa678af archive::File<x86_64>::makeObjectFileForMember(archive::File<x86_64>::Entry const*) const + 1149
2 0x10fa670fd archive::File<x86_64>::forEachAtom(ld::File::AtomHandler&) const + 645
3 0x10fa7776c ld::tool::InputFiles::forEachInitialAtom(ld::File::AtomHandler&) + 420
4 0x10fa80884 ld::tool::Resolver::resolve() + 44
5 0x10fa41380 main + 370
6 0x10fa32cd4 start + 52
A linker snapshot was created at:
/tmp/<Name Removed>-2013-09-22-135411.ld-snapshot
ld: Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /SourceCache/ld64/ld64-136/src/ld/parsers/archive_file.cpp, line 354.
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The problem does not occur in Xcode 5.0 (5A1413) with LLVM 5, but unfortunately I must continue to use Xcode 4 for a while.

Any suggestions for how to work around this assertion, or hints as to what is going wrong would be greatly appreciated.

Thanks for reading.

Regards,
David

--
David Garsha
Engineering Program Manager
Macintosh Desktop Products
Telestream, Inc.
www.flip4mac.com
www.telestream.net
dav...@telestream.net


_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Tim Northover

unread,
Oct 23, 2013, 4:02:31 AM10/23/13
to David Garsha, llv...@cs.uiuc.edu
Hi David,

> ld: Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /SourceCache/ld64/ld64-136/src/ld/parsers/archive_file.cpp, line 354.

This looks like a bug in the Apple linker, which isn't part of LLVM.
The best on-topic place to ask would probably be Apple's developer
forum (https://devforums.apple.com), but linkers are rather
specialised beasts.

The fact that it's been fixed in XCode 5 probably means filing a bug
won't be that useful for you. Having said that, the ld64 sources are
available online, so if you really need an XCode 4 solution you could
try to track it down yourself.

Sorry we couldn't be more help.

Tim.

Quentin Colombet

unread,
Oct 23, 2013, 1:07:57 PM10/23/13
to David Garsha, llv...@cs.uiuc.edu
Hi David,

I already saw this problem and it was due to a bad interaction (incompatible versions) between cctools and ld, IIRC.

CC’ed Nick, he may have more information about that.

-Quentin

Nick Kledzik

unread,
Oct 23, 2013, 5:24:44 PM10/23/13
to David Garsha, llv...@cs.uiuc.edu
David,

This usually means a static library is corrupt. The table of contents said a symbol was in an object file at some offset in the archive, but the linker later found there was no member at that offset.

-Nick

David Garsha

unread,
Oct 28, 2013, 2:38:35 PM10/28/13
to Nick Kledzik, llv...@cs.uiuc.edu
Thanks to all of you for your help, and thanks for the explanation, Nick. This will save me a lot of time, as now I know where to focus my efforts.

Regards,
David

--
David Garsha
Engineering Program Manager
Macintosh Desktop Products
Telestream, Inc.
www.flip4mac.com<http://www.flip4mac.com/>
www.telestream.net<http://www.telestream.net/>
dav...@telestream.net<mailto:dav...@telestream.net>

On Oct 23, 2013, at 2:24 PM, Nick Kledzik <kle...@apple.com<mailto:kle...@apple.com>> wrote:

David,

This usually means a static library is corrupt. The table of contents said a symbol was in an object file at some offset in the archive, but the linker later found there was no member at that offset.

-Nick

On Oct 22, 2013, at 3:24 PM, David Garsha <dav...@telestream.net<mailto:dav...@telestream.net>> wrote:
I'm encountering the following assertion when linking an Xcode project with Xcode 4.6.3 (4H1503). The project has dependencies on, and links against, an Objective-C static library Xcode project, and a C++ static library Xcode project. All are using using LLVM 4.2.

ld: Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /SourceCache/ld64/ld64-136/src/ld/parsers/archive_file.cpp, line 354.

0 0x10fa41098 __assert_rtn + 144
1 0x10fa678af archive::File<x86_64>::makeObjectFileForMember(archive::File<x86_64>::Entry const*) const + 1149
2 0x10fa670fd archive::File<x86_64>::forEachAtom(ld::File::AtomHandler&) const + 645
3 0x10fa7776c ld::tool::InputFiles::forEachInitialAtom(ld::File::AtomHandler&) + 420
4 0x10fa80884 ld::tool::Resolver::resolve() + 44
5 0x10fa41380 main + 370
6 0x10fa32cd4 start + 52
A linker snapshot was created at:
/tmp/<Name Removed>-2013-09-22-135411.ld-snapshot
ld: Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /SourceCache/ld64/ld64-136/src/ld/parsers/archive_file.cpp, line 354.
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The problem does not occur in Xcode 5.0 (5A1413) with LLVM 5, but unfortunately I must continue to use Xcode 4 for a while.

Any suggestions for how to work around this assertion, or hints as to what is going wrong would be greatly appreciated.

Thanks for reading.

Regards,
David

--
David Garsha
Engineering Program Manager
Macintosh Desktop Products
Telestream, Inc.
www.flip4mac.com<http://www.flip4mac.com>
Reply all
Reply to author
Forward
0 new messages