googleprojectzero / fuzzilli

A JavaScript Engine Fuzzer
Apache License 2.0
1.89k stars 306 forks source link

Fuzzilli fails to compile on release but not on debug - LinearLifetimeChecker assertion fail. #60

Closed n30m1nd closed 4 years ago

n30m1nd commented 4 years ago

While trying to compile Fuzzilli with the -c release flag, an assertion gets triggered. Command:

swift build -c release

Assertion failure:

swift: /home/buildnode/jenkins/workspace/oss-swift-5.2-package-linux-ubuntu-18_04/swift/lib/SIL/LinearLifetimeChecker.cpp:515: swift::LinearLifetimeError swift::LinearLifetimeChecker::checkValue(swift::SILValue, ArrayRef<swift::BranchPropagatedUser>, ArrayRef<swift::BranchPropagatedUser>, swift::ownership::ErrorBehaviorKind, SmallVectorImpl<swift::SILBasicBlock *> *): Assertion `!consumingUses.empty() && "Must have at least one consuming user?!"' failed.

The assertion is triggered by the compiler while doing, what looks like, variable usage checks on the following line in fuzzilli https://github.com/googleprojectzero/fuzzilli/blob/master/Sources/Fuzzilli/Modules/Storage.swift#L29

The implementation of the assertion that presumably does the variable checks can be seen here on swift: https://github.com/apple/swift/blob/master/lib/SIL/LinearLifetimeChecker.cpp#L504

Finally, this is all being done on Debian unstable, however, on my local machine (also Debian unstable) I can't reproduce this issue as this only happens on a cloud service provider with the following uname -a fingerprint Linux fuzzilli-0 4.19.53-mainline-rev1 #1 SMP Wed Jun 19 23:30:45 UTC 2019 x86_64 GNU/Linux. For this reason I've tried to get all the differences with sysctl -a in both machines and seeing the kernel values but didn't find many disparities. EDIT: Just tried in an Ubuntu 18.04 docker image and baremetal Ubuntu 18.04.2 and the issue still reproduces.


Full error and stack trace

javi@fuzzilli-0:~/fuzzilli$ swift run -c release FuzzilliCli --profile=v8 /home/javi/Victims/v8/out/fuzzbuild/d8 
/home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/Analyzer.swift:118:20: warning: static property 'global' produces an empty option set
        static let global     = Context(rawValue: 0)
                   ^
/home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/Analyzer.swift:118:20: note: use [] to silence this warning
        static let global     = Context(rawValue: 0)
                   ^                   ~~~~~~~~~~~~~
                                       ([])
/home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/TypeSystem.swift:749:16: warning: static property 'nothing' produces an empty option set
    static let nothing     = BaseType(rawValue: 0)
               ^
/home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/TypeSystem.swift:749:16: note: use [] to silence this warning
    static let nothing     = BaseType(rawValue: 0)
               ^                     ~~~~~~~~~~~~~
                                     ([])
/home/javi/fuzzilli/Sources/Fuzzilli/Modules/NetworkSync.swift:210:42: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
            let bytesRead = read(socket, UnsafeMutablePointer<UInt8>(&receiveBuffer), receiveBuffer.count)
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/javi/fuzzilli/Sources/Fuzzilli/Modules/NetworkSync.swift:210:70: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
            let bytesRead = read(socket, UnsafeMutablePointer<UInt8>(&receiveBuffer), receiveBuffer.count)
                                                                     ^~~~~~~~~~~~~~
/home/javi/fuzzilli/Sources/Fuzzilli/Modules/NetworkSync.swift:210:70: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
            let bytesRead = read(socket, UnsafeMutablePointer<UInt8>(&receiveBuffer), receiveBuffer.count)
                                                                     ^
/home/javi/fuzzilli/Sources/Fuzzilli/Modules/NetworkSync.swift:214:33: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
            receivedData.append(UnsafeMutablePointer<UInt8>(&receiveBuffer), count: Int(bytesRead))
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/javi/fuzzilli/Sources/Fuzzilli/Modules/NetworkSync.swift:214:61: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
            receivedData.append(UnsafeMutablePointer<UInt8>(&receiveBuffer), count: Int(bytesRead))
                                                            ^~~~~~~~~~~~~~
/home/javi/fuzzilli/Sources/Fuzzilli/Modules/NetworkSync.swift:214:61: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
            receivedData.append(UnsafeMutablePointer<UInt8>(&receiveBuffer), count: Int(bytesRead))
                                                            ^
swift: /home/buildnode/jenkins/workspace/oss-swift-5.2-package-linux-ubuntu-18_04/swift/lib/SIL/LinearLifetimeChecker.cpp:515: swift::LinearLifetimeError swift::LinearLifetimeChecker::checkValue(swift::SILValue, ArrayRef<swift::BranchPropagatedUser>, ArrayRef<swift::BranchPropagatedUser>, swift::ownership::ErrorBehaviorKind, SmallVectorImpl<swift::SILBasicBlock *> *): Assertion `!consumingUses.empty() && "Must have at least one consuming user?!"' failed.
Stack dump:
0.  Program arguments: /usr/bin/swift -frontend -c /home/javi/fuzzilli/Sources/Fuzzilli/Configuration.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/CodeGenerators.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/Component.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/Corpus.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/Environment.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/Events.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/FuzzerCore.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/JavaScriptEnvironment.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/Logging.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/ProgramBuilder.swift /home/javi/fuzzilli/Sources/Fuzzilli/Core/Timers.swift /home/javi/fuzzilli/Sources/Fuzzilli/Evaluation/ProgramAspects.swift /home/javi/fuzzilli/Sources/Fuzzilli/Evaluation/ProgramCoverageEvaluator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Evaluation/ProgramEvaluator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Execution/Execution.swift /home/javi/fuzzilli/Sources/Fuzzilli/Execution/Forkserver.swift /home/javi/fuzzilli/Sources/Fuzzilli/Execution/REPRL.swift /home/javi/fuzzilli/Sources/Fuzzilli/Execution/ScriptRunner.swift /home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/AbstractInterpreter.swift /home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/Analyzer.swift /home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/Blocks.swift /home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/Instruction.swift /home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/Operations.swift /home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/Program.swift /home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/TypeSystem.swift /home/javi/fuzzilli/Sources/Fuzzilli/FuzzIL/Variable.swift /home/javi/fuzzilli/Sources/Fuzzilli/Fuzzer.swift /home/javi/fuzzilli/Sources/Fuzzilli/Lifting/Expression.swift /home/javi/fuzzilli/Sources/Fuzzilli/Lifting/InliningPolicy.swift /home/javi/fuzzilli/Sources/Fuzzilli/Lifting/JSExpressions.swift /home/javi/fuzzilli/Sources/Fuzzilli/Lifting/JavaScriptLifter.swift /home/javi/fuzzilli/Sources/Fuzzilli/Lifting/Lifter.swift /home/javi/fuzzilli/Sources/Fuzzilli/Lifting/ScriptWriter.swift /home/javi/fuzzilli/Sources/Fuzzilli/Minimization/BlockReducer.swift /home/javi/fuzzilli/Sources/Fuzzilli/Minimization/CallArgumentReducer.swift /home/javi/fuzzilli/Sources/Fuzzilli/Minimization/GenericInstructionReducer.swift /home/javi/fuzzilli/Sources/Fuzzilli/Minimization/InliningReducer.swift /home/javi/fuzzilli/Sources/Fuzzilli/Minimization/Minimizer.swift /home/javi/fuzzilli/Sources/Fuzzilli/Minimization/Reducer.swift /home/javi/fuzzilli/Sources/Fuzzilli/Minimization/ReplaceReducer.swift /home/javi/fuzzilli/Sources/Fuzzilli/Modules/Module.swift /home/javi/fuzzilli/Sources/Fuzzilli/Modules/NetworkSync.swift /home/javi/fuzzilli/Sources/Fuzzilli/Modules/Statistics.swift /home/javi/fuzzilli/Sources/Fuzzilli/Modules/Storage.swift /home/javi/fuzzilli/Sources/Fuzzilli/Modules/ThreadSync.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/BaseInstructionMutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/CombineMutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/ConcatMutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/GrowMutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/InputMutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/InsertionMutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/JITStressMutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/Mutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/OperationMutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Mutators/SpliceMutator.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/CInterop.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/Error.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/Misc.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/MovingAverage.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/OperationSource.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/Random.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/RingBuffer.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/VariableMap.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/VariableSet.swift /home/javi/fuzzilli/Sources/Fuzzilli/Util/WeightedList.swift -supplementary-output-file-map /tmp/supplementaryOutputs-9ac03c -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release -I /home/javi/fuzzilli/Sources/libcoverage/include -I /home/javi/fuzzilli/Sources/libreprl/include -I /home/javi/fuzzilli/Sources/libsocket/include -I /home/javi/fuzzilli/Sources/libforkserver/include -color-diagnostics -g -module-cache-path /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/ModuleCache -swift-version 5 -O -D SWIFT_PACKAGE -Xcc -fmodule-map-file=/home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/libcoverage.build/module.modulemap -Xcc -fmodule-map-file=/home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/libreprl.build/module.modulemap -Xcc -fmodule-map-file=/home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/libsocket.build/module.modulemap -Xcc -fmodule-map-file=/home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/libforkserver.build/module.modulemap -parse-as-library -module-name Fuzzilli -num-threads 8 -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Configuration.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/CodeGenerators.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/Component.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/Corpus.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/Environment.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/Events.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/FuzzerCore.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/JavaScriptEnvironment.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/Logging.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/ProgramBuilder.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Core/Timers.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Evaluation/ProgramAspects.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Evaluation/ProgramCoverageEvaluator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Evaluation/ProgramEvaluator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Execution/Execution.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Execution/Forkserver.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Execution/REPRL.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Execution/ScriptRunner.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/FuzzIL/AbstractInterpreter.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/FuzzIL/Analyzer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/FuzzIL/Blocks.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/FuzzIL/Instruction.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/FuzzIL/Operations.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/FuzzIL/Program.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/FuzzIL/TypeSystem.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/FuzzIL/Variable.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Fuzzer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Lifting/Expression.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Lifting/InliningPolicy.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Lifting/JSExpressions.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Lifting/JavaScriptLifter.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Lifting/Lifter.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Lifting/ScriptWriter.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Minimization/BlockReducer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Minimization/CallArgumentReducer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Minimization/GenericInstructionReducer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Minimization/InliningReducer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Minimization/Minimizer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Minimization/Reducer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Minimization/ReplaceReducer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Modules/Module.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Modules/NetworkSync.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Modules/Statistics.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Modules/Storage.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Modules/ThreadSync.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/BaseInstructionMutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/CombineMutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/ConcatMutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/GrowMutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/InputMutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/InsertionMutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/JITStressMutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/Mutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/OperationMutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Mutators/SpliceMutator.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/CInterop.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/Error.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/Misc.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/MovingAverage.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/OperationSource.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/Random.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/RingBuffer.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/VariableMap.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/VariableSet.swift.o -o /home/javi/fuzzilli/.build/x86_64-unknown-linux-gnu/release/Fuzzilli.build/Util/WeightedList.swift.o 
1.  Swift version 5.2 (swift-5.2-RELEASE)
2.  While running pass #30507 SILFunctionTransform "SemanticARCOpts" on SILFunction "@$s8Fuzzilli7StorageC3for10storageDir19stateExportIntervalAcA6FuzzerC_SSSdSgtcfc".
 for 'init(for:storageDir:stateExportInterval:)' (at /home/javi/fuzzilli/Sources/Fuzzilli/Modules/Storage.swift:29:12)
 #0 0x0000000004b54af4 PrintStackTraceSignalHandler(void*) (/usr/bin/swift+0x4b54af4)
 #1 0x0000000004b526ce llvm::sys::RunSignalHandlers() (/usr/bin/swift+0x4b526ce)
 #2 0x0000000004b54db6 SignalHandler(int) (/usr/bin/swift+0x4b54db6)
 #3 0x00007f9fa4f84110 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14110)
 #4 0x00007f9fa4a15761 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3b761)
 #5 0x00007f9fa49ff55b abort (/lib/x86_64-linux-gnu/libc.so.6+0x2555b)
 #6 0x00007f9fa49ff42f (/lib/x86_64-linux-gnu/libc.so.6+0x2542f)
 #7 0x00007f9fa4a0e092 (/lib/x86_64-linux-gnu/libc.so.6+0x34092)
 #8 0x0000000000dd1f4a swift::LinearLifetimeChecker::checkValue(swift::SILValue, llvm::ArrayRef<swift::BranchPropagatedUser>, llvm::ArrayRef<swift::BranchPropagatedUser>, swift::ownership::ErrorBehaviorKind, llvm::SmallVectorImpl<swift::SILBasicBlock*>*) (/usr/bin/swift+0xdd1f4a)
 #9 0x0000000000d68fe2 swift::SILInstructionVisitor<(anonymous namespace)::SemanticARCOptVisitor, bool>::visit(swift::SILInstruction*) (/usr/bin/swift+0xd68fe2)
