facebook / FBRetainCycleDetector

iOS library to help detecting retain cycles in runtime.
Other
4.21k stars 586 forks source link

fishhook.c crash #96

Open applebest opened 4 years ago

applebest commented 4 years ago
WechatIMG167
youngdfb commented 4 years ago

What version of XCode were you running and what iOS version?

applebest commented 4 years ago

您正在运行哪个版本的XCode和哪个iOS版本?

xcode version 11.3.1 iOS version 13.4.1 It runs on my phone

So far I have switched release

simonepauro commented 4 years ago

I have the same issue on my Xs with iOS 13.2, does not happen on my 6s with iOS 12.4

Auber2071 commented 4 years ago

I have the same issue on my air3 iOS 13.3.1 and iPad Pro 12.9-inch (3rd generation) 13.5.

SummerYP commented 4 years ago

遇到了同样的问题,iOS13.5.1,运行必crash

humoroutlaw commented 4 years ago

When I try to create barcode with "CIFilter *filter = [CIFilter filterWithName:@"CIQRCodeGenerator"];",it crashes 100% on iOS13 under debug mode, while release mode is workable, same same crash issue with the screenshoot

travishan commented 4 years ago

Same Problem.

iOS 14.0 beta 2, XCode 12 beta 2, MacOS Big Sur

FuncTime commented 4 years ago

Same Problem.

iOS 13.6, XCode 11.6, MacOS 10.15.5

wangwanjie commented 3 years ago

Xcode 12.1 macOS 11.0.1 (20B29) the same. When I call +[CIFilter filterWithName:withInputParameters:]

jooyyy commented 3 years ago

Update fishhook to the latest version, contains .h and .c files; Be care for the renames.

lexuanquynh commented 3 years ago

Hot fix in Xcode 13, push this code into your Podfile:

pod 'MLeaksFinder', :configurations => ['Debug']
  post_install do |installer|
      ## Fix for XCode 12.5
      find_and_replace("Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.mm",
        "layoutCache[currentClass] = ivars;", "layoutCache[(id<NSCopying>)currentClass] = ivars;")
      ## Fix for XCode 13.0
        find_and_replace("Pods/FBRetainCycleDetector/fishhook/fishhook.c",
        "indirect_symbol_bindings[i] = cur->rebindings[j].replacement;", "if (i < (sizeof(indirect_symbol_bindings) / sizeof(indirect_symbol_bindings[0]))) { \n indirect_symbol_bindings[i]=cur->rebindings[j].replacement; \n }")
  end

push end of the file:

def find_and_replace(dir, findstr, replacestr)
  Dir[dir].each do |name|
      text = File.read(name)
      replace = text.gsub(findstr,replacestr)
      if text != replace
          puts "Fix: " + name
          File.open(name, "w") { |file| file.puts replace }
          STDOUT.flush
      end
  end
  Dir[dir + '*/'].each(&method(:find_and_replace))
end