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

Container overflow detected #3150

Closed
davidgloves opened this issue Jan 28, 2016 · 2 comments
Closed

Container overflow detected #3150

davidgloves opened this issue Jan 28, 2016 · 2 comments
Assignees
Labels

Comments

@davidgloves
Copy link

When I get a model with NSPredicate, the results count is more than zero. But I cannot get the item with [results objectAtIndex:0]. It crashed and told me container overflow detected. Is this issue occurred to anybody ? Need help.

@davidgloves
Copy link
Author

some log:

==14725==ERROR: AddressSanitizer: container-overflow on address 0x60300056ac58 at pc 0x00010549606a bp 0x7fff5bd69a30 sp 0x7fff5bd691e8
READ of size 32 at 0x60300056ac58 thread T0
#0 0x105496069 in asan_memcpy (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.2/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib+0x37069)
#1 0x1043fdf68 in std::__1::vector<realm::TableViewBase
, std::__1::allocatorrealm::TableViewBase* >::__swap_out_circular_buffer(std::__1::__split_buffer<realm::TableViewBase
, std::__1::allocatorrealm::TableViewBase*&>&) memory:1582
#2 0x1043fd009 in void std::__1::vector<realm::TableViewBase*, std::__1::allocatorrealm::TableViewBase* >::push_back_slow_pathrealm::TableViewBase*(realm::TableViewBase&&) vector:1579
#3 0x104bed8eb in realm::TableViewBase::TableViewBase(realm::Table
, realm::Query&, unsigned long, unsigned long, unsigned long) (/Users/wmbnm/Library/Developer/CoreSimulator/Devices/D9EB4DC7-797D-4FF7-8263-AC502D3AA5E7/data/Containers/Bundle/Application/5DF4096A-9360-47A2-8E2F-DC0F12E374C7/Writer.app/Writer+0x100d5c8eb)
#4 0x104be0cb1 in realm::Query::find_all(unsigned long, unsigned long, unsigned long) (/Users/wmbnm/Library/Developer/CoreSimulator/Devices/D9EB4DC7-797D-4FF7-8263-AC502D3AA5E7/data/Containers/Bundle/Application/5DF4096A-9360-47A2-8E2F-DC0F12E374C7/Writer.app/Writer+0x100d4fcb1)
#5 0x1043da77c in realm::Results::update_tableview() results.cpp:142
#6 0x1043daee9 in realm::Results::get(unsigned long) results.cpp:93
#7 0x1046f5a19 in -[RLMResults objectAtIndex:]::$_2::operator()() const RLMResults.mm:268
#8 0x1046e8c63 in auto translateErrors<-[RLMResults objectAtIndex:]::$_2>(-[RLMResults objectAtIndex:]::$_2&&, NSString*) RLMResults.mm:196
#9 0x1046e8aa3 in -[RLMResults objectAtIndex:] RLMResults.mm:267
#10 0x103efb420 in +[WriterRealm getUserByUserId:] WriterRealm.m:149
#11 0x10404bb77 in -[MessageViewController storeMessagesFromArray:] MessageViewController.m:436
#12 0x10404b153 in __41-[MessageViewController beginGetMessages]_block_invoke_2 MessageViewController.m:412
#13 0x1040ef749 in __46+[WHttps getWithUrl:params:completionHandler:]_block_invoke_2 WHttps.m:95
#14 0x104111167 in __116-[AFHTTPSessionManager dataTaskWithHTTPMethod:URLString:parameters:uploadProgress:downloadProgress:success:failure:]_block_invoke97 AFHTTPSessionManager.m:287
#15 0x1041689f8 in __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2151 AFURLSessionManager.m:308
#16 0x10549ea83 in __wrap_dispatch_group_async_block_invoke (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.2/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib+0x3fa83)
#17 0x109fa7185 in _dispatch_call_block_and_release (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libdispatch.dylib+0x2185)
#18 0x109fc6613 in _dispatch_client_callout (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libdispatch.dylib+0x21613)
#19 0x109faea1b in _dispatch_main_queue_callback_4CF (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libdispatch.dylib+0x9a1b)
#20 0x10645f1f8 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE** (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation+0xa91f8)
#21 0x106420dca in __CFRunLoopRun (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation+0x6adca)
#22 0x106420365 in CFRunLoopRunSpecific (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation+0x6a365)
#23 0x10b630a3d in GSEventRunModal (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices+0xca3d)
#24 0x107bb78bf in UIApplicationMain (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/UIKit.framework/UIKit+0x1c8bf)
#25 0x103fbf9fe in main main.m:14
#26 0x109ffa144 in start (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdyld.dylib+0x2144)
#27 0x0 ()

0x60300056ac60 is located 0 bytes to the right of 32-byte region [0x60300056ac40,0x60300056ac60)
allocated by thread T0 here:
#0 0x1054a100b in wrap__Znwm (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.2/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib+0x4200b)
#1 0x1043fef75 in std::1::__split_buffer<realm::TableViewBase, std::__1::allocatorrealm::TableViewBase*&>::__split_buffer(unsigned long, unsigned long, std::__1::allocatorrealm::TableViewBase&) new:156
#2 0x1043fdbfc in std::__1::__split_buffer<realm::TableViewBase*, std::__1::allocatorrealm::TableViewBase*&>::__split_buffer(unsigned long, unsigned long, std::__1::allocatorrealm::TableViewBase*&) __split_buffer:324
#3 0x1043fce34 in void std::__1::vector<realm::TableViewBase*, std::__1::allocatorrealm::TableViewBase* >::push_back_slow_pathrealm::TableViewBase*(realm::TableViewBase&&) vector:1575
#4 0x104bed8eb in realm::TableViewBase::TableViewBase(realm::Table
, realm::Query&, unsigned long, unsigned long, unsigned long) (/Users/wmbnm/Library/Developer/CoreSimulator/Devices/D9EB4DC7-797D-4FF7-8263-AC502D3AA5E7/data/Containers/Bundle/Application/5DF4096A-9360-47A2-8E2F-DC0F12E374C7/Writer.app/Writer+0x100d5c8eb)
#5 0x104be0cb1 in realm::Query::find_all(unsigned long, unsigned long, unsigned long) (/Users/wmbnm/Library/Developer/CoreSimulator/Devices/D9EB4DC7-797D-4FF7-8263-AC502D3AA5E7/data/Containers/Bundle/Application/5DF4096A-9360-47A2-8E2F-DC0F12E374C7/Writer.app/Writer+0x100d4fcb1)
#6 0x1043da77c in realm::Results::update_tableview() results.cpp:142
#7 0x1043daee9 in realm::Results::get(unsigned long) results.cpp:93
#8 0x1046f5a19 in -[RLMResults objectAtIndex:]::$_2::operator()() const RLMResults.mm:268
#9 0x1046e8c63 in auto translateErrors<-[RLMResults objectAtIndex:]::$_2>(-[RLMResults objectAtIndex:]::$_2&&, NSString*) RLMResults.mm:196
#10 0x1046e8aa3 in -[RLMResults objectAtIndex:] RLMResults.mm:267
#11 0x103efb420 in +[WriterRealm getUserByUserId:] WriterRealm.m:149
#12 0x1040d53e1 in -[CounselingWorksViewController storeMessageList:] CounselingWorksViewController.m:108
#13 0x1040d473a in __40-[CounselingWorksViewController getData]_block_invoke CounselingWorksViewController.m:85
#14 0x1040ef749 in __46+[WHttps getWithUrl:params:completionHandler:]_block_invoke_2 WHttps.m:95
#15 0x104111167 in __116-[AFHTTPSessionManager dataTaskWithHTTPMethod:URLString:parameters:uploadProgress:downloadProgress:success:failure:]_block_invoke97 AFHTTPSessionManager.m:287
#16 0x1041689f8 in __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2151 AFURLSessionManager.m:308
#17 0x10549ea83 in __wrap_dispatch_group_async_block_invoke (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.2/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib+0x3fa83)
#18 0x109fa7185 in _dispatch_call_block_and_release (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libdispatch.dylib+0x2185)
#19 0x109fc6613 in _dispatch_client_callout (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libdispatch.dylib+0x21613)
#20 0x109faea1b in _dispatch_main_queue_callback_4CF (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libdispatch.dylib+0x9a1b)
#21 0x10645f1f8 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE** (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation+0xa91f8)
#22 0x106420dca in __CFRunLoopRun (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation+0x6adca)
#23 0x106420365 in CFRunLoopRunSpecific (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation+0x6a365)
#24 0x10b630a3d in GSEventRunModal (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices+0xca3d)
#25 0x107bb78bf in UIApplicationMain (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/UIKit.framework/UIKit+0x1c8bf)
#26 0x103fbf9fe in main main.m:14
#27 0x109ffa144 in start (/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdyld.dylib+0x2144)
#28 0x0 ()

SUMMARY: AddressSanitizer: container-overflow ??:0 __asan_memcpy
Shadow bytes around the buggy address:
0x1c06000ad530: fd fd fa fa fd fd fd fa fa fa fd fd fd fa fa fa
0x1c06000ad540: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fd
0x1c06000ad550: fa fa fd fd fd fd fa fa 00 00 00 00 fa fa fd fd
0x1c06000ad560: fd fd fa fa fd fd fd fd fa fa 00 00 00 00 fa fa
0x1c06000ad570: fd fd fd fd fa fa fd fd fd fd fa fa 00 00 00 00
=>0x1c06000ad580: fa fa fd fd fd fd fa fa 00 00 00[fc]fa fa fd fd
0x1c06000ad590: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa
0x1c06000ad5a0: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd
0x1c06000ad5b0: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd
0x1c06000ad5c0: fd fd fa fa 00 00 00 00 fa fa 00 00 00 00 fa fa
0x1c06000ad5d0: 00 00 00 00 fa fa fd fd fd fd fa fa 00 00 00 fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==14725==ABORTING

@bdash
Copy link
Contributor

bdash commented Jan 28, 2016

Realm Objective-C only supports being built with Address Sanitizer enabled when its core database library is also built with Address Sanitizer enabled. Since we don't have publicly-available builds of the core database library with ASan support, you'll need to avoid building Realm Objective-C with ASan enabled for now.

@jpsim jpsim closed this as completed Feb 1, 2016
@jpsim jpsim removed the pending label Feb 1, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants