Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 0 additions & 183 deletions .github/workflows/ubuntu-ibm.yml

This file was deleted.

58 changes: 55 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
extra_checks: [capi]
fail-fast: false

env:
env: &make-env
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
RUBY_DEBUG: ci

Expand All @@ -59,7 +59,7 @@ jobs:
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps:
steps: &make-steps
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
sparse-checkout-cone-mode: false
Expand All @@ -73,7 +73,19 @@ jobs:
with:
ruby-version: '3.1'
bundler: none
if: ${{ !endsWith(matrix.os, 'arm') }}
if: >-
${{ !endsWith(matrix.os, 'arm')
&& !endsWith(matrix.os, 'ppc64le') && !endsWith(matrix.os, 's390x') }}

# A temporary workaround: Set HOME env to pass the step
# ./.github/actions/setup/directories.
# https://github.com/IBM/actionspz/issues/30
- name: Set HOME env
run: |
echo "HOME: ${HOME}"
echo "HOME=$(ls -d ~)" >> $GITHUB_ENV
working-directory:
if: ${{ endsWith(matrix.os, 'ppc64le') || endsWith(matrix.os, 's390x') }}

- uses: ./.github/actions/setup/directories
with:
Expand Down Expand Up @@ -123,6 +135,21 @@ jobs:
continue-on-error: true
timeout-minutes: 3

# Avoid possible test failures with the zlib applying the following patch
# on s390x CPU architecture.
# https://github.com/madler/zlib/pull/410
- name: Disable DFLTCC
run: echo "DFLTCC=0" >> $GITHUB_ENV
if: ${{ endsWith(matrix.os, 's390x') }}

# A temporary workaround: Set the user's primary group to avoid a mismatch
# between the group IDs of "id -g" and C function getpwuid(uid_t uid)
# pw_gid.
# https://github.com/IBM/actionspz/issues/31
- name: Set user's group id
run: sudo usermod -g "$(id -g)" runner
if: ${{ endsWith(matrix.os, 'ppc64le') || endsWith(matrix.os, 's390x') }}

- name: make ${{ matrix.test_task }}
run: |
test -n "${LAUNCHABLE_STDOUT}" && exec 1> >(tee "${LAUNCHABLE_STDOUT}")
Expand Down Expand Up @@ -168,6 +195,31 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
if: ${{ failure() }}

make-ibm:
strategy:
matrix:
include:
- test_task: check
os: ubuntu-24.04-ppc64le
- test_task: check
os: ubuntu-24.04-s390x
fail-fast: false

env: *make-env

runs-on: ${{ matrix.os }}

if: >-
${{github.repository == 'ruby/ruby'
&& !(false
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps: *make-steps

result:
if: ${{ always() }}
name: ${{ github.workflow }} result
Expand Down
41 changes: 12 additions & 29 deletions gc/default/default.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,9 @@ typedef struct rb_objspace {
VALUE gc_stress_mode;

struct {
bool parent_object_old_p;
VALUE parent_object;

int need_major_gc;
size_t last_major_gc;
size_t uncollectible_wb_unprotected_objects;
Expand Down Expand Up @@ -4309,15 +4311,11 @@ init_mark_stack(mark_stack_t *stack)
static void
rgengc_check_relation(rb_objspace_t *objspace, VALUE obj)
{
const VALUE old_parent = objspace->rgengc.parent_object;

if (old_parent) { /* parent object is old */
if (objspace->rgengc.parent_object_old_p) {
if (RVALUE_WB_UNPROTECTED(objspace, obj) || !RVALUE_OLD_P(objspace, obj)) {
rgengc_remember(objspace, old_parent);
rgengc_remember(objspace, objspace->rgengc.parent_object);
}
}

GC_ASSERT(old_parent == objspace->rgengc.parent_object);
}

static inline int
Expand Down Expand Up @@ -4385,12 +4383,7 @@ gc_mark_check_t_none(rb_objspace_t *objspace, VALUE obj)
rb_raw_obj_info(obj_info_buf, info_size, obj);

char parent_obj_info_buf[info_size];
if (objspace->rgengc.parent_object == Qfalse) {
strlcpy(parent_obj_info_buf, "(none)", info_size);
}
else {
rb_raw_obj_info(parent_obj_info_buf, info_size, objspace->rgengc.parent_object);
}
rb_raw_obj_info(parent_obj_info_buf, info_size, objspace->rgengc.parent_object);

rb_bug("try to mark T_NONE object (obj: %s, parent: %s)", obj_info_buf, parent_obj_info_buf);
}
Expand All @@ -4405,14 +4398,9 @@ gc_mark(rb_objspace_t *objspace, VALUE obj)
if (!gc_mark_set(objspace, obj)) return; /* already marked */

if (0) { // for debug GC marking miss
if (objspace->rgengc.parent_object) {
RUBY_DEBUG_LOG("%p (%s) parent:%p (%s)",
(void *)obj, obj_type_name(obj),
(void *)objspace->rgengc.parent_object, obj_type_name(objspace->rgengc.parent_object));
}
else {
RUBY_DEBUG_LOG("%p (%s)", (void *)obj, obj_type_name(obj));
}
RUBY_DEBUG_LOG("%p (%s) parent:%p (%s)",
(void *)obj, obj_type_name(obj),
(void *)objspace->rgengc.parent_object, obj_type_name(objspace->rgengc.parent_object));
}

gc_mark_check_t_none(objspace, obj);
Expand Down Expand Up @@ -4505,8 +4493,6 @@ rb_gc_impl_mark_weak(void *objspace_ptr, VALUE *ptr)
{
rb_objspace_t *objspace = objspace_ptr;

GC_ASSERT(objspace->rgengc.parent_object == 0 || !RVALUE_WB_UNPROTECTED(objspace, objspace->rgengc.parent_object));

VALUE obj = *ptr;

gc_mark_check_t_none(objspace, obj);
Expand Down Expand Up @@ -4565,7 +4551,8 @@ mark_roots(rb_objspace_t *objspace, const char **categoryp)
} while (0)

MARK_CHECKPOINT("objspace");
objspace->rgengc.parent_object = Qfalse;
objspace->rgengc.parent_object = Qundef;
objspace->rgengc.parent_object_old_p = false;

if (finalizer_table != NULL) {
st_foreach(finalizer_table, pin_value, (st_data_t)objspace);
Expand All @@ -4580,12 +4567,8 @@ mark_roots(rb_objspace_t *objspace, const char **categoryp)
static inline void
gc_mark_set_parent(rb_objspace_t *objspace, VALUE obj)
{
if (RVALUE_OLD_P(objspace, obj)) {
objspace->rgengc.parent_object = obj;
}
else {
objspace->rgengc.parent_object = Qfalse;
}
objspace->rgengc.parent_object = obj;
objspace->rgengc.parent_object_old_p = RVALUE_OLD_P(objspace, obj);
}

static void
Expand Down
Loading