Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

友盟上偶现的一个崩溃信息 ,[MJProperty valueForObject:] + [MJProperty.m : 78],一直排查不到 #844

Open
wangyanxi2019 opened this issue Aug 30, 2022 · 14 comments

Comments

@wangyanxi2019
Copy link

CrashDoctor Diagnosis: Stack overflow in (null)
Thread 0 Crashed:
0 CoreFoundation 0x000000019d38e56c _NSIsNSArray + [ : 4]
1 CoreFoundation 0x000000019d25dca0 -[NSArray isEqualToArray:] + [ : 96]
2 CoreFoundation 0x000000019d254080 -[__NSDictionaryM objectForKey:] + [ : 184]
3 CoreText 0x000000019e095284 TDescriptorSource::CopySpliceFontForName(__CFString const*, __CFString const*, __CFNumber const*, CTFontLegibilityWeight, __CFNumber const*, __CFString const*, __CFNumber const*) + [ : 384]
4 CoreText 0x000000019e08d644 TDescriptorSource::CopySplicedDescriptorForName(__CFString const*, __CFString const*, __CFString const*, __CFNumber const*, CTFontLegibilityWeight, __CFNumber const*, __CFString const*, __CFNumber const*) const + [ : 136]
5 CoreText 0x000000019e07c4f4 TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*, unsigned long) const + [ : 1764]
6 CoreText 0x000000019e07cd50 TDescriptor::InitBaseFont(unsigned long, double) + [ : 76]
7 CoreText 0x000000019e05e0bc TDescriptor::Hash() const + [ : 56]
8 UIFoundation 0x00000001a09f7f7c -[_UIFontDescriptorCacheKey _hash] + [ : 52]
9 UIFoundation 0x00000001a09f78f0 -[_UIFontCacheKey _precalculateHash] + [ : 32]
10 UIFoundation 0x00000001a09f78a0 +[_UIFontCacheKey fontCacheKeyWithFontDescriptor:pointSize:textStyleForScaling:pointSizeForScaling:maximumPointSizeAfterScaling:textLegibility:] + [ : 200]
11 UIFoundation 0x00000001a0a08b54 +[UIFont _fontWithDescriptor:size:textStyleForScaling:pointSizeForScaling:maximumPointSizeAfterScaling:forIB:legibilityWeight:] + [ : 220]
12 PhotosUI 0x00000001ba8d16e0 -[UIFont(PhotosUI) pu_fontWithMonospacedNumbers] + [ : 456]
13 Foundation 0x000000019d650620 -[NSObject(NSKeyValueCoding) valueForKey:] + [ : 308]
14 MyApp 0x00000001052d9b5c -[MJProperty valueForObject:] + [MJProperty.m : 78]
15 MyApp 0x0000000104f30ff8 __57-[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:]_block_invoke + [NSObject+MJKeyValue.m : 364]
16 MyApp 0x000000010525085c +[NSObject(Property) mj_enumerateProperties:] + [NSObject+MJProperty.m : 134]
17 MyApp 0x0000000104f30da8 -[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:] + [NSObject+MJKeyValue.m : 435]
18 MyApp 0x0000000104f3105c __57-[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:]_block_invoke + [NSObject+MJKeyValue.m : 371]
19 MyApp 0x000000010525085c +[NSObject(Property) mj_enumerateProperties:] + [NSObject+MJProperty.m : 134]
20 MyApp 0x0000000104f30da8 -[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:] + [NSObject+MJKeyValue.m : 435]
21 MyApp 0x0000000104f3105c __57-[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:]_block_invoke + [NSObject+MJKeyValue.m : 371]
22 MyApp 0x000000010525085c +[NSObject(Property) mj_enumerateProperties:] + [NSObject+MJProperty.m : 134]
23 MyApp 0x0000000104f30da8 -[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:] + [NSObject+MJKeyValue.m : 435]
24 MyApp 0x0000000104f3105c __57-[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:]_block_invoke + [NSObject+MJKeyValue.m : 371]
25 MyApp 0x000000010525085c +[NSObject(Property) mj_enumerateProperties:] + [NSObject+MJProperty.m : 134]
26 MyApp 0x0000000104f30da8 -[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:] + [NSObject+MJKeyValue.m : 435]
27 MyApp 0x0000000104f3105c __57-[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:]_block_invoke + [NSObject+MJKeyValue.m : 371]
28 MyApp 0x000000010525085c +[NSObject(Property) mj_enumerateProperties:] + [NSObject+MJProperty.m : 134]
29 MyApp 0x0000000104f30da8 -[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:] + [NSObject+MJKeyValue.m : 435]
30 MyApp 0x0000000104f3105c __57-[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:]_block_invoke + [NSObject+MJKeyValue.m : 371]
31 MyApp 0x000000010525085c +[NSObject(Property) mj_enumerateProperties:] + [NSObject+MJProperty.m : 134]
32 MyApp 0x0000000104f30da8 -[NSObject(MJKeyValue) mj_keyValuesWithKeys:ignoredKeys:] + [NSObject+MJKeyValue.m : 435]

