Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails2.7 segfaults #7091

Merged
merged 5 commits into from
Apr 17, 2020
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
2 changes: 1 addition & 1 deletion ruby/tests/common_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ def test_freeze
m.freeze

frozen_error = assert_raise(FrozenErrorType) { m.optional_int32 = 20 }
assert_equal "can't modify frozen #{proto_module}::TestMessage", frozen_error.message
assert_match "can't modify frozen #{proto_module}::TestMessage", frozen_error.message
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exception message for FrozenError changed from Ruby 2.6 -> 2.7; it now include something like the inspect version of an object in the error:

2.7.0 :001 > [1, 2, 3].freeze << 4
Traceback (most recent call last):
        4: from /Users/ericwalker/.rvm/rubies/ruby-2.7.0/bin/irb:23:in `<main>'
        3: from /Users/ericwalker/.rvm/rubies/ruby-2.7.0/bin/irb:23:in `load'
        2: from /Users/ericwalker/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/irb-1.2.1/exe/irb:11:in `<top (required)>'
        1: from (irb):1
FrozenError (can't modify frozen Array: [1, 2, 3])

assert_equal 10, m.optional_int32
assert_equal true, m.frozen?

Expand Down
1 change: 1 addition & 0 deletions ruby/tests/repeated_field_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def test_acts_like_an_array
:iter_for_each_with_index, :dimensions, :copy_data, :copy_data_simple,
:nitems, :iter_for_reverse_each, :indexes, :append, :prepend]
arr_methods -= [:union, :difference, :filter!]
arr_methods -= [:intersection, :deconstruct] # ruby 2.7 methods we can ignore
Copy link
Contributor Author

@ewalk153 ewalk153 Jan 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not completely sure we can just ignore these methods, either way the segfault is more concerning at the moment

arr_methods.each do |method_name|
assert m.repeated_string.respond_to?(method_name) == true, "does not respond to #{method_name}"
end
Expand Down
4 changes: 4 additions & 0 deletions tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ build_ruby26() {
internal_build_cpp # For conformance tests.
cd ruby && bash travis-test.sh ruby-2.6.0 && cd ..
}
build_ruby27() {
internal_build_cpp # For conformance tests.
cd ruby && bash travis-test.sh ruby-2.7.0 && cd ..
}

build_javascript() {
internal_build_cpp
Expand Down