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

[Error] I got some trouble when I loaded PCD file in pcl1.9.1 #5325

Closed
kyoasu opened this issue Jul 13, 2022 · 6 comments
Closed

[Error] I got some trouble when I loaded PCD file in pcl1.9.1 #5325

kyoasu opened this issue Jul 13, 2022 · 6 comments
Labels
status: triage Labels incomplete

Comments

@kyoasu
Copy link

kyoasu commented Jul 13, 2022

When I use pcl::io::loadPCDFile to load my data, I have encountered the following problem. Debug reports an error when the ide stays on this page
image

When I use gdb to trace the problem, show this
image

and this is the code for how I load the data
image

@kyoasu kyoasu added the status: triage Labels incomplete label Jul 13, 2022
@mvieth
Copy link
Member

mvieth commented Jul 13, 2022

  • Which operating system do you use?
  • How did you install PCL?
  • Which compiler do you use?
  • How do you compile your own project? If you use CMake, please post your CMakeLists.txt

@kyoasu
Copy link
Author

kyoasu commented Jul 13, 2022

  • Ubuntu20.04
  • I installed pcl by compiling the source code
  • gcc-9.5
  • Yep, I compiled my own project, here is my CMakeLists.txt
    cmake_minimum_required(VERSION 3.5)
    project(XLZAMultiPerception)
    set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
    set(CMAKE_CXX_STANDARD 14)
    ADD_COMPILE_OPTIONS(-std=c++14 )
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_MATH_DISABLE_FLOAT128")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_DONT_VECTORIZE")

############################ set output path #################################
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/)

############################# include directories #################################
INCLUDE_DIRECTORIES(
/usr/local/cuda/include
/opt/XLZALibs/flann1.8-noGPU/include
/home/xxx/InstallPackage/eigen3.3.9/include/eigen3
/opt/XLZALibs/pcl-1.9.1-noGPU/include/pcl-1.9
/home/xxx/InstallPackage/vtk9.1.0WithQt/include/vtk-9.1
/home/xxx/InstallPackage/Opencv-4.5.1/include
/home/xxx/InstallPackage/protobuf3.10.0/include
/home/xxx/InstallPackage/boost1.70.0/include
/home/xxx/InstallPackage/yaml-cpp0.7.0/include
)

include_directories(${PROTOBUF_INCLUDE_DIRS} BEFORE)

INCLUDE_DIRECTORIES(.)
INCLUDE_DIRECTORIES(./src)

######################### generate .so library ########################################

file(GLOB_RECURSE OpenCV_LIBRARIES /home/xxx/InstallPackage/Opencv-4.5.1/lib/x86_64-linux-gnu/.so)
file(GLOB_RECURSE PCL_LIBRARIES /opt/XLZALibs/pcl-1.9.1-noGPU/lib/
.so)
file(GLOB_RECURSE VTK_LIBRARIES /home/xxx/InstallPackage/vtk9.1.0WithQt/lib/.so)
file(GLOB_RECURSE BOOST_LIBRARIES /home/xxx/InstallPackage/boost1.70.0/lib/
.so)
file(GLOB_RECURSE PROTOBUF_LIBRARIES /home/xxx/InstallPackage/protobuf3.10.0/lib/.so)
file(GLOB_RECURSE YAML_LIBRARIES /home/xxx/InstallPackage/yaml-cpp0.7.0/lib/
.so)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

