Question

Cython compilation has suddenly started failing

Posted November 1, 2021 80 views
PythonDigitalOcean Droplets

I have a cythonised application which until yesterday was compiling and running completely fine.

Now, suddenly, when trying to compile (Ubuntu 20 droplet) I get this:

creating build/temp.linux-x86_64-3.8
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/var/www/anagami_console/anagami/anagamienv/include -I/usr/include/python3.8 -c event.c -o build/temp.linux-x86_64-3.8/event.o
x86_64-linux-gnu-gcc: fatal error: Killed signal terminated program cc1
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

The same code compiles and runs perfectly on my windows desktop using python 3.9.

1 comment
  • Way of fixing it was to erase each and every .c and .pyd record and recompile new. I’m as yet not certain what was causing the first mistake - yet erasing + doing a totally new recompile fixed it.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hello,

It sounds like that the server might be running out of memory. I could suggest checking your system logs to see if there are any OOM messages there.

If this is the case, you could try adding more RAM to the server or alternatively you could create a swap partition to have some extra buffer:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04

Best,
Bobby

by Brian Boucheron
One way to guard against out-of-memory errors in applications is to add some swap space to your server. In this guide, we will cover how to add a swap file to an Ubuntu 20.04 server.