topskychen / voxelizer

A fast parallel CPU-based surface & solid voxelizer.
MIT License
76 stars 20 forks source link

some stl file can't voxelizer,but change gsize 128 it work. #4

Closed zhiansht closed 6 years ago

zhiansht commented 6 years ago

L used some stl file to test.But some stl file get errors,when l changed g_size to 128,it worked.what is the problem with that.

milo@miloub:/mnt/windows/tmp/tmp$ /home/milo/src/voxelizer/build/bin/voxelizer 512 4 test1.stl test1.vox voxelizer init... faces : 160 vertices : 400 space : (-244.833 -244.833 -244.833), (262.185 262.185 262.185) mesh bound : (-226.01 -230.651 -244.833), (262.185 205.403 185.754) done. voxelizer initialization consumes 0.0601079 s.

surface voxelizing... done. surface voxelization consumes 32.8134 s.

solid voxelizing... round 1... round 2... done. solid voxelization consumes 14.7395 s.

writing voxels to file... dim : 512 x 512 x 512 lower bound : (-244.833 -244.833 -244.833) voxel size : 0.99027 wrote 2046729 voxels writing file consumes 1.97082 s.

Error in `/home/milo/src/voxelizer/build/bin/voxelizer': munmap_chunk(): invalid pointer: 0x00007f4ef158c010 ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x77725)[0x7f4ef3059725] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x1a8)[0x7f4ef3065c18] /home/milo/src/voxelizer/build/bin/voxelizer(ZN12ArrayDeleterIN5boost7atomics6atomicIjEEEclEPKS3+0x23)[0x436c65] /home/milo/src/voxelizer/build/bin/voxelizer(_ZN5boost6detail18sp_counted_impl_pdIPNS_7atomics6atomicIjEE12ArrayDeleterIS4_EE7disposeEv+0x27)[0x43a1c5] /home/milo/src/voxelizer/build/bin/voxelizer(_ZN5boost6detail15sp_counted_base7releaseEv+0x42)[0x42c954] /home/milo/src/voxelizer/build/bin/voxelizer(_ZN5boost6detail12shared_countD1Ev+0x27)[0x42c9e7] /home/milo/src/voxelizer/build/bin/voxelizer(_ZN5boost10shared_ptrINS_7atomics6atomicIjEEED1Ev+0x1c)[0x42d98a] /home/milo/src/voxelizer/build/bin/voxelizer(_ZN9VoxelizerD1Ev+0x2b)[0x42bcc1] /home/milo/src/voxelizer/build/bin/voxelizer(main+0x2d1)[0x427657] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f4ef3002830] /home/milo/src/voxelizer/build/bin/voxelizer(_start+0x29)[0x4272b9] ======= Memory map: ======== 00400000-00456000 r-xp 00000000 08:01 1053806 /home/milo/src/voxelizer/build/bin/voxelizer 00656000-00657000 r--p 00056000 08:01 1053806 /home/milo/src/voxelizer/build/bin/voxelizer 00657000-00658000 rw-p 00057000 08:01 1053806 /home/milo/src/voxelizer/build/bin/voxelizer 00658000-00659000 rw-p 00000000 00:00 0 0175c000-017a6000 rw-p 00000000 00:00 0 [heap] 7f4ed0000000-7f4ed322f000 rw-p 00000000 00:00 0 7f4ed322f000-7f4ed4000000 ---p 00000000 00:00 0 7f4ed8000000-7f4edaa1a000 rw-p 00000000 00:00 0 7f4edaa1a000-7f4edc000000 ---p 00000000 00:00 0 7f4ee0000000-7f4ee304a000 rw-p 00000000 00:00 0 7f4ee304a000-7f4ee4000000 ---p 00000000 00:00 0 7f4ee8000000-7f4eeaa1b000 rw-p 00000000 00:00 0 7f4eeaa1b000-7f4eec000000 ---p 00000000 00:00 0 7f4eee587000-7f4eee588000 ---p 00000000 00:00 0 7f4eee588000-7f4eeed88000 rw-p 00000000 00:00 0 7f4eeed88000-7f4eeed89000 ---p 00000000 00:00 0 7f4eeed89000-7f4eef589000 rw-p 00000000 00:00 0 7f4eef589000-7f4eef58a000 ---p 00000000 00:00 0 7f4eef58a000-7f4eefd8a000 rw-p 00000000 00:00 0 7f4eefd8a000-7f4eefd8b000 ---p 00000000 00:00 0 7f4eefd8b000-7f4ef258d000 rw-p 00000000 00:00 0 7f4ef258d000-7f4ef2594000 r-xp 00000000 08:01 923300 /lib/x86_64-linux-gnu/librt-2.23.so 7f4ef2594000-7f4ef2793000 ---p 00007000 08:01 923300 /lib/x86_64-linux-gnu/librt-2.23.so 7f4ef2793000-7f4ef2794000 r--p 00006000 08:01 923300 /lib/x86_64-linux-gnu/librt-2.23.so 7f4ef2794000-7f4ef2795000 rw-p 00007000 08:01 923300 /lib/x86_64-linux-gnu/librt-2.23.so 7f4ef2795000-7f4ef27ad000 r-xp 00000000 08:01 923292 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f4ef27ad000-7f4ef29ac000 ---p 00018000 08:01 923292 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f4ef29ac000-7f4ef29ad000 r--p 00017000 08:01 923292 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f4ef29ad000-7f4ef29ae000 rw-p 00018000 08:01 923292 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f4ef29ae000-7f4ef29b2000 rw-p 00000000 00:00 0 7f4ef29b2000-7f4ef29bc000 r-xp 00000000 08:01 11633 /usr/lib/x86_64-linux-gnu/libccd.so.2.0 7f4ef29bc000-7f4ef2bbb000 ---p 0000a000 08:01 11633 /usr/lib/x86_64-linux-gnu/libccd.so.2.0 7f4ef2bbb000-7f4ef2bbc000 r--p 00009000 08:01 11633 /usr/lib/x86_64-linux-gnu/libccd.so.2.0 7f4ef2bbc000-7f4ef2bbd000 rw-p 0000a000 08:01 11633 /usr/lib/x86_64-linux-gnu/libccd.so.2.0 7f4ef2bbd000-7f4ef2bc7000 r-xp 00000000 08:01 11739 /usr/lib/x86_64-linux-gnu/libminizip.so.1.0.0 7f4ef2bc7000-7f4ef2dc6000 ---p 0000a000 08:01 11739 /usr/lib/x86_64-linux-gnu/libminizip.so.1.0.0 7f4ef2dc6000-7f4ef2dc7000 r--p 00009000 08:01 11739 /usr/lib/x86_64-linux-gnu/libminizip.so.1.0.0 7f4ef2dc7000-7f4ef2dc8000 rw-p 0000a000 08:01 11739 /usr/lib/x86_64-linux-gnu/libminizip.so.1.0.0 7f4ef2dc8000-7f4ef2de1000 r-xp 00000000 08:01 923337 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f4ef2de1000-7f4ef2fe0000 ---p 00019000 08:01 923337 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f4ef2fe0000-7f4ef2fe1000 r--p 00018000 08:01 923337 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f4ef2fe1000-7f4ef2fe2000 rw-p 00019000 08:01 923337 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f4ef2fe2000-7f4ef31a2000 r-xp 00000000 08:01 923146 /lib/x86_64-linux-gnu/libc-2.23.so 7f4ef31a2000-7f4ef33a1000 ---p 001c0000 08:01 923146 /lib/x86_64-linux-gnu/libc-2.23.so 7f4ef33a1000-7f4ef33a5000 r--p 001bf000 08:01 923146 /lib/x86_64-linux-gnu/libc-2.23.so 7f4ef33a5000-7f4ef33a7000 rw-p 001c3000 08:01 923146 /lib/x86_64-linux-gnu/libc-2.23.so 7f4ef33a7000-7f4ef33ab000 rw-p 00000000 00:00 0 7f4ef33ab000-7f4ef33c1000 r-xp 00000000 08:01 923184 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f4ef33c1000-7f4ef35c0000 ---p 00016000 08:01 923184 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f4ef35c0000-7f4ef35c1000 rw-p 00015000 08:01 923184 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f4ef35c1000-7f4ef36c9000 r-xp 00000000 08:01 923216 /lib/x86_64-linux-gnu/libm-2.23.so 7f4ef36c9000-7f4ef38c8000 ---p 00108000 08:01 923216 /lib/x86_64-linux-gnu/libm-2.23.so 7f4ef38c8000-7f4ef38c9000 r--p 00107000 08:01 923216 /lib/x86_64-linux-gnu/libm-2.23.so 7f4ef38c9000-7f4ef38ca000 rw-p 00108000 08:01 923216 /lib/x86_64-linux-gnu/libm-2.23.so 7f4ef38ca000-7f4ef3a3c000 r-xp 00000000 08:01 11140 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 7f4ef3a3c000-7f4ef3c3c000 ---p 00172000 08:01 11140 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 7f4ef3c3c000-7f4ef3c46000 r--p 00172000 08:01 11140 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 7f4ef3c46000-7f4ef3c48000 rw-p 0017c000 08:01 11140 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 7f4ef3c48000-7f4ef3c4c000 rw-p 00000000 00:00 0 7f4ef3c4c000-7f4ef3c70000 r-xp 00000000 08:01 634 /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 7f4ef3c70000-7f4ef3e6f000 ---p 00024000 08:01 634 /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 7f4ef3e6f000-7f4ef3e71000 r--p 00023000 08:01 634 /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 7f4ef3e71000-7f4ef3e72000 rw-p 00025000 08:01 634 /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 7f4ef3e72000-7f4ef3e75000 r-xp 00000000 08:01 10153 /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 7f4ef3e75000-7f4ef4074000 ---p 00003000 08:01 10153 /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 7f4ef4074000-7f4ef4075000 r--p 00002000 08:01 10153 /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 7f4ef4075000-7f4ef4076000 rw-p 00003000 08:01 10153 /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 7f4ef4076000-7f4ef47d8000 r-xp 00000000 08:01 159269 /usr/local/lib/libfcl.so 7f4ef47d8000-7f4ef49d7000 ---p 00762000 08:01 159269 /usr/local/lib/libfcl.so 7f4ef49d7000-7f4ef4a06000 r--p 00761000 08:01 159269 /usr/local/lib/libfcl.so 7f4ef4a06000-7f4ef4a0a000 rw-p 00790000 08:01 159269 /usr/local/lib/libfcl.so 7f4ef4a0a000-7f4ef4a10000 rw-p 00000000 00:00 0 7f4ef4a10000-7f4ef4fd2000 r-xp 00000000 08:01 11741 /usr/lib/x86_64-linux-gnu/libassimp.so.3.2.0 7f4ef4fd2000-7f4ef51d2000 ---p 005c2000 08:01 11741 /usr/lib/x86_64-linux-gnu/libassimp.so.3.2.0 7f4ef51d2000-7f4ef5298000 r--p 005c2000 08:01 11741 /usr/lib/x86_64-linux-gnu/libassimp.so.3.2.0 7f4ef5298000-7f4ef529a000 rw-p 00688000 08:01 11741 /usr/lib/x86_64-linux-gnu/libassimp.so.3.2.0 7f4ef529a000-7f4ef529f000 rw-p 00000000 00:00 0 7f4ef529f000-7f4ef52c5000 r-xp 00000000 08:01 923118 /lib/x86_64-linux-gnu/ld-2.23.so 7f4ef549f000-7f4ef54aa000 rw-p 00000000 00:00 0 7f4ef54c1000-7f4ef54c4000 rw-p 00000000 00:00 0 7f4ef54c4000-7f4ef54c5000 r--p 00025000 08:01 923118 /lib/x86_64-linux-gnu/ld-2.23.so 7f4ef54c5000-7f4ef54c6000 rw-p 00026000 08:01 923118 /lib/x86_64-linux-gnu/ld-2.23.so 7f4ef54c6000-7f4ef54c7000 rw-p 00000000 00:00 0 7fff720c4000-7fff720e5000 rw-p 00000000 00:00 0 [stack] 7fff7214f000-7fff72151000 r--p 00000000 00:00 0 [vvar] 7fff72151000-7fff72153000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] Aborted (core dumped) milo@miloub:/mnt/windows/tmp/tmp$ /home/milo/src/voxelizer/build/bin/voxelizer 128 4 test1.stl test1.vox voxelizer init... faces : 160 vertices : 400 space : (-244.833 -244.833 -244.833), (262.185 262.185 262.185) mesh bound : (-226.01 -230.651 -244.833), (262.185 205.403 185.754) done. voxelizer initialization consumes 0.011822 s.

surface voxelizing... done. surface voxelization consumes 0.806176 s.

solid voxelizing... round 1... round 2... done. solid voxelization consumes 0.140749 s.

writing voxels to file... dim : 128 x 128 x 128 lower bound : (-244.833 -244.833 -244.833) voxel size : 3.96108 wrote 120197 voxels writing file consumes 0.038398 s.

topskychen commented 6 years ago

Thanks for the feedback. I have found a suspect, but need more time to verify. Could you share with me your testing file for further proof? My email is topskychen@gmail.com. Thanks again.