iOS - Address Sanitizer and Undefined Behaviour Sanitizer compiler error - c++

When we try to compile our C++ iOS game app with these two profilers in Xcode, we're getting the following linker error.
Ditto /Users/Max/Library/Developer/Xcode/DerivedData/TowerDuel-dsejjkbvgengpngaqrfokeoaquvx/Build/Products/Debug-iphoneos/TowerDuel-mobile.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib /Users/Max/Documents/XcodeWorkspace/TowerDuelWorkspace/TowerDuel/lib/clang/8.1.0/lib/darwin/libclang_rt.asan_ios_dynamic.dylib
cd /Users/Max/Documents/XcodeWorkspace/TowerDuelWorkspace/TowerDuel/proj.ios_mac
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/usr/bin/ditto -rsrc /Users/Max/Documents/XcodeWorkspace/TowerDuelWorkspace/TowerDuel/lib/clang/8.1.0/lib/darwin/libclang_rt.asan_ios_dynamic.dylib /Users/Max/Library/Developer/Xcode/DerivedData/TowerDuel-dsejjkbvgengpngaqrfokeoaquvx/Build/Products/Debug-iphoneos/TowerDuel-mobile.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib
ditto: can't get real path for source '/Users/Max/Documents/XcodeWorkspace/TowerDuelWorkspace/TowerDuel/lib/clang/8.1.0/lib/darwin/libclang_rt.asan_ios_dynamic.dylib'
Command /usr/bin/ditto failed with exit code 1
It seems like it's trying to use some iOS 8.1 library, even though our deployment target is iOS 9.
How can we fix this?
EDIT: Just to clarify, the issue also happens when only using ONE of these at the same time.

Related

Compile Gstreamer/orc 0.4.32 on ubuntu1804 for arm running in rootfs using ninja occur undefined reference exception

I am trying to compile gstreamer/orc on ubuntu_1804 for arm which running on rootfs my android mobile phone, but something wrong like this:
I tried some option (-j 1) to make it compile with single thread, but still not working.

Simulation terminated with exit code: 132

I am Mac OS 10.11 (El Capitan) user. I used 4.6 and when I tried to build some simulation I always get "Simulation terminated with exit code: 139" and couldn’t do nothing at all with that. I thought that when I install 5.0 then everything will be fine, but now I get something like that:
Simulation terminated with exit code: 132
Working directory: /Users/JL_Data/omnetpp-5.0/samples/tictoc
Command line: tictoc -r 0 --debug-on-errors=false omnetpp.ini
Environment variables:
PATH=/Users/JL_Data/omnetpp-5.0/bin::/usr/bin:/bin:/usr/sbin:/sbin
DYLD_LIBRARY_PATH=/Users/JL_Data/omnetpp-5.0/lib::
OMNETPP_IMAGE_PATH=/Users/JL_Data/omnetpp-5.0/images
And when I tried open some simulation in terminal I get:
Illegal instruction: 4
Do you have some idea what can I do with that problem? I tried to find something on the internet, but after one day I do not get any idea.
If you need some more information, please let me know.
As it is right now, your question is not completely clear, since it requires one to be familiar with omnet++ and probably some experience installing and setting it up. However, let me make a couple guesses.
First, Illegal instruction. This usually occurs when the binary was built for an architecture different than the one it's being run on; e.g. when then SSE2 or AVX instructions are present in the binary code, but are missing on the CPU.
See, for example, this SO question:
Find which assembly instruction caused an Illegal Instruction error without debugging
There is also a question that discusses exactly your problem, namely, "Illegal instruction: 4" on OS X:
What is the "Illegal Instruction: 4" error and why does "-mmacosx-version-min=10.x" fix it?
Now, since omnet++ appears to be an open source project, I expect it to have a mailing list and / or an IRC channel. Indeed, here is the communications page on the official website that links to a Google Groups-based mailing list:
https://omnetpp.org/get-involved
https://groups.google.com/forum/#!forum/omnetpp
I advise you to get in touch with the developers with a thorough description of your problem, since the chances of them knowing the solution are significantly higher compared to the chances of there being a user on SO who has faced similar problems when installing an identical version of omnet++ on an identical version of Mac OS X.

Unable to run Woden Physics Example in Pharo

