Project

General

Profile

Actions

Bug #20633

closed

compile error at vm_insnhelper.c when HAVE_DECL_ATOMIC_SIGNAL_FENCE is 0

Added by kimuraw (Wataru Kimura) 5 months ago. Updated 4 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
[ruby-dev:<unknown>]

Description

木村といいます。

最近導入された、vm_insnhelper.c 中での atomic_signal_fence()の呼び出し[1]が
config.hで ”#define HAVE_DECL_ATOMIC_SIGNAL_FENCE 0” のときコンパイルエラーになります。

おそらくコードの意図と異なると思うのでパッチ送ります。

compiling array.c
compiling vm.c
In file included from vm.c:514:
./vm_insnhelper.c:400:5: warning: implicit declaration of function 'atomic_signal_fence' is invalid in C99 [-Wimplicit-function-declaration]
    atomic_signal_fence(memory_order_seq_cst);
    ^
./vm_insnhelper.c:400:25: error: use of undeclared identifier 'memory_order_seq_cst'
    atomic_signal_fence(memory_order_seq_cst);
                        ^
1 warning and 1 error generated.

[1] Add explicit compiler fence when pushing frames to ensure safe profiling
https://github.com/ruby/ruby/commit/64fef3b870a8ed8147654531aef4c065d8a730c6


Files

patch-vm_insnhelper.c.diff (535 Bytes) patch-vm_insnhelper.c.diff kimuraw (Wataru Kimura), 07/13/2024 10:31 AM
Actions #1

Updated by kimuraw (Wataru Kimura) 5 months ago

  • Status changed from Open to Closed

Applied in changeset git|7472fff7f1b5296fbfcde0e2b7411a1d87781f3f.


[Bug #20633] Fix the condition for atomic_signal_fence

AC_CHECK_DECLS defines HAVE_DECL_SYMBOL to 1 if declared, 0
otherwise, not undefined.

Actions #2

Updated by ivoanjo (Ivo Anjo) 5 months ago

Thanks @kimuraw (Wataru Kimura) for fixing my mistake 😅

I've also opened the PRs to backport your fix to the Ruby 3.3 and 3.2 branches:

Actions #3

Updated by nagachika (Tomoyuki Chikanaga) 5 months ago

  • Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.2: DONE, 3.3: REQUIRED

Thank you for reporting and kindly create backport pull requests!
merged into ruby_3_2.

Actions #4

Updated by k0kubun (Takashi Kokubun) 4 months ago · Edited

  • Backport changed from 3.2: DONE, 3.3: REQUIRED to 3.2: DONE, 3.3: DONE
Actions #5

Updated by ivoanjo (Ivo Anjo) 4 months ago

Hey @k0kubun (Takashi Kokubun) I don't think 66312ad913d67bfd3c2c83b174eabf537f5def84 is related to this one? 👀

(Although I think this could be closed, as the fix + both backports have landed)

Actions #6

Updated by k0kubun (Takashi Kokubun) 4 months ago

The message was auto-generated by a script. The script only matches the last commit mentioning the ticket number, and there were two matching commits. Sorry for a delayed reply but I got distracted to fix it first (7d47f3c94f4c38f9b236716c9f98b928895d6b2d b6e7e903a09e1577adc2f17600ca40dee80a0534). I updated the above comment with its new output (and then edited it again with a strikethrough).

And, you're right. Looking at https://github.com/ruby/ruby/pull/11372, I think he meant [Bug #20670]. I'll make sure release notes will include that ticket as well.

Actions

Also available in: Atom PDF

Like0
Like1Like0Like0Like0Like0Like1