How do I compile swift without any dynamic libraries? - swift

Tring to make a "hello, world" style program to see if I can use Swift on the web by running it through emscripten to get asm.js output.
The problem is that when I compile it, its bitcode tries to link dynamic libraries. It doesn't seem like it should need to do this, or it seems like someone who understands how all these pieces fit together could tell me how to provide the file it needs (I'm willing to implement some of the functions it depends on in JavaScript, if necessary).
I have a more comprehensive explanation of the environment here, but this is the basics:
The file:
$ cat f.swift
var message = 1
Compile it to bitcode:
$ xcrun swiftc -emit-bc f.swift -o f.bc
Fail to compile the bitcode to asm.js:
$ emcc f.bc
WARNING: Linking two modules of different data layouts: '/Users/josh/.emscripten_cache/libc.bc' is 'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128' whereas '/Users/josh/deleteme/swift-play/f.bc' is 'e-m:o-i64:64-f80:128-n8:16:32:64-S128'
WARNING: Linking two modules of different target triples: /Users/josh/.emscripten_cache/libc.bc' is 'asmjs-unknown-emscripten' whereas '/Users/josh/deleteme/swift-play/f.bc' is 'x86_64-apple-darwin13.2.0'
Unknown specifier in datalayout string
UNREACHABLE executed at /Users/clb/emscripten-fastcomp/lib/IR/DataLayout.cpp:300!
0 opt 0x00000001086d04ae llvm::sys::PrintStackTrace(__sFILE*) + 46
1 opt 0x00000001086d07bb PrintStackTraceSignalHandler(void*) + 27
2 opt 0x00000001086d0b4c SignalHandler(int) + 412
3 libsystem_platform.dylib 0x00007fff8b0e35aa _sigtramp + 26
4 libsystem_platform.dylib 0x00007fff6492d380 _sigtramp + 3649347056
5 opt 0x00000001086d07eb raise + 27
6 opt 0x00000001086d08a2 abort + 18
7 opt 0x000000010865a7a6 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 198
8 opt 0x0000000108416b74 llvm::DataLayout::parseSpecifier(llvm::StringRef) + 2804
9 opt 0x0000000108415c57 llvm::DataLayout::init(llvm::StringRef) + 471
10 opt 0x000000010749b47e llvm::DataLayout::DataLayout(llvm::StringRef) + 158
11 opt 0x0000000107482ba5 llvm::DataLayout::DataLayout(llvm::StringRef) + 37
12 opt 0x000000010747943c main + 3756
13 libdyld.dylib 0x00007fff8a2865fd start + 1
Stack dump:
0. Program arguments: /Users/josh/code/emsdk_portable/clang/e1.25.0_64bit/opt /var/folders/7g/mbft22555w3_2nqs_h1kbglw0000gn/T/tmp93OFuV/a.out.bc -strip-debug -internalize -internalize-public-api-list=main,malloc,free -globaldce -pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt -enable-emscripten-cxx-exceptions -o /var/folders/7g/mbft22555w3_2nqs_h1kbglw0000gn/T/tmp93OFuV/a.out.bc.opt.bc
Traceback (most recent call last):
File "/Users/josh/code/emsdk_portable/emscripten/1.25.0/emcc", line 1224, in <module>
shared.Building.llvm_opt(final, link_opts)
File "/Users/josh/code/emsdk_portable/emscripten/1.25.0/tools/shared.py", line 1357, in llvm_opt
assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output
AssertionError: Failed to run llvm optimizations:

Looks like you're out of luck here. The IR compiler is generating is not standard - it includes some private Apple changes which were not upstreamed (in particular, the data layout string is non-standard at least).
And no, it is not trying to link any dynamic libraries. It tries to link statically (at LLVM IR level) all necessary stuff, in particular, C standard library.

Related

Opening Realm files of format version 5 is not supported by this version of Realm

I can't find a way to read my Realm file. I assumed Realm is backwards compatible. The Realm objects/attributes/classes have remained exactly the same. I tried changing the schema and also tried custom migration, which is impossible because I get "Opening Realm files of format version 5 is not supported by this version of Realm" as soon as I tried to read from Realm. I have tried many tricks i've read in other posts such as forcing readOnly to false:
let version = Realm.Configuration.defaultConfiguration.schemaVersion
print("schema version \(version)")
var configuration = Realm.Configuration(readOnly: false, schemaVersion: 1)
try! Realm(configuration: configuration) //FAILS Opening Realm files of format version 5 is not supported by this version of Realm
configuration = Realm.Configuration(readOnly: true)
let realm = try! Realm(configuration: configuration)
I can't update the app on the App Store because people with a previous version will have their app crash, and I don't want to delete their Realm file and get bad reviews because they lost all their data. Is there any option without downgrading to an earlier version of realm?
I'm using XCode 12.4 and swift 5. The schema of the Realm file is unchanged. The issue was supposed to be solved in Realm v5.4.1 on 9/20/2021. I have the latest version of Realm installed but the issue is not resolved. https://swift.libhunt.com/realm-cocoa-changelog?page=4
I've have also tried resetting the integration state:
pod cache clean Realm
pod cache clean RealmSwift
pod deintegrate || rm -rf Pods
pod install --verbose
rm -rf ~/Library/Developer/Xcode/DerivedData
My version info:
tee /dev/tty | pbcopy
ProductName: macOS
ProductVersion: 11.1
BuildVersion: 20C69
/Applications/Xcode.app/Contents/Developer
Xcode 12.4
Build version 12D4e
/Users/Paul/.rvm/rubies/ruby-2.4.1/bin/pod
1.10.1
Realm (10.5.1)
RealmSwift (10.5.1)
/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
/usr/bin/git
git version 2.24.3 (Apple Git-128)
My Pod File:
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
target 'Vending Receipt' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Vending Receipt
pod 'Realm'
pod 'RealmSwift' #, :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'master'
pod 'BTNavigationDropdownMenu'
pod 'SCLAlertView', :git => 'https://github.com/vikmeup/SCLAlertView-Swift.git'
target 'Vending ReceiptTests' do
inherit! :search_paths
use_frameworks!
# Pods for testing
pod 'Realm'
pod 'RealmSwift' #, :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'master'
pod 'BTNavigationDropdownMenu'
pod 'SCLAlertView', :git => 'https://github.com/vikmeup/SCLAlertView-Swift.git'
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
config.build_settings['EXCLUDED_ARCHS[sdk=watchsimulator*]'] = 'arm64'
config.build_settings['EXCLUDED_ARCHS[sdk=appletvsimulator*]'] = 'arm64'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
The crash log is below:
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=6 "Opening Realm files of format version 5 is not supported by this version of Realm" UserInfo={Error Code=6, NSFilePath=/var/mobile/Containers/Data/Application/04864A2A-4605-49B2-893F-15F76F60DD9B/Documents/default.realm, Underlying=Database has an unsupported version (5) and cannot be upgraded
Exception backtrace:
0 Realm 0x000000010104e4ac _ZN5realm2DB7do_openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbbNS_9DBOptionsE + 5356
1 Realm 0x0000000101050694 _ZN5realm2DB4openERNS_11ReplicationENS_9DBOptionsE + 244
2 Realm 0x000000010105517c _ZN5realm2DB6createERNS_11ReplicationENS_9DBOptionsE + 392
3 Realm 0x0000000100b5cf40 _ZN5realm5_impl16RealmCoordinator7open_dbEv + 992
4 Realm 0x0000000100b5c148 _ZN5realm5_impl16RealmCoordinator12do_get_realmENS_5Realm6ConfigERNSt3__110shared_ptrIS2_EENS_4util8OptionalINS_9VersionIDEEERNS8_17CheckedUniqueLockE + 68
5 Realm 0x0000000100b5bf64 _ZN5realm5_impl16RealmCoordinator9get_realmENS_5Realm6ConfigENS_4util8OptionalINS_9VersionIDEEE + 668
6 Realm 0x0000000100e4f204 _ZN5realm5Realm16get_shared_realmENS0_6ConfigE + 176
7 Realm 0x0000000100db93d4 +[RLMRealm realmWithConfiguration:queue:error:] + 1796
8 RealmSwift 0x0000000102a6f478 $sSo8RLMRealmC13configuration5queueABSo0A13ConfigurationC_So012OS_dispatch_C0CSgtKcfCTO + 156
9 RealmSwift 0x0000000102ac8734 $s10RealmSwift0A0V13configuration5queueA2C13ConfigurationV_So012OS_dispatch_D0CSgtKcfC + 216
10 Vending Receipt 0x000000010050d0cc $s15Vending_Receipt0B7StorageC11getReceipts_5sort15sort29ascending10RealmSwift7ResultsVyAA0B0CGSS_S2SSbtF + 1572
11 Vending Receipt 0x00000001004e4868 $s15Vending_Receipt14SearchReceiptsC11UpdateTableyyF + 1980
12 Vending Receipt 0x00000001004e11d0 $s15Vending_Receipt14SearchReceiptsC11viewDidLoadyyF + 5768
13 Vending Receipt 0x00000001004e1250 $s15Vending_Receipt14SearchReceiptsC11viewDidLoadyyFTo + 32
14 UIKitCore 0x00000001a72f2e50 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4623952
15 UIKitCore 0x00000001a72f7408 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4641800
16 UIKitCore 0x00000001a72f77e8 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4642792
17 UIKitCore 0x00000001a722b738 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 3807032
18 UIKitCore 0x00000001a723fbb0 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 3890096
19 UIKitCore 0x00000001a7240fe0 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 3895264
20 UIKitCore 0x00000001a7223e78 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 3776120
21 UIKitCore 0x00000001a7ec2398 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 17007512
22 QuartzCore 0x00000001a83c7df4 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 1400308
23 QuartzCore 0x00000001a83ce398 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 1426328
24 QuartzCore 0x00000001a83d96e8 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 1472232
25 QuartzCore 0x00000001a8324d7c 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 732540
26 QuartzCore 0x00000001a834ef40 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 905024
27 UIKitCore 0x00000001a79b6d8c CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 11718028
28 UIKitCore 0x00000001a7a5dac4 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 12401348
29 UIKitCore 0x00000001a7a54afc CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 12364540
30 CoreFoundation 0x00000001a50cdbf0 F3021642-E3C0-33F8-9911-DD303A6056D0 + 633840
31 CoreFoundation 0x00000001a50cdaf0 F3021642-E3C0-33F8-9911-DD303A6056D0 + 633584
32 CoreFoundation 0x00000001a50cce38 F3021642-E3C0-33F8-9911-DD303A6056D0 + 630328
33 CoreFoundation 0x00000001a50c73e0 F3021642-E3C0-33F8-9911-DD303A6056D0 + 607200
34 CoreFoundation 0x00000001a50c6ba0 CFRunLoopRunSpecific + 572
35 GraphicsServices 0x00000001bbe2f598 GSEventRunModal + 160
36 UIKitCore 0x00000001a79b82f4 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 11723508
37 UIKitCore 0x00000001a79bd874 UIApplicationMain + 164
38 Vending Receipt 0x00000001004d3444 main + 88
39 libdyld.dylib 0x00000001a4da5568 0B475C78-3C12-3121-B7F8-2B95B83DAF44 + 5480, NSLocalizedDescription=Opening Realm files of format version 5 is not supported by this version of Realm}: file Vending_Receipt/ReceiptModel.swift, line 52
2021-02-01 15:16:21.102889-0600 Vending Receipt[558:58472] Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=6 "Opening Realm files of format version 5 is not supported by this version of Realm" UserInfo={Error Code=6, NSFilePath=/var/mobile/Containers/Data/Application/04864A2A-4605-49B2-893F-15F76F60DD9B/Documents/default.realm, Underlying=Database has an unsupported version (5) and cannot be upgraded
Question was answered on Github:
v5.0.0 dropped support for opening Realm files written by versions before v3.0.0.
We support migrating from 6+ and the 5->6 migration just consisted of recreating the string indexes.
The core confusion is in the wording Realm files of format version 5.
The file format version is a different number from the Realm SDK Version.
Unfortunately, I don't think this correspondence of versions is clearly documented anywhere.
Searching the changelog for mention of format is the only way I know.
An important version probably fixed your upgrade woes 10.7.1 which Restores support for upgrading files from file format 5 (Realm Cocoa 1.x)
From my sheet which has much more detail:
SDK 10.8.0 Generates Realms with format v22
SDK 10.0.0 Generates Realms with format v11
SDK 5.4.0 Generates Realms with format v11 also (last of the pre-MongoDB standalone?)
SDK 2.4 ... 2.10 format 6
SDK 1.x format 5

Install4J fails to startup on Mac OS X

With JabRef, we experience a weird situation where some users get the following error when starting JabRef
We do not ship a JRE with our application and rely on that Java is installed on the machine of the users.
We have a long issue on GitHub about this particular error and despite all our efforts, it seems we cannot find the source of the issue. Especially, since none of the devs can reproduce it. Fortunately, one of the users who experiences this error was kind enough to provide all information about his machine:
$ java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
$ which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxr-xr-x 1 root wheel 74 Aug 14 12:09 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
1.8.0_161, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
1.8.0_121, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
$ echo $JDK_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
I asked this particular user to provide the INSTALL4J_LOG and so that we can compare the log-files of Install4J on my machine where it works and on the users machine where it fails.
My machine runs OS X 10.13.2 and the system of the user is OS X 10.12.6.
There are two main differences between them. The first difference is that when I invoke the JabRef launcher, it instantly tells me the order of places to search for Java:
2018-01-24 02:10:14.437 JavaApplicationStub[4846:345347] -[Launcher findJavaBundle:] [Line 479] search sequence (
EPATH,
Y,
"EJAVA_HOME",
"EJDK_HOME"
)
This is exactly the order we have configured in Install4J
On the users log-file this part is missing completely. However, it doesn't really matter, because the JRE/JDK is very rarely included in the $PATH variable. The next things to check are the default locations and this will find the JRE in Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin first.
Therefore, on my machine and on the users machine, JabRef will use this JRE and not any of additionally installed JDK's.
Now, there is the probably more important difference. On the machine of the user, it seems the JRE needs to be unpacked which does not happen for me:
2018-01-23 12:27:08.320 JavaApplicationStub[40695:1133965] -[Launcher findJavaBundle:] [Line 474] Running unpacker
2018-01-23 12:27:08.323 JavaApplicationStub[40695:1133965] +[Unpacker unpack:withProgress:] [Line 24] found ()
2018-01-23 12:27:08.323 JavaApplicationStub[40695:1133965] +[Unpacker unpack:withProgress:] [Line 24] found ()
After that, the logs look similar but when finally the JRE is invoked, it cannot be found on the user's machine and we get the error message
2018-01-23 12:27:08.328 JavaApplicationStub[40695:1133965] int launcher_main(int, char **) [Line 925] Could not load JRE from The bundle “Java SE 8” couldn’t be loaded because its executable couldn’t be located..: (
0 CoreFoundation 0x00007fff8ff882cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffa4d9e48d objc_exception_throw + 48
2 CoreFoundation 0x00007fff90006c3d +[NSException raise:format:] + 205
3 JavaApplicationStub 0x0000000100008644 -[Launcher launch] + 468
4 JavaApplicationStub 0x0000000100008ef5 launcher_main + 645
5 JavaApplicationStub 0x0000000100009062 main + 34
6 JavaApplicationStub 0x0000000100001504 start + 52
)
Now, I'm not sure why unpacking is necessary and if it can be explained by the particular JRE or the different Mac OS versions.
In any way, I have asked the user to install the Oracle JRE 1.8.0_161 so that we both have the exact same Java and I'll report back if this solved the problem.
However, has someone a bright idea why the Install4J launcher crashes?

iOS crash reports: atos not working as expected

I'm looking at a crash report provided by Apple
Hardware Model: iPhone4,1
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-11-18 16:03:44.951 -0600
OS Version: iOS 6.0.1 (10A523)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x51fe5264
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x352925b0 objc_msgSend + 16
1 MYAPP 0x0006573a -[MyViewController(Images) didReceiveImage:context:etag:expires:] + 42
2 MYAPP 0x0004fb26 -[MyImageTask didReceiveImage:] + 98
3 Foundation 0x361ac8e8 __NSThreadPerformPerform
4 CoreFoundation 0x3b37d680 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
5 CoreFoundation 0x3b37cee4 __CFRunLoopDoSources0
6 CoreFoundation 0x3b37bcb2 __CFRunLoopRun
7 CoreFoundation 0x3b2eeeb8 CFRunLoopRunSpecific
8 CoreFoundation 0x3b2eed44 CFRunLoopRunInMode
9 GraphicsServices 0x396bc2e6 GSEventRunModal
10 UIKit 0x3452e2f4 UIApplicationMain
11 MYAPP 0x0004934a main + 70
12 MYAPP 0x000492fc start + 36
The funny thing is when I use atos to lookup the line of code that corresponds to address locations 0x0006573a and 0x0004fb26 I get completely different match. The atos output is not even from the same class that's mentioned in the crash log (MyViewController, MyImageTask). Instead atos points me to totally benign lines of code in a completely unrelated class. I verified again that I'm working with the exact dSYM and IPA that I submitted to Apple.
My atos command
/Applications/Xcode.app/Contents/Developer/usr/bin/atos -arch armv7 -o MYAPP.app/MYAPP 0x0004fb26
Same result with /usr/bin/atos and for armv7s.
Has anyone else experienced this issue? Can you please advise? Thanks.
A simpler alternative: you can use the atos -l flag to make it do the maths for you.
Say you've got the following line in your crash log that you want to symbolicate:
5 MyApp 0x0044e89a 0x29000 + 4348058
The first hex number is the stack address, and the second hex number is the load address. You can ignore the last number. You don't need to worry about slide addresses either.
To symbolicate, do the following:
atos -o MyApp.app/MyApp -arch armv7 -l 0x29000 0x0044e89a
If you can't find your MyApp.app/MyApp file, rename your '.ipa' file to a '.zip', unzip it, and it'll be in the Payload folder.
And if you're not sure which architecture to use (for example, armv7 or armv7s), scroll to the 'Binary Images' part of the crash file and you can find it in there.
Cheers
You have to calculate the address to use with atos, you can't just use the one in the stacktrace.
symbol address = slide + stack address - load address
The slide value is the value of vmaddr in LC_SEGMENT cmd (Mostly this is 0x1000). Run the following to get it:
otool -arch ARCHITECTURE -l "APP_BUNDLE/APP_EXECUTABLE" | grep -B 3 -A 8 -m 2 "__TEXT"
Replace ARCHITECTURE with the actual architecture the crash report shows, e.g. armv7.
Replace APP_BUNDLE/APP_EXECUTABLE with the path to the actual executable.
The stack address is the hex value from the crash report.
The load address can be is the first address showing in the Binary Images section at the very front of the line which contains your executable. (Usually the first entry).
Since in the past value of the slide was equal to value of the load address this always worked. But since Apple introduced Address space layout randomization beginning with iOS 4.3 (in different variations), the apps loading address is randomized for security reasons.
Simply use dwarfdump:
dwarfdump --arch armv7 myApp.dSYM --lookup 0xaabbccdd | grep 'Line table'
No need to do any calculations at all.
(From Get symbol by address (symbolicating binary, iOS build)).
For whom that certain times doesn't have the value for Load Address like this:
Jan 14 11:02:39 Dennins-iPhone AppName[584] <Critical>: Stack Trace: (
0 CoreFoundation 0x2c3084b7 <redacted> + 150
1 libobjc.A.dylib 0x39abec8b objc_exception_throw + 38
2 CoreFoundation 0x2c21cc35 CFRunLoopRemoveTimer + 0
3 AppName 0x0005a7db AppName + 272347
I've created a simple bash to help me debug:
#! /bin/bash
read -p "[Path] [App Name] [Stack Address] [DecimalSum] " path appName stackAddress decimalSum
loadAddress=`echo "obase=16;ibase=10;$((stackAddress-decimalSum))" | bc`
atos -o $path/Payload/$appName.app/$appName -l $loadAddress $stackAddress -arch armv7
It just reads the path for the app, the app name, the stack address, and the value after "+" signal (the decimal value) and then find the value for load address to run atos command.

ZxingWidget archive error on ios6.0

I try to archive the ZxingWedget Demo,scanTest. compile is ok. it can run on the simulator.
but it can not archive completely on ios6.0.
this is the error:
Stripping /Users/ganguo/Library/Developer/Xcode/DerivedData/ScanTest-gadjcaxemklyqpcxsvmiorzakfhu/Build/Intermediates/ArchiveIntermediates/ScanTest/IntermediateBuildFilesPath/ZXingWidget.build/Release-iphoneos/ZXingWidget.build/Objects-normal/armv7/libZXingWidget.a
cd /Users/ganguo/objc/lib/zxing/iphone/ZXingWidget
setenv PATH "/Applications/app/Xcode45-DP4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/app/Xcode45-DP4.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/app/Xcode45-DP4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -S /Users/ganguo/Library/Developer/Xcode/DerivedData/ScanTest-gadjcaxemklyqpcxsvmiorzakfhu/Build/Intermediates/ArchiveIntermediates/ScanTest/IntermediateBuildFilesPath/ZXingWidget.build/Release-iphoneos/ZXingWidget.build/Objects-normal/armv7/libZXingWidget.a
0 0x10eaf75f0 __assert_rtn + 144
1 0x10eb5ed12 ld::tool::FunctionStartsAtom<arm>::encode() const + 594
2 0x10eb4d05b ld::tool::OutputFile::updateLINKEDITAddresses(ld::Internal&) + 251
3 0x10eb483b8 ld::tool::OutputFile::write(ld::Internal&) + 136
4 0x10eaf7c5f main + 1263
A linker snapshot was created at:
/tmp/strip.7jH8OR-2012-07-16-113649.ld-snapshot
ld: Assertion failed: (addr != badAddress), function encode, file /SourceCache/ld64/ld64-134.5/src/ld/LinkEdit.hpp, line 1289.
/Applications/app/Xcode45-DP4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: internal link edit command failed
Command /Applications/app/Xcode45-DP4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip failed with exit code 1
I filed the bug (12176840) with Apple for this problem today.
Do a clean and try again. If it still fails, file a bug with Apple. This is an xcode/toolchain bug (in prerelease software).
I believe that the zxing library doesn't support the armv7 architecture yet. I would love to be wrong, though...

iphone :How to do symobolication of crash report?

In my app i got crash report
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000
Crashed Thread: 7
In Thread 7 :
Thread 7 Crashed:
0 CoreFoundation 0x3728ba96 0x37278000 + 80534
1 CFNetwork 0x36617b84 0x36616000 + 7044
2 CFNetwork 0x36617af6 0x36616000 + 6902
3 MusicBandApp 0x0000bbfc 0x1000 + 44028
4 MusicBandApp 0x0000b740 0x1000 + 42816
5 Foundation 0x33b88382 0x33b6b000 + 119682
6 Foundation 0x33bfa5c6 0x33b6b000 + 587206
7 libsystem_c.dylib 0x3579530a 0x35762000 + 209674
8 libsystem_c.dylib 0x35796bb4 0x35762000 + 215988
but can"t show particular crash file name & line number.
How can sybolicate this crash report.
We need a file called symbolitecrash to process this file. This file can be located in /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources
Open the Terminal.
Copy symbolitecrash file to the default location shown when the terminal is opened.
eg. Terminal window :-
Last login: Wed Jun 22 15:28:21 on ttys000
UserMM:~ user$
Here, the default location is the directory "user".
Running this script with the -h option provides the minimal help:
UserMM:~ user$ symbolitecrash -h
usage:
/usr/local/bin/symbolicatecrash [-Ah] [-o ] LOGFILE [SYMBOL_PATH ...]
Symbolicates a crashdump LOGFILE which may be "-" to refer to stdin. By default,
all heuristics will be employed in an attempt to symbolicate all addresses.
Additional symbol files can be found under specified directories.
Options:
-A Only symbolicate the application, not libraries
-o If specified, the symbolicated log will be written to OUTPUT_FILE (defaults to stdout)
-h Display this message
-v Verbose
Place the .crash file in the same location where symbolitecrash file is copied.
To add symbols to the crash log you need the dSYM file generated by the linker when you compiled your application for AppStore. In other words, when you build for AppStore you should keep the dSYM package in a safe place backed up by Time Machine. This is very important. You should keep a copy of the dSYM for each version of your application ever shipped. If you have the package, translating code offsets to function names with line numbers has never been easier:
$ symbolicatecrash MiMo_2011-06-22-143801_Anands-Ipod.crash myApp.app.dSYM > myApp_2011-06-22-143801_Anands-Ipod1.crash
myApp_2011-06-22-143801_Anands-Ipod1.crash is the new crash file generated in the same location.
Here is the result:
Thread 0 Crashed:
0 libobjc.A.dylib 0x300c87ec objc_msgSend + 20
1 myApp 0x00006434 -[BoardView setSelectedPiece:] (BoardView.m :321)
I also described how to do this step by step in this post
It worked fine for me:
Crash Symbolized http://k.minus.com/jk4X2obwZMI7j.png