Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #14: test_color_tree Failing on Ubuntu 16.04 #168

Closed
choi1995 opened this issue May 10, 2017 · 7 comments
Closed

Test #14: test_color_tree Failing on Ubuntu 16.04 #168

choi1995 opened this issue May 10, 2017 · 7 comments

Comments

@choi1995
Copy link

14/14 Testing: test_color_tree
14/14 Test: test_color_tree
Command: "/home/ubuntu/Downloads/octomap-1.9.0/bin/test_color_tree"
Directory: /home/ubuntu/Downloads/octomap-1.9.0/build/octomap/src/testing
"test_color_tree" start time: May 10 11:00 PDT
Output:

test failed: 3431!=1034 in /home/ubuntu/Downloads/octomap-1.9.0/octomap/src/testing/test_color_tree.cpp, line 52

Test time = 0.24 sec

// should already be pruned
EXPECT_EQ(tree.size(), tree.calcNumNodes());
const size_t initialSize = tree.size();
EXPECT_EQ(initialSize, 1034); <----- failing on this line
tree.prune();
EXPECT_EQ(tree.size(), tree.calcNumNodes());
EXPECT_EQ(initialSize, tree.size());

All tests seem to be passing on OSX so this issue seems to be confined to ubuntu, or my machine in particular. Any ideas why?

Thank you.

@ahornung
Copy link
Member

That's weird, I cannot reproduce the issue. Is that a clean build? What's the gcc version?

armin@x230:~/code/octomap/build$ make test
Running tests...
Test project /home/armin/code/octomap/build
      Start  1: MathVector
 1/14 Test  #1: MathVector .......................   Passed    0.00 sec
      Start  2: MathPose
 2/14 Test  #2: MathPose .........................   Passed    0.00 sec
      Start  3: InsertRay
 3/14 Test  #3: InsertRay ........................   Passed    1.06 sec
      Start  4: InsertScan
 4/14 Test  #4: InsertScan .......................   Passed    0.52 sec
      Start  5: ReadGraph
 5/14 Test  #5: ReadGraph ........................   Passed    0.02 sec
      Start  6: StampedTree
 6/14 Test  #6: StampedTree ......................   Passed    1.06 sec
      Start  7: OcTreeKey
 7/14 Test  #7: OcTreeKey ........................   Passed    0.01 sec
      Start  8: test_scans
 8/14 Test  #8: test_scans .......................   Passed    0.14 sec
      Start  9: test_raycasting
 9/14 Test  #9: test_raycasting ..................   Passed    1.63 sec
      Start 10: test_io
10/14 Test #10: test_io ..........................   Passed    0.58 sec
      Start 11: test_pruning
11/14 Test #11: test_pruning .....................   Passed    0.03 sec
      Start 12: test_iterators
12/14 Test #12: test_iterators ...................   Passed    0.61 sec
      Start 13: test_mapcollection
13/14 Test #13: test_mapcollection ...............   Passed    0.29 sec
      Start 14: test_color_tree
14/14 Test #14: test_color_tree ..................   Passed    0.09 sec

100% tests passed, 0 tests failed out of 14

Total Test time (real) =   6.05 sec
armin@x230:~/code/octomap/build$ git status
HEAD detached at v1.9.0
nothing to commit, working directory clean
armin@x230:~/code/octomap/build$ cat /etc/issue
Ubuntu 16.04.2 LTS \n \l

@ahornung ahornung closed this as completed Dec 2, 2019
@tkircher
Copy link

tkircher commented Jul 2, 2020

I'm having this same exact issue on Ubuntu 18.04. Most recent octomap pulled from the repository. The error happens when it's built as Release, but not when it's built as Debug. GCC version is 7.5.0-3ubuntu1~18.04. Probably not critical, since a comment right above where the error occurs says the octree should already be pruned, before it checks the size, so maybe something is being optimized out.

@ahornung
Copy link
Member

ahornung commented Jul 2, 2020

@tkircher, this sounds like the problem described in #287. Do the changes from #288 also fix the problem for you?

@tkircher
Copy link

tkircher commented Jul 3, 2020

It doesn't fix it. Also, it doesn't matter what optimization the library is built with. It's the test file itself that's the problem. Building the test with -O1 doesn't trigger the error, but building with -O2 does.

@tkircher
Copy link

Incidentally, this bug is still present in the octomap-1.9.6 release.

@ahornung
Copy link
Member

ahornung commented Apr 21, 2021

@tkircher sorry to hear that! I'm still having problems reproducing the issue on an Ubuntu 18.04 machine.

The build jobs and unit tests all pass and build as "Release" by default.

With my local build of master or v1.9.6 both build and tests succeed for both "Release" (uses -O3) and "RelWithDebInfo" (uses -O2):

[...]

