The interesting parts from the upstream ticket:
Segmentation fault at 0x0067ffffb37006c0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]
-- Control frame information -----------------------------------------------
c:0012 p:---- s:0068 E:002060 CFUNC :next
c:0011 p:0005 s:0064 e:000063 BLOCK
/usr/local/bundle/ruby/3.3.0/gems/pkg-config-1.5.6/lib/pkg-config.rb:439
c:0010 p:0018 s:0060 e:000059 METHOD <internal:kernel>:187
c:0009 p:0014 s:0055 e:000054 METHOD
/usr/local/bundle/ruby/3.3.0/gems/pkg-config-1.5.6/lib/pkg-config.rb:438
c:0008 p:0035 s:0048 e:000047 METHOD
/usr/local/bundle/ruby/3.3.0/gems/pkg-config-1.5.6/lib/pkg-config.rb:403
c:0007 p:0003 s:0039 e:000038 METHOD
/usr/local/bundle/ruby/3.3.0/gems/pkg-config-1.5.6/lib/pkg-config.rb:297
c:0006 p:0007 s:0033 e:000032 METHOD
/usr/local/bundle/ruby/3.3.0/gems/pkg-config-1.5.6/lib/pkg-config.rb:603
c:0005 p:0108 s:0028 e:000025 METHOD extconf.rb:111
c:0004 p:0018 s:0016 e:000015 METHOD extconf.rb:53 [FINISH]
c:0003 p:---- s:0012 e:000011 CFUNC :new
c:0002 p:0067 s:0008 E:000f60 EVAL extconf.rb:449 [FINISH]
c:0001 p:0000 s:0003 E:000520 DUMMY [FINISH]
Unfortunately, no C-level backtrace included.
So it's crashing in Enumerator#next
on this line https://github.com/ruby-gnome/pkg-config/blob/eff47c9f57f8411b5e3c535cae0d8e4c9a368c27/lib/pkg-config.rb#L439
def normalize_cflags(cflags)
normalized_cflags = []
enumerator = cflags.to_enum
begin
loop do
cflag = enumerator.next # CRASH!
normalized_cflags << cflag
case cflag
when "-I"
normalized_cflags << enumerator.next
end
end
rescue StopIteration
end
normalized_cflags
end
I haven't tried to repro yet.