Do you know why? It's important to know

.
When random crashes occur, you can be pretty sure it's a pointer issue.
For everyone else having the same problem, here explanation:
You defined the vectors as pointers, but pointers do not yet point to the actual object. You either need to make an object and assign the pointer:
VECTOR *upleft_coords;
upleft_coords = vector(0, 0, 0);
Or dont make a pointer:
When you do not make a pointer (latter example), be absolutely sure you do NOT read the values before setting them:
VECTOR upleft_coords;
my.x = upleft_coords.x;
//this will definitely cause troubles which are not easy to find!
//the vector has not yet assigned a value, and holds random pointer values.
//using those will cuase these strange values to flow into your functions ;)
This is the correct way:
VECTOR upleft_coords;
vec_set( upleft_coords, nullvector );
my.x = upleft_coords.x;