tidalcycles / Tidal

Pattern language
http://tidalcycles.org/
GNU General Public License v3.0
2.28k stars 257 forks source link

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

Open cleary opened 2 years ago

cleary commented 2 years ago

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

Zalastax commented 2 years ago

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?

cleary commented 2 years ago

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

cleary commented 2 years ago

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
Zalastax commented 2 years ago

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:

cleary commented 2 years ago

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 :)

Zalastax commented 2 years ago

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,