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

Bug 325173

Summary: Registry de-references NULL if no loggers are configured
Product: [Technology] RTSC Reporter: Dave Russo <d-russo>
Component: RuntimeAssignee: Dave Russo <d-russo>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: c-mccormick, cring, jhead
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: target:3.20.04

Description Dave Russo CLA 2010-09-13 17:48:30 EDT
If the Registry module is used but no loggers are created, Registry_addModule() will derefernce a NULL pointer trying to assign a default diags mask to the legacy "module".
Comment 1 Dave Russo CLA 2010-09-13 18:20:05 EDT
The person who fix verifies needs to add tests for the Registry module.
File new bug to run xdc.runtime tests on x86 Linux target.
Comment 2 Dave Russo CLA 2010-09-13 21:11:27 EDT
fixed in 3.21 and 3.20 streams (r1138 and r1139)

Registry.c used 
    desc->mask = *Module__DGSMASK;

when it should have used
    desc->mask = Registry_Module_getMask();
Comment 3 Dave Russo CLA 2010-09-13 21:13:50 EDT
*** Bug 314926 has been marked as a duplicate of this bug. ***
Comment 4 Chris McCormick CLA 2010-09-20 14:48:56 EDT
Verified by code inspection in xdc-w10.

Also added a new test to the regresstest tree, RegistryNullLogger. However, this test case doesn't throw any errors when run on a typical target--dereferencing null is harmless. This test would need to be run on a target such as x86 which will complain when null is dereferenced.
Comment 5 Dave Russo CLA 2010-09-20 14:56:05 EDT
An embedded test can verify that the mask matches the mask of the Registry module.

The de-reference of NULL will almost certainly put garbage into the registered module's diags mask.
Comment 6 Dave Russo CLA 2011-06-20 14:40:15 EDT
Shipped in XDCtools 3.20.04