Multiple EquipNewItem functions causes Linux to crash (windows is fine)

Hello I’ve created a script that requires multiple items to be added at once (around 16 - full set of gear) and it crashes my Linux server, but my windows server stays up. The function I use looks like this:

player->EquipNewItem(EQUIPMENT_SLOT_HEAD, HeadEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_NECK, NeckEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_SHOULDERS, ShoulderEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_BACK, BackEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_CHEST, ChestEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_WRISTS, WristEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_HANDS, HandsEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_WAIST, BeltEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_LEGS, LegsEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_FEET, BootsEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_FINGER1, Ring1Entry, true);
player->EquipNewItem(EQUIPMENT_SLOT_FINGER2, Ring2Entry, true);
player->EquipNewItem(EQUIPMENT_SLOT_TRINKET1, Trinket1Entry, true);
player->EquipNewItem(EQUIPMENT_SLOT_TRINKET2, Trinket2Entry, true);
player->EquipNewItem(EQUIPMENT_SLOT_MAINHAND, MainHandEntry, true);
player->EquipNewItem(EQUIPMENT_SLOT_RANGED, RangedEntry, true);

It does equip the items and let me run and cast spells around for about… 5 seconds. Then the server crashes.

— Canned message start —

This thread is not related to the official Trinity codebase and was moved to the Custom Code section.

Please read the stickies next time.

— Canned message end —

asd(obj) // crashing function
Guess where the error is.

Seriously though, post the code. And crash logs if any.

Try debugging.