Xcode 3.2.5 Organizer hangs while importing iOS 5 debug symbols

0

I installed the iOS 5 GM seed onto my iPhone 4 and, as usual, I fire up Xcode & go to the Organizer window so that it can download the debug symbols for the newest iOS from my device onto my Mac. This usually takes 15 minutes or so, but this time, Xcode just hung for some reason, with the Organizer indicating that it was waiting for another symbol copy process to complete first.

After some investigating, I got the symbols downloaded and all was good again. Following is a summary of the issues I ran into and solutions:

1) The “waiting on other symbol copying…” message in the Xcode Organizer.

I’m not sure what happened for me to have more than one symbol import going on, but I believe the message was triggered by the existence of a “.copying_lock” file in the directory of the iOS version that Xcode was importing symbols for.

The symbols are all stored under /Developer/Platforms/iPhoneOS.platform/DeviceSupport and looks something like this:

total 24
drwxrwxr-x  5 root  admin  170 Mar 14  2011 3.0
lrwxr-xr-x  1 root  admin    3 Mar 14  2011 3.0.1 -> 3.0
drwxrwxr-x  5 root  admin  170 Mar 14  2011 3.1
lrwxr-xr-x  1 root  admin    3 Mar 14  2011 3.1.1 -> 3.1
drwxrwxr-x  5 root  admin  170 Mar 14  2011 3.1.2
drwxrwxr-x  5 root  admin  170 Mar 14  2011 3.1.3
drwxrwxr-x  5 root  admin  170 Mar 14  2011 3.2
drwxrwxr-x  5 root  admin  170 Mar 14  2011 3.2.1
drwxrwxr-x  5 root  admin  170 Mar 14  2011 3.2.2
drwxrwxr-x  5 root  admin  170 Mar 14  2011 4.0
drwxrwxr-x  5 root  admin  170 Mar 14  2011 4.0.1
drwxrwxr-x  5 root  admin  170 Mar 14  2011 4.0.2
drwxrwxr-x  5 root  admin  170 Mar 14  2011 4.1
drwxrwxr-x  5 root  admin  170 Mar 14  2011 4.2 (8C134)
drwxr-xr-x  3 root  admin  102 Aug 15 11:16 4.2.1 (8C148)
drwxr-xr-x  4 root  admin  136 Mar 14  2011 4.3 (8F190)
drwxr-xr-x  3 root  admin  102 Mar 28  2011 4.3.1 (8G4)
drwxr-xr-x  3 root  admin  102 Apr 20 15:24 4.3.2 (8H7)
drwxr-xr-x  3 root  admin  102 Jul 25 13:55 4.3.4 (8K2)
drwxr-xr-x  3 root  admin  102 Aug  8 11:14 4.3.5 (8L1)
drwxr-xr-x  3 root  admin  102 Oct  5 13:05 5.0 (9A334)
lrwxr-xr-x  1 root  admin   11 Mar 14  2011 Latest -> 4.2 (8C134)

In my case, I was trying to import iOS 5 symbols, and the contents of the 5.0 (9A334) directory were:

$ ls -la 5.0\ \(9A334\)/
total 0
drwxr-xr-x   3 root  admin  102 Oct  5 11:14 .
drwxrwxr-x  24 root  admin  816 Oct  5 11:14 ..
-rw-r--r--   1 root  admin    0 Oct  5 11:14 .copying_lock

Solution

  1. Quit out of Xcode,
  2. Delete /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.0 (9A334)
  3. Restarting Xcode to start the symbol import again. “Waiting” message should no longer appear when you import the symbols

2) The symbols import progress bar in the Xcode Organizer sits @ 0% progress

After fixing #1, I tried the symbol import again and no longer got the “waiting” message, but the progress bar in the Organizer stayed stuck at 0% for several minutes, which is not normal. Looking at my running processes, there were two copies of DTDKSymbolHelper running, one idle and one consuming 90% CPU. I ended up killing both, quitting out of Xcode and trying once again, and the symbols finally imported correctly.

Note that when you try to quit out of Xcode during the symbol import process, you’ll get a warning message along the lines of leaving your iPhone in some busted intermediate state (or something along those lines). I just ignored them and things progressed fine — if you are experiencing the same symptoms that I did, you should be able to quit without issues.

