"Antoine Arlaud" <thorexocet@gmail.com> writes:
> Hi all,
>
>
> I am currently trying to port an ssdp server from Linux on ecos, and
> the following function crashes the system.
>
>
> ssdpMcastAddr.imr_interface.s_addr = htonl( INADDR_ANY );
> ssdpMcastAddr.imr_multiaddr.s_addr = inet_addr( SSDP_IP );
>
> setsockopt( ssdpSock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
> ( char * )&ssdpMcastAddr,
> sizeof( struct ip_mreq ))
>
> Previously in the source code, I used the same function at a different
> level (socket level SOL_SOCKET,SOREUSE_ADDR,(char
> *)intvar,sizeof(intvar)) and it works.
>
>
> The error generated by the debugger is :
>
> Stack base corrupt - i: 0
> 8025F284: 10 27 05 80 0C D5 04 80 CC EF 21 80 10 1E 21 80 |.'........!...!.|
> ASSERT FAIL: <3246>mlqueue.cxx[306]void
> Cyg_Scheduler_Implementation::rem_thread() Queue map bit not set for pri
>
>
>
> Any ideas?
This looks like a simple case of memory corruption, probably a stack
overflow. That's what the "stack base corrupt" message implies. The
rem_thread() message indicates that a thread object has been
corrupted, probably because it lies just below the overflowed stack.
Try increasing the size of your thread stacks and see if it reoccurs.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts