Code Monkey home page Code Monkey logo

wuba / wbblades Goto Github PK

View Code? Open in Web Editor NEW
1.5K 37.0 224.0 72.24 MB

Mach-O based ObjC & Swift useless classes, useless protocols, useless resources detection, packet size analysis, point-to-point crash resolution.基于Mach-O的ObjC & Swift无用类、无用协议、无用资源检测,包大小分析,点对点崩溃解析。

License: BSD 3-Clause "New" or "Revised" License

Objective-C 98.66% Makefile 0.01% Swift 1.30% Shell 0.02% Ruby 0.02%
mach-o crash-analysis dsym symbolication classdump gpt gpt-35-turbo macho ios

wbblades's Introduction

English | 简体中文

Introduction

WBBlades is a tool set based on Mach-O file parsing, including one-click detection for app (supports OC and Swift), package size analysis (supports a single static library/dynamic library), Point-to-point crash analysis (based on system logs, supports Huawei and Bugly platform crash stack analysis, supports signed and unsigned states), Class automatic extraction and Hook capability based on Mach-O file. It mainly uses __Text assembly code analysis, architecture extraction, DYSM file stripping, symbol table stripping, crash file (ips) analysis technology.Support big method/small method parsing and iOS 15 above about dyld_chained_Fixups processing. In order to facilitate users in quickly understanding the WBBlades project, we provide an intelligent Readme feature based on GPT.

Tool Overview

Tool Name Function Overview Related Technologies
Intelligent Readme Interactive Q&A format facilitates a quick understanding of the WBBlades project and related technologies. GPT chat
One-Click Detection for App Swift & OC useless class detection, useless resource detection, and package downsizing optimization suggestions. Disassembly, __Text instruction extraction, Mach-O parsing, symbol table and Swift class structure in Mach-O
Package Size Analysis Detecting the actual size occupied by static & dynamic libraries in .ipa file. Architecture stripping, static library structure analysis
Crash Analysis Use .app or dYSM to analyze system crash logs, and support crash stack analysis on Huawei and Bugly platforms DYSM file parsing, lightweight symbol table extraction, ips file parsing, with/without symbol table crash parsing
Mach-O Class Hook Automatically extract classes from any Mach-O file, and then hook them. dyld_ chained_ Fixups, binding, rebase, and big/small method parsing

The new version implements a comprehensive visual implementation of the toolset based on the original command-line-based operation of the above tools, and is designed for R&D efficiency improvement. In addition, in the analysis of difficult crashes, for some crashes that are not easy to reproduce and cannot be collected by general tools (the app process is directly killed by the operating system), a point-to-point crash analysis is provided.

Installation

$ git clone https://github.com/wuba/WBBlades.git
$ cd WBBlades
$ pod install

Usage of Visualization Tool

Target selects "WBBladesCrashApp".

The WBBlades visualization tool is shown below. Click the button on the left function area, select a tool such as Useless Classes Detection,Application Size Analysis,etc., and operate according to the prompts in the tool, and the result will be output to the text box;

mainpage

Detailed introduction to visualization tool: Detailed introduction to visualization tool

Usage for Mac Command Line

Target selects "WBBlades",Compile and build to generate command line tools Copy the generated product "blades" to /usr/local/bin,as follows: sudo cp ${Your_BUILD_DIR}/blades /usr/local/bin

  • One-click detection

    $ blades -diagnose xxx.app

    One-click detection of useless classes, useless resources, and duplicate resources, and so on.

  • Unused Code Detection ObjC & Swift

    $ blades -unused xxx.app -from xxx.a xxx.a ....

    -from indicating that only the unused code in the following static libraries is analyzed. Without this parameter, the default is all classes in the APP.

  • App Size Analysis (Directly measure the size of .a or .framework after linking)

    $ blades -size xxx.a xxx.framework ....

    Supporting input a folder path, all static libraries under the folder will be analyzed.

  • Log Recovery without dSYM File (In the case of missing dSYM file, try ObjC crash stack symbolization, Swift is not supported)

    $ blades -symbol xxx.app -logPath xxx.ips

Tool Features

Unused code (unused class) detection support range

