Segfaults happen when you try to use memory areas you aren't assigned to. Nothing more, nothing less. That your program's crashing now, and not in Windows, may be because you didn't check the return value of a failed call and stored invalid values, or mangled a pointer because of integer size differences between Windows and AIX, or overran the end of an array and mangled your stack, or deleted something you never allocated and messed up your heap. On some platforms nothing happens; the function doesn't fail and the failing case never gets tested, or the integer sizes are just right to hold a pointer, you dump garbage on areas of the stack that don't matter, or the heap tolerates your misbehavior(for a time). But any change in circumstances, different compiler or different libraries or different architecture or different OS or different version, can bring out bugs that were waiting to happen. There's nothing magical or uniquely UNIX about it.
There's a few possibilities for what's causing your program to access invalid memory.
- Is the pointer you're deleting valid? Make sure you're deleting the same pointer you started with. The wrong pointer is just as bad as a NULL pointer.
- What does your destructor do? If it's deleting anything check that it's deleting what it started with too. delete doesn't care what's stored in it as long as the memory itself is valid, but the destructor might.
- Are you allocating with new and deleting with delete[], or vice versa? You have to match new[n] with delete[] and new with delete.
- Are you ever using arrays on the stack, or pointers to stack variables? Check you're not overrunning them.
- What are you deleting when? Some heap implementations don't do thorough checking, so deleting a bad pointer long ago can cause heap errors far later.
But I can't tell a single thing from your error message because you haven't posted all of your code. This could be a problem in far deeper or different code than you might think, and all these are just guesses.