<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/bootstraptest/test_method.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 18573b8d054f655e3e8b24902985bf4028f88810: [Backport #20178] (#9822)</title>
<updated>2024-02-04T04:13:15+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>nurse@users.noreply.github.com</email>
</author>
<published>2024-02-04T04:13:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ce6863a0cf971e0c0328e3fc85b10b6de36ecbad'/>
<id>ce6863a0cf971e0c0328e3fc85b10b6de36ecbad</id>
<content type='text'>
Avoid reading unused lvars in Primitive.cexpr

	Previously on builds with optimizations disabled, this could result in
	an out of bounds read. When we had all of:
	* built with -O0
	* Leaf builtin
	* Primitive.mandatory_only
	* "no args builtin", called by vm_call_single_noarg_inline_builti
	* The stack is escaped to the heap via binding or a proc

	This is because mk_builtin_loader generated reads for all locals
	regardless of whether they were used and in the case we generated a
	mandatory_only iseq that would include more variables than were actually
	available.

	On optimized builds, the invalid accesses would be optimized away, and
	this also was often unnoticed as the invalid access would just hit
	another part of the stack unless it had been escaped to the heap.

	The fix here is imperfect, as this could have false positives, but since
	Primitive.cexpr! is only available within the cruby codebase itself
	that's probably fine as a proper fix would be much more challenging (the
	only false positives we found were in rjit.rb).

	Fixes [Bug #20178]

	Co-authored-by: Adam Hess &lt;HParker@github.com&gt;
	---
	 bootstraptest/test_method.rb | 9 +++++++++
	 tool/mk_builtin_loader.rb    | 6 ++++++
	 2 files changed, 15 insertions(+)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid reading unused lvars in Primitive.cexpr

	Previously on builds with optimizations disabled, this could result in
	an out of bounds read. When we had all of:
	* built with -O0
	* Leaf builtin
	* Primitive.mandatory_only
	* "no args builtin", called by vm_call_single_noarg_inline_builti
	* The stack is escaped to the heap via binding or a proc

	This is because mk_builtin_loader generated reads for all locals
	regardless of whether they were used and in the case we generated a
	mandatory_only iseq that would include more variables than were actually
	available.

	On optimized builds, the invalid accesses would be optimized away, and
	this also was often unnoticed as the invalid access would just hit
	another part of the stack unless it had been escaped to the heap.

	The fix here is imperfect, as this could have false positives, but since
	Primitive.cexpr! is only available within the cruby codebase itself
	that's probably fine as a proper fix would be much more challenging (the
	only false positives we found were in rjit.rb).

	Fixes [Bug #20178]

	Co-authored-by: Adam Hess &lt;HParker@github.com&gt;
	---
	 bootstraptest/test_method.rb | 9 +++++++++
	 tool/mk_builtin_loader.rb    | 6 ++++++
	 2 files changed, 15 insertions(+)</pre>
</div>
</content>
</entry>
<entry>
<title>support concurrent btest execution</title>
<updated>2022-02-05T18:05:47+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2022-02-04T18:10:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=603ab709615dd35fa8ebe53087c27631f5b07812'/>
<id>603ab709615dd35fa8ebe53087c27631f5b07812</id>
<content type='text'>
* `-j` option for concurrent test with threads
  * `-jN` uses N threads
  * `-j` uses nproc/2 threads
* Introduce `BT` struct to manage configurations
* Introduce `Assertion` to manage all assertions
* Remove all toplevel instance variables
* Show elapsed seconds at last

```
$ time make btest
...
real    0m37.319s
user    0m26.221s
sys     0m16.534s

$ time make btest TESTOPTS=-j
...
real    0m11.812s
user    0m36.667s
sys     0m21.872s
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* `-j` option for concurrent test with threads
  * `-jN` uses N threads
  * `-j` uses nproc/2 threads
* Introduce `BT` struct to manage configurations
* Introduce `Assertion` to manage all assertions
* Remove all toplevel instance variables
* Show elapsed seconds at last

```
$ time make btest
...
real    0m37.319s
user    0m26.221s
sys     0m16.534s

$ time make btest TESTOPTS=-j
...
real    0m11.812s
user    0m36.667s
sys     0m21.872s
```
</pre>
</div>
</content>
</entry>
<entry>
<title>relax error message format</title>
<updated>2015-10-24T06:42:22+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2015-10-24T06:42:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e0ed0012cb5752ff39eebd245aabba5d95bce986'/>
<id>e0ed0012cb5752ff39eebd245aabba5d95bce986</id>
<content type='text'>
* bootstraptest/test_method.rb: relax error message format.
* test/ruby/test_arity.rb (err_mess): ditto.
  [Feature #9025], [ruby-core:71178] [Bug #11617]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* bootstraptest/test_method.rb: relax error message format.
* test/ruby/test_arity.rb (err_mess): ditto.
  [Feature #9025], [ruby-core:71178] [Bug #11617]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>* bootstraptest/test_method.rb: remove a test because $SAFE=2 was</title>
<updated>2015-06-18T21:36:49+00:00</updated>
<author>
<name>ko1</name>
<email>ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2015-06-18T21:36:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c78e0d37130bdbbfd3169abb74bd1d9e473b9040'/>
<id>c78e0d37130bdbbfd3169abb74bd1d9e473b9040</id>
<content type='text'>
  obsolete.
  Please check btest, too.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  obsolete.
  Please check btest, too.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>* include/ruby/ruby.h: $SAFE=3 is now obsolete.</title>
<updated>2015-06-17T05:29:51+00:00</updated>
<author>
<name>hsbt</name>
<email>hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2015-06-17T05:29:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bbf440c90b036c733729b1a5c996978ac2adaa9d'/>
<id>bbf440c90b036c733729b1a5c996978ac2adaa9d</id>
<content type='text'>
* ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c
  ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code
  for $SAFE=3
* bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb
  test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb
  test/ruby/test_thread.rb: remove tests for $SAFE=3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c
  ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code
  for $SAFE=3
* bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb
  test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb
  test/ruby/test_thread.rb: remove tests for $SAFE=3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>FreeBSD 10 SEGVs this less than 4M + 12K bytes.</title>
<updated>2014-01-15T01:57:59+00:00</updated>
<author>
<name>naruse</name>
<email>naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2014-01-15T01:57:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4892d046e5b434f47d9a0b62a5d6940d1cab6f8b'/>
<id>4892d046e5b434f47d9a0b62a5d6940d1cab6f8b</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>* bootstraptest/test_autoload.rb, bootstraptest/test_method.rb:</title>
<updated>2013-06-13T02:01:42+00:00</updated>
<author>
<name>shugo</name>
<email>shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2013-06-13T02:01:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c8151d123506d34384d8a7cd856ec43b14a3dd5a'/>
<id>c8151d123506d34384d8a7cd856ec43b14a3dd5a</id>
<content type='text'>
  remove tests for $SAFE=4.

* lib/pp.rb: use taint instead of untrust to avoid warnings when
  $VERBOSE is set to true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  remove tests for $SAFE=4.

* lib/pp.rb: use taint instead of untrust to avoid warnings when
  $VERBOSE is set to true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>* vm_insnhelper.c (vm_caller_setup_args): save and restore</title>
<updated>2012-11-13T08:34:43+00:00</updated>
<author>
<name>ko1</name>
<email>ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2012-11-13T08:34:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ffd3cbdc759841c984ec35bfecfb9f7ed28d4faa'/>
<id>ffd3cbdc759841c984ec35bfecfb9f7ed28d4faa</id>
<content type='text'>
  ci-&gt;argc and ci-&gt;blockptr before and after method invocations
  because these method dispatches override call_info.
* bootstraptest/test_method.rb: add tests for this fix.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  ci-&gt;argc and ci-&gt;blockptr before and after method invocations
  because these method dispatches override call_info.
* bootstraptest/test_method.rb: add tests for this fix.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>* vm_insnhelper.c (vm_call_method): disable CI_SET_FASTPATH() if</title>
<updated>2012-10-15T21:35:29+00:00</updated>
<author>
<name>ko1</name>
<email>ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2012-10-15T21:35:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3083ad7b83486e217ce7c112ed4610f3d4ba3702'/>
<id>3083ad7b83486e217ce7c112ed4610f3d4ba3702</id>
<content type='text'>
  this method call needs splat argument because cahced functions
  (vm_call_attrset, vm_call_ivar, vm_call_cfunc_fast_(unary|binary))
  do not check an arity.
* bootstraptest/test_method.rb: add a test to check an above issue.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  this method call needs splat argument because cahced functions
  (vm_call_attrset, vm_call_ivar, vm_call_cfunc_fast_(unary|binary))
  do not check an arity.
* bootstraptest/test_method.rb: add a test to check an above issue.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>* compile.c (iseq_compile_each): fix return value of obj[a,*b]=c.</title>
<updated>2011-06-17T10:18:39+00:00</updated>
<author>
<name>naruse</name>
<email>naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2011-06-17T10:18:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=021f166509dfead5f1de67651af60de43242365c'/>
<id>021f166509dfead5f1de67651af60de43242365c</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
