I have a problem with one of my projects that I just cannot figure out. I have some code, which I have managed to compile and link on my Ubuntu laptop & desktop, one of my colleagues also managed to install it on his laptop, but now another colleague tries to compile it and he keeps running into "recipe for target '' failed". The problem is that this is the ONLY message that is being shown. From other sources I have found that this is probably an underlying program that is failing, but I have no clue what it could be or how to further debug it. Any ideas are very welcome. The complete make log:
[ 2%] Performing update step for 'MIPS_RELEASE'
HEAD is now at 8a3ade7... dataFormatStreamReader didn't stop at the end of the stream
[ 4%] Performing configure step for 'MIPS_RELEASE'
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- filesystem
-- system
-- program_options
-- serialization
-- unit_test_framework
-- Configuring done
-- Generating done
-- Build files have been written to: /home/daniel/repo/AdaLab/MIPS_RELEASE-prefix/src/MIPS_RELEASE-build
[ 7%] Performing build step for 'MIPS_RELEASE'
[100%] Built target mips
[ 9%] Performing install step for 'MIPS_RELEASE'
[100%] Built target mips
Install the project...
-- Install configuration: ""
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/lib/libmips.so
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/mips.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/weightedVariable.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/sum.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/count.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/mean.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/variance.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/histogram.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/compositeStatistic.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/compositeStatistic.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/sumSerialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/countSerialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/meanSerialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/varianceSerialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/histogramSerialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/compositeStatisticSerialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/statistics/concepts/statistic.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/tree/rootedPointerTree.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/tree/rootedPointerTree.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/tree/rootedPointerTreeSerialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/tree/defaultNodeIterator.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/tree/defaultNodeIterator.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/core/tree/rootedTreeTraits.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/optionClass.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/optionClass.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/optionClassSerialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/dataFormatStreamReader.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/dataFormatStreamReader.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/logger.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/logManager.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/sink.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/storeByPointer.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/storeByValue.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/storeBySmartPointer.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/storeByInheritance.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/wrapPointer.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/sequentialDatabaseWrapper.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/sequentialDatabaseWrapper.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/sequentialDatabaseIterator.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/concepts/storagePolicy.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/utilities/concepts/dataFormatConcept.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/namespace.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/concepts/attributeExtractor.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/attributeType.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/concepts/modelClassifier.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/classifier.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/concepts/modelPrinter.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/modelPrinter.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/concepts/test.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/modelPrinter.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/classifier.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/defaultLearner.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/defaultTree.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/serialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/concepts/splittingCriterium.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/defaultSplittingCriterium.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/defaultSplittingCriterium.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/noChangeDBWrapper.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/concepts/heuristic.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/varianceReduction.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/informationgain.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/whitneymann.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/decisionTree.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/detail/nodeInfo.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/detail/nodeData.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/detail/testInfo.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/detail/alwaysTrueExtraTest.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/detail/queryEngine.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/detail/queryEngine.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/detail/treePrinter.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/detail/treePrinter.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/detail/heuristicDecider.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/concepts/exampleGenerator.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/splitExampleGenerator.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/splitExampleGenerator.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/concepts/testGenerator.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/removeUsedTestGenerator.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/removeUsedTestGenerator.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/depthFirstDecisionTreeLearner.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/depthFirstDecisionTreeLearner.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/concepts/prePruner.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/pruneResult.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/noActionPruner.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/depthPruner.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/fTestPruner.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionTree/minimumLeafSizePruner.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/defaultForest.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/depthFirstForestLearner.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/classifier.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/modelPrinter.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/decisionForest.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/serialization.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/probabilisticForest.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/probabilisticSplittingCriterium.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/probabilisticSplittingCriterium.hxx
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/randomFractionForest.hpp
-- Up-to-date: /home/daniel/repo/AdaLab/mips_release/local/include/mips/prediction/decisionForest/randomFraction.hpp
[ 11%] Completed 'MIPS_RELEASE'
[ 19%] Built target MIPS_RELEASE
[ 64%] Built target adalab
[ 64%] Built target export-TEST_CONT_NETWORK
[ 64%] Built target export-TEST_HG_NETWORK
[ 64%] Built target export-TEST_HG_NETWORK2
[ 64%] Built target export-TEST_HG_NETWORK3
[ 66%] Built target testNetwork
[ 69%] Built target testVertex
[ 69%] Built target export-SAMPLING_NETWORK
[ 71%] Built target test_experimentalspacesampling
[ 73%] Built target test_experiments
[ 73%] Built target export-TEST_EXPERIMENT
[ 73%] Built target export-TEST_NETWORK
[ 73%] Built target export-TEST_NETWORK2
[ 73%] Built target export-TEST_NETWORKCONT
[ 76%] Built target testSimulator
[ 76%] Built target export-MY_NETWORK
[ 78%] Built target testExperimentSelector
[ 80%] Built target testSigmoid
[ 83%] Built target testSimulated
[ 85%] Built target testUnitStep
[ 88%] Building CXX object src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o
src/general/test/CMakeFiles/testGeneralFunctions.dir/build.make:54: recipe for target 'src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o' failed
CMakeFiles/Makefile2:1031: recipe for target 'src/general/test/CMakeFiles/testGeneralFunctions.dir/all' failed
Makefile:126: recipe for target 'all' failed
EDIT: Running make with -d option (only copied last lines related to testGeneralFunctions):
Pruning file 'src/general/test/CMakeFiles/testGeneralFunctions.dir/flags.make'.
Finished prerequisites of target file 'src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o'.
Must remake target 'src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o'.
Putting child 0x22042e0 (src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o) PID 5337 on the chain.
Live child 0x22042e0 (src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o) PID 5337
[ 88%] Reaping winning child 0x22042e0 PID 5337
Live child 0x22042e0 (src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o) PID 5338
Building CXX object src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o
Reaping winning child 0x22042e0 PID 5338
Live child 0x22042e0 (src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o) PID 5340
Reaping losing child 0x22042e0 PID 5340
src/general/test/CMakeFiles/testGeneralFunctions.dir/build.make:54: recipe for target 'src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o' failed
Removing child 0x22042e0 PID 5340 from chain.
Reaping losing child 0x14b8640 PID 5336
CMakeFiles/Makefile2:1031: recipe for target 'src/general/test/CMakeFiles/testGeneralFunctions.dir/all' failed
Removing child 0x14b8640 PID 5336 from chain.
Reaping losing child 0x10a9940 PID 5094
Makefile:126: recipe for target 'all' failed
Removing child 0x10a9940 PID 5094 from chain.
EDIT2:
src/general/test/CMakeFiles/testGeneralFunctions.dir/build.make:54
corresponds to:
$(CMAKE_COMMAND) -E cmake_progress_report /home/daniel/repo/AdaLab/CMakeFiles $(CMAKE_PROGRESS_1)
EDIT3:
Last lines of running make with verbose:
make[2]: Entering directory '/home/daniel/repo/AdaLab'
/usr/bin/cmake -E cmake_progress_report /home/daniel/repo/AdaLab/CMakeFiles 31
Putting child 0x1d014c0 (src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o) PID 11603 on the chain.
Live child 0x1d014c0 (src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o) PID 11603
[ 88%] Reaping winning child 0x1d014c0 PID 11603
Live child 0x1d014c0 (src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o) PID 11604
Building CXX object src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o
Reaping winning child 0x1d014c0 PID 11604
cd /home/daniel/repo/AdaLab/src/general/test && /usr/bin/c++ -std=c++0x -lstdc++ -lm -I/home/daniel/repo/AdaLab -I/home/daniel/repo/AdaLab/mips_release/local/include -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -I/usr/share/R/include -I/home/daniel/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include -I/home/daniel/R/x86_64-pc-linux-gnu-library/3.2/RInside/include -I/home/daniel/repo/AdaLab/inspector -I/home/daniel/repo/AdaLab/data -o CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o -c /home/daniel/repo/AdaLab/src/general/test/testGeneralFunctions.cpp
Live child 0x1d014c0 (src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o) PID 11606
Reaping losing child 0x1d014c0 PID 11606
src/general/test/CMakeFiles/testGeneralFunctions.dir/build.make:54: recipe for target 'src/general/test/CMakeFiles/testGeneralFunctions.dir/testGeneralFunctions.cpp.o' failed
Removing child 0x1d014c0 PID 11606 from chain.
make[2]: Leaving directory '/home/daniel/repo/AdaLab'
Reaping losing child 0x1e521d0 PID 11602
CMakeFiles/Makefile2:1031: recipe for target 'src/general/test/CMakeFiles/testGeneralFunctions.dir/all' failed
Removing child 0x1e521d0 PID 11602 from chain.
make[1]: Leaving directory '/home/daniel/repo/AdaLab'
Reaping losing child 0xd9b960 PID 11242
Makefile:126: recipe for target 'all' failed
Removing child 0xd9b960 PID 11242 from chain.
Don't really see that much more in there!
If you are using Unix Makefiles you can set the environment variable VERBOSE to see exactly what commands are being run, like this
cmake ..
VERBOSE=1 make
For those interested: the real problem was masked due to the fact that the logs did not include stderr, once I got this info it was fixed very quickly. (The logs were mailed to me as my colleague works abroad)
Related
I'm trying to write CMake tests to detect leaks using the leaks command line tool that comes with XCode on macOS. I've been using LSAN with the Homebrew install of LLVM, but the run times on my M1 are 100x more than what they are on an amd64 machine.
Here's an example C source file with a memory leak:
// memory-leak.c
#include <stdlib.h>
void *p;
int main()
{
p = malloc(7);
p = 0; // The memory is leaked here.
return 0;
}
After compiling with clang memory-leak.c -o memleak and running the leaks command leaks -quiet -atExit -- ./memleak, the output is
% leaks -quiet -atExit -- ./memleak
Process 22773 is not debuggable. Due to security restrictions, leaks can only show or save contents of readonly memory of restricted processes.
leaks Report Version: 4.0
Process 22773: 214 nodes malloced for 12 KB
Process 22773: 1 leak for 16 total leaked bytes.
1 (16 bytes) ROOT LEAK: 0x600002970050 [16]
I want to include this process as CMake test targets. The CMakeLists.txt file is:
#CMakeLists.txt
cmake_minimum_required(VERSION 3.18)
project(memleak)
find_program(LEAKS_PATH NAMES leaks REQUIRED True)
enable_testing()
add_executable(memleak memory-leak.c)
add_test(NAME memleak COMMAND leaks -quiet -atExit -- $<TARGET_FILE:memleak>)
set_tests_properties(memleak PROPERTIES WILL_FAIL True)
The resulting test hangs indefinitely. Here's the terminal command and output.
% mkdir build && cd build && cmake .. && cmake --build . && ctest --verbose
-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/leakstest/build
[ 50%] Building C object CMakeFiles/memleak.dir/memory-leak.c.o
[100%] Linking C executable memleak
[100%] Built target memleak
UpdateCTestConfiguration from :/Users/user/leakstest/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/Users/user/leakstest/build/DartConfiguration.tcl
Test project /Users/user/leakstest/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
Start 1: memleak
1: Test command: /usr/bin/leaks "-atExit" "--" "/Users/user/leakstest/build/memleak"
1: Test timeout computed to be: 10000000
1: Process 24942 is not debuggable. Due to security restrictions, leaks can only show or save contents of readonly memory of restricted processes.
1:
1: Process: memleak [24942]
1: Path: /Users/USER/*/memleak
1: Load Address: 0x100208000
1: Identifier: memleak
1: Version: ???
1: Code Type: ARM64
1: Platform: macOS
1: Parent Process: leaks [24941]
1:
1: Date/Time: 2022-05-17 18:38:15.553 -0500
1: Launch Time: 2022-05-17 18:38:15.282 -0500
1: OS Version: macOS 12.3.1 (21E258)
1: Report Version: 7
1: Analysis Tool: /Applications/Xcode.app/Contents/Developer/usr/bin/leaks
1: Analysis Tool Version: Xcode 13.3 (13E113)
1:
1: Physical footprint: 7233K
1: Physical footprint (peak): 7233K
1: ----
1:
1: leaks Report Version: 4.0
1: Process 24942: 214 nodes malloced for 12 KB
1: Process 24942: 1 leak for 16 total leaked bytes.
1:
1: 1 (16 bytes) ROOT LEAK: 0x600002840050 [16]
1:
The test never exits. I expect the test to pass since there's a memory leak and the CMake file specifies that the test will fail.
The output of build/ctest --verbose shows that leaks is picking up on the memory leak, but it seems that CTest isn't responding to leaks returning.
I've tried using a shell script that contains exec leaks -quiet -atExit -- "$#" in place of the command, but I get the same results.
I've also tried doing the same thing with a Meson build file and got the same result.
Is there something I'm missing?
I'm setting suricata on debian 10 to block expected request with run command as below:
/usr/bin/suricata -c /etc/suricata/suricata.yaml --pidfile /var/run/suricata.pid -q 3 -q 4 -q 5 -D -v --user=logstash
Whenever I receives a request which is matched to be blocked, example:
{"timestamp":"2021-12-16T14:59:09.855634+0000","flow_id":3110969609810,"event_type":"drop","src_ip":"192.168.1.5","dest_ip":"192.168.1.18","proto":"ICMP","icmp_type":8,"icmp_code":0,"drop":{"len":60,"tos":0,"ttl":128,"ipid":29443,"icmp_id":256,"icmp_seq":31241},"alert":{"action":"blocked","gid":1,"signature_id":1000002,"rev":1,"signature":"ICMP connection attempt","category":"","severity":3}}
Suricata will be stopped right after that with this error:
[4585] 16/12/2021 -- 14:59:09 - (respond-reject-libnet11.c:226) <Error> (RejectSendLibnet11L3IPv4ICMP) -- [ERRCODE: SC_ERR_LIBNET_INIT(144)] - libnet_inint failed: libnet_open_raw4(): SOCK_RAW allocation failed: Operation not permitted
[4577] 16/12/2021 -- 14:59:09 - (tm-threads.c:1807) <Error> (TmThreadCheckThreadState) -- [ERRCODE: SC_ERR_FATAL(171)] - thread W-NFQ#5 failed
Output of file capability is:
# getcap /usr/bin/suricata
/usr/bin/suricata = cap_net_admin,cap_net_raw,cap_sys_nice+eip
What could I do to make it work now?
i'm trying to build RabbitMQ-C (https://github.com/alanxz/rabbitmq-c) with SSL support. I have downloaded & built last openSSL version (https://github.com/openssl/openssl) , and added it. (the openssl libraries are in openssl root folder).
My terminal log :
Macbook:rabbitmq-c user$ mkdir build && cd build
Macbook:build user$ cmake .. -DOPENSSL_ROOT_DIR=~/openssl/openssl -DOPENSSL_LIBRARIES=~/openssl/openssl
Macbook:build user$ cmake --build . --target install
cmake .. :
-- The C compiler identification is AppleClang 7.0.2.7000181
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- CMAKE_BUILD_TYPE not specified. Creating Release build
-- Found C inline keyword: inline
-- Looking for getaddrinfo
-- Looking for getaddrinfo - found
-- Looking for socket
-- Looking for socket - found
-- Looking for htonll
-- Looking for htonll - found
-- Looking for poll
-- Looking for poll - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Looking for posix_spawnp in rt
-- Looking for posix_spawnp in rt - not found
-- Performing Test HAVE_GNU90
-- Performing Test HAVE_GNU90 - Success
-- Could NOT find POPT (missing: POPT_INCLUDE_DIR POPT_LIBRARY)
-- Could NOT find XMLTO (missing: XMLTO_EXECUTABLE)
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found OpenSSL: /Users/user/openssl/openssl/libssl.a;/Users/user/openssl/openssl/libcrypto.a (found suitable version "1.1.0", minimum required is "0.9.8")
-- Building rabbitmq as a shared library - yes
-- Building rabbitmq as a static library - yes
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/desktop/rabbitMQ/rabbitmq-c/build
cmake --build:
Scanning dependencies of target rabbitmq
[ 1%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_framing.c.o
[ 2%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_api.c.o
[ 3%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_connection.c.o
[ 4%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_mem.c.o
[ 5%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_socket.c.o
[ 6%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_table.c.o
[ 6%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_url.c.o
[ 7%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_tcp_socket.c.o
[ 8%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_time.c.o
[ 9%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_consumer.c.o
[ 10%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_openssl.c.o
[ 11%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_openssl_hostname_validation.c.o
[ 12%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_hostcheck.c.o
[ 12%] Linking C shared library librabbitmq.dylib
Undefined symbols for architecture x86_64:
"_SSL_CTX_clear_options", referenced from:
_amqp_ssl_socket_set_ssl_versions in amqp_openssl.c.o
"_SSL_CTX_set_options", referenced from:
_amqp_ssl_socket_new in amqp_openssl.c.o
_amqp_ssl_socket_set_ssl_versions in amqp_openssl.c.o
"_TLS_client_method", referenced from:
_amqp_ssl_socket_new in amqp_openssl.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [librabbitmq/librabbitmq.4.1.4.dylib] Error 1
make[1]: *** [librabbitmq/CMakeFiles/rabbitmq.dir/all] Error 2
make: *** [all] Error 2
Now i can't understand what's wrong.
p.s. OSX 10.11,
Solved. problem was in "Cmake"(used for rabbitmq wrapper build) - he does not work correct on OS X.
I writing program as simply server. In this moment I want to debug child process, but happens something not understand for me, because if I want to debug child space (I set follow-fork-mode child )I always get statement:
[Thread debugging using libthread_db enabled] Using host libthread_db
library "/lib/x86_64-linux-gnu/libthread_db.so.1". (gdb) set
follow-fork-mode child
[New process 24892] [Thread debugging using libthread_db enabled]
Using host libthread_db library
"/lib/x86_64-linux-gnu/libthread_db.so.1". [Switching to Thread
0xf7c61700 (LWP 24892)] Continuing with signal SIGABRT.
Program terminated with signal SIGABRT, Aborted. The program no longer
exists.
My program works as well if I just runing him, but if I want to debug not. Here is little part of my program. I want to show main loop server, because I think here is a main problem.
while (loopFlag) {
sin_size = sizeof infoAboutClientAddress;
if ((newDS = accept(serverFileDescriptor, (struct sockaddr *) &infoAboutClient,
&sin_size)) == -1) {
// can not accept connection
continue;
}
pid_t newProcessForClient = fork();
if (!newProcessForClient) {
// here a want to debug but always get above statement
printf("Hello here is child");
} else if (newProcessForClient < 0) {
// something is wrong with new proces
close(newDS);
} else if (newProcessForClient > 0) {
// code for parent
close(newDS);
}
}
I read below topic, but I still don't know how ignore this signal, or what can I do so as he dosen't appears.
gdb debugging child process after fork (follow-fork-mode child configured)
EDIT 1
Idea is for each client should be create separate process
EDIT 2
I have install GDB Debian 7.7.1
I run debug just from IDE nothing to write just Shift+F9. debug works as well if I moving into parent space.
Here is screen shot flags for debug
EDIT 3
Statements after command cmake -DCMAKE_BUILD_TYPE=Debug in direcytory with project
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to:
There is already some functionality in tensorflow to create benchmarks which can be seen in action for example in the adjust contrast op benchmark. If I run this on my machine, however, I just get an empty output:
panmari#dingle:~/tensorflow$ bazel run //tensorflow/core:kernels_adjust_contrast_op_benchmark_test --test_output=all --cache_test_results=no -- --benchmarks=1000
INFO: Found 1 target...
Target //tensorflow/core:kernels_adjust_contrast_op_benchmark_test up-to-date:
bazel-bin/tensorflow/core/kernels_adjust_contrast_op_benchmark_test
INFO: Elapsed time: 10.736s, Critical Path: 8.71s.
INFO: Running command line: bazel-bin/tensorflow/core/kernels_adjust_contrast_op_benchmark_test '--benchmarks=1000'.
Running main() from test_main.cc
Benchmark Time(ns) Iterations
--------------------------------
Is my invocation of wrong?
To invoke the benchmarks, run the following command (passing --benchmarks=all as the final argument):
$ bazel run -c opt //tensorflow/core:kernels_adjust_contrast_op_benchmark_test \
--test_output=all --cache_test_results=no -- --benchmarks=all
To run GPU benchmarks, you must pass --config=cuda to bazel and append _gpu to the name of the test target. For example:
$ bazel run -c opt --config=cuda \
//tensorflow/core:kernels_adjust_contrast_op_benchmark_test_gpu \
--test_output=all --cache_test_results=no -- --benchmarks=all