undefined symbol: __afl_area_ptr when trying to compile Kisak strike - cmake

I want to fuzz the map loading feature in counter strike. The source code for csgo got leaked a while back and here is a build which you can compile https://github.com/SwagSoftware/Kisak-Strike . However, when I try to compile it using this command:
AFL_USE_ASAN=1 PERSIST=1 cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_ROCKETUI=ON -DFREETYPE_LIBRARY=/usr/lib/x86_64-linux-gnu/libfreetype.so -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/freetype/ -DUSE_KISAK_PHYSICS=ON -DCMAKE_C_COMPILER=/home/cyberhacker/Asioita/Hakkerointi/Counterstrikestuff/aflpp/afl-gcc-fastthing/AFLplusplus/afl-gcc-fast -DCMAKE_CXX_COMPILER=/home/cyberhacker/Asioita/Hakkerointi/Counterstrikestuff/aflpp/afl-gcc-fastthing/AFLplusplus/afl-g++-fast ..
and then when i try to run ./csgo_linux64 , it throws this error:
Failed to load the launcher(bin/linux64/launcher_client.so) (/home/cyberhacker/Asioita/Csgocompile/withjump/game/bin/linux64/libtier0_client.so: undefined symbol: __afl_area_ptr)
I am expecting it to just work as usual (same as with the regular build). It works completely fine when I try to compile it normally with this command:
cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_ROCKETUI=ON -DFREETYPE_LIBRARY=/usr/lib/x86_64-linux-gnu/libfreetype.so -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/freetype/ -DUSE_KISAK_PHYSICS=ON -DCMAKE_C_COMPILER=/usr/bin/cc -DCMAKE_CXX_COMPILER=/usr/bin/c++ ..
and then make -j8
I searched a bit and found this: this . In that conversation they say that this error can be cause by compiling with afl-gcc but then linking with normal gcc or ld. However this is not the cause of my problem since I have looked through the cmake log files and the binaries are being linked with afl-g++-fast so this shouldn't be a problem in my case. I read somewhere that the libraries should be statically included, not dynamic but I do not think that it is a necessity. Feel free to look at the Kisak strike source code if you want to (obviously).

Related

Unreal engine build fails on google colab

