Objective C Bus Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack bus error 10 c Overflow the company Business Learn more about hiring developers or posting ads with us
Bus Error 10 Mac
Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a bus error 10 gulp community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Bus error: 10 error up vote 23 down vote favorite 10 Here is my code #import
Bus Error Linux
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just bus error core dumped c like you, helping each other. Join them; it only takes a minute: Sign up xcodebuild - Build Succeeded -> Bus error up vote 2 down vote favorite I'm using xcodebuild to compile my project. I use this on http://stackoverflow.com/questions/8716714/bus-error-10-error the command line: xcodebuild -sdk iphoneos4.0 -configuration Distribution It returns with the regular build information scrolling by, then shows this: ** BUILD SUCCEEDED ** Bus error The package is built fine, so I'm not sure what is causing the Bus error after a successful build. Normally this wouldn't be a problem and I could ignore it, but the Bus error is killing my automation script. What is the cause of this bus error? Another interesting http://stackoverflow.com/questions/3294661/xcodebuild-build-succeeded-bus-error side note, I also get the bus error even if the build fails due to a code sign error. Edit: I tried putting more RAM in the machine, up to 2GB, in hopes that this would fix the bus error. It didn't. objective-c xcode bash xcodebuild share|improve this question edited Jul 22 '10 at 19:20 asked Jul 20 '10 at 21:47 Alex 179114 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted xcodebuild is a shell script which must be running a process after the "BUILD SUCCEEDED" message that is faulting and generating the error. The best way to debug shell scripts is to put set -x as the first line of the script which will show the text of commands before the shell executes them. share|improve this answer answered Jul 20 '10 at 21:56 msw 32.1k54790 I tried this out, I don't get any more information between the two lines. –Alex Jul 20 '10 at 23:00 Then your culprit is the line marked + that is executing last, whatever that might be. I kinda doubt the shell itself is getting SIGBUS. –msw Jul 20 '10 at 23:39 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers http://stackoverflow.com/questions/4145164/why-do-nil-null-blocks-cause-bus-errors-when-run or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x http://www.cocoabuilder.com/archive/cocoa/292151-stringbyreplacingcharactersinrange-leading-to-bus-error.html Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why do nil / NULL blocks cause bus errors when run? up vote 61 down vote favorite 22 I started using blocks a lot and soon noticed that nil blocks cause bus errors: typedef void (^SimpleBlock)(void); bus error SimpleBlock aBlock = nil; aBlock(); // bus error This seems to go against the usual behaviour of Objective-C that ignores messages to nil objects: NSArray *foo = nil; NSLog(@"%i", [foo count]); // runs fine Therefore I have to resort to the usual nil check before I use a block: if (aBlock != nil) aBlock(); Or use dummy blocks: aBlock = ^{}; aBlock(); // runs fine Is there another option? Is there a reason why nil blocks couldn’t be simply a bus error 10 nop? objective-c objective-c-blocks share|improve this question edited Jun 25 at 18:15 hfossli 14k678100 asked Nov 10 '10 at 13:52 zoul 66.5k27188280 add a comment| 4 Answers 4 active oldest votes up vote 117 down vote accepted I'd like to explain this a bit more, with a more complete answer. First let's consider this code: #import me, but I've been looking around for a few hours and can't seem to figure out what I'm doing wrong on my own and could use a second/third/fourth set of eyes. I have NSTimer that runs several times a second against an NSString called level, which is 190 characters long and previously initialized from: // NSString *level = [[NSString alloc] // initWithContentsOfFile:path // encoding:NSUTF8StringEncoding // error:&error]; During the timer call, the level NSString is modified by the following line of code: level=[level stringByReplacingCharactersInRange:NSMakeRange(5,1) withString:@" "]; This operation appears to succeed as I print it via NSLog and it looks fine and the length checks out, but the next time through the NSTimer I get a bus error and the application dies. If I comment out the line above, the code continues to run fine. Am I doing something wrong in terms of how I am using this method or assigning it back to the NSString? I appreciate the help! --Jim vincent habchi Re: stringByReplacingCharactersInRange leading to bus error Aug 18 2010, 06:43 Le 17 août 2010 à 23:03, James Miller a écrit : > // NSString *level = [[NSString alloc] > // initWithContentsOfFile:path > // encoding:NSUTF8StringEncoding > // error:&error]; > > > During the timer call, the level NSString is modified by the following line of code: > > level=[level stringByReplacingCharactersInRange:NSMakeRange(5,1) withString:@" "]; > > This operation appears to succeed as I print it via NSLog and it looks fine and the length checks out, but the next time through the NSTimer I get a bus error and the application dies. Since NSString is an immutable type, the first certain thing is that you will leak your first allocation, since as soon as you call your second line, you lose the reference to the original string ([level stringByReplacing…] does not modify the string in place, it rather returns you a pointer to a newly created string). Next, you should retain the result of [level stringBy…]: this method returnsNode Bus Error 10
How To Debug Bus Error