Open okayz opened 3 years ago
我也有这个问题,临时解决办法,把这行注释掉,但是有啥影响不知道
replace indirect_symbol_bindings[i] = cur->rebindings[j].replacement;
with
if (i < (sizeof(indirect_symbol_bindings) / sizeof(indirect_symbol_bindings[0]))){
indirect_symbol_bindings[i] = cur->rebindings[j].replacement;
}
replace in podfile, no need to rely on source code
`
def replaceFishhookFile(fileName)
File.chmod(0777, fileName)
File.open(fileName, "w") do |f|
f.write "// Copyright (c) 2013, Facebook, Inc.\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n// Redistributions of source code must retain the above copyright notice,\n// this list of conditions and the following disclaimer.\n// Redistributions in binary form must reproduce the above copyright notice,\n// this list of conditions and the following disclaimer in the documentation\n// and/or other materials provided with the distribution.\n// Neither the name Facebook nor the names of its contributors may be used to\n// endorse or promote products derived from this software without specific\n// prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#include \"fishhook.h\"\n\n#include
def FishhookFormatError replaceFishhookFile("Pods/FBRetainCycleDetector/fishhook/fishhook.c") end
post_install do |installer| installer.pods_project.targets.each do |target| FishhookFormatError() end end `
fixed the crash in podfile:
`post_install do |installer| 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 end
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`
I have the same question
fixed the crash in podfile:
`post_install do |installer| 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 end
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`
It works well! ThankU
This fix is not valid AFAICT see https://github.com/facebook/FBRetainCycleDetector/pull/123#discussion_r746256157