Description Support Code Example
ObjC classes's static call [MyClass new]
ObjC classes's dynamic call NSClassFromString(@"MyClass")
ObjC dynamic call througn string concatenation NSClassFromString(@"My" + @"Class")
ObjC load method +load{...}
ObjC & Swift being inherited SomClass : MyClass
ObjC & Swift being properties @property (strong,atomic) MyClass *obj;
Swift class direct call MyClass.init()
Swift call using runtime objc_getClass("Demo.MyClass")
Swift generic parameters SomeClass<MyClass>.init()
Swfit class dynamic call in ObjC NSClassFromString("Demo.MyClass")
Swift type declaration in the container var array:[MyClass]
Swift multiple nesting class SomeClass {class MyClass {...} ...}

App Size Analysis Tool

Supports quick detection of the linked size of a static library. No need to compile and link. For example: If you want to know how much app size will increase when an SDK is imported or updated, you can use blades -size to estimate the size, without the need to connect the SDK to compile and link successfully to calculate.

Crash Log Symbolization Tool Without dSYM File

In the case of losing the dSYM file, try to restore the log via blades -symbol. **For example, in an app packaging, the dSYM file is cleared after a period of time, but the app file is retained. In this case, you can consider using blades for symbolization. **Before using the tool, pay attention to a few points:

  • If your app is a debug package or a package that does not strip the symbol table, you can use dsymutil app -o xx.dSYM to extract the symbol table. Then use the symbol table to symbolize the log.

  • This tool only supports ObjC, and its principle is to determine the function of the crash by analyzing the address of the ObjC method in Mach-O. Therefore, it is not suitable for Swfit, C, and C++. In addition, tools are not omnipotent, and are only used as emergency supplementary technical means. In daily situations, it is recommended to use symbol tables for log symbolization.

Contributing & Feedback

We sincerely hope that developers can provide valuable comments and suggestions, and developers can provide feedback on suggestions and problems by submitting PR or Issue.

If you are interested in WBBlades, you can join the WBBlades development group and discuss technical issues together. Please add the wechat account "zqlong320" or scan the QR code below as your friend and then we will invite you to join the group.

wechat_qrcode.png

Related Technical Articles

Thanks

GitHub: https://github.com/aquynh/capstone

GitHub: https://github.com/Sunnyyoung/SYFlatButton

GitHub: https://github.com/nygard/class-dump

GitHub: https://github.com/alexrozanski/PXListView

GitHub: https://github.com/steventroughtonsmith/cartool

DWARF: https://www.prevanders.net/dwarf.html#releases


简体中文 | English

简介

WBBlades是基于Mach-O文件解析的工具集,包括App一键体检(支持OCSwift的无用类检测)、包大小分析(支持单个静态库/动态库的包大小分析)、点对点崩溃解析(基于系统日志,支持华为和Bugly平台崩溃堆栈解析,支持有符号和无符号状态)、基于Mach-O的Class自动提取和Hook能力。主要利用了__TEXT汇编代码分析、架构提取、符号表剥离、dYSM文件提取、崩溃文件(.ips)解析等技术手段实现,支持big method /small method 解析 以及 iOS 15以上关于dyld_chained_fixups的处理。并且为了便于用户更快了解WBBlades项目,我们提供了基于GPT的智能Readme功能。

工具概览

工具名称 功能概述 相关技术
智能Readme 问答式互动,便于快速了解WBBlades项目以及相关技术 GPT聊天
App一键体检 Swift/OC无用类检测、无用资源检测、包瘦身优化建议 反汇编、__Text指令提取、Mach-O解析、符号表/Swift类在Mach-O中的结构
包大小分析 检测静态库/动态库在.ipa中占用的实际大小 架构剥离、静态库结构分析
崩溃解析 利用.app或者dYSM对系统崩溃日志解析,支持华为和Bugly平台的崩溃堆栈解析 dYSM文件解析、轻量符号表提取、ips文件解析、有/无符号表崩溃解析
Mach-O类Hook 自动提取任意Mach-O中的Class并Hook dyld_chained_fixups 、binding、rebase、big/small method解析

