Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CrashReporter: unbreak build on FreeBSD #5786

Merged
merged 3 commits into from Apr 30, 2024
Merged

CrashReporter: unbreak build on FreeBSD #5786

merged 3 commits into from Apr 30, 2024

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented Apr 28, 2024

Regressed by #5771. POSIX.1-2017 and FreeBSD don't define sa_restorer while Linux discourages usage in applications. As Hyprland just want to zero-init check for a related macro in order to catch all platforms that may have the field.

writeCmdOutput appears broken:

--- /home/test/.cache/hyprland/hyprlandCrashReport1111.txt	before
+++ /home/test/.cache/hyprland/hyprlandCrashReport2222.txt	after
@@ -1,13 +1,12 @@ --------------------------------------------
 --------------------------------------------
    Hyprland Crash Report
 --------------------------------------------
-Calm down, it was a misinput! MISINPUT!
+Oops
 
-Hyprland received signal 11 (Segmentation fault)
+Hyprland received signal 11(SEGV)
+Version: 2e763764bfdaee2039961c6c220b5d6af31712d4
+Tag: v0.39.1-91-g2e763764
 
-Version: e400a288d0f8ef75672cb201203b857b65b782bb
-Tag: v0.39.1-88-ge400a288
-
 System info:
 	System name: FreeBSD
 	Node name: foo.bar
@@ -16,22 +15,7 @@
 
 GPU:
-	vgapci0@pci0:0:2:0:	class=0x030000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x1912 subvendor=0x1462 subdevice=0x7968
-    vendor     = 'Intel Corporation'
-    device     = 'HD Graphics 530'
-    class      = display
-    subclass   = VGA
-
-os-release:
-	NAME=FreeBSD
-	VERSION="15.0-CURRENT"
-	VERSION_ID="15.0"
-	ID=freebsd
-	ANSI_COLOR="0;31"
-	PRETTY_NAME="FreeBSD 15.0-CURRENT"
-	CPE_NAME="cpe:/o:freebsd:freebsd:15.0"
-	HOME_URL="https://FreeBSD.org/"
-	BUG_REPORT_URL="https://bugs.FreeBSD.org/"
 	
 
-
+os-release:
+<execv(cat /etc/os-release | sed 's/^/	/') resulted in errno �>
 Backtrace:

@vaxerski
Copy link
Member

needs a clang-format.

Anyways, any chance of fixing writeCmdOutput for bsd?

In file included from src/debug/CrashReporter.cpp:10:
src/debug/signal-safe.hpp:113:17: error: no member named 'sa_restorer' in 'sigaction'
            act.sa_restorer = NULL;
            ~~~ ^
execv() may fail with EFAULT otherwise.
hyprpm/src/core/PluginManager.cpp:165:43: error: use of undeclared identifier 'getuid'
  165 |     const std::string USERNAME = getpwuid(getuid())->pw_name;
      |                                           ^
hyprpm/src/core/PluginManager.cpp:431:45: error: use of undeclared identifier 'getuid'
  431 |     const std::string USERNAME   = getpwuid(getuid())->pw_name;
      |                                             ^
hyprpm/src/core/PluginManager.cpp:558:43: error: use of undeclared identifier 'getuid'
  558 |     const std::string USERNAME = getpwuid(getuid())->pw_name;
      |                                           ^
@jbeich
Copy link
Contributor Author

jbeich commented Apr 30, 2024

Done: both GPU and os-release show up in the log again. I didn't investigate errno value printed as garbage (ASCII non-printable character).

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@vaxerski vaxerski merged commit 07e0700 into hyprwm:main Apr 30, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants