Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
App Extension のスタックトレース情報からクラッシュを解析/集計する / Anal...
Search
naru-jpn
September 18, 2021
Technology
3
1.3k
App Extension のスタックトレース情報からクラッシュを解析/集計する / Analyzing app extension's stack trace
配信アプリで使用している Broadcast Extension 上で発生したクラッシュの詳細について、クラッシュ発生時のスタックトレースを取得して解析し、複数のクラッシュの修正に繋げた話。
naru-jpn
September 18, 2021
Tweet
Share
More Decks by naru-jpn
See All by naru-jpn
配信アプリのためのリアルタイムプッシュ通知ぼかしの夢
narujpn
3
730
PiPを応用した配信コメントバー機能の開発秘話と技術の詳解 / pip_streaming_comment_bar
narujpn
3
3.5k
Updating an App to Use Swift Concurrency 解説
narujpn
2
230
PiP で実現するミラティブの配信コメントバー / pip-streaming-comment-bar
narujpn
0
940
ミラティブとWebRTC - WebRTC framework の中身を覗いてみよう / WebRTC framework AudioUnit Processing
narujpn
1
2k
CoreML3のオンデバイストレーニングでつくる母音推定
narujpn
0
380
AltConfと周辺の歩き方
narujpn
0
1.9k
エンジニア経験を活かしたスクラムマスターとして 開発チームとプロダクトを成長させる
narujpn
1
370
GASで作るファネル分析ツール
narujpn
1
150
Other Decks in Technology
See All in Technology
成果のためのコミュニケーション - 語彙を育てよう -/communication-for-good-outcome-developing-vocabulary
hassaku63
4
140
Product Utilization of Large Language Models Starting Today
ymatsuwitter
2
600
いまからでも遅くない! コンテナでWebアプリケーションを 動かしてみよう(2-1)WebAPI座学
nomu
0
140
【shownet.conf_】革新と伝統を融合したファシリティ
shownet
PRO
0
240
トークナイザー入門
payanotty
2
380
山手線一周のパフォーマンス改善
suzukahr
0
110
スモールスタート、不都合な真実 〜 耳当たりの良い言葉に現場が振り回されないために/20240930-ssmjp-small-start
opelab
12
1.7k
GitHub Actions/Docker/Terraform/Renovate で最小限の Monorepo CD パイプラインを作る / Minimalistic Monorepo CD Pipeline with GitHub Actions, Docker, Terraform and Renovate
yuyatakeyama
4
340
たった一人で始めた音楽制作が気がついたら会社公認の部活動になっていた話〜組織の垣根を超えるコラボレーションを実現するには〜 / On-KAG-bu
piyonakajima
0
150
LINEヤフー新卒採用 コーディングテスト解説 アルゴリズム問題編
lycorp_recruit_jp
0
12k
小さな勉強会の始め方、広げ方、あるいは友達の作り方 / How to Start, Grow, and Build Connections with Small Study Groups
ar_tama
2
730
Renovate ではじめる運用レスなライブラリ更新 / 令和最新版 他人に自慢したいヤバいCI/CD LT会 @ yabaibuki.dev #2
ponkio_o
PRO
1
130
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
249
21k
No one is an island. Learnings from fostering a developers community.
thoeni
19
2.9k
GitHub's CSS Performance
jonrohan
1030
450k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
30
2.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Web development in the modern age
philhawksworth
205
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
How to train your dragon (web standard)
notwaldorf
87
5.6k
Into the Great Unknown - MozCon
thekraken
30
1.4k
Navigating Team Friction
lara
183
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
225
22k
Transcript
"QQ&YUFOTJPOͷελοΫτϨʔεใ͔Β ΫϥογϡΛղੳूܭ͢Δ /BSVLJ$IJHJSB !@OBSV@KQO J04%$
ϛϥςΟϒΞϓϦͷ͝հ
ࠓճͷͷഎܠ
& ΞϓϦຊମ #SPBEDBTU&YUFOTJPO ϛϥςΟϒͷJ04ΞϓϦ #SPBEDBTU&YUFOTJPOΛར༻ͯ͠৴ॲཧΛ͍ͯ͠Δ
& ΞϓϦຊମ #SPBEDBTU&YUFOTJPO ΞϓϦຊମͱ#SPBEDBTU&YUFOTJPOผͷϓϩηεͱͯ͠ಈ࡞͍ͯͯ͠ɺ ྫ͑ͲͪΒ͔͕Ϋϥογϡͯ͠ɺ͏Ұํಈ͖ଓ͚͍ͯͨΓ͢Δ 💥 ৴ͯ͠ΔΑ Ϋϥογϡͨ͠
& ΞϓϦຊମ #SPBEDBTU&YUFOTJPO Ϋϥογϡ͕ൃੜͨ࣌͠ɺ ͦΕͧΕͰߦ͍ͬͯΔॲཧҟͳ͍ͬͯΔ 💥 💥
ΞϓϦຊମ ΞϓϦຊମΫϥογϡใΛ'JSFCBTF$SBTIMZUJDTʹૹ৴͍ͯͯ͠ɺ 'JSFCBTFͷίϯιʔϧ্ͰΫϥογϡΛ֬ೝͯ͠ରԠ͍ͯ͠Δ 💥 📝
ϩά༻αʔόʔ & #SPBEDBTU&YUFOTJPO #SPBEDBTU&YUFOTJPOʹ'JSFCBTF$SBTIMZUJDTΈࠐ·Ε͓ͯΒͣɺ ಠࣗʹΫϥογϡ࣌ͷใΛऔಘ͍ͯ͠Δ 💥 📝 5ISFBEDBMM4UBDL4ZNCPMT
ϩά༻αʔόʔ & #SPBEDBTU&YUFOTJPO ݩʑɺϩάΫϥογϡͷൃੜසΛѲ͢ΔͨΊʹ༻͞Ε͍ͯͯɺ औಘ͞Ε͍ͯΔใΛݟ͚ͨͩͰΫϥογϡͷৄࡉ͔Βͳ͍ 💥 📝 5ISFBEDBMM4UBDL4ZNCPMT
ˠ#SPBEDBTU&YUFOTJPOͷΫϥογϡͷमਖ਼ ΞϓϦຊମͱൺֱͯ͠ɺܦݧʹґΔͱ͜Ζ͕େ͖͔ͬͨ ݩʑɺϩάΫϥογϡͷൃੜසΛѲ͢ΔͨΊʹ༻͞Ε͍ͯͯɺ औಘ͞Ε͍ͯΔใΛݟ͚ͨͩͰΫϥογϡͷৄࡉ͔Βͳ͍
& ΞϓϦຊମ #SPBEDBTU&YUFOTJPO ͷ͡ΊɺʮΠϠϗϯ৴ʯͱݺΕ͍ͯΔػೳͷվमʹͬͯ #SPBEDBTU&YUFOTJPOͰ৽ͨͳΫϥογϡ͕ൃੜ͢Δ͜ͱ͕ͳΜͱͳ͔͍ͬͯͨ͘ 💥
ˠͲ͏͍͏༰ͷΫϥογϡ͕ɺ Ͳͷ͘Β͍ͷׂ߹Ͱൃੜ͍ͯ͠Δ͔ௐΔखஈ͕ཉ͔ͬͨ͠ ͷ͡ΊɺʮΠϠϗϯ৴ʯͱݺΕ͍ͯΔػೳͷվमʹͬͯ #SPBEDBTU&YUFOTJPOͰ৽ͨͳΫϥογϡ͕ൃੜ͢Δ͜ͱ͕ͳΜͱͳ͔͍ͬͯͨ͘
#SPBEDBTU&YUFOTJPOʹ'JSFCBTF$SBTIMZUJDTΛΈࠐΉ ˠͦͦͰ͖Δͷ͔Βͳ͍ ΫϥογϡΛௐͯΔͷʹ৽͍͕͠ग़ͨΒා͍ Broadcast Extension σϦέʔτͳͷͰۃྗ৮Γͨ͘ͳ͍
9DPEFͷ0SHBOJ[FSΛཔΔ ˠ༰Λཧղ͢Δͷʹܦݧ͕ඞཁͩͬͨ ͨͱ͑4IBSFEʹEP0VUQVU1SPDFTTͱ͍͏ϝιουଘࡏ͠ͳ͍
#SPBEDBTU&YUFOTJPOͰϩάͱͯ͠औಘ͍ͯ͠Δ ελοΫτϨʔε DBMM4UBDL4ZNCPMT ͷใΛ׆༻͢Δ ˠͪΐ͏Ͳ6OJUZ'SBNFXPSLͷΫϥογϡௐ͍ࠪͯͯ͠ E4:.·ΘΓΛௐ͍ͯͨ͜ͱ͋ΓɺͰ͖ͦ͏ͳؾ͕ͨ͠ Mirrativ tech blog -
ʲiOSʳUnity Framework ͱΫϥογϡղੳͷऔΓΈ
"QQ&YUFOTJPOͷελοΫτϨʔεใ͔Β ΫϥογϡΛղੳूܭ͢Δ Ϋϥογϡ࣌ͷελοΫτϨʔεΛऔಘ͢Δ E4:.ϑΝΠϧΛͱͬͯ͘Δ BUPTίϚϯυͰελοΫτϨʔεΛղੳ͢Δ ղੳΛࣗಈԽͯ͠ूܭ͢Δ
ΫϥογϡΛमਖ਼͢Δ ඞཁͳࡐྉΛଗ͑Δ खಈͰղੳ͢Δ ࣗಈͰղੳ͢Δ मਖ਼͢Δ
Ϋϥογϡ࣌ͷελοΫτϨʔεΛऔಘ͢Δ
ΫϥογϡݕͱϋϯυϦϯά class func setup() { // ྫ֎ͷݕͱ࣮ߦ͢Δؔͷࢦఆ NSSetUncaughtExceptionHandler(exceptionHandler) // γάφϧͷݕͱ࣮ߦ͢Δؔͷࢦఆ
for sigcontext in [SIGABRT, SIGILL, SIGSEGV, SIGFPE, SIGBUS, SIGPIPE, SIGTRAP] { signal(sigcontext, signalHandler) } } private static let exceptionHandler: @convention(c) (NSException) -> () = { exeption in handleSignalException(exeption: exeption) } private static let signalHandler: @convention(c) (Int32) -> () = { signal in handleSignalException() } https://stackover fl ow.com/questions/36325140/how-to-catch-a-swift-crash-and-do-some-logging
ίʔϧελοΫͷऔಘ let callstack = exception.callStackSymbols.joined(separator: “\n”) // ͘͠ let callstack
= Thread.callStackSymbols.joined(separator: “\n”)
ίʔϧελοΫͷऔಘ let callstack = exception.callStackSymbols.joined(separator: “\n”) // ͘͠ let callstack
= Thread.callStackSymbols.joined(separator: “\n”) 0 broadcast-upload 0x000000010502eaf8 broadcast-upload + 223992 1 libsystem_platform.dylib 0x00000001e3b9c29c 987D48D5-3CAA-34D7-9141-C0BD6E2351E8 + 21148 2 broadcast-upload 0x0000000105106224 broadcast-upload + 1106468 3 broadcast-upload 0x0000000105103604 broadcast-upload + 1095172 4 Foundation 0x00000001991eb438 __NSFireTimer + 104 5 CoreFoundation 0x0000000197d911d4 338F58B1-9B75-38A0-B908-E2574AB1D39A + 672212 6 CoreFoundation 0x0000000197d90dd0 338F58B1-9B75-38A0-B908-E2574AB1D39A + 671184 7 CoreFoundation 0x0000000197d90220 338F58B1-9B75-38A0-B908-E2574AB1D39A + 668192 8 CoreFoundation 0x0000000197d89f8c 338F58B1-9B75-38A0-B908-E2574AB1D39A + 642956 … ͜ͷίʔϧελοΫͷใΛղੳͯ͠ɺϓϩάϥϜͷ࣮ߦߦͳͲΛಛఆ͍ͨ͠
E4:.ϑΝΠϧΛͱͬͯ͘Δ
"QQ4UPSF$POOFDU͔ΒE4:.ϑΝΠϧΛͱͬͯ͘Δ ͜ͷE4:.ϑΝΠϧͦΕͧΕ͕֤λʔήοτϥΠϒϥϦʹରԠ͍ͯ͠Δ App Store Connect
E4:.ϑΝΠϧ͕ͲͷλʔήοτϥΠϒϥϦʹରԠ͍ͯ͠Δ͔ௐΔ Mirrativ tech blog - ʲiOSʳUnity Framework ͱΫϥογϡղੳͷऔΓΈ files=`ls "$1"`
for uuid in ${files[@]}; do module=`ls "$1/${uuid}/Contents/Resources/DWARF/"` echo "${uuid:0:8}: ${module}" done fi OE@ETZNTI
Mirrativ tech blog - ʲiOSʳUnity Framework ͱΫϥογϡղੳͷऔΓΈ $ ./find_dsym.sh /Users/naruki.chigira/Desktop/appDsyms
2d4dd1c9: widget 310ef0bf: broadcast-upload 6d82e920: WebRTC 7cc5d65f: UnityFramework b11f4f4f: Shared de357eed: mirrativ … ֤λʔήοτϥΠϒϥϦʹରԠ͢ΔE4:.͕؆୯ʹ୳ͤΔΑ͏ʹͳͬͨ E4:.ϑΝΠϧ͕ͲͷλʔήοτϥΠϒϥϦʹରԠ͍ͯ͠Δ͔ௐΔ
BUPTίϚϯυͰελοΫτϨʔεΛղੳ͢Δ
BUPTͷجຊతͳ͍ํΛΔ $ man atos atos(1) BSD General Commands Manual atos(1)
NAME atos -- convert numeric addresses to symbols of binary images or processes SYNOPSIS atos [-o <binary-image-file>] [-p <pid> | <partial-executable-name>] [-arch architecture] [-l <load-address>] [-s <slide>] [-printHeader] [-fullPath] [-f <address- input-file>] [<address> …] … NBOίϚϯυͰ֬ೝͯ͠ΈΔ atos [-o <binary-image-file>] [-arch architecture] [-l <load-address>] [<address> …] ࠓճͷΫϥογϡղੳͷࡍʹඞཁͳύϥϝʔλ
BUPTʹ͢ύϥϝʔλE4:.ϑΝΠϧ atos [-o <binary-image-file>] [-arch architecture] [-l <load-address>] [<address> …]
Ϋϥογϡղੳͷࡍʹඞཁͳύϥϝʔλ E4:.ϑΝΠϧͷύε த 0 broadcast-upload 0x000000010502eaf8 broadcast-upload + 223992 ./appDsyms/310ef0bf-51fa-3535-8078-3fa06c470774.dSYM/Contents/Resources/DWARF/broadcast-upload
BUPTʹ͢ύϥϝʔλΞʔΩςΫνϟ atos [-o <binary-image-file>] [-arch architecture] [-l <load-address>] [<address> …]
Ϋϥογϡղੳͷࡍʹඞཁͳύϥϝʔλ Ϋϥογϡ͕ൃੜͨ͠ͷ$16ΞʔΩςΫνϟ BSN BSNF
ɾΞʔΩςΫνϟΛऔಘ͢ΔͨΊͷ4XJGUͷίʔυ IUUQTHJTUHJUIVCDPNOBSVKQOBEEEDBBCFCEFC fi MFEFWJDFTXJGU ɾJ1IPOF ͷΑ͏ͳϞσϧ໊͔ΒΞʔΩςΫνϟΛऔಘ͢ΔͨΊͷTRM IUUQTHJTUHJUIVCDPNOBSVKQOGGFCEEDBDEBD fi MFEFWJDFTRM BUPTʹ͢ύϥϝʔλΞʔΩςΫνϟ
BUPTʹ͢ύϥϝʔλελοΫτϨʔεͷΞυϨε atos [-o <binary-image-file>] [-arch architecture] [-l <load-address>] [<address> …]
Ϋϥογϡղੳͷࡍʹඞཁͳύϥϝʔλ -l 0x104ff8000 0x10502eaf8
atos [-o <binary-image-file>] [-arch architecture] [-l <load-address>] [<address> …] Ϋϥογϡղੳͷࡍʹඞཁͳύϥϝʔλ
-l 0x104ff8000 0x10502eaf8 0 broadcast-upload 0x000000010502eaf8 broadcast-upload + 223992 " # https://stackover fl ow.com/questions/11747802/symbolicating-stack-trace-without-crash " "# BUPTʹ͢ύϥϝʔλελοΫτϨʔεͷΞυϨε
atos [-o <binary-image-file>] [-arch architecture] [-l <load-address>] [<address> …] Ϋϥογϡղੳͷࡍʹඞཁͳύϥϝʔλ
-l 0x104ff8000 0x10502eaf8 0 broadcast-upload 0x000000010502eaf8 broadcast-upload + 223992 " # https://stackover fl ow.com/questions/11747802/symbolicating-stack-trace-without-crash "# BUPTʹ͢ύϥϝʔλελοΫτϨʔεͷΞυϨε "0x" + String(UInt64("10502eaf8", radix: 16)! - UInt64("223992", radix: 10)!, radix: 16)
$ atos -o {path_to_dsym} -arch arm64e -l 0x104ff8000 0x10502eaf8 0
broadcast-upload 0x000000010502eaf8 broadcast-upload + 223992 https://stackover fl ow.com/questions/11747802/symbolicating-stack-trace-without-crash ελοΫτϨʔεΛղੳ͢Δ closure #1 in variable initialization expression of static AnalyticsManager.recieveSignal (in broadcast-upload) (AnalyticsManager+Extension.swift:22) 🎉
$ atos -o {path_to_dsym} -arch arm64e -l 0x104ff8000 0x105106224 0x105103604
2 broadcast-upload 0x0000000105106224 broadcast-upload + 1106468 3 broadcast-upload 0x0000000105103604 broadcast-upload + 1095172 https://stackover fl ow.com/questions/11747802/symbolicating-stack-trace-without-crash ελοΫτϨʔεΛղੳ͢Δ specialized Stream.on(timer:) (in broadcast-upload) (Stream.swift:164) @objc Stream.on(timer:) (in broadcast-upload) (<compiler-generated>:0) 🎉
$ atos -o {path_to_dsym} -arch arm64e -l 0x104ff8000 0x10502eaf8 ࣮༻্ͷ՝
ɾE4:.ϑΝΠϧͷࢦఆΞυϨεͷܭࢉ͕खؒ ɾ࣮ߦʹ͕͔͔࣌ؒΔ ɹɾUJNFίϚϯυͰܭଌ͢Δͱ()[.BD#PPL1SPͰ<T> ˠख࡞ۀͰղੳͰ͖ͳ͍͠ɺେྔͷϩάΛղੳ͢ΔʹΩϟογϡ తͳΈ͕ඞཁ
ղੳΛࣗಈԽͯ͠ूܭ͢Δ
ղੳ༻ΞϓϦʹΑΔࣗಈԽʢ݅ͷΫϥογϡղੳʣ
ूܭ݁Ռͷྫ ൃੜճ ղੳࡁΈͷελοΫτϨʔε ͜͜·Ͱ͘Ε֤Ϋϥογϡͷ༰ͱӨڹͷେ͖͕͞ҰͰ͔Δ
ΫϥογϡΛमਖ਼͢Δ
Ϋϥογϡͷमਖ਼ ৄࡉলུʜ ɾ৴தʹ4JSJΛىಈ͢ΔͱɺԻσʔλͷྲྀΕ͕ෆنଇʹͳΔ ɾ৴தʹଞͷ௨ΞϓϦͰ௨Λ͢Δͱɺఆ֎ͷνϟωϧΛ࣋ͬ ͨԻσʔλ͕ྲྀΕͯ͘Δ ͳͲ
Ϋϥογϡमਖ਼ޙͷΫϥογϡͷվળ मਖ਼൛ͷϦϦʔε ΫϥογϡͷൃੜΛ ݮΒ͢͜ͱ͕Ͱ͖ͨʂ
·ͱΊ ෭࣍తʹಘΒΕͨͷ ɾΫϥογϡͷৄࡉͱ༁͕؆୯ʹ͔ΔΑ͏ʹͳͬͨ͜ͱͰɺ ɹमਖ਼Λ͢ΔࡍͷϝϦοτӨڹྗͷࣄલͷઆ໌͕͘͢͠ͳͬͨ ɾܦݧ͕ͳ͍ͱཧղͰ͖ͳ͔ͬͨྖҬͷղ૾্͕͕Γɺ ɹଐਓੑΛݮΒ͢͜ͱʹܨ͕ͬͨ ɾελοΫτϨʔεͱE4:.͔ΒΫϥογϡͷৄࡉ͕ղੳͰ͖ͯɺ ɹΫϥογϡͷղফʹܨ͕ͬͨ
͓·͚ DBMM4UBDL4ZNCPMT͔ΒऔಘͰ͖ΔจࣈྻΛύʔε͢ΔͨΊͷϥΠϒϥϦ IUUQTHJUIVCDPNOBSVKQO$BMM4UBDL4ZNCPMT
͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