[100%] Linking CXX executable ../../../../bin/exampleEDTOctomapStamped
cd /home/armin/code/octomap/build/dynamicEDT3D/src/examples && /usr/bin/cmake -E cmake_link_script CMakeFiles/exampleEDTOctomapStamped.dir/link.txt --verbose=1
/usr/bin/c++   -Wall -Wno-error  -O2 -g -DNDEBUG  -rdynamic CMakeFiles/exampleEDTOctomapStamped.dir/exampleEDTOctomapStamped.cpp.o  -o ../../../../bin/exampleEDTOctomapStamped  -L/home/armin/code/octomap/lib -Wl,-rpath,/home/armin/code/octomap/lib ../../../../lib/libdynamicedt3d.so.1.9.6 -loctomap -loctomath 
make[2]: Verzeichnis „/home/armin/code/octomap/build“ wird verlassen
[100%] Built target test_io
make[2]: Verzeichnis „/home/armin/code/octomap/build“ wird verlassen
make[2]: Verzeichnis „/home/armin/code/octomap/build“ wird verlassen
[100%] Built target exampleEDTOctomap
[100%] Built target exampleEDTOctomapStamped
make[1]: Verzeichnis „/home/armin/code/octomap/build“ wird verlassen
/usr/bin/cmake -E cmake_progress_start /home/armin/code/octomap/build/CMakeFiles 0
armin@workstation:~/code/octomap/build$ make test
Running tests...
Test project /home/armin/code/octomap/build
      Start  1: MathVector
 1/14 Test  #1: MathVector .......................   Passed    0.00 sec
      Start  2: MathPose
 2/14 Test  #2: MathPose .........................   Passed    0.00 sec
      Start  3: InsertRay
 3/14 Test  #3: InsertRay ........................   Passed    0.75 sec
      Start  4: InsertScan
 4/14 Test  #4: InsertScan .......................   Passed    0.31 sec
      Start  5: ReadGraph
 5/14 Test  #5: ReadGraph ........................   Passed    0.02 sec
      Start  6: StampedTree
 6/14 Test  #6: StampedTree ......................   Passed    1.03 sec
      Start  7: OcTreeKey
 7/14 Test  #7: OcTreeKey ........................   Passed    0.00 sec
      Start  8: test_scans
 8/14 Test  #8: test_scans .......................   Passed    0.08 sec
      Start  9: test_raycasting
 9/14 Test  #9: test_raycasting ..................   Passed    0.99 sec
      Start 10: test_io
10/14 Test #10: test_io ..........................   Passed    0.38 sec
      Start 11: test_pruning
11/14 Test #11: test_pruning .....................   Passed    0.02 sec
      Start 12: test_iterators
12/14 Test #12: test_iterators ...................   Passed    0.42 sec
      Start 13: test_mapcollection
13/14 Test #13: test_mapcollection ...............   Passed    0.17 sec
      Start 14: test_color_tree
14/14 Test #14: test_color_tree ..................   Passed    0.06 sec

100% tests passed, 0 tests failed out of 14

Total Test time (real) =   4.23 sec
armin@workstation:~/code/octomap/build$ uname -a
Linux workstation 5.4.0-72-generic #80~18.04.1-Ubuntu SMP Mon Apr 12 23:26:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
armin@workstation:~/code/octomap/build$ cat /etc/issue
Ubuntu 18.04.5 LTS \n \l

         
armin@workstation:~/code/octomap/build$ ../bin/test_color_tree 


Writing to / from file
===============================
Writing color tree to simple_color_tree.ot
Reading color tree from simple_color_tree.ot
Performing some queries:
READ: occupancy probability at (0 0 0):  0.7
color of node is: (175 175 175)
WRITE: occupancy probability at (0 0 0):         0.7
color of node is: (175 175 175)
occupancy probability at (-1 -1 -1):     0.7
color of node is: (15 15 15)
READ: occupancy probability at (-1 -1 -1):       0.7
color of node is: (15 15 15)
WRITE: occupancy probability at (-1 -1 -1):      0.7
color of node is: (15 15 15)
occupancy probability at (1 1 1):        is unknown
READ: occupancy probability at (1 1 1):  is unknown
WRITE: occupancy probability at (1 1 1):         is unknown

Pruning / expansion
===============================
Initial size: 1034
Size after expansion: 89234

Creating / deleting nodes
===============================
Initial size: 1034
Size after one insertion: 1040
armin@workstation:~/code/octomap/build$ c++ -v
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) 
armin@workstation:~/code/octomap/build$ 

@tkircher
Copy link

Well, the section that's returning a different value in test_color_tree.cpp is the middle loop where tree.updateNode(endpoint, false); is called. I had a quick look with gdb, and I got as far as seeing that computeChildIdx from octomap/include/octomap/OcTreeKey.h starts doing different things depending on optimization level. Not sure if that's a cause or effect. The runtime is significantly longer with the debug version, but all the other tests pass, so maybe it's fine to just ignore it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants