cookcli: segmentation fault when running cook server

Running on arch linux I get a segmentation fault on v0.1.3:

> cook server
Started server on http://127.0.0.1:9080, serving cook files from /home/ludwig/Documents/cook.
zsh: segmentation fault (core dumped)  cook server

but only after I open the webpage in my browser. I tried it both with the provided binary and with a self compiled binary.

Furthermore, with v0.1.2 I get an instant segmentation fault and with v0.0.13 it works.

I hope somebody can help me, or that this bug report will be of some help. Awesome project!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 8
  • Comments: 22 (6 by maintainers)

Most upvoted comments

@mjsr @ruudschouten @dpgeekzero thanks for sharing information about the context of an error.

I believe this happens because of recent updates made in Linux. Similar issue reported for statically compiled binaries which use nss library after update to glibc version 2.32+. I tried to avoid using nss https://github.com/cooklang/CookCLI/pull/46, but it seems there’re other places which use it internally.

As a workaround you can build cli manually. In that case project will use libraries from your machine and there will be no issues.

In longterm I’m migrating away from Swift because it causes unnecessary issues with cross-platform support. First step is to implement canonical parser in C. Then I’ll migrate CLI to go which has great cross-platform support.

Also, you can contribute and add CookCLI to your Linux distribution. See an example for Archlinux.

I migrated CLI to Rust and issue should be resolved. You can download binary from the releases. Please, reopen issue if needed.

I’m running into the same issue with 0.1.6, on WSL Ubuntu LTS. Tried with my existing recipes, and the ones generated from seed. Everything seems to work fine, until I navigate to localhost:9080, which is when Segmentation fault is printed in the log.

I did go ahead and tried a few previous versions, because it did work for me at one point, and 0.1.3 works without the error popping up, and I can navigate through my recipes.

also, screenfetch just in case you need it;

                          ./+o+-       ruuds@DESKTOP-5HH2MOP
                  yyyyy- -yyyyyy+      OS: Ubuntu 22.04 jammy(on the Windows Subsystem for Linux)
               ://+//////-yyyyyyo      Kernel: x86_64 Linux 5.4.72-microsoft-standard-WSL2
           .++ .:/++++++/-.+sss/`      Uptime: 13m
         .:++o:  /++++++++/:--:/-      Packages: 604
        o:+o+:++.`..```.-/oo+++++/     Shell: bash 5.1.16
       .:+o:+o/.          `+sssoo+/    Disk: 6.3T / 7.6T (84%)
  .++/+:+oo+o:`             /sssooo.   CPU: AMD Ryzen 7 3700X 8-Core @ 16x 3.593GHz
 /+++//+:`oo+o               /::--:.   GPU: NVIDIA GeForce RTX 2080
 \+/+o+++`o++o               ++////.   RAM: 474MiB / 25615MiB
  .++.o+++oo+:`             /dddhhh.  
       .+.o+oo:.          `oddhhhh+   
        \+.++o+o``-````.:ohdhhhhh+    
         `:o+++ `ohhhhhhhhyo++os:     
           .o:`.syhhhhhhh/.oo++o`     
               /osyyyyyyo++ooo+++/    
                   ````` +oo+++o\:    
                          `oo++.      

I also get this seg fault on manjaro using cook 0.1.4

I have a fresh directory, unzipped cook 0.1.4 into it, ran ./cook seed, ran ./cook server and received the output: Started server on http://127.0.0.1:9080, serving cook files from /path/to/cook.d.

Immediately after loading the page in a browser I get fish: Job 1, './cook server' terminated by signal SIGSEGV (Address boundary error)

It may be noteworthy that no recipes actually loaded on the web page. I have tried running cook as root, to no avail.

Hey, it’s not dead, but rather dormant 😅. You can try to compile manually and it should resolve the issue. Alternatively as we’re migrating CLI to rust you can check out this PoC https://github.com/Zheoni/cooklang-chef.

I just installed the binary today on Pop!_OS 22.04 LTS and I’m also getting the segfault.

Ok I spent 4 hours trying to build cooklang-git from the aur, only to have it fail. Ever the optimist, I tried it one more time (another 4 hours), to be met with the same fate.

So it would seem there’s no way to get 0.1.6 working on manjaro linux at the present time.

@dubadub makes sense. I’ll try to work around that although it might be hacky 😃

Thanks @mjsr for looking at this. Yeah, embedding is kind of ugly, but allows us to make a portable binary file without any dependencies or installation required.

@dubadub - Archlinux here

                   -`
                  .o+`                 
                 `ooo/                 OS: Arch Linux
                `+oooo:                Kernel: x86_64 Linux 5.18.14-arch1-1
               `+oooooo:               Uptime: 2d 3m
               -+oooooo+:              Packages: 1600
             `/:-:++oooo+:             Shell: fish 3.4.1
            `/++++/+++++++:            Resolution: 5120x1440
           `/++++++++++++++:           DE: KDE 5.96.0 / Plasma 5.25.3
          `/+++ooooooooooooo/`         WM: KWin
         ./ooosssso++osssssso+`        GTK Theme: Breeze [GTK2/3]
        .oossssso-````/ossssss+`       Icon Theme: breeze-dark
       -osssssso.      :ssssssso.      Disk: 260G / 477G (58%)
      :osssssss/        osssso+++.     CPU: Intel Core i7-9850H @ 12x 4.6GHz [51.0°C]
     /ossssssss/        +ssssooo/-     GPU: Quadro T1000
   `/ossssso+/:-        -:/+osssso+-   RAM: 10801MiB / 31731MiB
  `+sso+:-`                 `.-/+oso:
 `++:.                           `-/+/
 .`                                 `/