I follow the steps specified in docs:
git clone -b 4.25 git#github.com:EpicGames/UnrealEngine.git
which results in:
Cloning into 'UnrealEngine'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
So I found a workaround by connecting my github account with EpicGames following the instructions here. Then I fork the UnrealEngine repo which is a private repo and you can't access it unless you connect your github account as specified earlier. Then I clone the fork:
git clone --depth 1 https://username:token#github.com/username/UnrealEngine.git
which results in
Cloning into 'UnrealEngine'...
remote: Enumerating objects: 111586, done.
remote: Counting objects: 100% (111586/111586), done.
remote: Compressing objects: 100% (83748/83748), done.
remote: Total 111586 (delta 26650), reused 92556 (delta 24736), pack-reused 0
Receiving objects: 100% (111586/111586), 236.57 MiB | 17.26 MiB/s, done.
Resolving deltas: 100% (26650/26650), done.
Checking out files: 100% (137999/137999), done.
Followed by the instructions specified in docs
cd UnrealEngine
./Setup.sh
./GenerateProjectFiles.sh
make
Which work perfectly fine until I get an error at the later stages of the build as shown below. You can check the full build log here
... truncated for readability
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/librpcsvc.a
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/libpthread.a
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/libmcheck.a
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/libnss_nisplus.so
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/crt1.o
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/libnss_dns.so
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/Scrt1.o
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/libc.a
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/libBrokenLocale.so
./v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/usr/lib64/libnsl.a
Target arch set to: x86_64-unknown-linux-gnu
Building ThirdParty libraries
If you don't see SUCCESS message in the end, then building did not finish properly.
In that case, take a look into /content/UnrealEngine/Engine/Build/BatchFiles/Linux/BuildThirdParty.log for details.
No third party libs needed to be built locally
********** SUCCESS ****************
Setup successful.
Attempting to set up UE4 pretty printers for gdb (existing UE4Printers.py, if any, will be overwritten)...
updated UE4Printers.py
no ~/.gdbinit file found - creating a new one.
Setting up Unreal Engine 4 project files...
Fixing inconsistent case in filenames.
Setting up Mono
Generating data for project indexing... 100%
Generating data for project indexing... 100%
Writing project files... 100%
Generating data for project indexing... 100%
Generating data for project indexing... 100%
Generating data for project indexing... 100%
Generating data for project indexing... 100%
Writing project files... 100%
bash "/content/UnrealEngine/Engine/Build/BatchFiles/Linux/Build.sh" CrashReportClient Linux Shipping
Fixing inconsistent case in filenames.
Setting up Mono
Running command : Engine/Binaries/DotNET/UnrealBuildTool.exe CrashReportClient Linux Shipping
Using 'git status' to determine working set for adaptive non-unity build (/content/UnrealEngine).
Creating makefile for CrashReportClient (no existing makefile)
Creating makefile for UnrealHeaderTool (no existing makefile)
------- Build details --------
Using toolchain located at '/content/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu'.
Using clang (/content/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang++) version '10.0.1' (string), 10 (major), 0 (minor), 1 (patch)
Using bundled libc++ standard C++ library.
Using lld linker
Using llvm-ar : /content/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/llvm-ar
Using fast way to relink circularly dependent libraries (no FixDeps).
------------------------------
Performing 38 actions (2 in parallel)
[1/38] Compile PCH.Core.h
[2/38] Compile PCH.CoreUObject.h
[3/38] Compile BuildSettings.cpp
[4/38] Compile Module.TraceLog.cpp
[5/38] Compile SharedPCH.Core.ShadowErrors.h
[6/38] Compile Module.Core.4_of_14.cpp
[7/38] Compile Module.Core.12_of_14.cpp
[8/38] Compile Module.Core.11_of_14.cpp
[9/38] Compile Module.Core.7_of_14.cpp
[10/38] Compile Module.Core.10_of_14.cpp
[11/38] Compile Module.Core.9_of_14.cpp
[12/38] Compile Module.Core.2_of_14.cpp
[13/38] Compile Module.Core.6_of_14.cpp
[14/38] Compile Module.Core.5_of_14.cpp
[15/38] Compile Module.Core.13_of_14.cpp
[16/38] Compile Module.Core.8_of_14.cpp
[17/38] Compile Module.Core.3_of_14.cpp
[18/38] Compile Module.Core.1_of_14.cpp
[19/38] Compile Module.Core.14_of_14.cpp
[20/38] Link (lld) libUnrealHeaderTool-TraceLog.so
[21/38] Link (lld) libUnrealHeaderTool-BuildSettings.so
[22/38] Compile Module.Json.cpp
[23/38] Link (lld) libUnrealHeaderTool-Core.so
[24/38] Compile Module.Projects.cpp
[25/38] Link (lld) libUnrealHeaderTool-Json.so
[26/38] Compile Module.CoreUObject.6_of_8.cpp
[27/38] Link (lld) libUnrealHeaderTool-Projects.so
[28/38] Compile Module.CoreUObject.2_of_8.cpp
[29/38] Compile Module.CoreUObject.7_of_8.cpp
[30/38] Compile Module.CoreUObject.1_of_8.cpp
[31/38] Compile Module.CoreUObject.8_of_8.cpp
[32/38] Compile Module.CoreUObject.4_of_8.cpp
[33/38] Compile Module.CoreUObject.5_of_8.cpp
[34/38] Compile Module.CoreUObject.3_of_8.cpp
[35/38] Compile Module.UnrealHeaderTool.cpp
[36/38] Link (lld) libUnrealHeaderTool-CoreUObject.so
[37/38] Link (lld) UnrealHeaderTool
[38/38] UnrealBuildTool.exe UnrealHeaderTool.target
Total time in Local executor: 472.22 seconds
Parsing headers for CrashReportClient
Running UnrealHeaderTool CrashReportClient "/content/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="/content/UnrealEngine/Engine/Programs/UnrealBuildTool/Log_UHT.txt"
src/tcmalloc.cc:283] Attempt to free invalid pointer 0x7fab74511030
Makefile:327: recipe for target 'CrashReportClient-Linux-Shipping' failed
make: *** [CrashReportClient-Linux-Shipping] Error 3
I tried solutions to similar issues proposed here, here, and here and nothing seems to fix the problem, and some cause other errors.
For some reason it performs a wrongful memory deallocation (likely deallocating twice):
Attempt to free invalid pointer 0x7fab74511030
This might be a better place to ask: https://issues.unrealengine.com