More robust Postfix anti-spam configuration

0

My last post included an updated Postfix main.cf that was better at blocking spam and minimizing false positives through the use of DNS white lists (DNSWLs), but after a few days it was still letting in more spam than I wanted. I did additional tweaking and the following seems to work better, while still preventing false positives.

The main changes included specifying the following additional Postfix restrictions:

  • smtpd_sender_restrictions
  • smtpd_helo_restrictions
  • smtpd_data_restrictions
smtpd_helo_restrictions =
	reject_unknown_helo_hostname

smtpd_data_restrictions =
	reject_unauth_pipelining

smtpd_client_restrictions =
	permit_dnswl_client list.dnswl.org,
	reject_rbl_client b.barracudacentral.org,
	reject_rbl_client hostkarma.junkemailfilter.com=127.0.0.2,

smtpd_sender_restrictions =
	reject_unknown_sender_domain,
	reject_unknown_address,
	reject_rhsbl_sender dsn.rfc-ignorant.org,
	reject_rhsbl_reverse_client dbl.spamhaus.org,
	reject_rbl_client b.barracudacentral.org,

smtpd_recipient_restrictions =
	permit_mynetworks,
	reject_invalid_hostname,
	reject_non_fqdn_sender,
	reject_non_fqdn_recipient,
	reject_unknown_sender_domain,
	reject_unknown_recipient_domain,
	reject_unauth_destination,
	permit_dnswl_client list.dnswl.org,

	reject_rhsbl_reverse_client dbl.spamhaus.org,
	reject_rhsbl_sender dbl.spamhaus.org,
	reject_rhsbl_client dbl.spamhaus.org,
	reject_rhsbl_sender fresh15.spameatingmonkey.net,
	reject_rhsbl_client fresh15.spameatingmonkey.net,
	reject_rhsbl_sender uribl.spameatingmonkey.net,
	reject_rhsbl_client uribl.spameatingmonkey.net,
	reject_rhsbl_sender urired.spameatingmonkey.net,
	reject_rhsbl_client urired.spameatingmonkey.net,
	reject_rhsbl_client hostkarma.junkemailfilter.com=127.0.0.2,

	reject_rbl_client b.barracudacentral.org,
	reject_rbl_client zen.spamhaus.org,
	reject_rbl_client bl.spameatingmonkey.net,
	reject_rbl_client bl.spamcop.net,
	reject_rbl_client hostkarma.junkemailfilter.com=127.0.0.2,
	reject_rbl_client dnsbl.njabl.org,
	reject_rbl_client bl.tiopan.com,
	reject_rbl_client spamsources.fabel.dk,
	reject_rbl_client truncate.gbudb.net,
	reject_rbl_client ubl.unsubscore.com,
	reject_rbl_client aspews.ext.sorbs.net,
	reject_rbl_client dnsbl.sorbs.net,
	reject_rbl_client backscatter.spameatingmonkey.net,
	reject_rbl_client bl.spameatingmonkey.net,

	permit

12/1/2012 update: I removed reject_rhsbl_sender dsn.rfc-ignorant.org since it is no longer up as of 11/30/2012

Using DNS whitelists in Postfix

4

Update 7/21/2011: I’ve tweaked my main.cf config more recently that provided better results. I will have a follow-up post with the changes and additions.

In an earlier post several years back, I wrote about using DNS blacklists (DNSBLs) in postfix to block unwanted spam from hitting my inbox, and in the last week I tweaked it a bit to include DNS whitelists (DNSWLs). I was discovering that some of the DNSBLs were blocking a small portion of legitimate email from coming through (eg. blocking entire IP ranges for webmail providers).

You need Postfix 2.8 or higher (I was on 2.3.3 so I had to download and compile the latest, 2.8.3), which has a new configuration parameter which added support for querying a DNSWL like a DNSBL:

permit_dnswl_client dnswl_domain=d.d.d.d

The relevant portion of my updated Postfix main.cf is below (note permit_dnswl_client is inserted before any of the reject_rbl* parameters). The DNSWL queries are processed first before the DNSBLs, so it should allow legitimate IPs through and reduce the amount of false positives vs just using the DNSBLs alone.

