Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » Bug in xdc_runtime_Registry_addModule function ?(Bug ?)
Bug in xdc_runtime_Registry_addModule function ? [message #557809] Thu, 09 September 2010 04:39 Go to next message
Badri is currently offline BadriFriend
Messages: 17
Registered: July 2009
Junior Member
Champs I am using xdc 3.20.01.51 and my application crashes on invoking Registry_addModule function. My application is built for
GCArmv5T target.I suspect this crash to be due to the following piece of code in function Registry_addModule:

desc->mask = *Module__DGSMASK;

Module__DGSMASK is defined as below in
#undef Module__DGSMASK
#define Module__DGSMASK &xdc_runtime_Registry_CURDESC.mask

in Registry__epilogue.h followed by

#undef Module__DGSMASK
#define Module__DGSMASK xdc_runtime_Registry_Module__diagsMask__C

in "package\internal\Registry.xdc.h"

This effectively makes
#define Module__DGSMASK xdc_runtime_Registry_Module__diagsMask__C

In my app xdc_runtime_Registry_Module__diagsMask__C is set to zero so the code

desc->mask = *Module__DGSMASK;
would result in dereferencing NULL pointer.

Can you please review the function Registry_addModule() and either confirm that this is the reason for the crash or let me know what else could cause crash in this function.FYI I am passing a valid values for
Registry_Desc *desc & String modName which are the function arguments.



Regards
Badri
Re: Bug in xdc_runtime_Registry_addModule function ? [message #558660 is a reply to message #557809] Mon, 13 September 2010 20:14 Go to previous messageGo to next message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
This is definitely a bug. The line in question should be:
desc->mask = Registry_getMask();

However, simply fixing this line may not fix your problem (I think). If
the pointer is NULL, then you have a configuration which disables
Registry diagnostics which, in turn, is responsible for handling all Log
calls from modules added via Registry_addModule().

To ensure Registry Logging is enabled make sure your configuration
script has something like the following:
var Registry = xdc.useModule("xdc.runtime.Registry");
Registry.common$.logger = Logger.create();

where Logger is the logger of your choice (e.g., xdc.runtime.LoggerBuf).

On 9/8/2010 9:39 PM, Badri wrote:
> Champs I am using xdc 3.20.01.51 and my application crashes on invoking
> Registry_addModule function. My application is built for GCArmv5T
> target.I suspect this crash to be due to the following piece of code in
> function Registry_addModule:
>
> desc->mask = *Module__DGSMASK;
>
> Module__DGSMASK is defined as below in #undef Module__DGSMASK
> #define Module__DGSMASK &xdc_runtime_Registry_CURDESC.mask
>
> in Registry__epilogue.h followed by
> #undef Module__DGSMASK
> #define Module__DGSMASK xdc_runtime_Registry_Module__diagsMask__C
>
> in "package\internal\Registry.xdc.h"
>
> This effectively makes #define Module__DGSMASK
> xdc_runtime_Registry_Module__diagsMask__C
>
> In my app xdc_runtime_Registry_Module__diagsMask__C is set to zero so
> the code
>
> desc->mask = *Module__DGSMASK;
> would result in dereferencing NULL pointer.
>
> Can you please review the function Registry_addModule() and either
> confirm that this is the reason for the crash or let me know what else
> could cause crash in this function.FYI I am passing a valid values for
> Registry_Desc *desc & String modName which are the function arguments.
>
>
>
> Regards
> Badri
>
Re: Bug in xdc_runtime_Registry_addModule function ? [message #558821 is a reply to message #558660] Tue, 14 September 2010 14:26 Go to previous message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
On 9/13/2010 1:14 PM, dave russo wrote:
> This is definitely a bug. The line in question should be:
> desc->mask = Registry_getMask();
>
Actually it should be:
desc->mask = Registry_Module_getMask();

Anyway, it's been fixed and will be in the 3.20.004 release coming up in
about a week (in time for the CCS5 release at the end of the month).
Previous Topic:accessing runSegment/loadSegment addresses in an assembly file
Next Topic:issue with packages having name linux
Goto Forum:
  


Current Time: Mon Dec 22 15:39:09 GMT 2014

Powered by FUDForum. Page generated in 0.13286 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software