I have a UIViewController:DFUserChatViewController witch is inherit form DFChatViewController,in DFChatViewController init method I have a navigationItem.leftBarButtonItem with a method backAction
- (id)init
{
self = [super init];
if (self)
{
...........
self.navigationItem.leftBarButtonItem = [[[DFBarBackButtonItem alloc] initWithTarget:self action:#selector(backAction:) image:nil] autorelease];
}
return self;
}
in DFUserChatViewController I overwrite the method backAction:
#pragma mark - action
-(void)backAction:(id)sender
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
.............any other thing
.............
{
[self.navigationController popViewControllerAnimated:YES];
}
}
I use crashlytics for crash report and today I receive a crash
0
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x4000000c
raw
0
libobjc.A.dylib objc_msgSend + 5
1
DFmyPro
DFUserChatViewController.m line 349
-[DFUserChatViewController backAction:]
2
UIKit -[UIApplication sendAction:to:from:forEvent:] + 90
3
UIKit -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
4
UIKit -[UIControl sendAction:to:forEvent:] + 44
5
UIKit -[UIControl _sendActionsForEvents:withEvent:] + 374
6
UIKit -[UIControl touchesEnded:withEvent:] + 590
7
UIKit -[UIWindow _sendTouchesForEvent:] + 528
8
UIKit -[UIWindow sendEvent:] + 832
9
DFmyPro
DFShakeWindow.m line 46
-[DFShakeWindow sendEvent:]
10
UIKit -[UIApplication sendEvent:] + 196
11
UIKit _UIApplicationHandleEventQueue + 7098
12 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
13
CoreFoundation __CFRunLoopDoSources0 + 206
14
CoreFoundation __CFRunLoopRun + 622
15
CoreFoundation CFRunLoopRunSpecific + 522
16
CoreFoundation CFRunLoopRunInMode + 106
17
GraphicsServices GSEventRunModal + 138
18 UIKit UIApplicationMain + 1136
19
DFmyPro
main.m line 15
main
I run my app again and again ,and didn‘t catch the crash ,How do I know where goes wrong
Related
I've had this problem for a while and it's driving me nuts. This is reported by Crashlytics but only for a few users. I'm unable to recreate the problem myself.
I'm using a SplitViewController and this occurs after a user adds data within a UIViewController and touch the save button, which then returns to the SplitViewController to perform the method 'saveItemEntry' shown below.
I've tried a suggestion from a previous post which was to wrap the [self.tableView reloadData] with dispatch_async(dispatch_get_main_queue(), ^(void), but that actually made it worse. It isn't like the data takes ages to load, it doesn't, so I can't see that multi-tasking will help, but I'm open to advice on whether I should be doing that.
I'm really not clear on how to interperupt the crash info. If someone can and can suggest what might be causing this that would be awesome.
If more info is needed please let me know.
Here's the crash details:
Here's the Raw stuff..
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x20407ae2 objc_msgSend + 1
1 CoreFoundation 0x20b8391b -[NSDictionary descriptionWithLocale:indent:] + 310
2 Foundation 0x2136fe2d _NSDescriptionWithLocaleFunc + 60
3 CoreFoundation 0x20c011a3 __CFStringAppendFormatCore + 7986
4 CoreFoundation 0x20bff255 _CFStringCreateWithFormatAndArgumentsAux2 + 80
5 CoreFoundation 0x20c17559 _CFLogvEx2 + 96
6 CoreFoundation 0x20c179af _CFLogvEx3 + 118
7 Foundation 0x214374f7 _NSLogv + 126
8 Foundation 0x2137e79d NSLog + 28
9 UIKit 0x24eac5fb -[UITableView reloadData] + 1818
10 Simple Meeting Minutes 0xfb859 -[MMDetailTableVC saveItemEntry:] (MMDetailTableVC.m:1423)
11 Simple Meeting Minutes 0x10becf -[MMItemViewController saveButtonAction:] (MMItemViewController.m:526)
12 UIKit 0x24dfd771 -[UIApplication sendAction:to:from:forEvent:] + 80
13 UIKit 0x24f7ec71 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 140
14 UIKit 0x24dfd771 -[UIApplication sendAction:to:from:forEvent:] + 80
15 UIKit 0x24dfd701 -[UIControl sendAction:to:forEvent:] + 64
16 UIKit 0x24de561f -[UIControl _sendActionsForEvents:withEvent:] + 446
17 UIKit 0x24de574b -[UIControl _sendActionsForEvents:withEvent:] + 746
18 UIKit 0x24dfd051 -[UIControl touchesEnded:withEvent:] + 616
19 UIKit 0x24dfccbf -[UIWindow _sendTouchesForEvent:] + 646
20 UIKit 0x24df55d7 -[UIWindow sendEvent:] + 642
21 UIKit 0x24dc6119 -[UIApplication sendEvent:] + 204
22 UIKit 0x24dc4757 _UIApplicationHandleEventQueue + 5134
23 CoreFoundation 0x20bf1257 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
24 CoreFoundation 0x20bf0e47 __CFRunLoopDoSources0 + 454
25 CoreFoundation 0x20bef1af __CFRunLoopRun + 806
26 CoreFoundation 0x20b41bb9 CFRunLoopRunSpecific + 516
27 CoreFoundation 0x20b419ad CFRunLoopRunInMode + 108
28 GraphicsServices 0x21dbbaf9 GSEventRunModal + 160
29 UIKit 0x24e2dfb5 UIApplicationMain + 144
30 Simple Meeting Minutes 0xf5d6f main (main.m:16)
31 libdispatch.dylib 0x207f4873 (Missing)
and here's my code in this particular area..
- (void)saveItemEntry:(MMitem *)item{
if (item)
{
// save item to the sqlite3 database file
NSString *resultStr = [self.meetingModel saveItem:item];
if ([resultStr isEqualToString:#"OK"])
{
// all good so close form and refresh data
[self dismissViewControllerAnimated:NO completion:nil];
[self.tableView reloadData];
// or if there is an error result then display message
}
else if ([resultStr isEqualToString:#"DescriptionNotesMissing"])
{
[self showAlert:#"Missing Description or Notes" :#"An Item Description or Notes is required" :0];
[self.itemViewController.itemDescription becomeFirstResponder];
}
// for any other error do nothing
}
}
I'm fighting with a crash in my app but I can't find where it happens.
I'm working with last version of MZFormSheetController. When I receive a remote push I present a basic MZFormSheetController, it was working nice but from one day to the other it starts crashing with a weird stack trace :
Fatal Exception: NSInvalidArgumentException
*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
Thread : Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x2bfc2fef __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3a274c8b objc_exception_throw + 38
2 CoreFoundation 0x2bedcefb -[__NSArrayM insertObject:atIndex:] + 638
3 UIKit 0x2fb6289f __workaround10030904InvokeWithTarget_block_invoke + 14
4 UIKit 0x2f8b2ab1 +[UIView _performSystemAppearanceModifications:] + 32
5 UIKit 0x2f780639 workaround10030904InvokeWithTarget + 704
6 UIKit 0x2fb5ff3b applyInvocationsToTarget + 1242
7 UIKit 0x2f6bdd8f +[_UIAppearance _applyInvocationsTo:window:matchingSelector:] + 1262
8 UIKit 0x2f6bd89b +[_UIAppearance _applyInvocationsTo:window:] + 30
9 UIKit 0x2f8bc353 __88-[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:]_block_invoke + 54
10 UIKit 0x2f8bc2cb -[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:] + 262
11 UIKit 0x2f61cf07 -[UIView(Internal) _didChangeFromIdiom:onScreen:traverseHierarchy:] + 30
12 UIKit 0x2f633f0f -[UIScrollView _didChangeFromIdiom:onScreen:traverseHierarchy:] + 46
13 UIKit 0x2f8bc1b7 -[UIView(Internal) _didChangeFromIdiomOnScreen:traverseHierarchy:] + 138
14 UIKit 0x2f61497d -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1316
15 UIKit 0x2f633dfb -[UIScrollView _didMoveFromWindow:toWindow:] + 50
16 UIKit 0x2f6146fb -[UIView(Internal) _didMoveFromWindow:toWindow:] + 674
17 UIKit 0x2f6146fb -[UIView(Internal) _didMoveFromWindow:toWindow:] + 674
18 UIKit 0x2f613fa7 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 114
19 UIKit 0x2f613ec1 -[UIView(Hierarchy) _postMovedFromSuperview:] + 428
20 UIKit 0x2f61e72b -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1498
21 UIKit 0x2f61e14b -[UIView(Hierarchy) addSubview:] + 30
22 UIKit 0x2f61db69 -[UIWindow addRootViewControllerViewIfPossible] + 432
23 UIKit 0x2f61b3a1 -[UIWindow _setHidden:forced:] + 272
24 UIKit 0x2f6864a1 -[UIWindow makeKeyAndVisible] + 48
25 Project 0x000f382d -[MZFormSheetController presentAnimated:completionHandler:] (MZFormSheetController.m:509)
26 Project 0x0021b879 __60+[ARDPopupManager showFormsheet:animated:completionHandler:]_block_invoke_2 (ARDPopupManager.m:46)
27 libdispatch.dylib 0x3a7e9ecd _dispatch_barrier_sync_f_slow_invoke + 372
28 libdispatch.dylib 0x3a7df2cf _dispatch_client_callout + 22
29 libdispatch.dylib 0x3a7e2d2f _dispatch_main_queue_callback_4CF + 1330
30 CoreFoundation 0x2bf88609 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
31 CoreFoundation 0x2bf86d09 __CFRunLoopRun + 1512
32 CoreFoundation 0x2bed3201 CFRunLoopRunSpecific + 476
33 CoreFoundation 0x2bed3013 CFRunLoopRunInMode + 106
34 GraphicsServices 0x337b2201 GSEventRunModal + 136
35 UIKit 0x2f677a59 UIApplicationMain + 1440
36 Project 0x0007a88d main (main.m:14)
37 libdyld.dylib 0x3a800aaf start + 2
Of course I understand the crash but the exception breakpoint stops at this line :
[self.formSheetWindow makeKeyAndVisible];
In MZFormSheetController library and the MZFormSheetController is presented from my code like :
[formsheet presentAnimated:animated completionHandler:nil];
I added an All Exception Breakpoint but it does not point to an addObject: or insertObject:atIndex: method. Maybe it is elsewhere but I can't figure it out. I can't find the NSArray causing this crash.
Finally found : in the view controller presented in form sheet controller I added an UITextView and in my AppDelegate I wrote [[UITextView appearance] setKeyboardAppearance:UIKeyboardAppearanceDark]; and it crashes when I present the UITextView. So I had to set keyboard appearance individually on each UITextView instances storyboard or code...
I think it will solve problem.
YourViewController *objVc = [[YourViewController alloc] init]; // or you can use initWithNib
// Your remaining code
MZFormSheetController *formSheet = [[MZFormSheetController alloc]initWithViewController:objVc];
formSheet.transitionStyle = MZFormSheetTransitionStyleSlideFromBottom; //try different style
formSheet.presentedFormSheetSize = CGSizeMake(320, self.view.frame.size.height);
formSheet.willPresentCompletionHandler = ^(UIViewController *presentedFSViewController)
{
presentedFSViewController.view.autoresizingMask = presentedFSViewController.view.autoresizingMask | UIViewAutoresizingFlexibleWidth;
};
formSheet.shouldCenterVertically = YES;
[formSheet presentAnimated:YES completionHandler:^(UIViewController *presentedFSViewController){ }];
my application keeps crashing because of the below error. I tried debugging it but am not able to understand why is it caused and how to debug and remove this..
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x335cef46 objc_msgSend + 5
1 UIKit 0x29307c2b -[UIApplication sendAction:to:from:forEvent:] + 70
2 UIKit 0x29307bd1 -[UIControl sendAction:to:forEvent:] + 44
3 UIKit 0x292f2863 -[UIControl _sendActionsForEvents:withEvent:] + 582
4 UIKit 0x2930763d -[UIControl touchesEnded:withEvent:] + 588
5 UIKit 0x29307317 -[UIWindow _sendTouchesForEvent:] + 522
6 UIKit 0x29300be1 -[UIWindow sendEvent:] + 544
7 UIKit 0x292d73dd -[UIApplication sendEvent:] + 196
8 UIKit 0x2954ac29 _UIApplicationHandleEventFromQueueEvent + 13888
9 UIKit 0x292d5e39 _UIApplicationHandleEventQueue + 1296
10 CoreFoundation 0x25dde377 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
11 CoreFoundation 0x25ddd787 __CFRunLoopDoSources0 + 218
12 CoreFoundation 0x25ddbded __CFRunLoopRun + 772
13 CoreFoundation 0x25d2a211 CFRunLoopRunSpecific + 476
14 CoreFoundation 0x25d2a023 CFRunLoopRunInMode + 106
15 GraphicsServices 0x2d1230a9 GSEventRunModal + 136
16 UIKit 0x293361d1 UIApplicationMain + 1440
17 Application 0x000ffefb main (main.m:17)
I got a lot of crash reports on my current app using the following code in my AppDelegate:
- (void)prepareFrameworks
{
if([MFMessageComposeViewController canSendText])
(void)[[MFMessageComposeViewController alloc] init];
if([MFMailComposeViewController canSendMail])
(void)[[MFMailComposeViewController alloc] init];
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
(void)[[SLComposeViewController alloc] init];
}
I'm running the code to reduce the load time of the ComposeViewController on activation.
One of the stacktraces:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xe15f851f
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3ab570ec objc_retain + 11
1 libsystem_blocks.dylib 0x3b07fd97 _Block_object_assign + 386
2 libsystem_blocks.dylib 0x3b07f9e9 _Block_copy_internal + 444
3 UIKit 0x3346f987 +[_UIAsyncInvocation invocationWithBlock:] + 74
4 UIKit 0x33457b87 +[_UIRemoteViewControllerConnectionRequest requestViewController:fromServiceWithBundleIdentifier:serializedAppearanceCustomizations:legacyAppearance:useXPCObjects:exportedHostingObject:serviceViewControllerDeputyInterface:connectionHandler:] + 914
5 UIKit 0x3345a129 +[_UIRemoteViewController requestViewController:fromServiceWithBundleIdentifier:connectionHandler:] + 468
6 MessageUI 0x31f0d37f +[MFMailComposeRemoteViewController requestViewControllerWithConnectionHandler:] + 62
7 MessageUI 0x31f0a79f -[MFMailComposeInternalViewController initWithNibName:bundle:] + 126
8 MessageUI 0x31ef2281 -[MFMailComposeViewController initWithURL:] + 216
9 MY APP 0x000cb881 -[AppDelegate prepareFrameworks] (AppDelegate.m:262)
10 MY APP 0x000cad61 -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:128)
11 UIKit 0x32fae2ff -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 274
12 UIKit 0x32fadd4f -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1390
13 UIKit 0x32fa8353 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 714
14 UIKit 0x32f4341f -[UIApplication handleEvent:withNewEvent:] + 3130
15 UIKit 0x32f42721 -[UIApplication sendEvent:] + 72
16 UIKit 0x32fa7b3d _UIApplicationHandleEvent + 664
17 GraphicsServices 0x353de70d _PurpleEventCallback + 608
18 GraphicsServices 0x353de2f7 PurpleEventCallback + 34
19 CoreFoundation 0x307959df __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
20 CoreFoundation 0x3079597b __CFRunLoopDoSource1 + 346
21 CoreFoundation 0x3079414f __CFRunLoopRun + 1398
22 CoreFoundation 0x306fec27 CFRunLoopRunSpecific + 522
23 CoreFoundation 0x306fea0b CFRunLoopRunInMode + 106
24 UIKit 0x32fa6dd9 -[UIApplication _run] + 760
25 UIKit 0x32fa2049 UIApplicationMain + 1136
26 MY APP 0x000cac27 main (main.m:16)
I have a UITabBarController with three views. When I select View#2 the application crashes (see crash log). If I reorder the tabs so that View#2 is first it works (No crash).
0 libobjc.A.dylib 0x3368ef78 objc_msgSend + 16
1 CoreFoundation 0x359b8e90 CFRetain + 76
2 CoreFoundation 0x359c2b74 +[__NSArrayI __new::] + 48
3 CoreFoundation 0x359c2a8e -[__NSPlaceholderArray initWithObjects:count:] + 294
4 CoreFoundation 0x359c27ce +[NSArray arrayWithObjects:count:] + 38
5 CoreFoundation 0x359c24f2 -[NSDictionary allValues] + 230
6 UIKit 0x333e7f46 -[UINib instantiateWithOwner:options:] + 538
7 UIKit 0x333563c0 -[UIViewController _loadViewFromNibNamed:bundle:] + 240
8 UIKit 0x33233c52 -[UIViewController loadView] + 82
9 UIKit 0x331a9c10 -[UIViewController view] + 44
10 UIKit 0x33209636 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 86
11 UIKit 0x332095d4 -[UITabBarController transitionFromViewController:toViewController:] + 24
12 UIKit 0x33208f0e -[UITabBarController _setSelectedViewController:] + 294
13 UIKit 0x3329244e -[UITabBarController _tabBarItemClicked:] + 338
14 CoreFoundation 0x359ca3f6 -[NSObject performSelector:withObject:withObject:] + 46
15 UIKit 0x3318be00 -[UIApplication sendAction:to:from:forEvent:] + 56
16 UIKit 0x3318bdbc -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 24
17 UIKit 0x332922d2 -[UITabBar _sendAction:withEvent:] + 346
18 CoreFoundation 0x359ca3f6 -[NSObject performSelector:withObject:withObject:] + 46
19 UIKit 0x3318be00 -[UIApplication sendAction:to:from:forEvent:] + 56
20 UIKit 0x3318bdbc -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 24
21 UIKit 0x3318bd9a -[UIControl sendAction:to:forEvent:] + 38
22 UIKit 0x3318bb0a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 486
23 UIKit 0x33292062 -[UITabBar(Static) _buttonUp:] + 110
24 CoreFoundation 0x359ca3f6 -[NSObject performSelector:withObject:withObject:] + 46
25 UIKit 0x3318be00 -[UIApplication sendAction:to:from:forEvent:] + 56
26 UIKit 0x3318bdbc -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 24
27 UIKit 0x3318bd9a -[UIControl sendAction:to:forEvent:] + 38
28 UIKit 0x3318bb0a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 486
29 UIKit 0x3318c442 -[UIControl touchesEnded:withEvent:] + 470
30 UIKit 0x3318a924 -[UIWindow _sendTouchesForEvent:] + 312
31 UIKit 0x3318a312 -[UIWindow sendEvent:] + 374
32 UIKit 0x3317068e -[UIApplication sendEvent:] + 350
33 UIKit 0x3316ff34 _UIApplicationHandleEvent + 5820
34 GraphicsServices 0x33762224 PurpleEventCallback + 876
35 CoreFoundation 0x35a4451c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
36 CoreFoundation 0x35a444be __CFRunLoopDoSource1 + 134
37 CoreFoundation 0x35a4330c __CFRunLoopRun + 1364
38 CoreFoundation 0x359c649e CFRunLoopRunSpecific + 294
39 CoreFoundation 0x359c6366 CFRunLoopRunInMode + 98
40 GraphicsServices 0x33761432 GSEventRunModal + 130
41 UIKit 0x3319ecce UIApplicationMain + 1074
42 TecNotes 0x000c2a28 main (main.m:18)
43 TecNotes 0x000c2940 start + 32
There is no custom class or instance initialization. And the viewDidLoad method of View#2 does not seem to execute.
In an effort to debug the issue the viewDidLoad for View#2 has been reduced to the following.
- (void)viewDidLoad
{
NSLog(#"Enter View#2 viewDidLoad");
[super viewDidLoad];
NSLog(#"Exit View#2 viewDidLoad");
}
View#1 has similar logging to record that the viewDidLoad method is called.
- (void)viewDidLoad
{
NSLog(#"Enter View#1 viewDidLoad");
[super viewDidLoad];
NSFileManager *filemgr = [NSFileManager defaultManager];
NSString *cd = [filemgr currentDirectoryPath];
recipeName = [cd lastPathComponent];
NSString *basedir = [CategoryViewController getBaseDir];
int startPos = [basedir length]+1;
int len = [cd length]-startPos;
NSString *tmp = [cd substringWithRange:NSMakeRange(startPos, len)];
title = [CategoryViewController decode:tmp];
//self.navigationItem.backBarButtonItem.title = recipeName;
//self.tabBarController.navigationItem.title = recipeName;
currentNote = 0;
//-------
UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:#selector(swipedScreen:)];
swipeGesture.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:swipeGesture];
swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:#selector(swipedScreen:)];
swipeGesture.direction = UISwipeGestureRecognizerDirectionLeft ;
[self.view addGestureRecognizer:swipeGesture];
//-------
UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithTitle:#"Menu" style:UIBarButtonItemStylePlain target:self action:#selector(backButtonPressed)];
self.navigationItem.backBarButtonItem = back;
self.tabBarController.navigationItem.backBarButtonItem = back;
[noteView setFont:[UIFont systemFontOfSize:[NotesViewController getFontSize]]];
[self loadNotes];
NSLog(#"Exit View#1 viewDidLoad");
}
Here is the resulting log entries.
Dec 16 11:42:21 Tonys-iPad TecNotes[6577] : Enter View#1 viewDidLoad
Dec 16 11:42:21 Tonys-iPad TecNotes[6577] : Exit View#1 viewDidLoad
Dec 16 11:42:27 Tonys-iPad ReportCrash[6580] : Formulating crash report for process TecNotes[6577]
Dec 16 11:42:27 Tonys-iPad com.apple.launchd[1] (UIKitApplication:com.bringardner.tecnotes[0x2bd8][6577]) : (UIKitApplication:com.bringardner.tecnotes[0x2bd8]) Job appears to have crashed: Segmentation fault: 11