ET_ILLEGAL_RESOURCE with the XTCP Library

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
Redrat
Member++
Posts: 20
Joined: Wed Feb 04, 2015 10:14 am

ET_ILLEGAL_RESOURCE with the XTCP Library

Post by Redrat »

Hello,

I'm encountering a problem with the xtcp library when receiving multiple connections;
Even though I'm only allowing one connection and aborting (xtcp_abort()) any additional connection attempts, I've found that if another connection attempt is received while one already exists the program may (about 1 out of 10) crash with ET_ILEGAL_RESOURCE Resource exception fault on

Code: Select all

c_xtcp :> (conn,unsigned int[])[i];
in xtcp_event(chanend c_xtcp, xtcp_connection_t &conn) , xtcp_client.xc

I have no idea how to debug / fix this and would appreciate any help.

I'm using version 4.0.2 of xtcp and 14.2.1 of the tools, but the problem also existing in older versions of both.

Thanks,
Red.


louis
Member
Posts: 9
Joined: Thu Sep 08, 2016 11:27 am

Post by louis »

Hi Red,

I'm currently working closely with XTCP and will be looking in to the bug you have mentioned. I hope to get back to you at some point this week!

Cheers,
Louis
User avatar
Redrat
Member++
Posts: 20
Joined: Wed Feb 04, 2015 10:14 am

Post by Redrat »

Hi Louis,

Thanks, but the problem seems to of resolved itself; I reverted back to version 13.2 of the tools and 3.1.4rc0 of XTCP and can no longer reproduce the fault at all.

NB; when I reverted to version 13.2 of the tools and stayed on 4.0.2 of xtcp, instead of faulting the program would hang on the line in question.

Could this of been caused by incompatibility of other modules?

Cheers,
Red.
User avatar
Redrat
Member++
Posts: 20
Joined: Wed Feb 04, 2015 10:14 am

Post by Redrat »

After some experimentation I think I found the actual cause: xtcp_ignore_recv ;

I found that the fault would occur after using the ignore function (used when receiving data from an uninitialized connect, ie, those that were ignored/rejected) and no fault would occur if instead my application received the data from the xtcp server regardless of whether the client wants it or not.

I guess xtcp_ignore_recv was depreciated(or broken) after 3.1.4rc0 and the server will always attempt to send the received data which caused it to fault in xtcp_event.

Red.
louis
Member
Posts: 9
Joined: Thu Sep 08, 2016 11:27 am

Post by louis »

Hi Red,

Thank you for continuing to experiment with the library.

I've recently completed an overhaul of the library which will hopefully make it easier to work with and debug. It's currently experimental and uncommented, but can be found on the XMOS Github as a pull request: https://github.com/xmos/lib_xtcp/pull/20.

I only mention it here because it should fix the problem you're experiencing. The library will continue to be worked on and the pull request should be merged some time soon.

Cheers,
Louis