Bug 2256763 - clearsilver-0.10.5-77.fc40 FTBFS: Broken Ruby extension with GCC 14: neo_util.c:81:12: error: passing argument 1 of ‘RARRAY_PTR’ makes integer from pointer without a cast
Summary: clearsilver-0.10.5-77.fc40 FTBFS: Broken Ruby extension with GCC 14: neo_util...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: clearsilver
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
Depends On:
Blocks: PortingToModernCHelpNeeded F40FTBFS
TreeView+ depends on / blocked
 
Reported: 2024-01-04 12:07 UTC by Florian Weimer
Modified: 2024-01-29 18:00 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-01-29 18:00:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2024-01-04 12:07:31 UTC
This small program:

require 'neo'
h = Neo::Hdf::new
c = Neo::Cs.new h
c.parse_file 'does-not-exist'

Crashes when executed:

t.rb:2: warning: undefining the allocator of T_DATA class Neo::Hdf
t.rb:3: warning: undefining the allocator of T_DATA class Neo::Cs
t.rb:4: [BUG] Segmentation fault at 0x0000000000000000
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0003 p:---- s:0013 e:000012 CFUNC  :parse_file
c:0002 p:0026 s:0008 E:000e90 EVAL   t.rb:4 [FINISH]
c:0001 p:0000 s:0003 E:001590 DUMMY  [FINISH]

-- Ruby level backtrace information ----------------------------------------
t.rb:4:in `<main>'
t.rb:4:in `parse_file'

-- Machine register context ------------------------------------------------
 RIP: 0x00007fb4b1c63f5d RBP: 0x00007fff6ec4c970 RSP: 0x00007fff6ec4c298
 RAX: 0x0000000000000245 RBX: 0x00007fff6ec4c390 RCX: 0x0000000000000000
 RDX: 0x50203a726f727245 RDI: 0x50203a726f727245 RSI: 0x000000000000000b
  R8: 0x00007fff6ec4c350  R9: 0x0000000000000073 R10: 0x0000000000000001
 R11: 0x0000000000000000 R12: 0xffffffffffffffff R13: 0x50203a726f727245
 R14: 0x00007fff6ec4c9a0 R15: 0x0000000000000001 EFL: 0x0000000000010287

-- C level backtrace information -------------------------------------------
/lib64/libruby.so.3.2(0x7fb4b20e11e9) [0x7fb4b20e11e9]
/lib64/libruby.so.3.2(0x7fb4b20e5529) [0x7fb4b20e5529]
/lib64/libruby.so.3.2(0x7fb4b1f34bac) [0x7fb4b1f34bac]
/lib64/libruby.so.3.2(0x7fb4b2059166) [0x7fb4b2059166]
/lib64/libc.so.6(__restore_rt+0x0) [0x7fb4b1b409b0]
/lib64/libc.so.6(__strlen_avx2+0x1d) [0x7fb4b1c63f5d]
/lib64/libruby.so.3.2(0x7fb4b20f2718) [0x7fb4b20f2718]
/lib64/libruby.so.3.2(0x7fb4b205ca9d) [0x7fb4b205ca9d]
/lib64/libruby.so.3.2(rb_enc_vsprintf+0x61) [0x7fb4b205cc11]
/lib64/libruby.so.3.2(rb_raise+0xa4) [0x7fb4b1f36634]
/usr/lib64/ruby/vendor_ruby/hdf.so(0x7fb4ad2d243e) [0x7fb4ad2d243e]
/lib64/libruby.so.3.2(0x7fb4b20c154d) [0x7fb4b20c154d]
/lib64/libruby.so.3.2(0x7fb4b20c52ff) [0x7fb4b20c52ff]
/lib64/libruby.so.3.2(0x7fb4b20c7089) [0x7fb4b20c7089]
/lib64/libruby.so.3.2(rb_vm_exec+0xc2) [0x7fb4b20dcca2]
/lib64/libruby.so.3.2(0x7fb4b1f3da5e) [0x7fb4b1f3da5e]
/lib64/libruby.so.3.2(ruby_run_node+0x93) [0x7fb4b1f419a3]
/usr/bin/ruby-mri(0x55fe114b5197) [0x55fe114b5197]
/lib64/libc.so.6(__libc_start_call_main+0x7a) [0x7fb4b1b2a14a]
/lib64/libc.so.6(__libc_start_main+0x8b) [0x7fb4b1b2a20b]
/usr/bin/ruby-mri(_start+0x25) [0x55fe114b51e5]

Looks like the Ruby extension has not been ported to current Ruby versions, and merely kept compiling because GCC ignores C type errors by default. GCC 14 will treat these type errors as, well, errors, and fail the build instead.

Reproducible: Always

Comment 1 Gwyn Ciesla 2024-01-04 21:17:05 UTC
Clearsilver had a release in 2017 here: https://github.com/blong42/clearsilver but is currently archived.

This in turn relies on streamhtmlparser, which is also long-dead: https://github.com/google/streamhtmlparser

I don't see any users of clearsilver in Fedora, so I may retire this.

Comment 2 Petr Pisar 2024-01-29 09:17:53 UTC
clearsilver-0.10.5-77.fc40 fails like this now:

gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I/builddir/build/BUILD/clearsilver-0.10.5/ruby/ext/hdf -DHAVE_CLEARSILVER_H -I../../..    -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1   -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -m64 -o neo_util.o -c neo_util.c
neo_util.c: In function ‘h_mark’:
neo_util.c:65:33: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘t_hdfh *’ {aka ‘struct s_hdfh *’} [-Wformat=]
   65 |     fprintf(stderr,"mark top 0x%x\n",hdfh);
      |                                ~^    ~~~~
      |                                 |    |
      |                                 |    t_hdfh * {aka struct s_hdfh *}
      |                                 unsigned int
neo_util.c: In function ‘h_new’:
neo_util.c:81:12: error: passing argument 1 of ‘RARRAY_PTR’ makes integer from pointer without a cast [-Wint-conversion]
   81 |   if (err) Srb_raise(r_neo_error(err));
      |            ^~~~~~~~~
      |            |
      |            struct RString *

A difference between passing and failing build roots is at <https://koschei.fedoraproject.org/build/17103387>.

Comment 3 Gwyn Ciesla 2024-01-29 18:00:45 UTC
Retired.


Note You need to log in before you can comment on or make changes to this bug.