@wangyanxi2019 wangyanxi2019 changed the title 友盟上偶先的一个崩溃信息 ,[MJProperty valueForObject:] + [MJProperty.m : 78],一直排查不到 友盟上偶现的一个崩溃信息 ,[MJProperty valueForObject:] + [MJProperty.m : 78],一直排查不到 Aug 30, 2022
@wolfcon
Copy link
Collaborator

wolfcon commented Sep 2, 2022

请尝试 Refactor/4.0.0 这个分支.

请查看 这个列表, 还未发布.
如果想使用 pod. 可以添加如下命令

pod 'MJExtension', :git => 'https://github.com/CoderMJLee/MJExtension.git', :branch => 'Refactor/4.0.0'

@wangyanxi2019
Copy link
Author

@wolfcon 非常感谢回复,我想问下 4.0.0什么时候发布啊?这个问题大概是什么原因啊?能方便加Q吗。1659781834

@wolfcon
Copy link
Collaborator

wolfcon commented Sep 8, 2022

已知的问题是多线程问题.

你这个 crash 单凭这个日志也分析不出是啥. 你的模型转换是在不同线程处理的吗?

我近期整理下无用代码, 近期发布吧

@wangyanxi2019
Copy link
Author

@wolfcon 感谢回复!我的模型转换没有单独设置线程。(主要是我没复现,都是友盟反馈结果。)

@wolfcon
Copy link
Collaborator

wolfcon commented Sep 9, 2022

@wolfcon 感谢回复!我的模型转换没有单独设置线程。(主要是我没复现,都是友盟反馈结果。)

那模型转换发生在多线程环境下吗?

@wangyanxi2019
Copy link
Author

我无法定位到具体是那个代码调用MJ

@wangyanxi2019
Copy link
Author

@wolfcon 升级了4.0.0,有个问题
[NSObject(MJKeyValue) mj_unsafe_JSONObjectWithRecursiveMode:keys:ignoredKeys:managedIDs:] + [NSObject+MJKeyValue.m : 281] 。能看下是什么情况吗?

@wangyanxi2019
Copy link
Author

[MJProperty numberForObject:] + [MJProperty.m : 170]
[NSObject(MJKeyValue) mj_unsafe_JSONObjectWithRecursiveMode:keys:ignoredKeys:managedIDs:] + [NSObject+MJKeyValue.m : 283]

@wolfcon
Copy link
Collaborator

wolfcon commented Sep 16, 2022

[MJProperty numberForObject:] + [MJProperty.m : 170]
[NSObject(MJKeyValue) mj_unsafe_JSONObjectWithRecursiveMode:keys:ignoredKeys:managedIDs:] + [NSObject+MJKeyValue.m : 283]

这里的170行, 是 UInt 类型, 有对应模型数据吗?
能复现么?

@wangyanxi2019
Copy link
Author

@wolfcon 我感觉还是3.4.1问题,依然再4.0.0出现,而且还多了几个bug。我现在还是回滚到3.4.1,然后继续排查到底是什么数据引起的。

@wangyanxi2019
Copy link
Author

[MJProperty valueForObject:] 追查这个问题。

@wangyanxi2019
Copy link
Author

@wolfcon 我尝试去复现,但是依然没找到。但是我故意创造一个model,model里面如果有UIImage属性,再使用 mj_keyValue,把model转成dict。会崩溃到

  • (id)valueForObject:(id)object
    {
    if (self.type.KVCDisabled) return [NSNull null];
    //bug 不支持的类型,有可能奔溃点
    id value = [object valueForKey:self.name];
    }

我虽然无法复现问题,这个地方怎么避免这种操作呢?@Try也不行
ps:pod 'MJExtension', '~> 3.4.1'

@wolfcon
Copy link
Collaborator

wolfcon commented Oct 10, 2022

老版本需要 ignore 掉 UIkit 属性

@wangyanxi2019
Copy link
Author

嗯。我已经解决了。忽略掉UIImage,UIView,NSSet等。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants