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

Crash With IGListDiffKit SIGABRT ABORT #1578

Open
sugite opened this issue May 5, 2023 · 2 comments
Open

Crash With IGListDiffKit SIGABRT ABORT #1578

sugite opened this issue May 5, 2023 · 2 comments

Comments

@sugite
Copy link

sugite commented May 5, 2023

Crashlytics - Stack trace

Platform: apple

Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x7674 __pthread_kill + 8
1 libsystem_pthread.dylib 0x71ac pthread_kill + 268
2 libsystem_c.dylib 0x20c8c abort + 180
3 libsystem_malloc.dylib 0x1de2c malloc_vreport + 908
4 libsystem_malloc.dylib 0x1e0d0 malloc_zone_error + 100
5 libsystem_malloc.dylib 0x1382c free_list_checksum_botch + 40
6 libsystem_malloc.dylib 0x69d4 small_free_list_remove_ptr_no_clear + 980
7 libsystem_malloc.dylib 0x4210 small_malloc_from_free_list + 344
8 libsystem_malloc.dylib 0x1e38 small_malloc_should_clear + 220
9 libsystem_malloc.dylib 0x63b8 szone_malloc_should_clear + 120
10 libc++abi.dylib 0x138b0 operator new(unsigned long) + 32
11 xxx 0x51f80c std::__1::deque<long, std::__1::allocator >::__add_back_capacity() + 4305745932 (deque:4305745932)
12 xxx 0x51f6b4 std::__1::deque<long, std::__1::allocator >::push_back(long const&) + 1162 (deque:1162)
13 xxx 0x51df84 IGListDiffing(bool, long, long, NSArray<id >*, NSArray<id >, IGListDiffOption, long) + 1572 (vector:1572)
14 xxx 0x51eb48 IGListDiffPaths + 331 (IGListDiff.mm:331)
15 xxx 0x216c3c -[ViewModel insertMessages:] + 61 (ViewModel.m:61)
16 xxx 0x218234 __41-[ViewModel sendMessage:]_block_invoke_2 + 195 (ViewModel.m:195)
17 libdispatch.dylib 0x2460 _dispatch_call_block_and_release + 32
18 libdispatch.dylib 0x3f88 _dispatch_client_callout + 20
19 libdispatch.dylib 0x127f4 _dispatch_main_queue_drain + 928
20 libdispatch.dylib 0x12444 _dispatch_main_queue_callback_4CF + 44
21 CoreFoundation 0x9a6c8 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16
22 CoreFoundation 0x7c02c __CFRunLoopRun + 2036
23 CoreFoundation 0x80eb0 CFRunLoopRunSpecific + 612
24 GraphicsServices 0x1368 GSEventRunModal + 164
25 UIKitCore 0x3a1668 -[UIApplication _run] + 888
26 UIKitCore 0x3a12cc UIApplicationMain + 340
27 xxx 0x75fc main + 18 (main.m:18)
28 ??? 0x1ef358960 (缺少)

General information

  • IGListKit version: 4.0.0
  • iOS version(s): 16.3.1
  • CocoaPods/Carthage version: 1.11.3
  • Xcode version: 14.2
  • Devices/Simulators affected: iPhone 12 Pro Max

crash_info_entry_0
abort() called
crash_info_entry_1
xxx(16295,0x226d749c0) malloc: Incorrect checksum for freed object 0x1429e9000: probably modified after being freed. Corrupt value: 0x482036d01e800d0

@TimOliver
Copy link
Member

Hi @sugite. Thanks for the issue. Sorry to see you're having an issue here.

There's not enough info to really diagnose what's going on here. In the meantime can you please,

  1. Try installing the latest copy of IGListKit from the main branch and try again.
  2. Failing that, can you please show us the IGListDiffable objects you're trying to diff here.

Thanks!

@sugite
Copy link
Author

sugite commented May 10, 2023

Hi @TimOliver . Thank you for your reply.

  1. Since the project has not been migrated to Swift yet, the current version of IGListDiffKit being used is Objective-C version 4.0.0.
  2. The object that needs to be diffed is XXXBaseModel, defined as follows:
@interface XXXBaseModel : NSObject<IGListDiffable>
@end

@implementation XXXBaseModel
- (nonnull id<NSObject>)diffIdentifier {
    return @(self.message.mid);
}

- (BOOL)isEqualToDiffableObject:(nullable XXXBaseModel<IGListDiffable> *)object {
    if (self != object) {
        return NO;
    }
    return self.message.sendStatus == object.message.sendStatus;
}

@end
NSArray<XXXBaseModel *> *newModels = [_dict allValues];
IGListIndexPathResult *result = [IGListDiffPaths(1, 1, self.messageModels, newModels, IGListDiffEquality) resultForBatchUpdates];
self.messageModels = newModels;

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