Gazebo memory corruption error with CPU based Rplidar

I am working on PX4 Gazebo simulations. I successfully run mavros_posix_sitl.launch file and navigate drone. After that, i changed “vehicle” variable in that file so i can run other iris models too. I could run iris with IR Lock and Optical Flow modules successfully.

Rplidar model provided by sitl_gazebo uses GPU based ray class. But i cant use my driverless AMD graphic card to make it run. Therefore i changed Rplidar model so it uses CPU based ray classes now.

When i run mavros_posix_sitl.launch file with “iris_rplidar” as vehicle, i get memory allocation error:
Error in gzserver: malloc(): memory corruption: 0x0000000003504830

I placed iris_rplidar model seperately in Gazebo and it works fine. But when i run launch files i get this error.

After error backtrace and following mesafe are printed:

[gazebo-3] process has died [pid 18413, exit code 134, cmd /home/merdim/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/gzserver -e ode /home/merdim/catkin_ws/src/sukij01/launch/ __name:=gazebo __log:=/home/merdim/.ros/log/7d2b000c-236b-11e8-b40b-58fb84fafef1/gazebo-3.log]. log file: /home/merdim/.ros/log/7d2b000c-236b-11e8-b40b-58fb84fafef1/gazebo-3*.log