2017-07-30 15 views
5

मैं एक क्रैश रिपोर्ट है (यह पहले से ही symbolicated है कम से कम मैं तो आशा के रूप में मैं XCode आयोजक से इस लॉग प्राप्त होगा)XCode क्रैश रिपोर्ट (पहले से ही Symbolicated) लाइन नंबर

Incident Identifier: F4324555-0916-4E32-82EF-3272917367BB 
Beta Identifier:  80811904-A512-48A1-9593-D386703A62F0 
Hardware Model:  iPhone7,2 
Process:    SelfieSuperStarz [596] 
Path:    /private/var/containers/Bundle/Application/BFA0D82B-274B-400B-8F84-52A1D7369C51/SelfieSuperStarz.app/SelfieSuperStarz 
Identifier:   com.PuckerUp.PuckerUp 
Version:    21 (1.31) 
Beta:    YES 
Code Type:   ARM-64 (Native) 
Role:    Foreground 
Parent Process:  launchd [1] 
Coalition:   com.PuckerUp.PuckerUp [434] 


Date/Time:   2017-07-29 20:06:11.7394 -0400 
Launch Time:   2017-07-29 19:34:39.7433 -0400 
OS Version:   iPhone OS 10.3.2 (14F89) 
Report Version:  104 

Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x0000000000000000, 0x0000000000000000 
Exception Note: EXC_CORPSE_NOTIFY 
Triggered by Thread: 0 

Last Exception Backtrace: 
0 CoreFoundation     0x18bebafe0 __exceptionPreprocess + 124 (NSException.m:165) 
1 libobjc.A.dylib     0x18a91c538 objc_exception_throw + 56 (objc-exception.mm:521) 
2 CoreFoundation     0x18be26eb4 -[__NSArray0 objectAtIndex:] + 108 (CFArray.c:69) 
3 SelfieSuperStarz    0x10007b708 specialized _ArrayBuffer._getElementSlowPath(Int) -> AnyObject + 116 
4 SelfieSuperStarz    0x10007ea40 specialized Merger.merge(completion :() ->(), assets : [Asset]) ->() + 1444 (Merger.swift:0) 
5 SelfieSuperStarz    0x100071f3c specialized AssetView.finish(UIButton) ->() + 520 (Merger.swift:0) 
6 SelfieSuperStarz    0x1000712d0 @objc AssetView.finish(UIButton) ->() + 40 (AssetView.swift:0) 
7 UIKit       0x192021010 -[UIApplication sendAction:to:from:forEvent:] + 96 (UIApplication.m:4580) 
8 UIKit       0x192020f90 -[UIControl sendAction:to:forEvent:] + 80 (UIControl.m:609) 
9 UIKit       0x19200b504 -[UIControl _sendActionsForEvents:withEvent:] + 440 (UIControl.m:694) 
10 UIKit       0x192020874 -[UIControl touchesEnded:withEvent:] + 576 (UIControl.m:446) 
11 UIKit       0x192020390 -[UIWindow _sendTouchesForEvent:] + 2480 (UIWindow.m:2122) 
12 UIKit       0x19201b728 -[UIWindow sendEvent:] + 3192 (UIWindow.m:2292) 
13 UIKit       0x191fec33c -[UIApplication sendEvent:] + 340 (UIApplication.m:10778) 
14 UIKit       0x1927e6014 __dispatchPreprocessedEventFromEventQueue + 2400 (UIEventDispatcher.m:1448) 
15 UIKit       0x1927e0770 __handleEventQueue + 4268 (UIEventDispatcher.m:1671) 
16 UIKit       0x1927e0b9c __handleHIDEventFetcherDrain + 148 (UIEventDispatcher.m:1706) 
17 CoreFoundation     0x18be6942c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1943) 
18 CoreFoundation     0x18be68d9c __CFRunLoopDoSources0 + 540 (CFRunLoop.c:1989) 
19 CoreFoundation     0x18be669a8 __CFRunLoopRun + 744 (CFRunLoop.c:2821) 
20 CoreFoundation     0x18bd96da4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113) 
21 GraphicsServices    0x18d800074 GSEventRunModal + 100 (GSEvent.c:2245) 
22 UIKit       0x192051058 UIApplicationMain + 208 (UIApplication.m:4089) 
23 SelfieSuperStarz    0x10002e990 main + 56 (AppDelegate.swift:16) 
24 libdyld.dylib     0x18ada559c start + 4 

गुम आप इसे देख सकते हैं मेरी क्लास विलय में लाइन 0 पर कहता है। जो असंभव है, जैसा कि आप शायद अनुमान लगा सकते हैं। मुझे यकीन नहीं है कि किस विशेष तरीके का अर्थ है या @objc क्यों है।

3 SelfieSuperStarz    0x10007b708 specialized _ArrayBuffer._getElementSlowPath(Int) -> AnyObject + 116 
4 SelfieSuperStarz    0x10007ea40 specialized Merger.merge(completion :() ->(), assets : [Asset]) ->() + 1444 (Merger.swift:0) 
5 SelfieSuperStarz    0x100071f3c specialized AssetView.finish(UIButton) ->() + 520 (Merger.swift:0) 
6 SelfieSuperStarz    0x1000712d0 @objc AssetView.finish(UIButton) ->() + 40 (AssetView.swift:0) 

बस सुनिश्चित करें कि नहीं, जहां त्रुटि पंक्ति के रूप में हो रहा है का कहना है कि विलय: 0 और मुझे यकीन है कि उन हेडर (विशेष/ObjC) क्या मतलब है अगर वे मुझे कुछ भी कह रहे हैं नहीं कर रहा हूँ।

यहां विलय के अंदर मेरा विलय कार्य है। मैं अस्पष्टता के लिए विभिन्न प्रकार की लूप और गणना का उपयोग करता हूं और चीजों को निर्धारित करता हूं, लेकिन मैं स्थानों में शून्य की जांच करता हूं।

