13-CF / afetch

Simple system info written in C
GNU General Public License v3.0
223 stars 39 forks source link

Hangs on Ubuntu 20.10 #57

Closed vaskark closed 3 years ago

vaskark commented 3 years ago

afetch hangs when run. If other info is needed please reply.

13-CF commented 3 years ago

Are you using the latest version? Someone had this problem when running it on an ARM CPU but it was fixed ages ago. Does it display any text at all, or does it not display anything?

What's the output of cat /etc/os-release, and what's the output when you run uname -m? I'll set up an Ubuntu VM so I can run GDB to see where it's freezing.

vaskark commented 3 years ago

Yes, it's the latest version, updated today. No text is displayed at all.

cat /etc/os-release:

NAME="Ubuntu"
VERSION="20.10 (Groovy Gorilla)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.10"
VERSION_ID="20.10"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=groovy
UBUNTU_CODENAME=groovy

uname -m:

x86_64

Hopefully this info helps. afetch is a great app. Keep up the great work!

vaskark commented 3 years ago

Also, here's the output of make:

cc -O2 -std=c99 -Wall -Wextra src/fetch.c -lpthread -o afetch
src/fetch.c: In function ‘pipeRead’:
src/fetch.c:29:2: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   29 |  fscanf(pipe, "%[^\n]s", returnVal);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13-CF commented 3 years ago

I think it's an issue with glibc, someone else had the same issue. It compiles without any warnings on Alpine Linux (musl libc), OpenBSD, FreeBSD and MacOS (all of which use their own libc).

Edit: Tried on a Debian VM, didn't get the compiler warning but it had the same issue as yours.

I know what area of the code is responsible for the problem, so I should hopefully have a fix soon.

tormath1 commented 3 years ago

@13-CF it now works fine on Gentoo with this PR: #58 :wink:

13-CF commented 3 years ago

I've tested it on Debian after PR #58 and it works perfectly, so it should work on Ubuntu. Let us know how you get on!

vaskark commented 3 years ago

Yup. Works fine on Ubuntu now. Many thanks.

13-CF commented 3 years ago

Great to hear, you can thank @KikooDX for fixing the Linux section of the os() function.