smtpd_recipient_restrictions =
        permit_mynetworks,
        reject_invalid_hostname,
        reject_non_fqdn_sender,
        reject_non_fqdn_recipient,
        reject_unknown_sender_domain,
        reject_unknown_recipient_domain,
        reject_unauth_destination,
        permit_dnswl_client list.dnswl.org,
        reject_rbl_client b.barracudacentral.org,
        reject_rbl_client zen.spamhaus.org,
        reject_rbl_client bl.spameatingmonkey.net,
        reject_rbl_client bl.spamcop.net,
        reject_rbl_client hostkarma.junkemailfilter.com=127.0.0.2,
        reject_rbl_client dnsbl.njabl.org,
        reject_rbl_client bl.tiopan.com,
        reject_rbl_client spamsources.fabel.dk,
        reject_rbl_client truncate.gbudb.net,
        reject_rbl_client ubl.unsubscore.com,
        reject_rbl_client aspews.ext.sorbs.net,
        reject_rbl_client dnsbl.sorbs.net,
        reject_rbl_client backscatter.spameatingmonkey.net,
        reject_rbl_client bl.spameatingmonkey.net,
        reject_rhsbl_sender fresh15.spameatingmonkey.net,
        reject_rhsbl_client fresh15.spameatingmonkey.net,
        reject_rhsbl_sender uribl.spameatingmonkey.net,
        reject_rhsbl_client uribl.spameatingmonkey.net,
        reject_rhsbl_sender urired.spameatingmonkey.net,
        reject_rhsbl_client urired.spameatingmonkey.net,
        reject_rbl_client dnsbl.inps.de,
        reject_rbl_client DDNSBL.InternetDefenseSystems.com,
        permit

After watching the logs for the last couple days, this setup seems to work quite well…only 1 piece of spam slipped through, and more importantly, no false positives! I should also note that I stopped using spamassassin a while back and just these settings in postfix seems to block almost all legitimate spam coming into my server while not generating false positives.

BTW, if you want to tail your maillog from the command line in realtime and see the rejects in a more readable format, this short one liner will work:

$ tail -f /var/log/mail.log | sed -r -n 's/^(.*) \S+ postfix\/.* blocked using ([^;]+).*; from=<(\S+)> to=<(\S+)> proto=.* helo=.*>$/\1 - \2 - \3 - \4/p'

it will output in the format TIMESTAMP – DNSBL – FROM ADDRESS – TO ADDRESS

Updating iPhone apps to support Retina displays

0

The iPhone 4′s 640×960 display is night and day better than the previous generation’s 320×480 display. Supporting both is actually pretty straightforward.  The simplest thing is to do nothing: iOS 4 automagically up-sizes your image assets when running on a higher resolution display like the iPhone 4. It’ll look ok, but likely pixelated for the iPhone 4′s super sharp display.

To use higher res assets for iPhone 4, while keeping the lower res versions for earlier devices, simply add higher res images into your Xcode project with the following naming convention:

[ImageName]@2x.[filename_extension]

If you have an existing image named foobar.png that is 100×100, simply name the higher res 200×200 version as foobar@2x.png, add it to your project, and re-build. You don’t need to do anything else…when that app runs on an iPhone 4, if there is a @2x version of an image, that version will be loaded instead.

This document on the Apple Developer site summarizes it nicely & goes into more detail than I’ve covered here.

Resizing UILabel inside a UITable cell when doing a swipe delete gesture

0

When you do a right swipe gesture on a table cell in the iPhone’s Mail app, a delete button appears and the text reflows around the button, like so:

I built a similar interface that looks and functions similarly. The only problem was that when you right swiped, the delete button would appear, but the text would not reflow. Looking at the API docs, I made sure that all the subviews were added to the UITableViewCell’s contentView. I found a post on Stack Overflow that mentioned setting the contentMode property to UIViewContentModeLeft, but that didn’t work for me.

After digging around some more, I discovered that the autoresizingMask property of UILabel defaults to UIViewAutoresizingNone. When i set autoresizingMask to UIViewAutoresizingFlexibleWidth in the two UILabels (subject & body preview), they now reflow automatically when the delete button appears.

Page 2 of 1612345...10...Last »
Go to Top