新版本在原来基于命令行运行上述工具的基础上,对工具集进行了全面的可视化实现,开箱即用,专为研发提效而设计。另外,在疑难崩溃解析上,针对一些不易复现、且通用工具无法收集的崩溃(被操作系统直接杀死App进程场景),提供了基于系统日志的点对点崩溃解析功能。

安装

$ git clone https://github.com/wuba/WBBlades.git
$ cd WBBlades
$ pod install

使用

可视化工具用法

target选择:WBBladesCrashApp

WBBlades可视化工具如下图所示。点击左侧功能区按钮,点击进入无用类检测、包大小检测等工具,根据工具内的提示进行操作即可,具体的数据会输出到文本框中;

mainpage

可视化工具详细介绍: 可视化工具详细介绍

命令行工具blades用法

target选择:WBBlades,编译运行,生成命令行工具 将生成的产物blades 拷贝至 /usr/local/bin 下,具体操作如: sudo cp ${Your_BUILD_DIR}/blades /usr/local/bin

  • 一键诊断

    $ blades -diagnose xxx.app

    一键检测无用类、无用资源、重复资源等

  • 无用代码检测 OC & Swift

    $ blades -unused xxx.app -from xxx.a xxx.a ....

    -from 标识只分析以下静态库中的无用代码,不加此参数默认为APP中全部类

  • 包大小分析 (直接测算.a |.framework链接后的大小)

    $ blades -size xxx.a xxx.framework ....

    支持输入一个文件夹路径,输入后该文件下所有的静态库都会被分析

  • 无符号表日志符号化(在丢失符号表的情况下,尝试OC崩溃堆栈符号化,不支持Swift

    $ blades -symbol xxx.app -logPath xxx.ips

工具特性介绍

无用代码(无用类)检测支持范围

说明 是否支持 代码示例
OC 的类的静态调用 [MyClass new]
OC 的动态调用 NSClassFromString(@"MyClass")
OC 字符串拼接动态调用 NSClassFromString(@"My" + @"Class")
OC load方法使用 +load{...}
OC & Swift 被继承 SomClass : MyClass
OC & Swift 作为属性 @property (strong,atomic) MyClass *obj;
Swift 类直接调用 MyClass.init()
Swift 通过runtime调用 objc_getClass("Demo.MyClass")
Swift 泛型参数 SomeClass<MyClass>.init()
Swfit 类在OC中动态调用 NSClassFromString("Demo.MyClass")
Swift 容器中作为类型声明 var array:[MyClass]
Swift 多重嵌套 class SomeClass {class MyClass {...} ...}

包大小分析工具

支持快速检测一个静态库的链接后大小。无需编译链接。举例说明:如果你想知道一个接入或更新一个SDK对会增加多少包大小,可以用blades -size 来预估下大小,而无需将SDK接入编译链接成功后进行测算。

无符号表日志符号化工具

在丢失dSYM文件的情况下,尝试通过blades -symbol恢复日志。例如某次打包,在一段时间后符号表被清除,但是保留了app文件,这种情况下可以考虑使用WBBlades进行符号化。在工具使用前应先注意几点:

  • 如果你的app是debug包或者没有剥离符号表的包,那么可以通过dsymutil app -o xx.dSYM 来提取符号表。然后用符号表进行日志符号化。
  • 工具只适用于OC的场景,其原理为通过分析Mach-O中OC方法地址来确定崩溃的函数。因此不适用于Swfit、C、C++场景。另外,工具并非万能,仅作为应急补充技术手段,日常情况下还是推荐用符号表进行日志符号化。

如何贡献&反馈问题

我们诚挚地希望开发者提出宝贵的意见和建议,开发者可以通过提交PR或者Issue来反馈建议和问题。

欢迎对WBBlades感兴趣的小伙伴加入WBBlades开发交流群,一起探讨技术问题,请先添加微信号"zqlong320"或者扫描下面的二维码为好友,备注"WBBlades",我们会邀请您进群。

wechat_qrcode.png

相关技术文章

致谢

GitHub地址:https://github.com/aquynh/capstone

GitHub地址:https://github.com/Sunnyyoung/SYFlatButton

GitHub地址:https://github.com/nygard/class-dump

GitHub地址:https://github.com/alexrozanski/PXListView

GitHub地址:https://github.com/steventroughtonsmith/cartool

DWARF地址:https://www.prevanders.net/dwarf.html#releases

GitHub: https://github.com/nygard/class-dump

wbblades's People

Contributors

cntrump avatar coder-star avatar gladpf avatar handsomeliuyang avatar hbulixu avatar jiaxw32 avatar pilaf-king avatar simplegood avatar springwinding avatar zengql512 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wbblades's Issues

字典key为nil [__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil

image

2022-12-20 17:48:51.994663+0800 WBBladesCrashApp[5947:65559] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x00000001880b4418 __exceptionPreprocess + 176
1 libobjc.A.dylib 0x0000000187bfeea8 objc_exception_throw + 60
2 CoreFoundation 0x0000000188199cc4 -[__NSCFString characterAtIndex:].cold.1 + 0
3 CoreFoundation 0x00000001881a6e4c -[__NSDictionaryM setObject:forKeyedSubscript:].cold.2 + 0
4 CoreFoundation 0x0000000188001a0c -[_NSDictionaryM setObject:forKeyedSubscript:] + 928
5 WBBladesCrashApp 0x00000001022e6324 +[WBBladesScanManager(UnuseClassScan) readClassList:aimClasses:set:fileData:classSize:] + 2892
6 WBBladesCrashApp 0x00000001022e2a3c +[WBBladesScanManager(UnuseClassScan) scanAllClassWithFileData:classes:progressBlock:] + 3392
7 WBBladesCrashApp 0x00000001022c3b48 +[WBBladesInterface scanUnusedClassWithAppPath:fromLibs:] + 920
8 WBBladesCrashApp 0x0000000102173c88 $s16WBBladesCrashApp36BladesUnusedClassCheckViewControllerC09beginScaneF0yyypFyycfU
+ 372
9 WBBladesCrashApp 0x0000000102141e54 $sIeg_IeyB_TR + 48
10 libdispatch.dylib 0x0000000102a68ecc _dispatch_call_block_and_release + 32
11 libdispatch.dylib 0x0000000102a6a9d4 _dispatch_client_callout + 20
12 libdispatch.dylib 0x0000000102a6d9a0 _dispatch_queue_override_invoke + 1196
13 libdispatch.dylib 0x0000000102a8293c _dispatch_root_queue_drain + 408
14 libdispatch.dylib 0x0000000102a83560 _dispatch_worker_thread2 + 196
15 libsystem_pthread.dylib 0x0000000102677cec _pthread_wqthread + 228
16 libsystem_pthread.dylib 0x000000010267fa7c start_wqthread + 8
)

.app 路径中间文件夹包含空格会报错

~ blades -unused /Users/moonlight/Desktop/App\ 2021/Zeus
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
[1]    23624 segmentation fault  blades -unused /Users/moonlight/Desktop/App\ 2021/Zeus

另外向大佬问一个问题: Swift无用代码检测依赖Debug包的符号表,检测到您的包里没有符号表,建议使用arm64真机的debug包扫描 这里提到的真机 debug 包是指xcode在真机上run的包么?这种包应该怎么去获取

检查无用类是崩溃

-[NSConcreteMutableData getBytes:range:]: range {18446744068510046853, 8} exceeds data length 86567552'

请问下,目前对swift包支持不够么?

我导入纯swift包,会有crash。

2022-11-17 15:47:55.226624+0800 WBBladesCrashApp[69393:17883431] [General] (
0 CoreFoundation 0x000000018b39d1a8 _exceptionPreprocess + 240
1 libobjc.A.dylib 0x000000018b0e7e04 objc_exception_throw + 60
2 Foundation 0x000000018c1fbad4 -[NSData(NSData) getBytes:length:] + 0
3 WBBladesCrashApp 0x0000000104388314 +[WBBladesTool readString:fixlen:fromFile:] + 260
4 WBBladesCrashApp 0x0000000104383128 +[WBBladesScanManager(UnuseClassScan) readSwiftTypes:set:fileData:] + 6792
5 WBBladesCrashApp 0x000000010437e7c4 +[WBBladesScanManager(UnuseClassScan) scanAllClassWithFileData:classes:progressBlock:] + 2968
6 WBBladesCrashApp 0x000000010435f9ec +[WBBladesInterface scanUnusedClassWithAppPath:fromLibs:] + 920
7 WBBladesCrashApp 0x000000010427a054 $s16WBBladesCrashApp36BladesUnusedClassCheckViewControllerC09beginScaneF0yyypFyycfU
+ 376
8 WBBladesCrashApp 0x000000010424b900 $sIeg_IeyB_TR + 48
9 libdispatch.dylib 0x0000000104b9c804 _dispatch_call_block_and_release + 32
10 libdispatch.dylib 0x0000000104b9e3a8 _dispatch_client_callout + 20
11 libdispatch.dylib 0x0000000104ba1398 _dispatch_queue_override_invoke + 1188
12 libdispatch.dylib 0x0000000104bb5fc8 _dispatch_root_queue_drain + 408
13 libdispatch.dylib 0x0000000104bb6bdc _dispatch_worker_thread2 + 196
14 libsystem_pthread.dylib 0x000000010469ff48 _pthread_wqthread + 228
15 libsystem_pthread.dylib 0x00000001046a7a9c start_wqthread + 8
)

// 这个方法中的 [fileData getBytes:buffer range:range];

  • (NSString *)readString:(NSRange &)range fixlen:(NSUInteger)len fromFile:(NSData *)fileData {
    range = NSMakeRange(NSMaxRange(range), len);
    uint8_t *buffer = (uint8_t *)malloc(len + 1); buffer[len] = '\0';
    [fileData getBytes:buffer range:range];
    NSString *str = NSSTRING(buffer);
    free (buffer);
    return [self replaceEscapeCharsInString:str];
    }

Thread 12: "*** -[NSConcreteMutableData getBytes:range:]: range {419430429, 150} exceeds data length 11429520"

Library not loaded: @rpath/libswiftDemangle.dylib

当我进行安装后
$ git clone https://github.com/wuba/WBBlades.git
$ cd WBBlades
$ sudo make install

准备检测代码
我输入
blades -unused /Users/deshglh/Library/Developer/Xcode/DerivedData/GuruClub-dnlcblbkuusqhdamckjrtkqowzle/Build/Products/Debug-iphoneos/GuruClub.app

提示dyld[67938]: Library not loaded: @rpath/libswiftDemangle.dylib
Referenced from: /usr/local/bin/blades
Reason: tried: '/usr/local/bin/../lib/libswiftDemangle.dylib' (no such file), '/usr/local/bin/../lib/libswiftDemangle.dylib' (no such file), '/usr/local/lib/libswiftDemangle.dylib' (no such file), '/usr/lib/libswiftDemangle.dylib' (no such file)
[1] 67938 abort blades -unused -from

是我哪里没操作对?

源码询问

您好,请问下,像struct class64,struct class64Info这些MACH-O的结构体我看您们是自己定义的,您们是如何知道这个结构体的结构的,有没有官方的相关文档说明,谢谢

参数输入错误时会崩溃

./WBBlades -unused xxxx.a
2020-11-04 11:24:58.543 WBBlades[46761:7665159] 正在提取arm64架构
2020-11-04 11:24:58.573 WBBlades[46761:7665159] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSConcreteMutableData getBytes:range:]: range {540094549, 8} exceeds data length 2142888'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff32810727 __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff6b746a9e objc_exception_throw + 48
2 Foundation 0x00007fff34e4c05e -[NSData(NSData) getBytes:range:] + 616
3 WBBlades 0x000000010ae92cae +[WBBladesScanManager(UnuseClassScan) scanAllClassWithFileData:classes:] + 862
4 WBBlades 0x000000010aeeda20 scanUnusedClass + 752
5 WBBlades 0x000000010aeed253 main + 387
6 libdyld.dylib 0x00007fff6c8e6cc9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1] 46761 abort ./WBBlades -unused xxxx.a

