Skip to content

Non-moving collector segmentation fault with ghcide

Summary

Segmentation fault that occurs when running ghcide with -xn on 8.10.1

https://github.com/digital-asset/ghcide/issues/512

Reading symbols from /home/pepe/scratch/ghcide/dist-newstyle/build/x86_64-linux/ghc-8.10.1/ghcide-0.1.0/x/ghcide/build/ghcide/ghcide...
[New LWP 23766]
[New LWP 23298]
[New LWP 23321]
[New LWP 23301]
[New LWP 23310]
[New LWP 23326]
[New LWP 23320]
[New LWP 23330]
[New LWP 23318]
[New LWP 23380]
[New LWP 23322]
[New LWP 23316]
[New LWP 23383]
[New LWP 23424]
[New LWP 23302]
[New LWP 23314]
[New LWP 23311]
[New LWP 23308]
[New LWP 23312]
[New LWP 23669]
[New LWP 23317]
[New LWP 23611]
[New LWP 23454]
[New LWP 23315]
[New LWP 23299]
[New LWP 23381]
[New LWP 23313]
[New LWP 23300]
[New LWP 23332]
[New LWP 23319]
[New LWP 23329]
[New LWP 23389]
[New LWP 23323]
[New LWP 23349]
[New LWP 23328]
[New LWP 23327]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libthread_db.so.1".
Core was generated by `/home/pepe/scratch/ghcide/dist-newstyle/build/x86_64-linux/ghc-8.10.1/ghcide-0.'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000003e8bdbd in nonmovingSweepMutLists ()
[Current thread is 1 (Thread 0x7f5f02928700 (LWP 23766))]
(gdb) bt
#0  0x0000000003e8bdbd in nonmovingSweepMutLists ()
#1  0x0000000003e6a47c in nonmovingMark_.constprop.0 ()
#2  0x0000000003e6a655 in nonmovingConcurrentMark ()
#3  0x00007f5fbbe78edd in start_thread () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libpthread.so.0
#4  0x00007f5fbbbbaa4f in clone () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6

Steps to reproduce

  1. Build ghcide with 8.10.1. I am using https://github.com/digital-asset/ghcide/pull/519/commits/cd175ff57435eb56ae93a53e9121e9fa860a1a7a and http://github.com/pepeiborra/nixpkgs

  2. Install the ghcide extension in VSCode and change the settings to:

  • point at the ghcide binary built with 8.10.1, and
  • add the flags +RTS -xn -I0.1 to the default --lsp
  1. Load the ghcide project in VSCode, editing the hie.yaml file if necessary to make it use your build system
  2. Make sure the Output window is showing the "Haskell IDE Core" output. Keep an eye on this window to notice when VSCode restarts ghcide after a crash.
  3. Using the workspace tree widget, open various files in the editor to build up the heap until reaching ~ 1G
  4. Open a file and make random edits for a while.

Expected behavior

After a few edits, a segfault occurs

Environment

  • GHC version used: 8.10.1

Optional:

  • Operating System: tested on Ubuntu and Mac OS
  • System Architecture: x86
Edited by Pepe Iborra
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information