| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
| |
Suggested by ko1. rb_fatal requires GVL so just in case one lacks,
print that information and let the process die. As commented,
we cannot print the given messages on such situations.
|
|
|
|
|
|
| |
Requested by ko1 that ability of calling rb_raise from anywhere
outside of GVL is "too much". Give up that part, move the GVL
aquisition routine into gc.c, and make our new gc_raise().
|
|
|
|
| |
Indicate that the situation is fatal.
|
| |
|
|
|
|
|
|
|
| |
* ext/openssl/ossl_asn1.c (Init_ossl_asn1): register the static
variable to grab an internal object, before creating the object.
otherwise the just-created object could get collected during the
global variable list allocation. [Bug #16196]
|
|
|
|
|
|
| |
https://gist.github.com/ko1/a88834d744a0682711dab53fd9015a04#file-brlog-trunk-nopara-20191005-235153-L393-L472
https://github.com/rubygems/rubygems/commit/707408d8e7
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/1bd77f53df
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/1de8f39ac4
|
| |
|
|
|
|
|
|
| |
* parse.y (struct local_vars): moved numbered parameter NODEs for
nesting check to separate per local variable scopes, as numbered
parameters should belong to local variable scopes. [Bug #16248]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that allocation routines like ALLOC_N() can raise exceptions
on integer overflows. This is a problem when the calling thread
has no GVL. Memory allocations has been allowed without it, but
can still fail.
Let's just relax rb_raise's restriction so that we can call it
with or without GVL. With GVL the behaviour is unchanged. With
no GVL, wait for it.
Also, integer overflows can theoretically occur during GC when
we expand the object space. We cannot do so much then. Call
rb_memerror and let that routine abort the process.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This typo introduced memory corruption when __builtin_add_overflow
is not available but uint128_t is. GCC before 5 are one of such
situatins.
See also https://rubyci.org/logs/rubyci.s3.amazonaws.com/opensuseleap/ruby-master/log/20191009T120004Z.log.html.gz
|
|
|
|
| |
The st_is_member DEFINE has simpler semantics, for more readable code.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
On Android, a signal handler that is not SIG_DFL is set by default for
SIGSEGV. Ruby's install_sighandler inserts Ruby's handler only when the
signal has no handler, so it does not insert Ruby's SEGV report handler,
which caused some test failures.
This changeset forces to install Ruby's handler for some fatal signals
(sigbus, sigsegv, and sigill). They keep the original handlers, and
call them when the interpreter receives the signals.
|
|
|
|
|
|
|
|
|
|
| |
Just refactoring.
The name "rb_bug_context" is completely unclear for me.
(Can you see that "context" means "machine register context"?)
The context is available only when a fatal signal (sigbus, sigsegv, or
sigill) is received; in fact, the function is used only for fatal
signals. So, I think the name should be changed.
|
|
|
|
|
|
| |
The three functions for fatal signals, sigbus, sigsegv, and sigill, are
a family. The definition of ruby_abort had interrupted them for no
reason. This change just moves the definition after the family.
|
| |
|
|
|
|
|
|
|
|
|
| |
A method call is often with `argc = 1` and `argv = &v` where v is a
VALUE, and some functions shift the arguments by `argc-1` and `argv+1`
(for example, rb_sym_proc_call). I'm unsure whether it is safe or not
to pass a pointer `argv+1` to memcpy with zero length, but Coverity Scan
complains it. So this attempts to suppress the warning by explicit
check of the length.
|
|
|
| |
as the file is not executable anyway.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The declaration of local variable in loop, it will initialize local variable for each run of the loop with clang generated code.
So, it shouldn't declare the local variable in heavy loop.
Array#sum with float elements will be faster around 30%.
* Before
user system total real
3.320000 0.010000 3.330000 ( 3.336088)
* After
user system total real
2.590000 0.010000 2.600000 ( 2.602399)
* Test code
require 'benchmark'
Benchmark.bmbm do |x|
ary = []
10000.times { ary << Random.rand }
x.report do
50000.times do
ary.sum
end
end
end
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset is to kill future possibility of bugs similar to
CVE-2019-11932. The vulnerability occurs when reallocarray(3)
(which is a variant of realloc(3) and roughly resembles our
ruby_xmalloc2()) returns NULL. In our C API, ruby_xmalloc()
never returns NULL to raise NoMemoryError instead. ruby_xfree()
does not return NULL by definition. ruby_xrealloc() on the other
hand, _did_ return NULL, _and_ also raised sometimes. It is very
confusing. Let's not do that. x-series APIs shall raise on
error and shall not return NULL.
|
|
|
|
|
|
|
| |
This changeset basically replaces `ruby_xmalloc(x * y)` into
`ruby_xmalloc2(x, y)`. Some convenient functions are also
provided for instance `rb_xmalloc_mul_add(x, y, z)` which allocates
x * y + z byes.
|
|
|
|
|
| |
Make them gcc friendly. Note that realloc canot be __malloc__
attributed, according to the GCC manual.
|
|
|
|
| |
Seems nobody has actually used this macro. Such an obvious typo.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Show the size of String.
To see the whole contents even after NUL char:
```
(lldb) rp str
(const char [5]) $1 = "x"
(lldb) memory read -s1 --format x --count `sizeof($1)` -- &$1 0x1010457a8: 0x78 0x00 0x61 0x61 0x61
```
|
|
|
|
| |
Use GetLocation to get the address of embedded array.
|
|
|
|
| |
Fixes [Bug #11275]
|
| |
|
|
|
|
| |
`8 * RbConfig::SIZEOF` ... is not straight.
|
|
|
| |
Sync to ruby/bigdecimal@92356ba71c6bd325b0ab618c634a7aecf8cdc767
|
|
|
|
|
|
| |
These macros should make it easier to C extensions to switch to
the Ruby 2.7 C-API *_kw functions, but still have the code work
correctly on older Ruby versions.
|
|
|
|
|
| |
There is no need for these in Ruby 3.0, and the plan is to
remove them.
|
| |
|
|
|
|
|
| |
Sweep step checks `heap_pages_freeable_pages`, so compaction should do
the same.
|
|
|
|
|
| |
I think we need to be moving empty pages to the tomb after they become
empty.
|
|
|
|
|
| |
`T_MOVED` is a linked list, so we can just iterate through the `T_MOVED`
objects, clearing them out and adding them to respective free lists.
|
| |
|
|
|
|
| |
pointed out by ruby-trunk-changes
|
|
|
|
|
|
|
|
| |
There are libraries that use define_method with argument splats
where they would like to pass keywords through the method. To
more easily allow such libraries to use ruby2_keywords to handle
backwards compatibility, it is necessary for ruby2_keywords to
support bmethods.
|
| |
|