[1] 96318 segmentation fault blades -unused Test.app

在创建DemoApp测试时是可以正常检测并输出的,但是用在正式App上就总是报这个错误,没有其它更多的提示信息了。而且每次错误,前面的'96318'这个序号还都不一样,大佬们能否查一查这可能是什么原因,感谢

EXC_BAD_ACCESS Crash

无用类检测的时候 直接就crash 了
image
image

Translated Report (Full Report Below)

Process: WBBladesCrashApp [8988]
Path: /Users/USER/Library/Developer/Xcode/DerivedData/WBBlades-auardhnotmoowpecyskwsgogtjcg/Build/Products/Debug/WBBladesCrashApp.app/Contents/MacOS/WBBladesCrashApp
Identifier: com.jiangyan.app.WBBlades
Version: 1.0 (1)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
User ID: 508161570

Date/Time: 2022-12-19 17:47:24.6065 +0800
OS Version: macOS 13.0.1 (22A400)
Report Version: 12
Anonymous UUID: DB5C61DF-C8DD-8F24-243B-05A3D52C7091

Sleep/Wake UUID: 07576904-E6D4-4E5F-84BE-924BD0943C0B

Time Awake Since Boot: 360000 seconds
Time Since Wake: 27607 seconds

System Integrity Protection: enabled