#10 0x0000000000d64e4c (anonymous namespace)::SemanticARCOpts::run() (/usr/bin/swift+0xd64e4c)
#11 0x000000000097bbdd swift::SILPassManager::runPassOnFunction(unsigned int, swift::SILFunction*) (/usr/bin/swift+0x97bbdd)
#12 0x000000000097c8a2 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) (/usr/bin/swift+0x97c8a2)
#13 0x000000000097dbcf swift::SILPassManager::execute() (/usr/bin/swift+0x97dbcf)
#14 0x0000000000562f78 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) (/usr/bin/swift+0x562f78)
#15 0x0000000000985c8d swift::runSILDiagnosticPasses(swift::SILModule&) (/usr/bin/swift+0x985c8d)
#16 0x000000000076122a swift::CompilerInstance::performSILProcessing(swift::SILModule*, swift::UnifiedStatsReporter*) (/usr/bin/swift+0x76122a)
#17 0x00000000004ec7a8 performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) (/usr/bin/swift+0x4ec7a8)
#18 0x00000000004e2655 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) (/usr/bin/swift+0x4e2655)
#19 0x00000000004df453 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/usr/bin/swift+0x4df453)
#20 0x0000000000473fa5 main (/usr/bin/swift+0x473fa5)
#21 0x00007f9fa4a00e0b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26e0b)
#22 0x0000000000473bea _start (/usr/bin/swift+0x473bea)
n30m1nd commented 4 years ago

:man_facepalming: solved. It's the new Swift version 5.2 that breaks the compilation. Fuzzilli with Swift 5.1.5 compiles swiftly. Still raises the issue about why it breaks with newer Swift?

saelo commented 4 years ago

Hmm interesting... I just tried it on macOS and there Fuzzilli compiles just fine with swift 5.2 (although with some compiler warnings that should be fixed now). So it seems this issue is related to the Linux toolchain then. I'll take a look when I get a chance