############################ Specify src code directory #################################
file(GLOB_RECURSE SRC_PRJ_APP ${PROJECT_SOURCE_DIR}/src/app/.cpp)
file(GLOB_RECURSE SRC_PRJ_BASE ${PROJECT_SOURCE_DIR}/src/base/
.cpp src/base/.hpp)
file(GLOB_RECURSE SRC_PRJ_COMMON ${PROJECT_SOURCE_DIR}/src/common/
.cpp)
file(GLOB_RECURSE SRC_PRJ_CONFIG ${PROJECT_SOURCE_DIR}/src/configuration/*.cpp)

file(GLOB_RECURSE SRC_PRJ_VIS ${PROJECT_SOURCE_DIR}/src/visualization/*.cpp)

file(GLOB_RECURSE SRC_PRJ_RADAR_PERCEPTION ${PROJECT_SOURCE_DIR}/src/radar_perception/.cpp
${PROJECT_SOURCE_DIR}/src/radar_perception/common/
.cpp
${PROJECT_SOURCE_DIR}/src/radar_perception/preprocess/cpu/.cpp
${PROJECT_SOURCE_DIR}/src/radar_perception/cluster/cpu/
.cpp
${PROJECT_SOURCE_DIR}/src/radar_perception/process/cpu/.cpp
${PROJECT_SOURCE_DIR}/src/radar_perception/process/common/
.cpp)

file(GLOB_RECURSE SRC_PRJ_TRACK ${PROJECT_SOURCE_DIR}/src/track/cpu/.cpp
${PROJECT_SOURCE_DIR}/src/track/common/
.cpp)

file(GLOB_RECURSE SRC_PRJ_UTILS ${PROJECT_SOURCE_DIR}/src/utils/*.cpp)

file(GLOB_RECURSE SRC_PRJ_PUBLISH ${PROJECT_SOURCE_DIR}/src/publish_data/*.pb.cc)

file(GLOB_RECURSE SRC_PRJ_FILES ${SRC_PRJ_APP} ${SRC_PRJ_BASE} ${SRC_PRJ_COMMON} ${SRC_PRJ_PUBLISH} ${SRC_PRJ_VIS}
${SRC_PRJ_CONFIG} ${SRC_PRJ_RADAR_PERCEPTION} ${SRC_PRJ_TRACK} ${SRC_PRJ_UTILS}
)

set(DEPEND_LIBRARIES ${PROTOBUF_LIBRARIES} ${OpenCV_LIBRARIES} ${VTK_LIBRARIES} ${PCL_LIBRARIES} ${BOOST_LIBRARIES}
${YAML_LIBRARIES})

add_library(XLZAMultiPerception SHARED ${SRC_PRJ_FILES})
link_libraries(${DEPEND_LIBRARIES})
########################### generate executable file #####################################

file(GLOB_RECURSE SRC_PRJ_MAIN main/main.cpp)
add_executable(XLZAMultiPerception_main ${SRC_PRJ_MAIN})
target_link_libraries(XLZAMultiPerception_main XLZAMultiPerception ${DEPEND_LIBRARIES})
#target_link_libraries(XLZAMultiPerception_main XLZAMultiPerception ${PROTOBUF_LIBRARIES} ${PCL_LIBRARIES})
message(STATUS "CMake configure finished.")

@kyoasu
Copy link
Author

kyoasu commented Jul 13, 2022

And when I use pcl::PointCloudpcl::PointXYZRGB::Ptr in functions, it reports "double free or corruption(out)" on return. The ide stays on this page
image

@mvieth
Copy link
Member

mvieth commented Jul 13, 2022

The -DEIGEN_DONT_VECTORIZE option is likely the problem. If you want to use it in your project, you also have to compile PCL with it

@kyoasu
Copy link
Author

kyoasu commented Jul 14, 2022

The -DEIGEN_DONT_VECTORIZE option is likely the problem. If you want to use it in your project, you also have to compile PCL with it

It's work! But I'm sorry that I have another problem. When I use pcl::PointCloudpcl::PointXYZRGB::Ptr in functions, it reports "double free or corruption(out)" on return.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff27aa859 in __GI_abort () at abort.c:79
#2 0x00007ffff281526e in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff293f298 "%s\n")
at ../sysdeps/posix/libc_fatal.c:155
#3 0x00007ffff281d2fc in malloc_printerr (str=str@entry=0x7ffff2941670 "double free or corruption (out)")
at malloc.c:5347
#4 0x00007ffff281efa0 in _int_free (av=0x7ffff2974b80 <main_arena>, p=0x7fffe9556010, have_lock=)
at malloc.c:4314
#5 0x0000555555580a66 in Eigen::internal::aligned_free (ptr=0x7fffe9556020)
at /home/xxx/InstallPackage/eigen3.3.9/include/eigen3/Eigen/src/Core/util/Memory.h:177
#6 0x000055555558a208 in Eigen::aligned_allocatorpcl::PointXYZRGB::deallocate (this=0x555556da2718,
p=0x7fffe9556020) at /home/xxx/InstallPackage/eigen3.3.9/include/eigen3/Eigen/src/Core/util/Memory.h:763
#7 0x0000555555589128 in std::allocator_traits<Eigen::aligned_allocatorpcl::PointXYZRGB >::deallocate (
__a=..., __p=0x7fffe9556020, __n=524288) at /usr/include/c++/9/bits/alloc_traits.h:332
#8 0x0000555555588244 in std::_Vector_base<pcl::PointXYZRGB, Eigen::aligned_allocatorpcl::PointXYZRGB >::_M_deallocate (this=0x555556da2718, __p=0x7fffe9556020, __n=524288) at /usr/include/c++/9/bits/stl_vector.h:351
#9 0x0000555555586698 in std::_Vector_base<pcl::PointXYZRGB, Eigen::aligned_allocatorpcl::PointXYZRGB >::~_Vector_base (this=0x555556da2718, __in_chrg=) at /usr/include/c++/9/bits/stl_vector.h:332
#10 0x00005555555866ed in std::vector<pcl::PointXYZRGB, Eigen::aligned_allocatorpcl::PointXYZRGB >::~vector (
this=0x555556da2718, __in_chrg=) at /usr/include/c++/9/bits/stl_vector.h:680
#11 0x000055555558a2c2 in pcl::PointCloudpcl::PointXYZRGB::~PointCloud (this=0x555556da26e0,
__in_chrg=) at /opt/XLZALibs/pcl-1.9.1-noGPU/include/pcl-1.9/pcl/point_cloud.h:240
#12 0x000055555558a2f2 in pcl::PointCloudpcl::PointXYZRGB::~PointCloud (this=0x555556da26e0,
__in_chrg=) at /opt/XLZALibs/pcl-1.9.1-noGPU/include/pcl-1.9/pcl/point_cloud.h:240
#13 0x0000555555589259 in boost::checked_delete<pcl::PointCloudpcl::PointXYZRGB > (x=0x555556da26e0)
at /home/xxx/InstallPackage/boost1.70.0/include/boost/core/checked_delete.hpp:36
#14 0x000055555558ff10 in boost::detail::sp_counted_impl_p<pcl::PointCloudpcl::PointXYZRGB >::dispose (
this=0x5555555f1590)
at /home/xxx/InstallPackage/boost1.70.0/include/boost/smart_ptr/detail/sp_counted_impl.hpp:93
#15 0x0000555555580f0b in boost::detail::sp_counted_base::release (this=0x5555555f1590)
at /home/xxx/InstallPackage/boost1.70.0/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp:112
#16 0x0000555555580fa3 in boost::detail::shared_count::~shared_count (this=0x7fffffffda18,
__in_chrg=)
at /home/xxx/InstallPackage/boost1.70.0/include/boost/smart_ptr/detail/shared_count.hpp:427
#17 0x0000555555582ba6 in boost::shared_ptr<pcl::PointCloudpcl::PointXYZRGB >::~shared_ptr

@kyoasu
Copy link
Author

kyoasu commented Jul 14, 2022

I have solved this problem

@kyoasu kyoasu closed this as completed Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage Labels incomplete
Projects
None yet
Development

No branches or pull requests

2 participants