Why program receives a SEGV signal under the debugger?

The garbage collector on some platforms uses the SEGV (segmentation violation) signal to detect modified portions of the dynamically allocated space. It is possible to disable this feature or to inform the debugger to let these signals propagate. See the m3gdb documentation.