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

Bug 365673

Summary: remove references to atexit(), exit() and abort() from System module
Product: [Technology] RTSC Reporter: Karl Wechsler <karl>
Component: RuntimeAssignee: Vikram Adiga <vikram.adiga>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: d-russo, sascha
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: target:3.26.00

Description Karl Wechsler CLA 2011-12-05 17:26:48 EST
The atexit() reference requires malloc() for the TI/EABI/ELF targets.  And the TI/COFF implementation has a large static array.   If app doesn't call System_exit(), the app still suffers from the data footprint for this static array.
Comment 1 Sasha Slijepcevic CLA 2013-01-22 20:28:30 EST
If we remove the call to exit() from System_exit, we could still run atexitHandlers in a loop in System_exit, instead of relying on exit() to call System_rtsExit(), where the loop is currently run.
However, CCS automatically sets a breakpoint at C$$EXIT, and if we don't call exit() we will not hit that code. SYS/BIOS regressions rely on the tests hitting C$$EXIT, but they could be changed to set a breakpoint at System_exit. Karl thinks that this bug raises too many small issues, and we should probably postpone it.
Comment 2 Vikram Adiga CLA 2013-11-07 18:44:50 EST
The usage of exit() and abort() in System module is now configurable. The System Module contains configurable variables which can be set to point to user defined abort() and exit() implementation to avoid the large footprint from C Standard APIs.

This allows backward compatibility though atexit() is no longer used. The atexit() was used to connect the System_atexit()'s to atexit() so that all functions bound via atexit() or System_atexit() were processed when exit() or System_exit(). Now, it users responsibility to connect the System_atexit() to atexit().

This has been fixed in xdc-A03
Comment 3 Karl Wechsler CLA 2014-03-18 12:19:31 EDT
verified by code review.   also verified the .map file for a few .out files and atexit() is gone. 

verify pass.
Comment 4 Sasha Slijepcevic CLA 2014-06-16 20:33:48 EDT
- shipped in 3.30.0