aconchillo / homebrew-guile

A Homebrew Tap for Guile libraries and applications.
41 stars 1 forks source link

guile fibers crashing on M3 airbook (Mac15,12) using guile-next #321

Open dannyob opened 2 months ago

dannyob commented 2 months ago

(This also means that guile goblins doesn't work)

I've included the versions and lldb dump below. Hope that helps, happy to help more!

Thanks for all your work,

lldb -- guile -c '(use-modules (fibers))'

(lldb) target create "guile"
Current executable set to '/opt/homebrew/bin/guile' (arm64).
(lldb) settings set -- target.run-args  "-c" "(use-modules (fibers))"
(lldb) run
Process 90216 launched: '/opt/homebrew/bin/guile' (arm64)
;;; note: source file /opt/homebrew/share/guile/site/3.0/fibers/config.scm
;;;       newer than compiled /opt/homebrew/lib/guile/3.0/site-ccache/fibers/config.go
;;; found fresh local cache at /Users/danny/.cache/guile/ccache/3.0-LE-8-4.7/opt/homebrew/Cellar/fibers/1.3.1_1/share/guile/site/3.0/fibers/config.scm.go
Process 90216 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x00000001011bc584 libguile-3.0.1.dylib`scm_from_utf8_symboln + 684
libguile-3.0.1.dylib`scm_from_utf8_symboln:
->  0x1011bc584 <+684>: ldr    x0, [x8, #0x8]
    0x1011bc588 <+688>: adrp   x2, 0
    0x1011bc58c <+692>: add    x2, x2, #0x5d4            ; utf8_lookup_predicate_fn
    0x1011bc590 <+696>: add    x3, sp, #0x8
Target 0: (guile) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
  * frame #0: 0x00000001011bc584 libguile-3.0.1.dylib`scm_from_utf8_symboln + 684
    frame #1: 0x0000000101149ac4 libguile-3.0.1.dylib`create_subr + 208
    frame #2: 0x0000000100f3f520 fibers-libevent.0.so`init_fibers_libevt + 88
    frame #3: 0x000000010063bcf0 libguile-3.0.1.dylib`scm_dynamic_call + 20
    frame #4: 0x00000001006329d0 libguile-3.0.1.dylib`vm_regular_engine + 4328
    frame #5: 0x000000010063153c libguile-3.0.1.dylib`scm_call_n + 352
    frame #6: 0x00000001005e554c libguile-3.0.1.dylib`scm_primitive_load_path + 940
    frame #7: 0x00000001006329d0 libguile-3.0.1.dylib`vm_regular_engine + 4328
    frame #8: 0x000000010063153c libguile-3.0.1.dylib`scm_call_n + 352
    frame #9: 0x00000001005e554c libguile-3.0.1.dylib`scm_primitive_load_path + 940
    frame #10: 0x00000001006329d0 libguile-3.0.1.dylib`vm_regular_engine + 4328
    frame #11: 0x000000010063153c libguile-3.0.1.dylib`scm_call_n + 352
    frame #12: 0x00000001005e554c libguile-3.0.1.dylib`scm_primitive_load_path + 940
    frame #13: 0x00000001006329d0 libguile-3.0.1.dylib`vm_regular_engine + 4328
    frame #14: 0x000000010063153c libguile-3.0.1.dylib`scm_call_n + 352
    frame #15: 0x00000001005a63a4 libguile-3.0.1.dylib`scm_eval + 160
    frame #16: 0x00000001006329d0 libguile-3.0.1.dylib`vm_regular_engine + 4328
    frame #17: 0x000000010063153c libguile-3.0.1.dylib`scm_call_n + 352
    frame #18: 0x00000001005a63a4 libguile-3.0.1.dylib`scm_eval + 160
    frame #19: 0x000000010060ee98 libguile-3.0.1.dylib`scm_shell + 80
    frame #20: 0x00000001005bf178 libguile-3.0.1.dylib`invoke_main_func + 64
    frame #21: 0x00000001005a17b4 libguile-3.0.1.dylib`c_body + 24
    frame #22: 0x00000001006329d0 libguile-3.0.1.dylib`vm_regular_engine + 4328
    frame #23: 0x000000010063153c libguile-3.0.1.dylib`scm_call_n + 352
    frame #24: 0x000000010062f258 libguile-3.0.1.dylib`catch_body + 184
    frame #25: 0x00000001005a7ac4 libguile-3.0.1.dylib`scm_c_with_exception_handler + 400
    frame #26: 0x00000001005a1714 libguile-3.0.1.dylib`scm_i_with_continuation_barrier + 156
    frame #27: 0x00000001005a178c libguile-3.0.1.dylib`scm_c_with_continuation_barrier + 80
    frame #28: 0x000000010062d128 libguile-3.0.1.dylib`with_guile + 76
    frame #29: 0x00000001006dd364 libgc.1.dylib`GC_call_with_stack_base + 36
    frame #30: 0x00000001005bf124 libguile-3.0.1.dylib`scm_boot_guile + 68
    frame #31: 0x0000000100003ec8 guile`main + 192
    frame #32: 0x0000000184c6e0e0 dyld`start + 2360
(lldb) 

brew info aconchillo/guile/guile-next aconchillo/guile/fibers

==> aconchillo/guile/guile-next: stable 3.0.9 (bottled)
GNU Ubiquitous Intelligent Language for Extensions
https://www.gnu.org/software/guile/
Installed
/opt/homebrew/Cellar/guile-next/3.0.9_4 (858 files, 61MB) *
  Poured from bottle on 2024-05-11 at 06:41:49
From: https://github.com/aconchillo/homebrew-guile/blob/HEAD/Formula/guile-next.rb
License: LGPL-3.0-or-later
==> Dependencies
Build: autoconf ✔, automake ✘, gettext ✔, gnu-sed ✔, texinfo ✔
Required: bdw-gc ✔, gmp ✔, libtool ✔, libunistring ✔, pkg-config ✔, readline ✔
==> Caveats
To use `guile-next` you need to unlink `guile` and then link `guile-next`:
  brew unlink guile
  brew link guile-next

Guile libraries can now be installed here:
    Source files: /opt/homebrew/share/guile/site/3.0
  Compiled files: /opt/homebrew/lib/guile/3.0/site-ccache
      Extensions: /opt/homebrew/lib/guile/3.0/extensions

Add the following to your .bashrc or equivalent:
  export GUILE_LOAD_PATH="/opt/homebrew/share/guile/site/3.0"
  export GUILE_LOAD_COMPILED_PATH="/opt/homebrew/lib/guile/3.0/site-ccache"
  export GUILE_SYSTEM_EXTENSIONS_PATH="/opt/homebrew/lib/guile/3.0/extensions"

==> aconchillo/guile/fibers: stable 1.3.1 (bottled)
Concurrency library for Guile
https://github.com/wingo/fibers
Installed
/opt/homebrew/Cellar/fibers/1.3.1_1 (58 files, 2.6MB) *
  Poured from bottle on 2024-07-11 at 12:47:41
From: https://github.com/aconchillo/homebrew-guile/blob/HEAD/Formula/fibers.rb
==> Dependencies
Build: autoconf ✔, automake ✘, texinfo ✔
Required: guile ✔, libevent ✔
==> Caveats
Remember to add the following to your .bashrc or equivalent in order to use this module:
  export GUILE_LOAD_PATH="/opt/homebrew/share/guile/site/3.0"
  export GUILE_LOAD_COMPILED_PATH="/opt/homebrew/lib/guile/3.0/site-ccache"
  export GUILE_SYSTEM_EXTENSIONS_PATH="/opt/homebrew/lib/guile/3.0/extensions"
aconchillo commented 1 month ago

@dannyob thank you for reporting this and for the sponsor :heart: ! i'll take a look as soon as i can. I was on vacation for a couple of weeks and just catching up with work and others.

dannyob commented 1 month ago

No hurry! One thing I noticed was downloading and building guile-fibers from scratch on my Mac worked fine. Not sure which compiler it was using, but I can find out if it is useful to you!

aconchillo commented 1 month ago

Hi! I checked (and actually pushed a new guile-next) and could reproduce the issue. I believe the .go files should be compatible between versions so not sure what's going on. I will ask the guile-user mailing list and see what they say.