This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSPLink RingIO_open issue?

Hi All,

Has anyone encountered the following problem? Could this be a bug?

An exception occurs in RingIO_Open() due to invalid address passing into status = MPCS_enter (ringIoState->mpcsObj) ;. From the code, ringIoState comes from extern RingIO_Object RingIO_State [MAX_DSPS] ;. But the following code in RingIO_Open() shows that RingIO_State is trying to access an invalid element:

// MAX_DSPS = 1, MAX_PROCESSORS = 2

for (procId = 0 ; (procId < MAX_PROCESSORS) && (control == NULL) ; procId++) {

 ringIoState = &RingIO_State [procId] ; // if procId = 1, ringIoState is invalid?

...

...

status = MPCS_enter (ringIoState->mpcsObj) ; // unexpected value if procId = 1

But the above code does not give exception all the time. I have 2 separate builds to illustrate good and bad cases.

GOOD CASE

From symbol file:

00b24b98 00000002 B DSPLINK_isSignal
00b24b9c 00000300 B POOL_addrConfig
00b24e9c 00000020 B RingIO_State <--- &RingIO_State [0]
00b24ebc 00000020 B MPCS_State  <--- &RingIO_State [1]

BAD CASE

From symbol file:

00bc516c 00000020 B RingIO_State  <--- &RingIO_State [0]
00bc518c 00000002 B DSPLINK_isSignal  <--- &RingIO_State [1]
00bc5190 00000020 B MPCS_State


Regards,

PJ

  • Pei Jir Yeoh said:

    Has anyone encountered the following problem? Could this be a bug?

    I don't know if other folks have encountered this problem, but I believe you have uncovered a bug.

    Pei Jir Yeoh said:
    extern RingIO_Object RingIO_State [MAX_DSPS] ;

    Note that RingIO_State[MAX_DSPS] has MAX_DSPS array elements, which in your case is just 1.

    Pei Jir Yeoh said:

    // MAX_DSPS = 1, MAX_PROCESSORS = 2

    for (procId = 0 ; (procId < MAX_PROCESSORS) && (control == NULL) ; procId++) {

    The above loop termination expression is wrong, should be "procId < MAX_DSPS".

    Pei Jir Yeoh said:
    00b24e9c 00000020 B RingIO_State <--- &RingIO_State [0]
    00b24ebc 00000020 B MPCS_State  <--- &RingIO_State [1]

    There is no RingIO_State[1] for a system with MAX_DSPS=1, so your above assignment illustration is not happening as you indicate.

    I will file a bug against DSPLink for this.  Thankyou for taking the time and effort to identify this and bring it to our attention.

    Can you "fix" it in your copy of the DSPLink code and try it out?  Just to be clear, replace MAX_PROCESSORS in the above "for" loop expression with MAX_DSPS.

    However, you are apparently hitting this bug because the first iteration through this loop didn't find the desired RingIO object.  So, after fixing the bug in your local copy, you will most likely get a failure from this particular call to RingIO_open().  To solve this, I just have basic advice to check that your "name" is correct and that a RingIO object with that name has already been created with RingIO_create() for procId 0.

    Regards,

    - Rob

  • Hi Rob,

    Thanks for your reply.

    Yes, I have fixed my copy with your said change. RingIO_open() is working fine now. I also did not encounter any failure due to invalid RingIO name after this change. I shall continue to monitor my RingIO for any such failures. Thanks again.

    Regards,

    PJ

  • PJ,

    You're welcome, great to hear that it fixes your issue.  I have filed a bug internally and we actually have a DSPLink release in the works (version 1.65.02) that will incorporate the fix for this bug (although I'm not sure when it will be released to the public).  For your reference, since you can look for its mention in the product release notes, the bug report has the following info for tracking:
        SDOCM00092960 - DSPLink API RingIO_open() can crash system when iterating beyond valid procId

    I'm still curious as to why your call to RingIO_open() proceeded into the bogus iteration.  Is it possible that you are doing a RingIO_create() with a (invalid) procId of 1?

    Regards,

    - Rob

     

  • Hi Rob,

    When RingIO_create() was called, my procId was 0.

    In my case, I found that it went into the invalid loop because the RingIO name was found to be invalid. This resulted in control == NULL, and the for-loop was not terminated successfully when procId incremented to 1.

    Regards,

    PJ

  • Hi Rob,

    When can we expect a new release of dsplink with this bug fix.? Do you have a date scheduled?

    Regards,

    Lavanya

  • Hi Lavanya,

    I don't believe we have a schedule date for the next release (which will have this bug fix in it).  My supervisor is out of the office for the next few days and I can ask him when he gets back.

    Regards,

    - Rob