Unable to read symbols error - iphone

I get these errors when I build and run for the device. Should I be worried about them? The app runs fine.
run
Running…
[Switching to thread 10755]
[Switching to thread 10755]
warning: Couldn't raise load state for requested shlib: "libobjc.A.dylib" for breakpoint 1.
(gdb) continue
warning: Unable to read symbols for ""/Users/tim/Code/Cat War/build/Debug-iphoneos"/Tiger War.app/Tiger War" (file not found).
warning: Unable to read symbols for ""/Users/tim/Code/Cat War/build/Debug-iphoneos"/Tiger War.app/Tiger War" (file not found).

You probably turned off debug symbols in the build settings. They should be off for release but they are helpful for debuging.

Hmm. I get this as well, but only when testing on the iPhone or iPod touch. Also, for my Debug Target Config settings, "Generate Debug Symbols" is set. (Not much in the Xcode project was changed in terms of the build settings, and I suspect it wasn't in yours either ... ?)
By any chance do you have an objc_exception_throw breakpoint in play? I have these two in my global breakpoints group:
[NSException raise] (CoreFoundation)
objc_exception_throw (libobjc.A.dylib)
Perhaps there's a correlation?

Related

Eclipse remote debugging arm-linux library

I am running:
Eclipse 3.8.1 (Build id: deb build).
On Ubuntu 16.04 LTS in a VM and UbuntuMATE 16.04 LTS on target Raspberry Pi 3.
gdb-multiarch(architecture set to arm in .gdbinit) locally andgdbserver` on the target.
Cross compilation and remote deployment is successful. However, there appears to be some library issue when I run on the remote target. Output from gdb-multiarch below (superfluous text removed):
GNU gdb (Ubuntu 7.11-0ubuntu1) 7.11 Copyright (C) 2016 Free Software
Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
http://gnu.org/licenses/gpl.html This GDB was configured as
"x86_64-linux-gnu".
Program stopped. 0x76fd7a40 in ?? () from
/home/fred/raspberrypi/rootfs/lib/arm-linux-gnueabihf/ld-2.23.so
Execution stops at main. However, it doesn't appear to stop due to a breakpoint. The stop appears to be the result of some library issue possibly and unresolved symbol (or something more serious) resulting in the ??.
I have set sysroot in the .gdbinit file to indicate where the shared libraries can be found. The StepIn, StepOut icons are hi-lighted in Eclipse, and I can read ARM registers if I press pause and see which core is being used to run the process (with process ID)!
After further resume & pause operations a segmentation fault occurs:
Program stopped. 0x76fe2e92 in ?? () from
/home/fred/raspberrypi/rootfs/lib/arm-linux-gnueabihf/ld-2.23.so
Program received signal SIGSEGV, Segmentation fault. 0x76fd905e in ??
() from
/home/fred/raspberrypi/rootfs/lib/arm-linux-gnueabihf/ld-2.23.so
Program terminated with signal SIGSEGV, Segmentation fault. The
program no longer exists.
Any ideas? (I am very much new to Linux as it probably shows.)
Thanks for the questions which have resulted in further exploration below:
In Eclipse I started GDB by selecting Debug Configuration and then choosing the remote configuration that I had set up.
The code is very simple, consisting of a stream operator to output some text and then a loop, however it is never reached. I think I have just managed to reproduce the issue from the command line. Incidentally I started the target going first. (Again superfluous text was removed for clarity.)
gdb-multiarch Hello_Raspberry_Pi
Reading symbols from Hello_Raspberry_Pi...done.
The target architecture is assumed to be arm
(gdb) target remote ubuntumate-pi
(gdb) target remote 192.168.0.12:2345
Remote debugging using 192.168.0.12:2345
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initialisers
and track explicitly loaded dynamic code.
0x76fd7a40 in ?? ()
(gdb) set architecture arm
The target architecture is assumed to be arm
(gdb) set sysroot /home/fred/raspberrypi/rootfs/lib/arm-linux-gnueabihf
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initialisers
and track explicitly loaded dynamic code.
(gdb)
The target side behaved as would be expected:
fred#UbuntuMATE-Pi:~/Hello_Raspberry_Pi$ gdbserver 192.168.0.7:2345 Hello_Raspberry_Pi
Process Hello_Raspberry_Pi created; pid = 17363
Listening on port 2345
Remote debugging from host 192.168.0.7
So perhaps Unable to find dynamic linker breakpoint function. is a big clue?
It would appear that I had defined Shared Libraries incorrectly. When I deleted this setting something closer to expected behaviour occurred. As shown below, however I there is still a warning that I would like to remove:
For help, type "help".
Type "apropos word" to search for commands related to "word".
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initialisers
and track explicitly loaded dynamic code.
0x76fd7a40 in ?? ()
Breakpoint 2, main () at ../src/Hello_Raspberry_Pi.cpp:18
18 cout << "I'm in the While loop and the value of variable i is: " << i << endl;
Breakpoint 1, main () at ../src/Hello_Raspberry_Pi.cpp:20
20 usleep(1000000); //wait for 1 seconds
So now Eclipse does breakpoint at main and permit stepping - finally!
I also faced problems similar to this, getting segmentation fault from ld.so. Did the following steps to fix it.
Install libc6-dbg package in both sysroot and target.
create a folder /lib/.debug in both sysroot and target.
copy /usr/lib/debug/lib/arm-linux-gnueabihf/ld-2.23.so to /lib/.debug in both sysroot and target.

Raspberry PI cross compilation linking error - unknown symbol _dl_hwcap

I have successfully set up a cross-complation environment for my RPI under 64 Bit ubuntu. I can compile and run a personal project using gstreamer just fine.
Due to performance-issues with gstreamer, I want to work on a fork of omxplayer. I adapted it to my environment, and compilation of ffmpeg and omxplayer themselves work just fine.
However, linking an actual executable (ffmpeg, or omxplayer.bin) yields a linking error I have been unable to resolve.
You find the full output of the last failing linking-step with verbose flags here:
https://gist.github.com/deets/3bba7c94017405d28f81
The error message is
ffmpeg_compiled/usr/local/lib/libavcodec.so: undefined reference to `_dl_hwcap'
collect2: error: ld returned 1 exit status
The missing symbol to me suggests something with dynamic loading. Maybe the libc or libdl are botched? But how come these are working just fine if compiling another project?
Found the culprit. When setting up the crosscompilation-environment, make sure your copy of the RPI's libraries are correct. I had unresolved symbolic library links that needed fixing in my rsync'ed copy of the RPI's file-system.

Struggling with Xcode 4

I've recently downloaded Xcode 4 and now two of my projects that were working perfectly fine before have started giving me errors. Both errors are effectively to do with linking options, but I can't figure out how to change these options and get rid of the errors.
The first problem is with a project written in C++ using the SDL_ttf and SDL_image frameworks. The project builds correctly, but when I try to run, it gives me the following warnings on the console:
warning: Unable to read symbols for #executable_path/../Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf (file not found).
warning: Unable to read symbols from "SDL_ttf" (not yet mapped into memory).
warning: Unable to read symbols for #executable_path/../Frameworks/SDL_image.framework/Versions/A/SDL_image (file not found).
warning: Unable to read symbols from "SDL_image" (not yet mapped into memory).
Since the files are not being found, the executable cannot load any images making it exit straight away when I try to load images. I think the issue here is that the frameworks are not in the directory above the executable, they are in /Library/Framework/ which worked fine before in Xcode 3.2. How do I resolve this?
The second problem comes when compiling an application I wrote for iOS. Along with giving me a bunch of warnings about depracated code on iOS 5, which I will deal with later, it fails to build due to a linker error which I have no clue how to resolve, it says:
ld: library not found for -lz.1.2.3
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
I can answer the second question.
-lz.1.2.3
should be
-lz
You might have accidentally added the zlib.1.2.3.dylib to the project's "link binary with libraries" build phase. You should use the standard zlib without any version in its filename, or simply add -lz to the Other Linker Flags under Build Settings and not add zlib in the "link binary with libraries" build phase.
As for the missing frameworks my best guess is that it has to do with the relative path, ie if you can get rid of the /../ part and instead provide an absolute path that might resolve the issue.

GDB: unable to read symbols

When trying to run my iOS app on a device, I get the following from GDB, and resulting in my app exiting just right after it started so I never get the chance to debug it. Anyone knows what I'm doing wrong or what I can do to fix it?
GNU gdb 6.3.50-20050815 (Apple version gdb-1470) (Thu May 27 05:54:06 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys002
sharedlibrary apply-load-rules all
warning: Unable to read symbols from "dyld" (prefix __dyld_) (not yet mapped into memory).
warning: Unable to read symbols for "(null)/Library/Frameworks/UIKit.framework/UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).
warning: Unable to read symbols from "Foundation" (not yet mapped into memory).
warning: Unable to read symbols for "(null)/Library/Frameworks/CoreGraphics.framework/CoreGraphics" (file not found).
warning: Unable to read symbols from "CoreGraphics" (not yet mapped into memory).
warning: Unable to read symbols from "AudioToolbox" (not yet mapped into memory).
warning: Unable to read symbols from "libgcc_s.1.dylib" (not yet mapped into memory).
warning: Unable to read symbols from "libSystem.B.dylib" (not yet mapped into memory).
warning: Unable to read symbols from "libobjc.A.dylib" (not yet mapped into memory).
warning: Unable to read symbols from "CoreFoundation" (not yet mapped into memory).
target remote-mobile /tmp/.XcodeGDBRemote-4572-43
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to thread 11523]
[Switching to thread 11523]
gdb stack crawl at point of internal error:
/SourceCache/gdb/gdb-1470/src/gdb/macosx/macosx-nat-dyld.c:1547: internal-error: unrecognized shared library breakpoint
A problem internal to GDB has been detected,
further debugging may prove unreliable.
0 gdb-arm-apple-darwin 0x0013117d internal_vproblem + 316
I have the same problem at the moment, but I believe it is to do with your frameworks.
Maybe try removing them and re-adding them to your project. Sorry I couldn't be more help, if I find a solution I will let you know.
*EDIT
Ignore the whole framework issue, the real problem is your IOS on your development screen. Make sure you have the latest version and that this matches your iphone's IOS.

Failed to launch simulated application: Unknown error

OS X 10.5.7 (genuine Mac)
Xcode 3.1.3
iPhone SDK 3.0
When I try to execute my iPhone application in simulator, I get the dreaded error message:
Failed to launch simulated application: Unknown error.
My application has two targets, but this error occurs on both of them.
When error occurs, the simulated OS hangs — it displays black screen and no longer responds on any input. Simulator application itself does not hang — all menus are active.
All other applications I've tried running (mostly Apple samples) do work fine. Purging of caches, rebooting and howling on the Moon did not helped. Rebuilding project from scratch did not helped either. I guess I have to do it again in smaller steps.
Meanwhile, are there any other things to try than these below?
Xcode | Empty Caches...
Delete directory /Library/Caches/com.apple.DeveloperTools.###
Full rebuild
Reboot
Change the product name (it did not contain any spaces anyway)
Create new project and configure it manually from scratch
A quote from the system.log:
12.08.09 0:13:59 [0x0-0xa70a7].com.apple.iphonesimulator[5368] -[MonitorController forwardEvents]: unable to send msg to ffffffff: 10000003
12.08.09 0:13:59 [0x0-0xa70a7].com.apple.iphonesimulator[5368] -[MonitorController forwardEvents]: unable to send msg to ffffffff: 10000003
12.08.09 0:14:03 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Unknown key for integer: JetsamPriority
12.08.09 0:14:03 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.apsd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 0:14:03 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 0:14:03 vot[9750] ******** AX INSPECTOR MODE ************
12.08.09 0:14:03 vot[9750] VoiceOverTouch exiting because accessibility is not enabled. To enable do this: 'defaults write com.apple.Accessibility AccessibilityEnabled true'
12.08.09 0:14:03 Xcode[9079] Error launching simulated application: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x39251e0 "Unknown error."
Note that something called VoiceOverTouch is mentioned in the log. My application does not contain (to the best of my knowledge) anything related to accessibility (could be brought in by some dependency though). I've enabled accessibility on my Mac as suggested in error message, but it did not helped. I've enabled Accessibility Inspector in the iPhone simulator. VoiceOverTouch message no longer appears in logs, but the Unknown error persists.
New logs:
12.08.09 11:01:20 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.AXInspector[10808]) Exited: Terminated
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Unknown key for integer: JetsamPriority
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.apsd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 11:01:28 vot[10812] ******** AX INSPECTOR MODE ************
12.08.09 11:01:28 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x2e9b930, has non-zero refcount = 1
12.08.09 11:01:28 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x495e240, has non-zero refcount = 1
12.08.09 11:01:28 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x2e9b930, has non-zero refcount = 1
12.08.09 11:01:28 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x495e240, has non-zero refcount = 1
12.08.09 11:01:28 Xcode[10200] Error launching simulated application: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x49b0060 "Unknown error."
12.08.09 11:01:29 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x44e4ba0, has non-zero refcount = 1
12.08.09 11:01:29 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x4537820, has non-zero refcount = 1
12.08.09 11:01:29 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x44e4ba0, has non-zero refcount = 1
12.08.09 11:01:29 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x4537820, has non-zero refcount = 1
12.08.09 11:01:29 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x4775400, has non-zero refcount = 1
12.08.09 11:01:29 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x478fa20, has non-zero refcount = 1
12.08.09 11:01:29 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x4775400, has non-zero refcount = 1
12.08.09 11:01:29 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x478fa20, has non-zero refcount = 1
Recreating project step-by-step showed that it was directory structure.
I've had directory named 'resources' with resources for my application. That directory was added to the bundle as is (via Folder References feature).
When I renamed that directory to less common name, error went away.
So, never name any custom directories in the bundle 'resources'.
Guys from Xcode (or simulator) team could improve their error reporting. I've had to spend whole day debugging this issue. :-(
I just encountered similar error after cleaning up our XCode projects and updated them to use XCode config files. It occured only to one of our iPhone application targets, not all of them.
XCode said
Error from Debugger: Failed to launch simulated application: Unknown error.
In Console, only information was following two lines:
30.9.2009 14.31.19 com.apple.launchd[99] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
30.9.2009 14.31.19 Xcode[13827] Error launching simulated application: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x389db50 "Unknown error."
It turned out that I had accidentally deleted Info.list file build setting from the target and neither XCode nor iPhone simulator could emit any useful error message about that. Adding a build setting again fixed the problem.
Looks like this is your key bit (doesn't normally come up in system log):
VoiceOverTouch exiting because accessibility is not enabled. To enable do this:
'defaults write com.apple.Accessibility AccessibilityEnabled true'
Your app has some dependency on accessibility being enabled. Suggest you follow the instruction and run the bit in quotes on your system console.
I'm worried about these two lines:
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.apsd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
It appears to me like your Xcode (specifically, the iPhone Simulator) installation is broken somehow. I'd suggest saving all your important files and reinstalling the SDK.
I had a similar issue with a different solution: some of my .xib files had a deployment target (2.0) that was no longer installed on my machine.
The solution was to open the xibs in Interface Builder, do cmd-opt-I to get the project info for each one, and make sure the deployment and development targets were set to correct versions.
I then did cmd-shift-K to clean the project in XCode, rebuilt, deployed, and everything seems to work fine.
Nothing above helped me - I went through all the suggestions. What eventually fixed it was deleting ~/Library/Application Support/iPhone Simulator. I then compiled and ran my app in the Simulator again, it recreated the directories, and my app ran fine. None of the accessibility or missing file errors were relevant.
To add to the above, i've had to resort to just creating a new project in my latest version of the SDK (this problem only raised its ugly head when I upgraded to 3.1.3). I then had to copy all my source files and resources over and reconfigure the build settings etc. This seems to cure the problem but it was a bit of work!
I was getting this problem when I had my Info.plist file set to export to the target. You might want to check that, de-selecting that option fixed the problem for me.
After an update of the SDK I had the same problem. None of the tips worked for me. Finally I´ve noticed in the plist file there was a space character after ${EXECUTABLE_NAME} which caused the problem.
I had a similar issue. I was also unable to install the app on a device, getting a 'The application bundle does not contain a valid identifier." error message. This was due to a directory named "Contents" added as a Folder Reference. I removed the reference, renamed the directory, add it again as a Folder Reference, clean the project, rebuild and voilà, I was able to launch the simulator.
I use the Rename Project option to change my project's name and everything worked after that. I think we're all dancing around any number of methods of "fixing" whatever internal files XCode uses to track what it's doing. Pretty frustrating bug.
Another reason for such an error message: a number in the executable file name (set in the projet plist file under "Executable file" key). The solution was to remove any number there, remove the application in the simulator, quit and relaunch xcode, rebuild, and tada, it's that simple :-(
For what it's worth, after reading this thread, I decided to just delete my targets and recreate them. Problem went away.
EDIT:
After thinking I had finally found a way of working through this, I discovered I still had issues.
The only surefire way I discovered to fix this issue is to create a new project from scratch. Then when adding new targets, rather than adding a new target, duplicate the existing target.
One thing I have noticed is that if the Project and the Targets have the GCC 4.2 settings on their settings page than everything seems to work fine. If, however, those settings are missing and instead is a section called 'User-Defined' than all sorts of weird errors occur.
I have no idea whether those settings are a symptom or the source of the problem. I have also discovered no way to consistently get the settings page to switch.
One solution, that I have seen work sometimes (but, also seen not work many other times) is to switch the active target to Device while a device is plugged in. In certain cases this causes the correct settings to load. Then when you switch back to Simulator the correct settings are still there and everything seems to work fine.
I believe I have also noticed the following: My original project file had the GCC settings on the Project Settings page. One of the targets had the settings and worked, the other target didn't and didn't work. I deleted all of the targets and re-added two new targets. After this the GCC settings disappeared on the project settings page and were also absent from the settings pages of any targets that I created. Nothing I did could change that. Any of the targets I tried to install in the simulator result in the simulator showing a black screen with an error message simply saying failed to run in the simulator with an unknown error.
Attempting to run those same targets on the device failed instantly without ever even attempting to compile (even after cleaning all targets) with an error saying something about invalid file.
I'd really love to know what's going on, but after 6 hours of no progress, I gave up and simply recreated the project and the targets as described above and everything works fine.
I believe that ultimately there are a spectrum of issues at play here. Some may be resolved by clean & rebuild, deleting preferences, etc.
None of these help resolve my issue.
I discovered that I had added some 3rd party code to my app that contained 1.) XIB files for their sample app and 2.) an info.plist file both of which erroneously had been added to my target.
Removing the XIB did not resolve the issue, but removing the info.plist file did.
Check your targets carefully and ensure that the assets that are being built and bundled are in fact needed.
I had the same issue. I had a lite scheme and a full version scheme. Neither radio button was selected under Launch. I wish I had taken a screenshot when it was in this state. As soon as I clicked "Automatically" it worked just fine.
Seems like a pretty glaring issue with XCode 4.
I had the same problem. Turned out the Info.plist was "missing" and had to be explicitly declared in the project settings. For some reason using the default name wasn't enough.