Xcode 16 Previews: dyld Loader Crash

We have been seeing a dyld loader crash when trying out the new Previews engine in Xcode 16 beta 3.

Feedback filed with reproducer + diagnostics: https://feedbackassistant.apple.com/feedback/14323960

Investigation:

  1. Running nm -a on the debug dylib reveals duplicate SO entries pointing to SomeStatic.swift. One entry originates from the LibAStatic module, while the other comes from the LibBStatic module.
  2. Local workaround - 1 Providing unique file names resolves the issue. However, these files are in different modules, so ideally, this shouldn't be necessary. Our codebase is extensive, and many code-generated modules have the same file names. Therefore, renaming files to ensure uniqueness is not a simple solution for us due to various complexities.
  3. Local workaround - 2 Making these dependencies dylibs instead of static libraries also resolves the issue. However, we can't pursue this direction because a significant portion of our pre-build setup, foundations, and vendor linkages are statically linked.

Note: The same flow works with "Legacy Preview Engine in Xcode 16/15" but dynamic replacement has other issues, which we are super happy that the new engine doesn't make use of.

This issue is currently a blocker for us in trying out the new Previews in our project, it would be highly beneficial if this problem could be resolved soon.

Hi,

Thanks for bringing this to our attention, and for filing a feedback with a reproducer! I'll make sure the bug report gets routed to the right team asap.

Xcode 16 Previews: dyld Loader Crash
 
 
Q