I am trying to run the Woden Physics Example inside Pharo which involves getting Bullet properly compiled and the smalltalk bindings properly installed in Pharo.
I am using Linux Mint 17 x64.
But NativeBoost seems unable to load the compiled libraries. I have been using the sources provided here:
https://github.com/ronsaldo/bullet-pharo
https://github.com/ronsaldo/swig
I built the modified version of swig as well as the bullet libraries and bindings with the provided build scripts.
I also have doublechecked that the bullet libraries are 32 bit.
Opening up the Woden physics example returns this error:
failed to get a symbol address:
PharoNB_new_BTDefaultCollisionConfiguration__SWIG_1
When examining the call stack in the debugger, it turns out that the module handle is 0.
I verified this by executing the same message as
BulletCInterface nbLibraryNameOrHandle
executes:
NativeBoost forCurrentPlatform loadModule: 'BulletPharo'
This message returns 0. I tried to specify the full path to libPharoBullet.so in the workspace, like:
NativeBoost forCurrentPlatform loadModule:
'/home/martin/.local/share/Pharo/bullet-pharo/libBulletPharo.so'
with the same result. I also verified it with a 32 bit system library of mine (liblzma) and there NativeBoost was able to load it, as it returned a non-zero handle.
So i suspect something during compilation went wrong...
I also did
readelf -h libPharoBullet.so
and its ABI was "UNIX - GNU" while the ABI of pharo-vm is "UNIX - System V"
Could this be the problem here ?
How can i force the ABI to be System V when compiling ? I use gcc 4.8.2
Or what steps could i otherwise perform ?

Rcpp error, learning Rcpp and C++ on mac

I've decided to start learning Rcpp and C++ so I can make aspects of my R code faster. For a start I'm using the tutorial hadley has in the devtools wiki. I have a c++ compiler on this machine in that it's a mac and I have xcode installed on it - I'm told that puts the c++ compiler on the machine. I try to run the first example:
cppFunction('
int one(){
return 1;
}
')
However, what happens is:
sh: make: command not found
Error in sourceCpp(code = code, env = env, rebuild = rebuild, showOutput = showOutput, :
Error 1 occurred building shared library.
I'm guessing I have a setup issue, but what to do I'm not sure. For a general C++ knowlege I've started reading Absolute C++ by Savitch, which so far does not actually tell you anything about setting up a machine with compiler etc, because you're instructed to use something called MyProgrammingLab which just tells you if you got the answer right or not and gives output, you don't go through the compilation or anything like that.
Thanks,
Ben W.
Errors of the type sh: foo: command not found are pretty obvious. You are lacking the make command. Install it, and try again. Or if Xcode installs it outside of the path, add it to the path.

DOS-reported error: Bad file number

I have a batch file that tries to compile a static library using Borland C++ Builder 6.0
It is called from Borland make (makefile created with bpr2mak) which is called from a .bat file (used to compile the whole project with Visual Studio and some Borland C++ Builder legacy projects), which is called from a bash shell script running inside Cygwin.
When I run the .bat file directly from a Cygwin shell, it runs OK, but when its being run from a Program calling cygwin with Boost::Process::launcher I'm getting this error:
C:\ARQUIV~1\Borland\CBUILD~1\Bin\..\BIN\TLib /u bclibs.lib #MAKE0000.###
DOS-reported error: Bad file number
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
opening 'MAKE0000.###'
** error 1 ** deleting bclibs.lib
It's a complicated scenario, but this Program which calls cygwin is run whenever we need to build our software package which needs to be build for various Linux distos and Windows 32 and 64-bit.
Note: It's the only Borland Project failing, the other compile just fine (it's the only static library using borland also, so it can be some problem with the TLib tool.
The problem was that TLib does not like to have his output redirected (seen here) without having an input pipe as well. Solved by creating an input pipe to in the Boost::Process::launcher using set_stdin_behavior
I'm just guessing here, but this may have to do with long filenames and/or spaces in paths.
1) Modify your makefile so it would save current environment to a file, immediately before executing the failing command (set > d:\env.txt & echo CD=%CD% >> d:\env.txt). Then run it both ways (directly and via program) and compare the environments of good run and bad run.
2) Using filemon from Sysinternals, capture logs of disk access in both cases (these logs are going to be huge, though you can uncheck everything except Open in the filter to reduce the size). Again, compare and check for clues...
3) Try instaling everything involved to paths conforming to 8.3 scheme.
This error is not related to C++ itself. It happens when your build script opens too much files (more than defined in DOS command processor environment). To resolve this issue try to set value of files variable to 253. For Windows XP this variable defined in the file %WINDIR%\system32\config.nt.
files=253
Seems it is known bug in Borland C++ tools. Here is description and possible workaround for this issue:
Problem: Some static Lib projects will
not link correctly when compiled. You might see something
like this :
J:\Borland\CBUILD~1\bin\..\BIN\TLib /u debug\jpegD.lib #MAKE0000.###
DOS-reported error: Bad file number
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
opening 'MAKE0000.###'
** error 1 ** deleting debug\jpegD.lib
MAKE failed, returned : 1
Workaround : In some cases (where the "Bad file number" error is seen) it may be possible to work around this by specifying -tDEFLIB.BMK in the BPR2MAKE Options field, and Turning off the "Capture Make Output" option.
I have not tested it, but I hope that helps.