[#112166] [Ruby master Bug#19397] ruby -h fails with SIGSGV if ulimit -s is any else than unlimited — "john_d_s (John Damm Soerensen) via ruby-core" <ruby-core@...>

Issue #19397 has been reported by john_d_s (John Damm Soerensen).

7 messages 2023/02/01

[#112187] [Ruby master Bug#19403] Unable to Build Native Gems on Mac with Ruby 3.1.0+ — "jcouball@... (James Couball) via ruby-core" <ruby-core@...>

Issue #19403 has been reported by jcouball@yahoo.com (James Couball).

10 messages 2023/02/02

[#112213] [Ruby master Bug#19412] Socket starts queueing and not responding after a certain amount of requests — "brodock (Gabriel Mazetto) via ruby-core" <ruby-core@...>

Issue #19412 has been reported by brodock (Gabriel Mazetto).

13 messages 2023/02/03

[#112218] [Ruby master Bug#19414] uninitialized constant URI::WSS in 3.0.X and 3.1.X — "noraj (Alexandre ZANNI) via ruby-core" <ruby-core@...>

Issue #19414 has been reported by noraj (Alexandre ZANNI).

7 messages 2023/02/05

[#112220] [Ruby master Bug#19415] Incorrect circularity warning for concurrent requires — "fxn (Xavier Noria) via ruby-core" <ruby-core@...>

Issue #19415 has been reported by fxn (Xavier Noria).

7 messages 2023/02/05

[#112245] [Ruby master Bug#19421] Distribution documentation — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19421 has been reported by ioquatix (Samuel Williams).

21 messages 2023/02/07

[#112262] [Ruby master Feature#19422] Make `--enabled-shared` mandatory on macOS — "nobu (Nobuyoshi Nakada) via ruby-core" <ruby-core@...>

Issue #19422 has been reported by nobu (Nobuyoshi Nakada).

8 messages 2023/02/07

[#112284] [Ruby master Bug#19424] Degradation in **Marshal load** only in Ruby 3.1.2 compared to 2.7.4 — "sumitdey035 (Sumit Dey) via ruby-core" <ruby-core@...>

Issue #19424 has been reported by sumitdey035 (Sumit Dey).

14 messages 2023/02/08

[#112304] [Ruby master Bug#19427] Marshal.load(source, freeze: true) doesn't freeze in some cases — "andrykonchin (Andrew Konchin) via ruby-core" <ruby-core@...>

Issue #19427 has been reported by andrykonchin (Andrew Konchin).

14 messages 2023/02/09

[#112320] [Ruby master Misc#19429] DevMeeting-2023-03-09 — "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>

Issue #19429 has been reported by mame (Yusuke Endoh).

15 messages 2023/02/10

[#112326] [Ruby master Feature#19430] Contribution wanted: DNS lookup by c-ares library — "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>

Issue #19430 has been reported by mame (Yusuke Endoh).

16 messages 2023/02/10

[#112329] [Ruby master Misc#19431] DevMeeting at RubyKaigi 2023 — "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>

Issue #19431 has been reported by mame (Yusuke Endoh).

35 messages 2023/02/10

[#112398] [Ruby master Feature#19435] Expose counts for each GC reason in GC.stat — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #19435 has been reported by byroot (Jean Boussier).

10 messages 2023/02/13

[#112399] [Ruby master Bug#19436] Call Cache for singleton methods can lead to "memory leaks" — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #19436 has been reported by byroot (Jean Boussier).

25 messages 2023/02/13

[#112433] [Ruby master Bug#19439] Marshal.load doesn't load Regexp instance variables — "andrykonchin (Andrew Konchin) via ruby-core" <ruby-core@...>

Issue #19439 has been reported by andrykonchin (Andrew Konchin).

8 messages 2023/02/15

[#112446] [Ruby master Bug#19442] Remove USE_RINCGC flag — "eightbitraptor (Matthew Valentine-House) via ruby-core" <ruby-core@...>

Issue #19442 has been reported by eightbitraptor (Matthew Valentine-House).

10 messages 2023/02/16

[#112457] [Ruby master Feature#19443] Cache `Process.pid` — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #19443 has been reported by byroot (Jean Boussier).

16 messages 2023/02/16

[#112494] [Ruby master Feature#19450] Is there an official way to set a class name without setting a constant? — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19450 has been reported by ioquatix (Samuel Williams).

27 messages 2023/02/20

[#112503] [Ruby master Feature#19451] Extract path and line number from SyntaxError? — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19451 has been reported by ioquatix (Samuel Williams).

9 messages 2023/02/20

[#112505] [Ruby master Bug#19452] `Thread::Backtrace::Location` should have column information if possible. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19452 has been reported by ioquatix (Samuel Williams).

13 messages 2023/02/20

[#112533] [Ruby master Bug#19455] Ruby 3.2: wrong Regexp encoding with non-ASCII comments — janosch-x via ruby-core <ruby-core@...>

Issue #19455 has been reported by janosch-x (Janosch M=FCller).

7 messages 2023/02/22

[#112538] [Ruby master Feature#19458] Expose HEREDOC identifier — "joelhawksley (Joel Hawksley) via ruby-core" <ruby-core@...>

SXNzdWUgIzE5NDU4IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGpvZWxoYXdrc2xleSAoSm9lbCBIYXdr

14 messages 2023/02/22

[#112552] [Ruby master Bug#19461] Time.local performance tanks in forked process (on macOS only?) — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19461 has been reported by ioquatix (Samuel Williams).

11 messages 2023/02/23

[#112584] [Ruby master Feature#19465] [PATCH] reuse open(2) from rb_file_load_ok on POSIX-like system — "normalperson (Eric Wong) via ruby-core" <ruby-core@...>

Issue #19465 has been reported by normalperson (Eric Wong).

9 messages 2023/02/25

[ruby-core:112573] [Ruby master Bug#18286] Universal arm64/x86_84 binary built on an x86_64 machine segfaults/is killed on arm64

From: "benhamilton (Ben Hamilton) via ruby-core" <ruby-core@...>
Date: 2023-02-24 17:25:47 UTC
List: ruby-core #112573
Issue #18286 has been updated by benhamilton (Ben Hamilton).


I also reproduced the `SIGSEGV` from the original bug using a build with debug symbols:

```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
  * frame #0: 0x00000001002444b4 ruby`ruby_vm_special_exception_copy [inlined] RBASIC_CLASS(obj=0) at rbasic.h:155:25
    frame #1: 0x00000001002444b4 ruby`ruby_vm_special_exception_copy(exc=0) at vm_insnhelper.c:52:42
    frame #2: 0x0000000100244584 ruby`ec_stack_overflow(ec=0x0000000100704920, setup=1) at vm_insnhelper.c:65:16
    frame #3: 0x0000000100244504 ruby`rb_ec_stack_overflow(ec=0x0000000100704920, crit=0) at vm_insnhelper.c:97:5
    frame #4: 0x000000010026b544 ruby`rb_call0(ec=0x0000000100704920, recv=4300956680, mid=3121, argc=1, argv=0x000000016fdff3e0, call_scope=<unavailable>, self=4) at rgengc.h:0:9
    frame #5: 0x000000010013ca30 ruby`rb_class_new_instance [inlined] rb_class_new_instance_kw(argc=1, argv=0x000000016fdff3e0, klass=<unavailable>, kw_splat=0) at object.c:2025:5
    frame #6: 0x000000010013c9f0 ruby`rb_class_new_instance(argc=1, argv=0x000000016fdff3e0, klass=<unavailable>) at object.c:2033:12
    frame #7: 0x00000001000953c0 ruby`rb_exc_new_str(etype=<unavailable>, str=4300956720) at error.c:1145:12
    frame #8: 0x000000010025d668 ruby`rb_vm_register_special_exception_str(sp=ruby_error_reenter, cls=<unavailable>, mesg=<unavailable>) at vm.c:2872:17
    frame #9: 0x00000001000a1d50 ruby`Init_eval at eval.c:2091:5
    frame #10: 0x00000001000d51fc ruby`rb_call_inits at inits.c:41:5
    frame #11: 0x000000010009fa14 ruby`ruby_setup at eval.c:89:9
    frame #12: 0x000000010009fa90 ruby`ruby_init at eval.c:101:17
    frame #13: 0x0000000100004610 ruby`main [inlined] rb_main(argc=1, argv=0x000000016fdff938) at main.c:37:5
    frame #14: 0x0000000100004604 ruby`main(argc=1, argv=0x000000016fdff938) at main.c:57:12
    frame #15: 0x000000018599be50 dyld`start + 2544

(snip)

(lldb) print *ec
(rb_execution_context_t) $7 = {
  vm_stack = 0x0000000108028000
  vm_stack_size = 131072
  cfp = 0x0000000108127fc0
  tag = 0x000000016fdff4b0
  interrupt_flag = 0
  interrupt_mask = 0
  fiber_ptr = 0x00000001007048d0
  thread_ptr = 0x0000000100704260
  local_storage = NULL
  local_storage_recursive_hash = 4
  local_storage_recursive_hash_for_trace = 4
  storage = 4
  root_lep = 0x0000000000000000
  root_svar = 0
  ensure_list = NULL
  trace_arg = NULL
  errinfo = 4
  passed_block_handler = 0
  raised_flag = '\0'
  method_missing_reason = MISSING_NOENTRY
  private_const_reference = 0
  machine = {
    stack_start = 0x000000016fdff4ac
    stack_end = 0x000000016fdff2c0
    stack_maxsize = 0

(snip)

(lldb) print ec->machine.stack_start
(VALUE *) $4 = 0x000000016fdff4ac
(lldb) print ec->machine.stack_end
(VALUE *) $5 = 0x000000016fdff2c0
(lldb) print ec->machine.stack_end - ec->machine.stack_start
(long) $6 = -61

(snip)

(lldb) print ruby_stack_length(NULL)
(size_t) $8 = 18446744073709551529
```

Looks like it's got the stack direction backwards. I checked `config.log`, and it's incorrectly detecting the stack length as `+1` (growing towards larger addresses) for `arm64`:

```
| #if defined __x86_64__
| #define STACK_GROW_DIRECTION -1
| #endif /* defined __x86_64__ */
| #if defined __arm64__
| #define STACK_GROW_DIRECTION +1

(snip)

rb_cv_stack_grow_dir_arm64=+1
rb_cv_stack_grow_dir_x86_64=-1
```

Sent PR https://github.com/ruby/ruby/pull/7373 with this fix as well.


----------------------------------------
Bug #18286: Universal arm64/x86_84 binary built on an x86_64 machine segfaults/is killed on arm64
https://bugs.ruby-lang.org/issues/18286#change-102022

* Author: ccaviness (Clay Caviness)
* Status: Open
* Priority: Normal
* ruby -v: 3.0.2
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
A universal arm64/x86_84 ruby binary for macOS built on a x86_64 machine segfaults/is killed when executed on an arm64 machine.

To reproduce:
* On an Intel Mac: `git clone https://github.com/ruby/ruby && cd ruby && git checkout v3_0_2 && ./autogen.sh && ./configure --with-arch=arm64,x86_64 && make -j$(sysctl -n hw.ncpu)`
* Copy the built `./ruby` binary to an Apple Silicon machine
* Attempt to execute it

Expected:
The universal `ruby` binary works correctly on both devices

Actual:
The universal `ruby` binary crashes with either `Segmentation fault: 11` or `Killed: 9` (this seems to occur if `arm64e` is used instead of `arm64`).

Details:
I'm attempting to build a universal Ruby for macOS that will run on both Intel (x86_64) and Apple Silicon (arm64) machines.

It seemed initially that this was as easy as adding `--with-arch=arm64,x86_64` to `./configure` would do it, as it produced a `ruby` binary that reports as `Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]`

This `ruby` works correctly on the Intel machine I built in on, but does not work when copied to an Apple Silicon device. The reverse, however, seems to work. That is, if I build the universal ruby on an Apple Silicon machine, the `ruby` binary that's built seems to work correctly on both Intel and Apple Silicon machines.

Intel:
```
$ ./ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [universal.x86_64-darwin21]
```

Apple Silicon:
```
$ ./ruby -v
Segmentation fault: 11
$ lldb ./ruby
(lldb) target create "./ruby"
Current executable set to '/Users/crc/ruby' (arm64).
(lldb) run
Process 77071 launched: '/Users/crc/ruby' (arm64)
Process 77071 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x00000001002176b8 ruby`ruby_vm_special_exception_copy + 16
ruby`ruby_vm_special_exception_copy:
->  0x1002176b8 <+16>: ldr    x0, [x0, #0x8]
    0x1002176bc <+20>: bl     0x10011fed8               ; rb_class_real
    0x1002176c0 <+24>: bl     0x10012070c               ; rb_obj_alloc
    0x1002176c4 <+28>: mov    x20, x0
Target 0: (ruby) stopped.
(lldb) ^D
```

I also attempted the same thing with ruby 2.7.4 source, with the same result.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

In This Thread