Tidal icon indicating copy to clipboard operation
Tidal copied to clipboard

tidal-1.9.2 segfaults on 32-bit/i386 with startTidal(...)

Open cleary opened this issue 2 years ago • 6 comments

tested on devuan 4.0/i386 (debian-based)

cabal-install version 3.0.0.0
compiled using version 3.0.1.0 of the Cabal library

Confirmed using the BootTidal.hs loaded directly in ghci - if I comment the startTidal(...) line, the file loads cleanly to the end

If I include the startTidal(...) line, I get the following:

GHCi, version 8.8.4: https://www.haskell.org/ghc/  :? for help
Loaded package environment from /home/bernie/.ghc/i386-linux-8.8.4/environments/default
Prelude> :script BootTidal.hs
[TidalCycles version 1.9.2]
Installed in /home/bernie/.cabal/store/ghc-8.8.4/tidal-1.9.2-aa64e723f878646ed318ab6b17f3cd857dfb5f63d554d046ddd2930bf1e986a0/share
Listening for external controls on 127.0.0.1:6010
Segmentation fault

If I revert to tidal-1.8.0, it works as expected

cleary avatar Oct 14 '22 19:10 cleary

Hi @cleary, Tidal 1.9.x interops with C++ to use Ableton Link. C++ interop is not so common in Haskell, so the bug might be in GHC. There's a possibility that the issue you are facing is solved in later versions of GHC - this is the case for Windows. Would you be willing to try upgrading GHC and report back?

Zalastax avatar Oct 17 '22 21:10 Zalastax

Yep can do, I'll get back to you in a couple of days 🙂

cleary avatar Oct 18 '22 05:10 cleary

Never mind the build issues, ghcup came to my rescue - same error on ghc 9.2.4

bernie@devuan-i386:~/source$ ghci
Loaded package environment from /home/bernie/.ghc/i386-linux-9.2.4/environments/default
GHCi, version 9.2.4: https://www.haskell.org/ghc/  :? for help
ghci> :script /home/bernie/.cabal/store/ghc-9.2.4/tidal-1.9.2-96c3396ea8d0e66a3e67dbf7446b6706312521a1cfe90b696d3a6f0d6cbd71fe/share/BootTidal.hs
[TidalCycles version 1.9.2]
Installed in /home/bernie/.cabal/store/ghc-9.2.4/tidal-1.9.2-96c3396ea8d0e66a3e67dbf7446b6706312521a1cfe90b696d3a6f0d6cbd71fe/share
Listening for external controls on 127.0.0.1:6010
Segmentation fault

cleary avatar Oct 19 '22 19:10 cleary

That's a bummer!

Does i386 mean that you have some unusual hardware? There is some risk that there is a bug in GHC. But finding a minimal case to report as a bug can take a fair amount of dedication.

Some things to try:

  • Start ghci with ghci -v3 to see if we can get some more details.
  • Run the hello function from tidal-link to see how far it gets https://github.com/tidalcycles/Tidal/blob/main/tidal-link/src/hs/Main.hs
  • Download https://github.com/Zalastax/ghc-bug-20918 to see if exception handling works as expected

Zalastax avatar Oct 23 '22 13:10 Zalastax

That's a bummer!

Does i386 mean that you have some unusual hardware? There is some risk that there is a bug in GHC. But finding a minimal case to report as a bug can take a fair amount of dedication.

No, it's a bog standard old Toshiba Satellite laptop with an x86_64 pentium cpu, just with an i386 install for the purposes of testing

Some things to try:

* Start ghci with `ghci -v3` to see if we can get some more details.

* Run the hello function from tidal-link to see how far it gets https://github.com/tidalcycles/Tidal/blob/main/tidal-link/src/hs/Main.hs

* Download https://github.com/Zalastax/ghc-bug-20918 to see if exception handling works as expected

I'll give this a look over the next few days - thanks :)

cleary avatar Oct 24 '22 03:10 cleary

Thanks a lot @cleary! If you get stuck, I can try booting a virtual machine with an i386 install to see how it behaves for me,

Zalastax avatar Oct 24 '22 20:10 Zalastax