uncovered logic branches in mem_malloc(mem_size_t size)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

uncovered logic branches in mem_malloc(mem_size_t size)

rukhlins
the heap searching algorithm in the function has got unimplemented logic branches.
There is no condition about next mem-structure is not used when we try to place data in current mem-structure.
The logic could be simplified a lot if we would delete mem structure in mem_free()-function from the linked list.
Reply | Threaded
Open this post in threaded view
|

Re: uncovered logic branches in mem_malloc(mem_size_t size)

goldsimon@gmx.de
Hi rukhlins,

rukhlins wrote:
> There is no condition about next mem-structure is not used when we try to
> place data in current mem-structure.
> The logic could be simplified a lot if we would delete mem structure in
> mem_free()-function from the linked list.

I'm not sure I fully understood. But did you have a look at 'plug_holse()'?
I think it might do what you were looking for.

Simon

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: uncovered logic branches in mem_malloc(mem_size_t size)

rukhlins
Hi Simon,
Yes it is complicated and it is a problem.
I have got mem-errors after more than 500 MBytes were sent from LWIP. And it is initiated in the function mem_malloc() when it returns NULL-pointer.
I am not sure the alocation algorithm keeps the root cause but to me it looks like it is simpler to write my own algorithm than make analysis for the existing implementation including patches.

regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: uncovered logic branches in mem_malloc(mem_size_t size)

goldsimon@gmx.de
rukhlins wrote:
> I have got mem-errors after more than 500 MBytes were sent from LWIP. And it
> is initiated in the function mem_malloc() when it returns NULL-pointer.

So far so good, there are many kinds of memory leaks possible.

> I am not sure the alocation algorithm keeps the root cause

Me neither!

> but to me it looks like it is simpler to write my own algorithm than make
> analysis for the existing implementation including patches.

No problem at all. Everyone's free to write their own code. People even wrote
a fully new TCP/IP stack. Good luck!

And feel free to come back here if you actually found something and can describe the bug.


Cheers,
Simon

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: uncovered logic branches in mem_malloc(mem_size_t size)

rukhlins
it turns out the issue does not linked the allocation!
Looks
"tcp_output_segment() ignores errors from ip_output(), from HAL"
topic for details!
Reply | Threaded
Open this post in threaded view
|

Re: uncovered logic branches in mem_malloc(mem_size_t size)

goldsimon@gmx.de
rukhlins wrote:
> it turns out the issue does not linked the allocation!
> Looks
> "tcp_output_segment() ignores errors from ip_output(), from HAL"
> topic for details!

Sorry but I don't get it. Do you suspect a bug or not?
Also, I don't see where tcp_output_segment ignores an error: it returns
it to the caller.

Could it be that you are working on an old version?

Simon

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel