public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Ethernet Communication
@ 2007-11-12 10:39 Alperen Coskun
  2007-11-12 10:55 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Alperen Coskun @ 2007-11-12 10:39 UTC (permalink / raw)
  To: ecos discuss


Hi all,

I have two boards running ECOS and I want to create a communication between them via ethernet interface. I'm using UDP sockets. One will send a character buffer in a loop and other will receive it in a loop. (I think everything is clear till here) I wrote a server program and put it in one of the board. I write a client program and run it on Linux. Everything worked as I expected.

BUT, when I put the client program to the other board, everything exploded. If the buffer is sent only one time, no errors occur. But, using it with a loop, client is sending the buffer and server is receiving it but only for 5 times. Then, a 'sendto error' occurs. I examined example programs such as 'udp_lo_test.c'. All the things are same but I didn't understand where the error is. (It gives different errors, ENAMETOOLONG, EHOSTDOWN, sometimes bind error etc.)

Could anyone give a suggestion to me?

Regards...
Alperen

_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Ethernet Communication
  2007-11-12 10:39 [ECOS] Ethernet Communication Alperen Coskun
@ 2007-11-12 10:55 ` Andrew Lunn
  2007-11-12 13:11   ` Alperen Coskun
       [not found]   ` <BAY121-W40DA18DB31664E5920D34ACC870@phx.gbl>
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Lunn @ 2007-11-12 10:55 UTC (permalink / raw)
  To: Alperen Coskun; +Cc: ecos discuss

> BUT, when I put the client program to the other board, everything
> exploded. If the buffer is sent only one time, no errors occur. But,
> using it with a loop, client is sending the buffer and server is
> receiving it but only for 5 times. Then, a 'sendto error' occurs. I
> examined example programs such as 'udp_lo_test.c'. All the things
> are same but I didn't understand where the error is. (It gives
> different errors, ENAMETOOLONG, EHOSTDOWN, sometimes bind error
> etc.)

This sounds like stack overflow or some other form of data corruption.
Turn on CYG_INFRA_DEBUG and stack checking.

     Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [ECOS] Ethernet Communication
  2007-11-12 10:55 ` Andrew Lunn
@ 2007-11-12 13:11   ` Alperen Coskun
       [not found]   ` <BAY121-W40DA18DB31664E5920D34ACC870@phx.gbl>
  1 sibling, 0 replies; 5+ messages in thread
From: Alperen Coskun @ 2007-11-12 13:11 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos discuss


Thanks for your reply,



I did what you said and get the following error message:



ASSERT FAIL: dlmalloc.cxx [ 771] void Cyg_Mempool_dlmalloc_Implementation::do_check_chunk() (cyg_uint8 *)p + sz <= (cyg_uint8 *)(((mbinptr)((char*)&(av_[2*(0) + 2]) - 2*(sizeof(Cyg_Mempool_dlmalloc_Implementation::Cyg_dlmalloc_size_t))))->fd)



What do you suggest me doing?



Regards

Alperen





> Date: Mon, 12 Nov 2007 11:55:36 +0100
> From: andrew@lunn.ch
> To: a_a_coskunoc@hotmail.com
> CC: ecos-discuss@ecos.sourceware.org
> Subject: Re: [ECOS] Ethernet Communication
>
>> BUT, when I put the client program to the other board, everything
>> exploded. If the buffer is sent only one time, no errors occur. But,
>> using it with a loop, client is sending the buffer and server is
>> receiving it but only for 5 times. Then, a 'sendto error' occurs. I
>> examined example programs such as 'udp_lo_test.c'. All the things
>> are same but I didn't understand where the error is. (It gives
>> different errors, ENAMETOOLONG, EHOSTDOWN, sometimes bind error
>> etc.)
>
> This sounds like stack overflow or some other form of data corruption.
> Turn on CYG_INFRA_DEBUG and stack checking.
>
> Andrew

_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Ethernet Communication
       [not found]   ` <BAY121-W40DA18DB31664E5920D34ACC870@phx.gbl>
@ 2007-11-12 13:27     ` Andrew Lunn
  2007-11-14 16:15       ` Alperen Coskun
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2007-11-12 13:27 UTC (permalink / raw)
  To: Alperen Coskun; +Cc: ecos discuss

On Mon, Nov 12, 2007 at 03:10:32PM +0200, Alperen Coskun wrote:
> 
> 
> Thanks for your reply,
>  
> I did what you said and get the following error message:
>  
> ASSERT FAIL: <5>dlmalloc.cxx [ 771] void Cyg_Mempool_dlmalloc_Implementation::do_check_chunk() (cyg_uint8 *)p + sz <= (cyg_uint8 *)(((mbinptr)((char*)&(av_[2*(0) + 2]) - 2*(sizeof(Cyg_Mempool_dlmalloc_Implementation::Cyg_dlmalloc_size_t))))->fd)
>  
> What do you suggest me doing?

So your heap is getting corrupted. Look for a buffer overflow, double
free of a block of memory etc....

     Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [ECOS] Ethernet Communication
  2007-11-12 13:27     ` Andrew Lunn
@ 2007-11-14 16:15       ` Alperen Coskun
  0 siblings, 0 replies; 5+ messages in thread
From: Alperen Coskun @ 2007-11-14 16:15 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos discuss



Andrew,

I looked for what you said and searched for other possible problems but I couldn't find anything. Buffers are large enough and I send only 1 byte each time that means 5x1 byte... I don't know how to check buffer overflow and get rid of this problem. The interesting thing is I send data for 5 times, after that it gives error for 40-50 times, then sends again for 5 times and then again error 40-50 times and so on...

But, big thanks for your advises.

Alperen





> Date: Mon, 12 Nov 2007 14:27:36 +0100
> From: andrew@lunn.ch
> To: a_a_coskunoc@hotmail.com
> CC: ecos-discuss@ecos.sourceware.org
> Subject: Re: [ECOS] Ethernet Communication
>
> On Mon, Nov 12, 2007 at 03:10:32PM +0200, Alperen Coskun wrote:
>>
>>
>> Thanks for your reply,
>>
>> I did what you said and get the following error message:
>>
>> ASSERT FAIL: dlmalloc.cxx [ 771] void Cyg_Mempool_dlmalloc_Implementation::do_check_chunk() (cyg_uint8 *)p + sz <= (cyg_uint8 *)(((mbinptr)((char*)&(av_[2*(0) + 2]) - 2*(sizeof(Cyg_Mempool_dlmalloc_Implementation::Cyg_dlmalloc_size_t))))->fd)
>>
>> What do you suggest me doing?
>
> So your heap is getting corrupted. Look for a buffer overflow, double
> free of a block of memory etc....
>
> Andrew

_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-14 15:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-12 10:39 [ECOS] Ethernet Communication Alperen Coskun
2007-11-12 10:55 ` Andrew Lunn
2007-11-12 13:11   ` Alperen Coskun
     [not found]   ` <BAY121-W40DA18DB31664E5920D34ACC870@phx.gbl>
2007-11-12 13:27     ` Andrew Lunn
2007-11-14 16:15       ` Alperen Coskun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).