Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363383

Summary: SIGSEGV of program is kept hidden when executing a C/C++ executable
Product: [Tools] CDT Reporter: Jeff Johnston <jjohnstn>
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: angvoz.dev, cdtdoug, germano.massullo, pawel.1.piech
Version: 8.0.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jeff Johnston CLA 2011-11-09 15:55:45 EST
The following program when built and run as a local C/C++ executable:

int main()
{
	int *array;
	array = calloc(10,sizeof(int));
	for(int i = 1; i < 10; i++)
	{
		array[i] = i;
	}
	sprintf("%d\n", array[1]);

	return 0;
}

causes a SIGSEGV to occur in the sprintf call.  This is expected for this program.

The problem is that there is nothing in the console to indicate a SIGSEGV has occurred nor is the -1 exit code from the program reported.  The console just says: <terminated> .....

The exit code is present when one switches to the Debug perspective and looks in the Debug View.

If gdb is being used to run the program, perhaps the console could be kept for viewing after and non-zero exit code should perhaps be reported, if not at least optionally.