func merge(completion:@escaping() -> Void, assets:[Asset]) { 

    self.setupAI() 

    let assets = assets.sorted(by: { $0.layer.zPosition < $1.layer.zPosition }) 
    if let firstAsset = controller.firstAsset { 

     let mixComposition = AVMutableComposition() 

     let firstTrack = mixComposition.addMutableTrack(withMediaType: AVMediaTypeVideo, 
                    preferredTrackID: Int32(kCMPersistentTrackID_Invalid)) 

     do { 
      try firstTrack.insertTimeRange(CMTimeRangeMake(kCMTimeZero, self.controller.realDuration), 
              of: firstAsset.tracks(withMediaType: AVMediaTypeVideo)[0], 
              at: kCMTimeZero) 
     } catch _ { 
      print("Failed to load first track") 
     } 

     let documentDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] 

     var myTracks:[AVMutableCompositionTrack] = [] 
     var ranges:[ClosedRange<CMTime>] = [] 

     for asset in assets { 

      let secondTrack = mixComposition.addMutableTrack(withMediaType: AVMediaTypeVideo, 
                      preferredTrackID: Int32(kCMPersistentTrackID_Invalid)) 
      secondTrack.preferredTransform = asset.asset.preferredTransform 
      do { 
       try secondTrack.insertTimeRange(CMTimeRangeMake(kCMTimeZero, asset.endTime-asset.beginTime), 
               of: asset.asset.tracks(withMediaType: AVMediaTypeVideo)[0], 
               at: CMTime(seconds: CMTimeGetSeconds(asset.beginTime), preferredTimescale: 600000)) 
      } catch _ { 
       print("Failed to load second track") 
      } 
      if(ranges.count == 0) { 
       ranges.append(asset.beginTime...asset.endTime) 
      } 
      else { 
       var none = true 
       for range in ranges { 
        let start = range.contains(asset.beginTime) 
        let end = range.contains(asset.endTime) 
        var connection = false 
        var nothing = false 

        //This range is completely encompassed (begin and end inside) 
        if(start && end) { 
         //Don't add to the rnge 
         none = false 
         nothing = true 
        } 

        //Begin is in range (right side) 
        else if(start && !end) { 
         connection = true 
         none = false 
        } 

        //End is in range (left side) 
        else if(!start && end) { 
         connection = true 
         none = false 
        } 

        var connected = false 
        //It connects 2 different timess 
        if(connection) { 
         for range2 in ranges { 
          if(range != range2) { 
           if(start && range2.contains(asset.endTime)) { 
            let index = ranges.index(of: range) 
            if(index != nil) { 
             ranges.remove(at: index!) 
             ranges.append(range.lowerBound...range2.upperBound) 
             connected = true 
             break 
            } 
           } 
           else if(end && range2.contains(asset.beginTime)) { 
            let index = ranges.index(of: range) 
            if(index != nil) { 
             ranges.remove(at: index!) 
             ranges.append(range.lowerBound...range2.upperBound) 
             connected = true 
             break 
            } 
           } 
          } 
         } 
        } 
        if(!connected && !none && !nothing) { 
         if(start) { 
          let index = ranges.index(of: range) 
          if(index != nil) { 
           ranges.remove(at: index!) 
           ranges.append(range.lowerBound...asset.endTime) 
          } 
         } 
         else if(end) { 
          let index = ranges.index(of: range) 
          if(index != nil) { 
           ranges.remove(at: index!) 
           ranges.append(asset.beginTime...asset.endTime) 
          } 
         } 
        } 
       } 
       if(none) { 
        ranges.append(asset.beginTime...asset.endTime) 
       } 
      } 
      myTracks.append(secondTrack) 
     } 

     for range in ranges { 
      print(CMTimeGetSeconds(range.lowerBound), CMTimeGetSeconds(range.upperBound)) 
     } 
     for assets in self.controller.assets { 
      print(CMTimeGetSeconds(assets.beginTime), CMTimeGetSeconds(assets.endTime)) 
     } 

     if let loadedAudioAsset = self.controller.audioAsset { 
      let audioTrack = mixComposition.addMutableTrack(withMediaType: AVMediaTypeAudio, preferredTrackID: 0) 
      do { 
       try audioTrack.insertTimeRange(CMTimeRangeMake(kCMTimeZero, self.controller.realDuration), 
               of: loadedAudioAsset.tracks(withMediaType: AVMediaTypeAudio)[0] , 
               at: kCMTimeZero) 
      } catch _ { 
       print("Failed to load Audio track") 
      } 
     } 

     let mainInstruction = AVMutableVideoCompositionInstruction() 
     mainInstruction.timeRange = CMTimeRangeMake(kCMTimeZero, self.controller.realDuration) 

     // 2.2 
     let firstInstruction = self.videoCompositionInstructionForTrack(firstTrack, firstAsset) 
     var instructions:[AVMutableVideoCompositionLayerInstruction] = [] 
     var counter:Int = 0 
     for tracks in myTracks { 
      let secondInstruction = self.videoCompositionInstructionForTrack(tracks, assets[counter].asset, type:true) 
      let index = myTracks.index(of: tracks) 

      //This should never be nil, but if it is, it might cause opacity's to go out of whack for that specific track. Only reason I can think of why I am crashing in this method. 
      if(index != nil) { 
       if(index! < assets.count-1) { 
        for i in (counter+1...assets.count-1) { 
         if(assets[counter].endTime > assets[i].endTime) { 
          secondInstruction.setOpacity(1.0, at: assets[i].endTime) 
          secondInstruction.setOpacity(0.0, at: assets[counter].endTime) 
          print("Bigger") 
          break 
         } 
        } 
       } 
       if(index! > 0) { 
        for i in (0...counter).reversed() { 
         if(assets[counter].endTime < assets[i].endTime) { 
          secondInstruction.setOpacity(0.0, at: assets[counter].endTime) 
          print("Smaller") 
          break 
         } 
        } 
       } 
       if(counter < myTracks.count-1) { 
        if(assets[counter].layer.zPosition <= assets[counter+1].layer.zPosition) { 
         secondInstruction.setOpacity(0.0, at: assets[counter+1].beginTime) 
        } 
        else { 
         secondInstruction.setOpacity(0.0, at: assets[counter].endTime) 
        } 
       } 
       instructions.append(secondInstruction) 
       counter += 1 
      } 
     } 

     for range in ranges { 
      firstInstruction.setOpacity(0.0, at: range.lowerBound) 
      firstInstruction.setOpacity(1.0, at: range.upperBound) 
     } 

     // 2.3 
     mainInstruction.layerInstructions = [firstInstruction] + instructions 

     let imageLayer = CALayer() 
     let image = UIImage(named: "Watermark") 
     imageLayer.contents = image!.cgImage 

     let ratio = (firstAsset.tracks(withMediaType: AVMediaTypeVideo)[0].naturalSize.width/image!.size.width)/2 
     let rect = CGRect(x: image!.size.width*ratio, y: 0, width: image!.size.width*ratio, height: image!.size.height*ratio) 
     imageLayer.frame = rect 
     imageLayer.backgroundColor = UIColor.clear.cgColor 
     imageLayer.opacity = 0.75 

     let videoLayer = CALayer() 
     videoLayer.frame = CGRect(x: 0, y: 0, width: firstAsset.tracks(withMediaType: AVMediaTypeVideo)[0].naturalSize.width, height: firstAsset.tracks(withMediaType: AVMediaTypeVideo)[0].naturalSize.height) 

     let parentlayer = CALayer() 
     parentlayer.frame = CGRect(x: 0, y: 0, width: image!.size.width*ratio, height: image!.size.height*ratio) 
     parentlayer.addSublayer(videoLayer) 
     parentlayer.addSublayer(imageLayer) 

     let mainComposition = AVMutableVideoComposition() 
     mainComposition.instructions = [mainInstruction] 
     mainComposition.frameDuration = CMTimeMake(1, 30) 
     mainComposition.renderSize = self.controller.firstAsset!.tracks(withMediaType: AVMediaTypeVideo)[0].naturalSize 
     mainComposition.animationTool = AVVideoCompositionCoreAnimationTool(postProcessingAsVideoLayer: videoLayer, in: parentlayer) 
+0

क्या ऐसी कोई संपत्ति है जो आप किसी इंडेक्स पर किसी संपत्ति तक पहुंचने का प्रयास कर रहे हैं? या उसमें कोई अन्य सरणी जिसके लिए आप किसी ऑब्जेक्ट तक पहुंचने का प्रयास कर रहे हैं जो वहां नहीं है? – adev

+0

मैंने उस कक्षा के लिए अपना कोड जोड़ा जो इस स्थिति से संबद्ध है – impression7vx

+0

आपके कोड में बहुत से स्थानों में यह '[0] 'है। यदि गणना करने से पहले गिनती शून्य से अधिक हो तो गिनती शून्य होने पर आपको त्रुटि जांचनी चाहिए। यह इस दुर्घटना का कारण होना चाहिए। – adev

उत्तर

1

यह स्पष्ट है कि "Merger.merge" विधि एक गैर-मौजूदा तत्व तक पहुंचती है। डीबगर आपको दिखाएगा कि वह कहां है।

मुझे लगता है कि कुछ धागा आपकी पीठ के पीछे कुछ सरणी संशोधित कर रहा है ताकि किसी बिंदु पर मान्य एक सूचकांक अमान्य हो जाए। और "श्रेणी 2 में श्रेणियों के लिए" जब आप बाद में "श्रेणियां" संशोधित करते हैं तो परेशानी के लिए पूछ रहे हैं।

+0

मुझे एक्सकोड ऑर्गनाइज़र से एक परीक्षक से क्रैश रिपोर्ट मिली और मैं इस मुद्दे को पुन: उत्पन्न नहीं कर सकता। इसलिए, जबकि ब्रेकपॉइंट टेस्ट मदद करेगा, मैं इस मुद्दे को पुन: उत्पन्न नहीं कर सकता। यही कारण है कि मैं ऐप्पल और एक्सकोड के ऑर्गनाइज़र से क्रैश लॉग से क्रैश रिपोर्ट का उपयोग करता हूं। यदि आप ध्यान देते हैं, तो मैं 1 रेंज हटा देता हूं और हमेशा एक और जोड़ता हूं। मैं ऐसा कुछ करने के लिए ऐसा करता हूं: (1-10) लेकिन अब मैं चाहता हूं (1-15) तो मैं हटा देता हूं (1-10) और (1-15) जोड़ता हूं। – impression7vx

1

मुझे लगता है कि समस्या +1444 ऑफ़सेट और सरणी पहुंच पर विचार करते हुए लाइन 12 9 के कारण होती है। क्या आपने ऑडियो के बिना वीडियो की कोशिश की है, जैसे ऑडियो अनुमति के बिना लिया गया वीडियो? मुझे अपने ऐप में ली गई वीडियो को हमेशा ऑडियो ट्रैक रखने के द्वारा बाध्य दुर्घटना का सामना करना पड़ा। आप उपयोगकर्ताओं द्वारा आश्चर्यचकित होंगे कि वे आपके ऐप में कौन सा वीडियो खिलाते हैं। मेरे उपयोगकर्ता ने अपने ऐप को अपने फ्लैश वीडियो के साथ दुर्घटनाग्रस्त कर दिया था, जिसे उनके फोन एल्बम से चुना गया था।

(मुझे यकीन नहीं है कि यह स्विफ्ट के लिए काम करेगा) डीबगर का उपयोग कर एक्सकोड में लाइन का पता लगाना भी संभव है। सबसे पहले, आप रिलीज बिल्ड के रूप में एक ही अनुकूलन सेटिंग के साथ ऐप चलाते हैं। फिर आप असेंबली कोड की जांच के लिए फ़ंक्शन में अलग-अलग पंक्तियां तोड़ते हैं। How to see assembly code in xcode 6। फ़ंक्शन नाम और ऑफसेट के अर्थ को दोबारा जांचने के लिए आपको शीर्ष पर स्क्रॉल करने की आवश्यकता हो सकती है।

_ArrayBuffer._getElementSlowPath निजी एपीआई में एक वर्ग है, जो अंडरस्कोर उपसर्ग द्वारा इंगित किया गया है। आपको शायद इसके बारे में कोई विश्वसनीय और/या आधिकारिक स्रोत नहीं मिलेगा।

आपके क्रैश लॉग में अपूर्णता शायद स्विफ्ट (इसके पीछे के उपकरण) की बग/अपरिपक्वता के कारण होती है। सबसे प्रवृत्त और प्रचारित भाषा में से एक में आपका स्वागत है। काम करने की स्थितियों में भी, स्विफ्ट जेनरेट कोड के लिए लाइन 0 देता है जहां कोड स्रोत कोड के किसी भी सार्थक हिस्सों से मेल नहीं खाता है। हालांकि यह आपका मामला नहीं है।

+0

डीबगिंग के साथ समस्या यह है कि मैं त्रुटि को पुन: उत्पन्न नहीं कर सकता; परीक्षकों में से केवल एक। इस प्रक्रिया को अविश्वसनीय रूप से जटिल बनाना – impression7vx

+0

यह भी ध्यान दें, ऑडियो फाइल जो मैं खींच रहा हूं वह उनके ऑडियो से नहीं है, यह हमारे वीडियो से है। यह एक गारंटीकृत वीडियो भी है। हम एक प्रीसेट वीडियो का उपयोग करते हैं जो पहले से ही ऐप में है और वहां से जाता है। – impression7vx

+0

आपने अन्य धागे के सभी स्टैक ट्रेस को हटा दिया है। बहु-थ्रेड समस्या अभी भी खुली है। मान लीजिए कि यह एक बहु-थ्रेड समस्या नहीं है, समस्या का पुन: उत्पन्न करने में असमर्थ है जिसका अर्थ है कि आपको अभी तक महत्वपूर्ण कदम नहीं मिला है। एक वीडियो में कोई ऑडियो ट्रैक नहीं हो सकता है। मुझे यकीन नहीं है कि प्रीसेट क्या है। क्या आपने अप्रत्याशित वीडियो के साथ अपने ऐप को खिलाने के लिए पर्याप्त मेहनत की है? – keithyip

संबंधित मुद्दे