nokogiri
nokogiri copied to clipboard
[ruby_memcheck] failures spotted in CI
Seen at https://github.com/sparklemotion/nokogiri/runs/4549544439?check_suite_focus=true#step:7:4016
16,720 (336 direct, 16,384 indirect) bytes in 1 blocks are definitely lost in loss record 37,802 of 38,098
calloc (vg_replace_malloc.c:760)
calloc1 (gc.c:1583)
heap_page_allocate (gc.c:1812)
heap_page_create (gc.c:1910)
heap_assign_page (gc.c:1935)
heap_increment (gc.c:2018)
heap_prepare (gc.c:2037)
heap_next_freepage (gc.c:2189)
ractor_cache_slots (gc.c:2208)
newobj_slowpath (gc.c:2254)
newobj_slowpath_wb_protected (gc.c:2273)
newobj_of0 (gc.c:2312)
newobj_of (gc.c:2322)
rb_wb_protected_newobj_of (gc.c:2344)
str_alloc (string.c:784)
str_new0 (string.c:806)
rb_enc_str_new (string.c:858)
*rb_xml_node_content (xml_node.c:749)
...
{
insert_a_suppression_name_here
Memcheck:Leak
fun:calloc
fun:calloc1
fun:heap_page_allocate
fun:heap_page_create
fun:heap_assign_page
fun:heap_increment
fun:heap_prepare
fun:heap_next_freepage
fun:ractor_cache_slots
fun:newobj_slowpath
fun:newobj_slowpath_wb_protected
fun:newobj_of0
fun:newobj_of
fun:rb_wb_protected_newobj_of
fun:str_alloc
fun:str_new0
fun:rb_enc_str_new
fun:rb_xml_node_content
...
}
I could add this to the memcheck todo list (in /suppressions/
) but I want to see how commonly this pops up to see if we can learn something first.
Another seen at
- https://github.com/sparklemotion/nokogiri/runs/7287036089?check_suite_focus=true
- https://github.com/sparklemotion/nokogiri/runs/7471552599?check_suite_focus=true
37 bytes in 1 blocks are definitely lost in loss record 14,158 of 38,756
malloc (vg_replace_malloc.c:307)
objspace_xmalloc0 (gc.c:11445)
str_new0 (string.c:900)
rb_enc_str_new (string.c:946)
*Nokogiri_wrap_xml_syntax_error (xml_syntax_error.c:53)
*Nokogiri_error_array_pusher (xml_syntax_error.c:33)
*__xmlRaiseError (error.c:604)
*htmlParseErr (HTMLparser.c:117)
*htmlParseComment (HTMLparser.c:3519)
*htmlParseContentInternal (HTMLparser.c:4819)
*htmlParseDocument (HTMLparser.c:4992)
*htmlDoRead (HTMLparser.c:6912)
*rb_html_document_s_read_memory (html4_document.c:111)
...
{
insert_a_suppression_name_here
Memcheck:Leak
fun:malloc
fun:objspace_xmalloc0
fun:str_new0
fun:rb_enc_str_new
fun:Nokogiri_wrap_xml_syntax_error
fun:Nokogiri_error_array_pusher
fun:__xmlRaiseError
fun:htmlParseErr
fun:htmlParseComment
fun:htmlParseContentInternal
fun:htmlParseDocument
fun:htmlDoRead
fun:rb_html_document_s_read_memory
...
}
I've opened https://github.com/Shopify/ruby_memcheck/issues/6 to ignore stack_chunk_alloc-related stacks which have showed up in:
- https://github.com/sparklemotion/nokogiri/runs/7474777076?check_suite_focus=true
- https://github.com/sparklemotion/nokogiri/runs/7457816991?check_suite_focus=true
- https://github.com/sparklemotion/nokogiri/runs/7282476570?check_suite_focus=true
- https://github.com/sparklemotion/nokogiri/runs/7310948711?check_suite_focus=true
- https://github.com/sparklemotion/nokogiri/runs/7287062715?check_suite_focus=true
and all start with
# malloc (vg_replace_malloc.c:307)
# stack_chunk_alloc (gc.c:5917)
# push_mark_stack_chunk (gc.c:5980)
# push_mark_stack (gc.c:6038)
# gc_grey (gc.c:6665)
Here's another one that might be ruby internals and not the C extension code?
- https://github.com/sparklemotion/nokogiri/runs/7282108248?check_suite_focus=true
- https://github.com/sparklemotion/nokogiri/runs/7273451879?check_suite_focus=true
# 39,848 bytes in 1 blocks are definitely lost in loss record 38,889 of 38,956
# realloc (vg_replace_malloc.c:834)
# objspace_xrealloc.constprop.0 (gc.c:11516)
# ary_heap_realloc (array.c:381)
# ary_resize_capa (array.c:461)
# ary_double_capa (array.c:507)
# ary_ensure_room_for_push (array.c:654)
# rb_ary_push (array.c:1311)
# *noko_xml_node_wrap (xml_node.c:2075)
# *noko_xml_node_attrs (xml_node.c:2094)
{
insert_a_suppression_name_here
Memcheck:Leak
fun:realloc
fun:objspace_xrealloc.constprop.0
fun:ary_heap_realloc
fun:ary_resize_capa
fun:ary_double_capa
fun:ary_ensure_room_for_push
fun:rb_ary_push
fun:noko_xml_node_wrap
fun:noko_xml_node_attrs
...
}
which I suppressed in https://github.com/sparklemotion/nokogiri/commit/a0360803740e5c85767ace75563bb3a3b33d1963