Mysterious memory corruption bug

2012-05-01 Thread Bean
Hi, Thanks to Vladimir's memory patch, it's actually quite easy to reproduce mysterious issue. First, there are two memory leaks in ip.c. It allocates the rsm but never frees it. free_rsm frees its content, but not the pointer itself. You can see it in printmem at ip.c:473 rsm =

Re: Mysterious memory corruption bug

2012-05-01 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 01.05.2012 20:53, Bean wrote: Hi, Thanks to Vladimir's memory patch, it's actually quite easy to reproduce mysterious issue. First, there are two memory leaks in ip.c. It allocates the rsm but never frees it. free_rsm frees its content, but not the pointer itself. You can see it in

Re: Mysterious memory corruption bug

2012-05-01 Thread Bean
On Wed, May 2, 2012 at 3:08 AM, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 01.05.2012 20:53, Bean wrote: Hi, Thanks to Vladimir's memory patch, it's actually quite easy to reproduce mysterious issue. First, there are two memory leaks in ip.c. It allocates the rsm

Re: Mysterious memory corruption bug

2012-05-01 Thread Bean
On Wed, May 2, 2012 at 3:46 AM, Bean bean12...@gmail.com wrote: On Wed, May 2, 2012 at 3:08 AM, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 01.05.2012 20:53, Bean wrote: Hi, Thanks to Vladimir's memory patch, it's actually quite easy to reproduce mysterious issue.

Re: Mysterious memory corruption bug

2012-05-01 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 01.05.2012 21:52, Bean wrote: On Wed, May 2, 2012 at 3:46 AM, Bean bean12...@gmail.com wrote: On Wed, May 2, 2012 at 3:08 AM, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 01.05.2012 20:53, Bean wrote: Hi, Thanks to Vladimir's memory patch, it's actually quite easy to

Re: Mysterious memory corruption bug

2012-05-01 Thread Bean
On Wed, May 2, 2012 at 3:56 AM, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 01.05.2012 21:52, Bean wrote: On Wed, May 2, 2012 at 3:46 AM, Bean bean12...@gmail.com wrote: On Wed, May 2, 2012 at 3:08 AM, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On

Re: Mysterious memory corruption bug

2012-05-01 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 01.05.2012 22:02, Bean wrote: Hi, Yeah, I have a patch that save the buffer for later use when there is no data, it can solve the unnecessary alloc/free loop. No, what I mean: allocate a buffer once for every card and then do send/recv with only this buffer and copy to/from it when

Re: Mysterious memory corruption bug

2012-05-01 Thread Bean
On Wed, May 2, 2012 at 4:06 AM, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 01.05.2012 22:02, Bean wrote: Hi, Yeah, I have a patch that save the buffer for later use when there is no data, it can solve the unnecessary alloc/free loop. No, what I mean: allocate a buffer

Re: Mysterious memory corruption bug

2012-05-01 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 01.05.2012 22:09, Bean wrote: On Wed, May 2, 2012 at 4:06 AM, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 01.05.2012 22:02, Bean wrote: Hi, Yeah, I have a patch that save the buffer for later use when there is no data, it can solve the unnecessary alloc/free loop.

Re: Mysterious memory corruption bug

2012-05-01 Thread Bean
On Wed, May 2, 2012 at 4:16 AM, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 01.05.2012 22:09, Bean wrote: On Wed, May 2, 2012 at 4:06 AM, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 01.05.2012 22:02, Bean wrote: Hi, Yeah, I have a patch that save