我有一个奇怪的崩溃,它只发生在 TestFlight ad hoc 发行版上。我知道是什么导致了崩溃(一个简单的 while 循环,见下文),但我不明白为什么它不会在我的模拟器或 iPhone 或 iPad(具有开发配置文件)上崩溃。
我一直在分发临时构建来跟踪崩溃,但我终于放弃了。如何更有效地跟踪此错误?
这是 TestFlight 崩溃报告:
Exception reason
SIGSEGV
Stacktrace
PRIMARY THREAD THREAD 0
0 Meernotes 0x0019649a testflight_backtrace + 158
1 Meernotes 0x001970c4 TFSignalHandler + 244
2 libsystem_c.dylib 0x32d9d7ec _sigtramp + 48
3 libobjc.A.dylib 0x37d34eac _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 224
4 libobjc.A.dylib 0x37d34eac _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 224
5 libobjc.A.dylib 0x37d34dc8 _objc_autoreleasePoolPop + 12
6 CoreFoundation 0x358e1cfe _CFAutoreleasePoolPop + 18
7 UIKit 0x333d5c92 _wrapRunLoopWithAutoreleasePoolHandler + 42
8 CoreFoundation 0x35965b1a __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
9 CoreFoundation 0x35963d56 __CFRunLoopDoObservers + 258
10 CoreFoundation 0x359640b0 __CFRunLoopRun + 760
11 CoreFoundation 0x358e74a4 CFRunLoopRunSpecific + 300
12 CoreFoundation 0x358e736c CFRunLoopRunInMode + 104
13 GraphicsServices 0x37583438 GSEventRunModal + 136
14 UIKit 0x333f3cd4 UIApplicationMain + 1080
15 Meernotes 0x000850da main (main.m:16)
16 Meernotes 0x0008508f start + 39
这是触发它的代码(但在模拟器/iphone 上没问题):
while (textStillFits) {
textToBeKeptBeforeCutting = textToBeKept;
textToBeMovedBeforeCutting = textToBeMoved;
rangeCutOffPosition = [settings determineFirstCutOffRangeOfString:textToBeMoved];
textToBeKeptTemp = [textToBeMoved substringToIndex:rangeCutOffPosition.location];
textToBeMovedTemp = [textToBeMoved substringFromIndex:rangeCutOffPosition.location];
textToBeMoved = textToBeMovedTemp;
textToBeKept = [NSString stringWithFormat:@"%@%@", textToBeKept, textToBeKeptTemp];
NSUInteger l = [settings linesOfText:textToBeKept];
if (l > maxLines) {
textStillFits = NO;
textToBeKept = textToBeKeptBeforeCutting;
textToBeMoved = textToBeMovedBeforeCutting;
// brakes here!
}else {
textStillFits = YES;
}
}
我看过这个,但没有帮助:ad hoc iphone sigsegv crash
更多上下文,正如@ott 提到的 NSNotFound 可能导致此:
-(NSRange)determineFirstCutOffRangeOfString:(NSString *)s {
NSRange rangeSpace = [s rangeOfString:@" " options:NSCaseInsensitiveSearch];
NSRange rangeReturn = [s rangeOfString:@"\n" options:NSCaseInsensitiveSearch];
if (rangeSpace.location == NSNotFound && rangeReturn.location == NSNotFound) {
rangeSpace = NSMakeRange(1, 0); // don't take 0,0 as this will lead to endless loop
rangeReturn = NSMakeRange(1, 0);
NSLog(@"NEITHER SPACE NOR RETURN FOUND");
}
NSRange rangeCutOffPosition = NSMakeRange(0, 0);
if (rangeSpace.location < rangeReturn.location) {
// i.e. if the space char is the lowest char where you can cut off
rangeCutOffPosition = NSMakeRange(rangeSpace.location+1,0); // +1, i.e. always cut off AFTER the space
} else {
// i.e. if the return char is the lowest char where you can cut off
rangeCutOffPosition = NSMakeRange(rangeReturn.location+1,0); // +1, i.e. always cut off AFTER the return
}
return rangeCutOffPosition;
}
最佳答案
他们最新的sdk 1.2.4解决了这个问题!
关于iphone - SIGSEGV 在 iOS TestFlight 设备上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12280491/
为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar
当我在Rails控制台中按向上或向左箭头时,出现此错误:irb(main):001:0>/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/rb-readline-0.4.2/lib/rbreadline.rb:4269:in`blockin_rl_dispatch_subseq':invalidbytesequenceinUTF-8(ArgumentError)我使用rvm来管理我的ruby安装。我正在使用=>ruby-2.0.0-p247[x86_64]我使用bundle来管理我的gem,并且我有rb-readline(0.4.2)(人们推荐的最少
在应用开发中,有时候我们需要获取系统的设备信息,用于数据上报和行为分析。那在鸿蒙系统中,我们应该怎么去获取设备的系统信息呢,比如说获取手机的系统版本号、手机的制造商、手机型号等数据。1、获取方式这里分为两种情况,一种是设备信息的获取,一种是系统信息的获取。1.1、获取设备信息获取设备信息,鸿蒙的SDK包为我们提供了DeviceInfo类,通过该类的一些静态方法,可以获取设备信息,DeviceInfo类的包路径为:ohos.system.DeviceInfo.具体的方法如下:ModifierandTypeMethodDescriptionstatic StringgetAbiList()Obt
Devise是一个Ruby库,它为我提供了这个User类:classUser当写入:confirmable时,注册时会发送一封确认邮件。上周我不得不批量创建300个用户,所以我在恢复之前注释掉了:confirmable几分钟。现在我正在为用户批量创建创建一个UI,因此我需要即时添加/删除:confirmable。(我也可以直接修改Devise的源码,但我宁愿不去调和它)问题:如何即时添加/删除:confirmable? 最佳答案 WayneConrad的解决方案:user=User.newuser.skip_confirmation
代码:threads=[]Thread.abort_on_exception=truebegin#throwexceptionsinthreadssowecanseethemthreadseputs"EXCEPTION:#{e.inspect}"puts"MESSAGE:#{e.message}"end崩溃:.rvm/gems/ruby-2.1.3@req/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:478:inload_missing_constant':自动加载常量MyClass时检测到循环依赖稍加研究后,
任何人都可以解释为什么当对方法的调用看起来像这样时我可能会看到这个堆栈(由HTTParty::post请求引起):beginresponse=HTTParty::post(url,options)rescuelogger.warn("Couldnotpostto#{url}")rescueTimeout::Errorlogger.warn("Couldnotpostto#{url}:timeout")end堆栈:/usr/local/lib/ruby/1.8/timeout.rb:64:in`timeout'/usr/local/lib/ruby/1.8/net/protocol.rb
我使用vim编辑ruby文件,但是当我输入“.”时它崩溃了。我发现它是由AutoComplPop插件引起的。我该怎么办? 最佳答案 我找到了一种使用autocomplpop和filetype=ruby来防止vim崩溃的方法。将以下行放入您的.vimrcletg:acp_behaviorRubyOmniMethodLength=-1这将防止在您键入“.”时触发autocomplpop。(期间)这不是解决办法。(我不是vim插件程序员)祝你好运! 关于ruby-vim使用AutoComp
我在Rails5项目的app/services文件夹下有多个加载/需要类的问题,我开始放弃这个问题。首先要明确的是,services/是我在整个项目中使用的简单PORO类,用于从Controller、模型等中抽象出大部分业务逻辑。树看起来像这样app/services/my_service/base.rbfunny_name.rbmy_service.rbmodels/funny_name.rb失败#1首先,当我尝试使用MyService.const_get('FunnyName')时,它从我的模型目录中获取了FunnyName。当我直接执行MyService::FunnyName时,
我正在从Ruby2.3.1升级到Ruby2.4.1,这样做之后,Unicorn似乎与新版本不兼容。我收到以下错误。我正在使用Unicorn5.1.0并尝试过Unicorn5.3.1无济于事。我是否需要使用不同的库而不是XCode工具进行编译?我在使用foremanstart和Procfile启动服务器后立即收到错误:webpack:bin/webpack-dev-servergulp:gulpredis:./scripts/start_redis_server.shsidekiq:bundleexecsidekiq-Cconfig/sidekiq.ymlannotations_serv
我正在构建一个与RubyonRails后端对话的iPhone应用程序。RubyonRails应用程序还将为Web用户提供服务。restful_authentication插件是提供快速和可定制的用户身份验证的绝佳方式。但是,我希望iPhone应用程序的用户在新列中存储一个由手机的唯一标识符([[UIDevicedevice]uniqueIdentifier])自动创建的帐户。稍后,当用户准备好创建用户名/密码时,帐户将更新为包含用户名和密码,iPhone唯一标识符保持不变。用户在设置用户名/密码之前不能访问该网站。然而,他们可以使用iPhone应用程序,因为该应用程序可以使用它的标识符