Closed Joshix-1 closed 2 years ago
I tried some ways to run uwufetch with python:
#!/bin/env python3
import os
import subprocess
os.system("uwufetch")
print(os.popen("uwufetch").read())
subprocess.call("uwufetch")
subprocess.run("uwufetch")
But all of them work without problems, could you post the line where uwufetch is called? Do you edit some system variables in the program before running uwufetch?
I run it with asyncio.create_subprocess_exec. (it didn't work with asyncio.create_subprocess_shell or os.popen either) It's really strange. I run the same code on two different machines and on one it works and on another (a vps) it doesn't.
How could editing system variables affect uwufetch? Or what could affect uwufetch in this way?
If you really want to see the code: https://github.com/asozialesnetzwerk/an-website/blob/main/an_website/host_info/host_info.py#L64 calls https://github.com/asozialesnetzwerk/an-website/blob/main/an_website/utils/utils.py#L165
I run it with asyncio.create_subprocess_exec.
I did the same and it works
It didn't work with asyncio.create_subprocess_shell or os.popen either
With os.popen you should call its read() method
It's really strange. I run the same code on two different machines and on one it works and on another (a vps) it doesn't.
What if you use gdb to debug it in the python script (if you have access to the console)?
How could editing system variables affect uwufetch? Or what could affect uwufetch in this way?
In some cases changing some variable (i. e. $LANG) some program called by uwufetch could change its output and break the get_info() function
Sorry, miss clicked
I think the ekzem is that the python program gets run with supervisord. That means that not all the required env vars are set. LANG, PATH, HOME, USER are all set
Some observations:
running env -i uwufetch
produces a segfault.
uwufetch uses vfork often
dumping the current env in a text and then using it to run uwufetch produces an error
the command: env | sed -E 's/^([^=]+)=(.+)$/\1="\2"/g' > env.txt
Yes this is the solution, $HOME
and $SHELL
are not set in env
I'm experiencing a reliable segfault on a VPS of mine, while running uwufetch from a python program. I can't reproduce this on my main machine or outside of the python program. I don't have any idea what the cause could be.
Output of dmesg:
output of journalctl:
uwufetch running fine on the same vps:![2021-09-19_13-45](https://user-images.githubusercontent.com/57299889/133926309-826f3dd8-603a-4164-ba58-9d95d19c9eb4.png)