Domanda

La mia applicazione si costruisce, funziona, simula ecc. Ecc. Bene!Tutto funziona al 100% su entrambi i simulatori e dispositivi fisici.Nessun errore o avvertimenti durante la costruzione.

Ora, quando provo ad archiviare il mio progetto, ottengo il seguente errore:

0  clang             0x000000010bdb3472 _ZL15PrintStackTracePv + 34
1  clang             0x000000010bdb38f9 _ZL13SignalHandleri + 553
2  libsystem_c.dylib 0x00007fff8bd8ccfa _sigtramp + 26
3  libsystem_c.dylib 0x0000000000000001 _sigtramp + 18446603338169922337
4  clang             0x000000010bc7fbbf (anonymous namespace)::ObjCARCOpt::runOnFunction(llvm::Function&) + 7407
5  clang             0x000000010b0502b2 llvm::FPPassManager::runOnFunction(llvm::Function&) + 322
6  clang             0x000000010b052baf (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) + 1039
7  clang             0x000000010b050bc1 llvm::MPPassManager::runOnModule(llvm::Module&) + 289
8  clang             0x000000010b0505c5 llvm::PassManagerImpl::run(llvm::Module&) + 277
9  clang             0x000000010b0504ad llvm::PassManager::run(llvm::Module&) + 13
10 clang             0x000000010b02f0e8 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 4424
11 clang             0x000000010b02c941 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 513
12 clang             0x000000010aef83f6 clang::ParseAST(clang::Sema&, bool) + 406
13 clang             0x000000010aef6ed7 clang::CodeGenAction::ExecuteAction() + 855
14 clang             0x000000010aec943f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 879
15 clang             0x000000010aec80cb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2683
16 clang             0x000000010aeba8ce cc1_main(char const**, char const**, char const*, void*) + 5086
17 clang             0x000000010ae950d8 main + 648
18 clang             0x000000010ae94e44 start + 52
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/yn/jhqtwmzx2l31sytjj7ltz_qc0000gn/T/Image-u5GlrW.mii
clang: note: diagnostic msg: /var/folders/yn/jhqtwmzx2l31sytjj7ltz_qc0000gn/T/Image-u5GlrW.sh
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254
.

E non ho idea del perché.Ora il problema viene da image.mm che sto usando dal progetto simple-iphone-image-processing.E penso che abbia a che fare con l'arco.Possono anch'erano più luce su questo?

Grazie


.

Aggiornamento

OK, quindi ho appena provato un mucchio di volte e ha funzionato.Quindi il problema è intermittente.Sto lasciando questa domanda qui se qualcun altro forse ha qualcosa da dire.

È stato utile?

Soluzione

La funzione che è la rottura è ObjCARCOpt::runOnFunction(llvm::Function&). Solo per i risatine, ho postato il codice Runonfunction () di seguito. Lo scopo di questa funzione è quello di ottimizzare il codice dell'oggetto relativo ad arco nell'oggetto llvm::Function in cui è passato. Va bene, ma sembra che ci sia un bug nel compilatore correlato alla movimentazione obiettiva-C ++, che francamente non mi sorprende.

Bug Reports sono già stati inviati ad Apple ( qui , qui , probabilmente altri luoghi). Dovresti segnalarlo anche tu.

Allora, ci sono alcune cose che potrei suggerire.

1) Dato che il problema è intermittente, vai avanti con il tuo progetto. Questo potrebbe funzionare per te, o forse no. Dopo tutto, i compilatori dovrebbero essere deterministici ...

2) Prova a disattivare l'arco per le tue cose OBJ-C ++. Questo è probabilmente il modo più semplice.

3) Disattiva ottimizzazioni ARC. Fallo omettendo -enable-objc-arc-opts dalla tua build. Come fare ciò Usare le impostazioni di Build Xcode è lasciato come esercizio per il lettore. Comunque penso che la tua migliore scommessa sia 2).

Il codice da llvm-3.0.src/lib/Transforms/Scalar/ObjCARC.cpp è inferiore. La soluzione migliore è uscire a if (!Run) return false;. Run sarà falso se ARC è disabilitato nel modulo analizzato. Buona fortuna, non dimenticare di inviare questo rapporto di bug!

bool ObjCARCOpt::runOnFunction(Function &F) {
  if (!EnableARCOpts)
    return false;

  // If nothing in the Module uses ARC, don't do anything.
  if (!Run)
    return false;

  Changed = false;

  PA.setAA(&getAnalysis<AliasAnalysis>());

  // This pass performs several distinct transformations. As a compile-time aid
  // when compiling code that isn't ObjC, skip these if the relevant ObjC
  // library functions aren't declared.

  // Preliminary optimizations. This also computs UsedInThisFunction.
  OptimizeIndividualCalls(F);

  // Optimizations for weak pointers.
  if (UsedInThisFunction & ((1 << IC_LoadWeak) |
                            (1 << IC_LoadWeakRetained) |
                            (1 << IC_StoreWeak) |
                            (1 << IC_InitWeak) |
                            (1 << IC_CopyWeak) |
                            (1 << IC_MoveWeak) |
                            (1 << IC_DestroyWeak)))
    OptimizeWeakCalls(F);

  // Optimizations for retain+release pairs.
  if (UsedInThisFunction & ((1 << IC_Retain) |
                            (1 << IC_RetainRV) |
                            (1 << IC_RetainBlock)))
    if (UsedInThisFunction & (1 << IC_Release))
      // Run OptimizeSequences until it either stops making changes or
      // no retain+release pair nesting is detected.
      while (OptimizeSequences(F)) {}

  // Optimizations if objc_autorelease is used.
  if (UsedInThisFunction &
      ((1 << IC_Autorelease) | (1 << IC_AutoreleaseRV)))
    OptimizeReturns(F);

  return Changed;
}
.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top