Custom build command does not work with `cargo publish` because CMake says the path would exceed CMAKE_OBJECT_PATH_MAX

My project can be built and run locally, but when running cargo publish I get an error:
PS C:\Users\jonat\Projects\vulkano_blas> cargo publish
Updating crates.io index
Packaging vulkano_blas v0.1.0 (C:\Users\jonat\Projects\vulkano_blas)
Verifying vulkano_blas v0.1.0 (C:\Users\jonat\Projects\vulkano_blas)
Compiling autocfg v1.0.0
Compiling lazy_static v1.4.0
Compiling maybe-uninit v2.0.0
Compiling libc v0.2.73
Compiling cfg-if v0.1.10
Compiling cc v1.0.58
Compiling proc-macro2 v1.0.19
Compiling scopeguard v1.1.0
Compiling unicode-xid v0.2.1
Compiling syn v1.0.35
Compiling vulkano v0.19.0
Compiling either v1.5.3
Compiling smallvec v1.4.1
Compiling vk-sys v0.5.2
Compiling half v1.6.0
Compiling fnv v1.0.7
Compiling itertools v0.9.0
Compiling crossbeam-utils v0.7.2
Compiling memoffset v0.5.5
Compiling crossbeam-epoch v0.8.2
Compiling shared_library v0.1.9
Compiling cmake v0.1.44
Compiling quote v1.0.7
Compiling shaderc-sys v0.6.2
Compiling crossbeam-queue v0.2.3
Compiling crossbeam-channel v0.4.3
Compiling crossbeam-deque v0.7.3
Compiling crossbeam v0.7.3
The following warnings were emitted during compilation:
warning: System installed library not found. Falling back to build from source
error: failed to verify package tarball
Caused by:
failed to run custom build command for `shaderc-sys v0.6.2`
Middle part removed due to its size
--- stderr
CMake Warning in spirv-tools/source/reduce/CMakeLists.txt:
The object file directory
C:/Users/jonat/Projects/vulkano_blas/target/package/vulkano_blas-0.1.0/target/debug/build/shaderc-sys-81aff4f7b9007197/out/build/spirv-tools/source/reduce/CMakeFiles/SPIRV-Tools-reduce.dir/./
has 191 characters. The maximum full path to an object file is 250
characters (see CMAKE_OBJECT_PATH_MAX). Object file
remove_unreferenced_instruction_reduction_opportunity_finder.cpp.obj
cannot be safely placed under this directory. The build may not work
correctly.
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_ASM_COMPILER
CMAKE_ASM_FLAGS
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', C:\Users\jonat\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.44\src\lib.rs:885:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Where does the problem lie? And how could I approach fixing this?
As the error says, the path is too long for CMake / Windows.
You might try to enable Long Paths support in Windows, or put your project in a shallower path.
Building in a shallower directory worked for me:
#.cargo/config.toml
[build]
# fixes CMAKE_OBJECT_PATH_MAX
target-dir = "C:/temp/crate_name"
While this can also be done with a compiler flag, that is not recommended because cargo clean etc will not work as expected.
A side note, Ive had some runtime linker errors using this method with embuild and an esp32. The solution there was to move the entire repo closer to root and keep the default target dir, its a bummer but no two ways about it.

library not found for -lReact

