以下是来自 Crashlytics 的堆栈跟踪,它在设置 TextView 的框架高度时崩溃:
(我在同一行 @objc UIView.height.setter (UIView+.swift) 遇到了 EXC_BAD_ACCESS KERN_INVALID_ADDRESS 和 SIGABRT ABORT 崩溃)
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000000000000d
Crashed: com.apple.main-thread
0 CoreText 0x194d24cd8 TOpenTypeMorph::SetLookups(OTL::GSUB&, unsigned int const*, OTL::GlyphLookups&) + 200
1 CoreText 0x194d24dd4 TOpenTypeMorph::SetLookups(OTL::GSUB&, unsigned int const*, OTL::GlyphLookups&) + 452
2 CoreText 0x194d25a40 void TOpenTypeMorph::ApplyShapingEngine<TInlineVector<unsigned int, 30ul> >(OTL::GSUB&, OTL::GlyphLookups&, unsigned int*, CFRange, TInlineVector<unsigned int, 30ul>&, SyncState&) + 1620
3 CoreText 0x194d24fac TOpenTypeMorph::ShapeGlyphs(SyncState&) + 340
4 CoreText 0x194cc4a4c TShapingEngine::ShapeGlyphs(TLine&, TCharStream const&) + 224
5 CoreText 0x194c8fa48 TTypesetter::TTypesetter(__CFArray const*, __CFString const*, void const* (*)(__CTRun const*, __CFString const*, void*), void*) + 188
6 CoreText 0x194c8f860 CTTypesetterCreateWithRunArray + 88
7 UIFoundation 0x197dffbb4 -[NSATSGlyphStorage createCTTypesetter] + 1512
8 UIFoundation 0x197dfa960 -[NSATSTypesetter _ctTypesetter] + 296
9 UIFoundation 0x197e03b14 -[NSATSLineFragment layoutForStartingGlyphAtIndex:characterIndex:minPosition:maxPosition:lineFragmentRect:] + 128
10 UIFoundation 0x197dfb534 -[NSATSTypesetter _layoutLineFragmentStartingWithGlyphAtIndex:characterIndex:atPoint:renderingContext:] + 2316
11 UIFoundation 0x197dfcaf8 -[NSATSTypesetter layoutParagraphAtPoint:] + 160
12 UIFoundation 0x197e53980 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] + 5692
13 UIFoundation 0x197e53da4 -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 244
14 UIFoundation 0x197dfd558 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 448
15 UIFoundation 0x197de968c -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 1116
16 UIFoundation 0x197deb180 -[NSLayoutManager(NSPrivate) _fillLayoutHoleAtIndex:desiredNumberOfLines:] + 196
17 UIFoundation 0x197deb8b4 -[NSLayoutManager(NSPrivate) _markSelfAsDirtyForBackgroundLayout:] + 344
18 UIFoundation 0x197df477c -[NSLayoutManager(NSPrivate) _invalidateLayoutForExtendedCharacterRange:isSoft:invalidateUsage:] + 2292
19 UIFoundation 0x197e1dee8 -[NSLayoutManager textContainerChangedGeometry:] + 332
20 UIFoundation 0x197e40220 -[NSTextContainer setSize:] + 160
21 UIKit 0x197f74508 _UITextContainerViewResyncNSTextContainer + 264
22 UIKit 0x19890198c __64-[_UITextContainerView _setFrameOrBounds:oldRect:settingAction:]_block_invoke + 52
23 UIKit 0x198901878 -[_UITextContainerView _setFrameOrBounds:oldRect:settingAction:] + 308
24 UIKit 0x197f7436c -[_UITextContainerView setFrame:] + 188
25 UIKit 0x1988ee64c -[UITextView _resyncContainerFrameForNonAutolayoutDeferringSizeToFit:] + 644
26 UIKit 0x1988ef1b4 -[UITextView _setFrameOrBounds:fromOldRect:settingAction:] + 500
27 UIKit 0x197f73bf8 -[UITextView setFrame:] + 188
28 MyAppCore 0x1024ac944 @objc UIView.height.setter (UIView+.swift)
29 MyAppShell 0x1030a1cbc MyAppTextBaseCell.setSubviewFrames() -> () (MyAppTextBaseCell.swift)
30 MyAppShell 0x1059254e0 MyAppCollectionViewCell.layoutSubviews() -> () (MyAppCollectionViewCell.swift:215)
31 MyAppShell 0x1059255d4 @objc MyAppCollectionViewCell.layoutSubviews() -> () (MyAppCollectionViewCell.swift)
32 UIKit 0x197ec6220 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1196
33 QuartzCore 0x195386188 -[CALayer layoutSublayers] + 148
34 QuartzCore 0x19537ae64 CA::Layer::layout_if_needed(CA::Transaction*) + 292
35 UIKit 0x197edac90 -[UIView(Hierarchy) layoutBelowIfNeeded] + 1020
36 MyAppLib 0x100b56ea4 -[MyAppImpressionTracker reloadViewPortCellsWithCompletion:] (MyAppImpressionTracker.m:59)
37 MyAppLib 0x100b65f0c -[MyAppTracker viewPortWillRefresh:withReloadDataCompletion:] (MyAppTracker.m:150)
38 MyAppShell 0x1030d3440 MyAppViewController.reloadData() -> () (MyAppViewController.swift)
39 MyAppFeed 0x102a85ad4 MyAppViewController.providerHasUpdated(fromCache : Bool, hasInitialUpdates : Bool) -> () (MyAppViewController.swift)
40 MyAppFeed 0x102a85c80 @objc MyAppViewController.providerHasUpdated(fromCache : Bool, hasInitialUpdates : Bool) -> () (MyAppViewController.swift)
41 MyAppFeed 0x102a53030 protocol witness for MyAppProviderDelegate.providerHasUpdated(fromCache : Bool, hasInitialUpdates : Bool) -> () in conformance MyAppViewController (MyAppCellViewModel.swift)
42 MyAppFeed 0x102b35c84 specialized MyAppProvider.(updateSectionProviders(Bool, hasInitialUpdates : Bool, completion : () -> ()?) -> ()).(closure #2) (MyAppProvider.swift)
43 MyAppFeed 0x102b32380 partial apply for MyAppProvider.(updateSectionProviders(Bool, hasInitialUpdates : Bool, completion : () -> ()?) -> ()).(closure #2) (MyAppProvider.swift)
44 MyAppCore 0x10246188c partial apply for static GCD.(dispatchAsyncMyAppOperationQueue(() -> (), thenOnMainQueue : () -> ()?) -> ()).(closure #1).(closure #1) (QueueHelper.swift)
45 libdispatch.dylib 0x190ef9200 _dispatch_call_block_and_release + 24
46 libdispatch.dylib 0x190ef91c0 _dispatch_client_callout + 16
47 libdispatch.dylib 0x190efdd6c _dispatch_main_queue_callback_4CF + 1000
48 CoreFoundation 0x19201bf2c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
49 CoreFoundation 0x192019b18 __CFRunLoopRun + 1660
50 CoreFoundation 0x191f48048 CFRunLoopRunSpecific + 444
51 GraphicsServices 0x1939ce198 GSEventRunModal + 180
52 UIKit 0x197f342fc -[UIApplication _run] + 684
53 UIKit 0x197f2f034 UIApplicationMain + 208
54 MyApp 0x1000b344c main (AppDelegate.swift:27)
55 libdispatch.dylib 0x190f2c5b8 (Missing)
由于崩溃日志与 Glyph 相关,它似乎是因为一些奇怪的字符/符号可能是英语以外的语言而发生的。
我无法重现这次崩溃,有人可以提供任何指示吗。
最佳答案
发生这种情况是因为 jña正在接收泰卢固语字符。不过,这是旧 ios 版本的问题。参见 this video.
关于iOS CoreText 崩溃 : EXC_BAD_ACCESS KERN_INVALID_ADDRESS while setting view height,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41124500/
为了将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)(人们推荐的最少
我刚刚开始从Ruby1.8.7升级到Ruby1.9.2(使用RVM)。我的所有应用程序都使用“脚本/服务器”(或“rails服务器”)和1.9.2运行,但是,只有Rails3.0.0RC应用程序可以与Passenger一起使用。Rails2.3.8应用给出的错误信息是:invalidbytesequenceinUS-ASCII我猜这是一个Passenger问题。我使用找到的RVM指南安装了Passenger2.2.15here.任何想法如何修复这个错误?谢谢。我已更新以包含堆栈跟踪:/Users/kevin/.rvm/gems/ruby-1.9.2-p0/gems/actionpack
尝试在我的Rails应用程序中导入CSV文件时,出现错误UTF-8中的无效字节序列。一切正常,直到我添加了一个gsub方法来将其中一个CSV列与我的数据库中的一个字段进行比较。当我导入CSV文件时,我想检查每一行的地址是否包含在特定客户端的不同地址数组中。我有一个带有alt_addresses属性的客户端模型,其中包含客户端地址的几种不同可能格式。然后我有一个引用模型(如果您熟悉本地SEO,您就会知道这个术语)。引用模型没有地址字段,但它有一个nap_correct?字段(NAP代表“姓名”、“地址”、“电话号码”)。如果CSV行的名称、地址和电话号码与我在该客户的数据库中拥有的相同,
代码: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时检测到循环依赖稍加研究后,
我对UTF-8编码有一些问题。我在这里阅读了一些帖子,但它仍然无法正常工作。这是我的代码:#!/bin/envruby#encoding:utf-8defdeterminefile=File.open("/home/lala.txt")file.eachdo|line|puts(line)type=line.match(/DOG/)puts('aaaaa')iftype!=nilputs(type[0])breakendendend这是我文件的前3行:;?lalalalal60000065535-1362490443-0000006334-0000018467-0000000041en
任何人都可以解释为什么当对方法的调用看起来像这样时我可能会看到这个堆栈(由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
首先:我正在使用grape构建我的API(Rails4)。当有人发送无效的JSON正文时(例如忘记最后一个}),会引发以下错误:ActionDispatch::ParamsParser::ParseError(795:unexpectedtokenat'{"foobar":1234')我尝试使用grapesrescue_from:all选项,但这不起作用。在堆栈跟踪中,我没有看到涉及的葡萄gem。这个错误似乎是从actionpack中抛出的:.gems/gems/actionpack-4.1.4/lib/action_dispatch/middleware/params_parser.
我正在使用Rails5。我想从Word文档(.doc)中获取文本,所以我正在使用这段代码text=nilMSWordDoc::Extractor.load(file_location)do|ctl00_MainContent_List1_grdData|text=contents.whole_contentsend但我收到以下错误。我的Gemfile中有这个gemgem'msworddoc-extractor'我还需要做什么才能从Word文档中获取内容?如果我可以像对.doc文件一样对.docx文件应用相同的代码,那就太好了。/Users/davea/.rvm/gems/ruby-2.