Bug #7041
closedMemory leak in Mutex
Description
=begin
Ruby does not destroy pthread condattr structure after allocating and using it in pthread_thread.c:native_cond_initialize().
This causes a memory leak that can be demonstrated by the following snipplet:
loop do
Mutex.new
GC.start
end
The patch attached fixes it.
This happens on both 1.9 and head.
=end
Files
Updated by stass (Stanislav Sedov) over 12 years ago
Ruby does not destroy pthread condattr structure after allocating and using it in pthread_thread.c:native_cond_initialize().
This causes a memory leak that can be demonstrated by the following snipplet:
loop do
Mutex.new
GC.start
end
The patch attaches fixes this.
The bug happens on both 1.9 and head.
Updated by shyouhei (Shyouhei Urabe) over 12 years ago
- Description updated (diff)
- Category changed from core to YARV
- Status changed from Open to Assigned
- Assignee set to ko1 (Koichi Sasada)
- Priority changed from 6 to Normal
Updated by kosaki (Motohiro KOSAKI) over 12 years ago
- Assignee changed from ko1 (Koichi Sasada) to kosaki (Motohiro KOSAKI)
good catch.
Updated by kosaki (Motohiro KOSAKI) over 12 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r37001.
Stanislav, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- thread_pthread.c (native_cond_initialize): destroy condattr
after using it. Patch by Stanislav Sedov. Thank you.
[Bug #7041] [ruby-core:47619]