I'm getting this error in all my app builds now and I can't seem to figure it out.
I am using the .xcworkspace file
I had to rename the app. Used: react-native-app-id ...
This morning I was able to build/run on emulator. I tried to setup xcode to run on an actual device and now the universe hates me.
I can't even react-native start and react-native run-ios without getting these errors:
ld: warning: directory not found for option '-L/Users/gmike/Projects/promiscue/tribeoffive/TribeOfFive/ios/build/Build/Products/Debug-iphonesimulator/React'
ld: library not found for -lReact
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/tribe-of-five.app/tribe-of-five normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/tribe-of-five.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/tribe-of-five.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I've checked out a bunch of other stackoverflow articles.
I think this is telling:
Thoughts on how to un-mess up my env?
The error goes away when you remove libReact.a from the Xcode file tree (for me, it was under the Frameworks folder).
I also removed other files (they all had a transparent/white overlay on them which probably mean they were missing, actually couldn't open them in the finder neither)
Ok let's resolve this:
What to look for:
Here's a list of all the sub projects (or their products) that will cause XCode to throw that error when building a react-native project w/ cocoapods:
[
RCTActionSheet,
ART,
RCTBlob,
RCTCameraRoll,
RCTGeolocation,
RCTImage,
RCTLinking,
RCTAnimation,
RCTNetwork,
RCTPushNotification,
RCTTest,
RCTSettings,
RCTText,
RCTVibration,
RCTWebSocket,
]
Where to look for those weird project names:
First of all you'll look in the actual error message.
Here's a typical library not found error
Notice the ... /libART.a part?
That fellow is causing that error on my end.
In your case it can be any of the strings in the array above.
Found the troublemaker, what to do now?
Step 1: Remove the troublemaker project.
Let's try the lucky shot first:
Open the Project Navigator, and check if you can see the linked project that corresponds to the troublemaker string. In my case it was an XCode project called ART.
If you find it there, just remove it's reference, and you should be fine.
If that didn't work:
Open {Project Target} > Build Phases > Link binary with libraries and check wether you can see the troublemaker string in there. (It could be something like libArt.a depending on what's causing the issue on your end)
If that worked, forget the next step, otherwise move on:
Step 2: Delete the derived data directory, clean and rebuild
In my case (as seen in the raw error above) the derived data directory was /Users/sudoplz/Library/Developer/Xcode/DerivedData/MySuperApp-haxjchilyksewvdfcnnxwrulvyvy/Build/Products/Debug-iphonesimulator/
find yours in the error log, and delete it.
You can then clean XCode, shut it down, launch it again, and re-build.
Hopefully that should either fix the issue, or help you move on with fixing other stuff that may have gone wrong.
That's all folks.
Try to add that file to the libraries by finding libReact.a from the project, then clean and run Xcode.
or
Try to add libReact.a to your project "Build Phases" > Link binary with libraries, then clean and run Xcode.

Open Kinect - OpenNI, NITE - Compilation issues

I am busy trying to get the kinect working using Ubuntu 15.10. I have installed Libfreenect, OpenNI, NITE as well as SensorKinect.
I am able to run the programs in the OpenNI/Platform/Linux/Bin/x64-Release/ folder, for example Sample-NiUserTracker... However I have so far been unable to compile any of my own code.
I have tried to compile the examples in the Samples folder, for example SimpleViewer.java but I just get the following error:
SimpleViewerApplication.java:34: error: cannot find symbol
private SimpleViewer viewer;
^
symbol: class SimpleViewer
location: class SimpleViewerApplication
SimpleViewerApplication.java:66: error: cannot find symbol
app.viewer = new SimpleViewer();
^
symbol: class SimpleViewer
location: class SimpleViewerApplication
2 errors
I also tried to compile the C++ programs to no avail. Any suggestions on how to get something to compile would be awesome thanks.
Ok, so unfortunately you cannot just naively compile the example programs directly as they need to be linked with a whole bunch of files. One method of compiling without worrying about creating your own makefiles is to edit one of the existing files and go the OpenNI/Platform/Linux/Build and enter make. This will compile the example programs for you. and you can go to OpenNI/Platform/Linux/Bin/x64-Release and run the compile code.
Something that makes all this easier is to install PyOpenNI. Which enables you to code for the Kinect in glorious Python.
You can see full instructions at my github page https://github.com/RobbieJKatz/Kinect.

Not getting TBB to compile test examples

I am not getting TBB to work. I am following the steps in the "Getting started" document.
I am doing the following steps:
downloading the linux files + the sources files.
extracting them in 1 directory
calling make
going to tbb.../bin calling source tbbvars.sh intel64
going to examples/Getting_started/sub_string_finder
calling make
I then get the error:
sub_string_finder.cpp:32:30: fatal error: tbb/parallel_for.h: No such file or directory
I really googled a lot but can't find any related stuff.
I did also try to add some -I statement but it didnt help
I assume it is kind of a including/linking problem but I dont know how to fix.
This is all done on fedora 16 64bit. (kernel 3.1.4) // TBB version 4.0
The solution was to install tbb-devel package.