Menu

#532 sys_thread_new possibly leaks memory

2.6.6
closed-rejected
None
Other
Medium
2.6.5
False
2018-01-16
2014-09-04
No

in sys_arch.c, within the lwip bindings, any time a thread is started with sys_thread_new, new memory is allocated from the Core Memory Manager, possibly leaking memory (if, for instance, PPP sessions are started, and stopped)

Attached is a patch that allows the threads to be declared on the default heap, then released, so that the memory can be reclaimed.

1 Attachments

Discussion

  • Giovanni Di Sirio

    I see, how threads would be terminated? there is not a function that terminates a lwIP thread so that the memory could be recovered.

     
  • Giovanni Di Sirio

    • assigned_to: Giovanni Di Sirio
    • Affected Version: Trunk --> 2.6.5
    • Milestone: 2.6.5 --> 2.6.6
     
  • Giovanni Di Sirio

    • status: open --> pending
     
  • Woodrow Douglass

    My way around this was to call chRegFirstThread and chRegNextThread to iterate through the thread registry and reap any threads with 0 refcounts. the ppp thread does indeed terminate when you call pppClose, in lwip version 1.4.1.

     
  • Giovanni Di Sirio

    • status: pending --> closed-rejected
    • Component: --> Other
     

Log in to post a comment.