Alan Wu 1a52c42e61
Always use assert-free APIs when profiling and crashing
rb_profile_frames() is used by profilers in a way such that it can run
on any instruction in the binary, and it crashed previously in the
following situation in `RUBY_DEBUG` builds:

```
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x00000001002827f0 miniruby`vm_make_env_each(ec=0x0000000101866b00, cfp=0x000000080c91bee8) at vm.c:992:74
   989              }
   990
   991              vm_make_env_each(ec, prev_cfp);
-> 992              VM_FORCE_WRITE_SPECIAL_CONST(&ep[VM_ENV_DATA_INDEX_SPECVAL], VM_GUARDED_PREV_EP(prev_cfp->ep));
   993          }
   994      }
   995      else {
(lldb) call rb_profile_frames(0, 100, $2, $3)
/Users/alan/ruby/vm_core.h:1448: Assertion Failed: VM_ENV_FLAGS:FIXNUM_P(flags)
ruby 3.5.0dev (2025-09-23T20:20:04Z master 06b7a70837) +PRISM [arm64-darwin25]

-- Crash Report log information --------------------------------------------
   See Crash Report log file in one of the following locations:
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.
Don't forget to include the above Crash Report log file in bug reports.

-- Control frame information -----------------------------------------------
c:0008 p:---- s:0029 e:000028 CFUNC  :lambda
/Users/alan/ruby/vm_core.h:1448: Assertion Failed: VM_ENV_FLAGS:FIXNUM_P(flags)
ruby 3.5.0dev (2025-09-23T20:20:04Z master 06b7a70837) +PRISM [arm64-darwin25]

-- Crash Report log information --------------------------------------------
<snip>
```

There is a small window where the control frame is invalid and fails the
assert.

The double crash also shows that in `RUBY_DEBUG` builds, the crash reporter was
previously not resilient to corrupt frame state. In release builds, it
prints more info.

Add unchecked APIs for the crash reporter and profilers so they work
as well in `RUBY_DEBUG` builds as non-debug builds.
2025-09-25 18:30:12 -04:00
2025-08-30 14:14:10 +02:00
2025-09-24 03:59:03 +09:00
2025-09-16 20:28:37 +09:00
2025-09-22 12:10:10 -07:00
2025-09-21 13:12:34 -04:00
2025-09-24 03:59:03 +09:00
2025-09-15 12:08:02 +02:00
2025-09-16 08:35:45 -04:00
2025-09-22 20:11:23 +00:00
2025-09-10 16:45:25 +09:00
2025-09-16 20:28:37 +09:00
2025-09-13 16:32:30 +09:00
2025-08-30 22:41:23 +09:00
2025-09-17 09:25:17 -04:00
2025-07-26 20:19:55 +09:00
2025-09-16 20:28:37 +09:00
2025-06-12 09:30:09 +02:00
2025-05-20 22:12:58 +09:00
2025-09-19 15:35:15 -07:00
2025-06-17 15:32:53 -07:00
2025-08-16 17:08:11 -04:00
GPL
2025-09-24 03:59:03 +09:00
2025-09-17 09:25:17 -04:00
2025-08-30 14:14:10 +02:00
2025-09-06 07:17:52 +09:00
2025-05-25 15:22:43 +09:00
2025-09-23 10:20:21 -07:00
2025-09-13 16:32:31 +09:00
2025-09-23 21:18:48 +02:00
2025-06-12 09:30:09 +02:00
2025-08-30 22:41:23 +09:00
2025-08-04 02:23:43 +09:00
2025-09-24 03:59:03 +09:00
2025-09-24 03:59:03 +09:00
2025-09-24 03:59:03 +09:00
2025-06-12 09:30:09 +02:00
2025-08-19 10:02:13 -04:00
2025-08-30 22:41:23 +09:00
2025-09-04 14:26:53 +09:00
2025-07-28 12:22:42 +02:00
2025-09-22 09:59:35 -07:00
2025-07-24 16:35:20 -07:00
2025-05-31 04:01:33 +09:00
2025-09-24 03:59:03 +09:00
2025-07-29 10:00:15 -07:00
2025-08-26 13:02:17 -07:00
2025-09-18 14:46:03 -04:00

Actions Status: MinGW Actions Status: Ubuntu Actions Status: Windows Travis Status

What is Ruby?

Ruby is an interpreted object-oriented programming language often used for web development. It also offers many scripting features to process plain text and serialized files, or manage system tasks. It is simple, straightforward, and extensible.

Features of Ruby

  • Simple Syntax
  • Normal Object-oriented Features (e.g. class, method calls)
  • Advanced Object-oriented Features (e.g. mix-in, singleton-method)
  • Operator Overloading
  • Exception Handling
  • Iterators and Closures
  • Garbage Collection
  • Dynamic Loading of Object Files (on some architectures)
  • Highly Portable (works on many Unix-like/POSIX compatible platforms as well as Windows, macOS, etc.) cf. https://docs.ruby-lang.org/en/master/maintainers_md.html#label-Platform+Maintainers

How to get Ruby

For a complete list of ways to install Ruby, including using third-party tools like rvm, see:

https://www.ruby-lang.org/en/downloads/

You can download release packages and the snapshot of the repository. If you want to download whole versions of Ruby, please visit https://www.ruby-lang.org/en/downloads/releases/.

Download with Git

The mirror of the Ruby source tree can be checked out with the following command:

$ git clone https://github.com/ruby/ruby.git

There are some other branches under development. Try the following command to see the list of branches:

$ git ls-remote https://github.com/ruby/ruby.git

You may also want to use https://git.ruby-lang.org/ruby.git (actual master of Ruby source) if you are a committer.

How to build

See Building Ruby

Ruby home page

https://www.ruby-lang.org/

Documentation

Mailing list

There is a mailing list to discuss Ruby. To subscribe to this list, please send the following phrase:

join

in the mail subject (not body) to the address ruby-talk-request@ml.ruby-lang.org.

Copying

See the file COPYING.

Feedback

Questions about the Ruby language can be asked on the Ruby-Talk mailing list or on websites like https://stackoverflow.com.

Bugs should be reported at https://bugs.ruby-lang.org. Read "Reporting Issues" for more information.

Contributing

See "Contributing to Ruby", which includes setup and build instructions.

The Author

Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.

matz@ruby-lang.org

Description
Languages
Ruby 58.9%
C 29.5%
Rust 6.1%
C++ 2.9%
Yacc 0.9%
Other 1.6%