Featured Posts

How to background load and cache UIImageViews images It's often the case that the apps I am working on are required to download quite a couple, or even a few dozen, images and display them in a UIImageView. In looking online I found a few different methods...

Readmore

It sure does snow in Kansas! This week I am visiting my Grandmother in Kansas. Monday night I arrived at the farm just as the first snow was falling, and by Tuesday morning I couldn't have left if I wanted to. Here are some pictures...

Readmore

*Warning* Do not install software included in Panasonic... Background A while back I purchased a Panasonic camera that can not only take pictures, but also record video. I chose the camera because of this combination, in combination with it's optical zoom. Now,...

Readmore

UPS continues tradition of poor service Warning, rant ahead! I don't like posting such, but UPS is making my life miserable often enough that I feel I have to. Anyway, I purchased a product recently which the company shipped via UPS with...

Readmore

Suggestions to correct iTunes / iPhone music sync Recently I had a coworker who upgraded his iPhone to 3.0 find that he could no longer sync that iPhone with his iTunes music library on a Windows computer. It would, however, sync just fine on a Mac OS...

Readmore

  • Prev
  • Next

putpkt: write failed: Broken pipe

Posted on : 01-06-2009 | By : Lane Roathe | In : Development, iPhone

8

Hopefully this will provide some useful information for someone, because I did a lot of google searching and didn’t come up with an answer to this one that way.

After upgrading my sdk from 2.2.1 to 3.0 beta 5 I was no longer able to install my application on the iPhone. The compile, link, build and install process went fine but as soon as the application was launched, and before it got to main(), the app crashed. In the debugger I was getting putpkt: write failed: Broken pipe.

After hours (and hours) of various tests, back tracking, deleting, re-installing, restoring and other contortions I finally remembered that several weeks back I had added an entitlements plist to solve a similar issue. So, I deleted the reference to the plist from my project settings entitlement field, and it worked!.

That is, until I went to make a distribution build, at which time it failed again. However, this time it gave me the old, familiar error about an invalid entitlement. So, I re-added the entitlement plist reference and the ad-hoc installation worked.

Hopefully the final 3.0 SDK will correct this issue so that I don’t have to remember to do this each time I switch between development and distribution builds.

Comments (8)

How this broke actually and how it happen

Well, it didn’t actually “Break”, per se, what happened is that starting with the 3.0 SDK you can no longer have a distribution plist for debugbuilds, but they are required for ad-hoc or app store builds.

My solution is to have four build configurations:

- debug
- release
- adhoc
- distribution

This setup allows me to have debug/release use no distribution plist and my development profile, while the adhoc and distribution do have the plist and then each has their own profile. Works very well.

This error also seems to occur if you build and debug whilst the application is already running on the iPhone.

you saved me all sorts of time and frustration. thanks for putting the tip out there.

I’m afraid I spoke too soon. It did help, but only for one program run. There is something else going on here.

Solved! I have been able to reliably avoid this error completely:

1. Before doing a new build, always stop the debugger first.
2. Then stop the app on the device.
3. Only after doing the above 2 steps, then build and go.

That’s all you need. (No need to restart Xcode, restart device, delete app from device, etc.)

Forrest

PS. This is bug in XCode.

Hey All

i am also facing this problem but this problem happened with me in UITableViewCell.
when i am scrolling the table view, not always but sometimes it crashed and displays the above error in degub console.
please help me what may be the reason.

Asad,

I am not sure why scrolling a tableview would result in a broken pipe, although in combination with the “sometimes” symptom my first thought is a bad pointer leading to a memory overwrite.

Try turning on Guard Malloc in the run menu; your program will run really slow but it’s likely to find any memory issues.

Write a comment

Powered by WP Hashcash