Crashed Thread: 2 Dispatch queue: com.apple.root.default-qos

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000004cb207c80
Exception Codes: 0x0000000000000001, 0x00000004cb207c80

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [8988]

VM Region Info: 0x4cb207c80 is not in any region. Bytes after previous region: 2522241 Bytes before following region: 47057961856
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
MALLOC_LARGE 4c8b64000-4cafa0000 [ 36.2M] rw-/rwx SM=PRV
---> GAP OF 0xaf5060000 BYTES
commpage (reserved) fc0000000-1000000000 [ 1.0G] ---/--- SM=NUL ...(unallocated)

Kernel Triage:
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage

Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x1b27dadf0 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1b27ec8d8 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x1b27e3638 mach_msg_overwrite + 540
3 libsystem_kernel.dylib 0x1b27db16c mach_msg + 24
4 CoreFoundation 0x1b28f9bdc __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x1b28f84c8 __CFRunLoopRun + 1232
6 CoreFoundation 0x1b28f78a4 CFRunLoopRunSpecific + 612
7 HIToolbox 0x1bbf6b3bc RunCurrentEventLoopInMode + 292
8 HIToolbox 0x1bbf6b200 ReceiveNextEventCommon + 672
9 HIToolbox 0x1bbf6af48 _BlockUntilNextEventMatchingListInModeWithFilter + 72
10 AppKit 0x1b5b50630 _DPSNextEvent + 632
11 AppKit 0x1b5b4f7c0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
12 AppKit 0x1b5b43bf0 -[NSApplication run] + 464
13 AppKit 0x1b5b1b058 NSApplicationMain + 880
14 WBBladesCrashApp 0x1009c2518 static NSApplicationDelegate.main() + 40
15 WBBladesCrashApp 0x1009c24e0 static AppDelegate.$main() + 44 (AppDelegate.swift:10)
16 WBBladesCrashApp 0x1009c2580 main + 28
17 dyld 0x1b24efe50 start + 2544

Thread 1:
0 libsystem_pthread.dylib 0x1b2814e18 start_wqthread + 0

Thread 2 Crashed:: Dispatch queue: com.apple.root.default-qos
0 libsystem_platform.dylib 0x1b28453dc platform_strcmp + 12
1 WBBladesCrashApp 0x100a91008 +[WBBladesScanManager(UnuseClassScan) scanSELCallerWithAddress:heigh:low:begin:end:] + 304 (WBBladesScanManager+UnuseClassScan.mm:271)
2 WBBladesCrashApp 0x100a9749c +[WBBladesScanManager(UnuseClassScan) findCallAccessFunc:accessFunc:fileData:] + 1508 (WBBladesScanManager+UnuseClassScan.mm:1104)
3 WBBladesCrashApp 0x100a96bf8 +[WBBladesScanManager(UnuseClassScan) readSwiftTypes:set:fileData:] + 14760 (WBBladesScanManager+UnuseClassScan.mm:1050)
4 WBBladesCrashApp 0x100a90540 +[WBBladesScanManager(UnuseClassScan) scanAllClassWithFileData:classes:progressBlock:] + 2592 (WBBladesScanManager+UnuseClassScan.mm:195)
5 WBBladesCrashApp 0x100a7f0e0 +[WBBladesInterface scanUnusedClassWithAppPath:fromLibs:] + 920 (WBBladesInterface.m:292)
6 WBBladesCrashApp 0x1009b9234 closure #1 in BladesUnusedClassCheckViewController.beginScanUnusedClass(
:) + 376 (BladesUnusedClassCheckViewController.swift:78)
7 WBBladesCrashApp 0x100990198 thunk for @escaping @callee_guaranteed () -> () + 48
8 libdispatch.dylib 0x1b26919dc _dispatch_call_block_and_release + 32
9 libdispatch.dylib 0x1b2693504 _dispatch_client_callout + 20
10 libdispatch.dylib 0x1b26965f0 _dispatch_queue_override_invoke + 788
11 libdispatch.dylib 0x1b26a4f94 _dispatch_root_queue_drain + 396
12 libdispatch.dylib 0x1b26a57c0 _dispatch_worker_thread2 + 164
13 libsystem_pthread.dylib 0x1b28160c4 _pthread_wqthread + 228
14 libsystem_pthread.dylib 0x1b2814e20 start_wqthread + 8

