Project

General

Profile

Actions

Bug #20245

closed

Crash when checking symbol encoding

Added by peterzhu2118 (Peter Zhu) 3 months ago. Updated about 1 month ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:116622]

Description

GitHub PR: https://github.com/ruby/ruby/pull/9871

We sometimes pass in a fake string to sym_check_asciionly. This can crash if sym_check_asciionly raises because it creates a CFP with the fake string as the receiver which will crash if GC tries to mark the CFP.

For example, the following script crashes:

GC.stress = true
Object.const_defined?("\xC3")
Actions #1

Updated by peterzhu2118 (Peter Zhu) 3 months ago

  • Status changed from Open to Closed

Applied in changeset git|01fd262e62076277a41af72ea13f20deb1b462a2.


Fix crash when checking symbol encoding

[Bug #20245]

We sometimes pass in a fake string to sym_check_asciionly. This can crash
if sym_check_asciionly raises because it creates a CFP with the fake
string as the receiver which will crash if GC tries to mark the CFP.

For example, the following script crashes:

GC.stress = true
Object.const_defined?("\xC3")

Updated by naruse (Yui NARUSE) about 2 months ago

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

ruby_3_3 b2c2702f20abfd4bb5f38cad60170e2bbb3adff9 merged revision(s) 01fd262e62076277a41af72ea13f20deb1b462a2.

Updated by nagachika (Tomoyuki Chikanaga) about 1 month ago

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

ruby_3_2 27606daf8efeb0ae6d0590a2c9bb1c5aae07f140 merged revision(s) ac0163949a6ee678dfccec9f6e56422b91e5f0a9,01fd262e62076277a41af72ea13f20deb1b462a2.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0