Closed gastamper closed 7 years ago
This was resolved by changing clones of vehicles to use alloc_mem() instead of alloc_perm().
The original implementation using alloc_perm() was also a massive waste of memory as it allocated MAX_PERM_BLOCK (262144) instead of sizeof(struct obj_vehicledata which is normally ~88 bytes or so.
x_extract_obj() is called on containers (such as vehicles) when purged to empty their contents before removing them. In the case of vehicles, clones will have an incorrect sizeof(struct obj_vehicle_data) passed to the free_mem() portion of handler.c responsible for performing the purge; the incorrect sMem parameter for free_mem() thus causes a segmentation fault.