动态库二进制拖进去crash

2022-08-16 22:17:38.500 blades[3635:45074] fileData lenth is 11752040 begin:30788 size:3898756
2022-08-16 22:17:38.919 blades[3635:45074] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSConcreteMutableData getBytes:range:]: range {4298914984, 8} exceeds data length 11752040'
*** First throw call stack:
(
0 CoreFoundation 0x00000001aad0c12c __exceptionPreprocess + 240
1 libobjc.A.dylib 0x00000001aaa5d808 objc_exception_throw + 60
2 Foundation 0x00000001abb5f7f8 -[NSData(NSData) getBytes:length:] + 0
3 blades 0x000000010470ff5c blades + 409436
4 blades 0x000000010470dff4 blades + 401396
5 blades 0x00000001047038fc blades + 358652
6 blades 0x000000010470354c blades + 357708
7 blades 0x00000001046af07c blades + 12412
8 dyld 0x0000000104b350f4 start + 520
)
libc++abi: terminating with uncaught exception of type NSException
[1] 3635 abort -unused

无符号崩溃解析的结果没有符号化

我新建了一个工程,代码如下:

    NSArray *arr = @[@1, @2];
    [arr objectAtIndex:3];

Release模式下运行,崩溃。

然后在手机中导出ips文件,进行进行解析,解析文件没有符号化~

https://mp.weixin.qq.com/s/tGvE-2flzhm4skkrfbUIBA 对于Bugly的分析描述有误。

你好,我是Bugly的iOS端开发。
Bugly在堆栈处理过程中,是可以拿到nearest symbol信息的,通过nearest symbol+偏移来表示当前执行的指令。
RCTFBQuickPerformanceLoggerConfigureHooks+1803318 并不是代表执行了RCTFBQuickPerformanceLoggerConfigureHooks,而是表示执行了RCTFBQuickPerformanceLoggerConfigureHooks偏移1803318所在的指令。

你遇到的这些情况都是堆栈没有翻译导致的,并不是Bugly堆栈解析错误。

运行检查无用类时Crash

2021-05-31 10:03:13.070 WBBlades[24816:2796153] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSConcreteMutableData getBytes:range:]: range {2254311852, 150} exceeds data length 685746064'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff32e8fbe7 __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff6bcae5bf objc_exception_throw + 48
2 Foundation 0x00007fff354a605e -[NSData(NSData) getBytes:range:] + 616
3 WBBlades 0x0000000107b6e911 +[WBBladesTool readString:fixlen:fromFile:] + 321
4 WBBlades 0x0000000107b2073a +[WBBladesScanManager(UnuseClassScan) readSwiftTypes:set:fileData:] + 3098
5 WBBlades 0x0000000107b1bd6d +[WBBladesScanManager(UnuseClassScan) scanAllClassWithFileData:classes:] + 4205
6 WBBlades 0x0000000107b896c0 scanUnusedClass + 752
7 WBBlades 0x0000000107b88ef3 main + 387
8 libdyld.dylib 0x00007fff6ce55cc9 start + 1
9 ??? 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1] 24816 abort -unused

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.