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

Compilation error #52

Open
linvegas opened this issue Apr 25, 2024 · 24 comments
Open

Compilation error #52

linvegas opened this issue Apr 25, 2024 · 24 comments

Comments

@linvegas
Copy link

Hey there, i am trying to compile the program on Arch but i am facing theses error after running make:

/usr/bin/ld: /tmp/cc06hV2B.o: referência indefinida a símbolo "_ZN4absl12lts_2024011612log_internal17MakeCheckOpStringIPKvS4_EEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEET_T0_PKc"
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/libabsl_log_internal_check_op.so.2401.0.0: erro ao adicionar símbolos: DSO em falta da linha de comandos
collect2: error: ld returned 1 exit status
make: *** [makefile:18: matrix] Error 1

I know some bits are in portuguese, but they are basically saying "undefined reference at symbol" and "error adding symbols: DSO missing from command line"

I've already checked if the libraries were installed, maybe there is a missing library on the README code example?

@collinalexbell
Copy link
Owner

Someone else had this problem. I'll look into it. I'm not directly using libabsl, so I don't know where the requirement for that library is coming from at the moment.

@collinalexbell
Copy link
Owner

Could you tell me what distro you are using?

@linvegas
Copy link
Author

Could you tell me what distro you are using?

I am on arch, btw.

Someone else had this problem. I'll look into it. I'm not directly using libabsl, so I don't know where the requirement for that library is coming from at the moment.

Did a little research and apparently, on Arch Linux, the package protobuf depends on abseil-cpp , which is the package responsable for libabsl_log_internal_check_op.so, but i already have it installed and still it's not working.

@collinalexbell
Copy link
Owner

Ok. Good to know. Checkout the linker arguments in this PR. That should fix the problem. I'll have to think about how to add this in a distribution specific way. I reverted out the PR because it doesn't work on Ubuntu.

#48

@Nergon123
Copy link

Ok. Good to know. Checkout the linker arguments in this PR. That should fix the problem. I'll have to think about how to add this in a distribution specific way. I reverted out the PR because it doesn't work on Ubuntu.

#48

Had same problem, and this fixed issue for me, thanks.

I'm also using arch

@linvegas
Copy link
Author

linvegas commented Apr 26, 2024

Ok. Good to know. Checkout the linker arguments in this PR. That should fix the problem. I'll have to think about how to add this in a distribution specific way. I reverted out the PR because it doesn't work on Ubuntu.

#48

Thanks! It did solve the problem here, but now i can't actually execute the program (lol), the output says it's looking for things on /home/collin/matrix/matrix. Apparently you hard coded your project absolute path in some parts of you code. Have anyone actually manage to run this on your machine?

@Rafi1018
Copy link
Contributor

Ok. Good to know. Checkout the linker arguments in this PR. That should fix the problem. I'll have to think about how to add this in a distribution specific way. I reverted out the PR because it doesn't work on Ubuntu.
#48

Thanks! It did solve the problem here, but now i can't actually execute the program (lol), the output says it's looking for things on /home/collin/matrix/matrix. Apparently you hard coded your project absolute path in some parts of you code. Have anyone actually manage to run this on your machine?

are you using startx or your login manager to run it ?

@linvegas
Copy link
Author

are you using startx or your login manager to run it ?

startx, i've have configured it the way it's specified on the README, if i run in normal mode, it simply go back to login, but if i run on develop mode it starts to keep showing these error logs that i've mentioned.

@Rafi1018
Copy link
Contributor

are you using startx or your login manager to run it ?

startx, i've have configured it the way it's specified on the README, if i run in normal mode, it simply go back to login, but if i run on develop mode it starts to keep showing these error logs that i've mentioned.

oh can you share the errors?

@collinalexbell
Copy link
Owner

Hello all. Would someone with this libabsl error test this branch out to see if it works with arch linux?

#55

@vulnoryx
Copy link

Hello all. Would someone with this libabsl error test this branch out to see if it works with arch linux?

I have tested it. It compiled successfully but I cant get it to run (using startx).
It straight up crashes?

I launched my system without any display manager, logged in (using tty) and launched startx.
My screen went black for about 5 seconds, then X11 shut down.

@Rafi1018
Copy link
Contributor

Hello all. Would someone with this libabsl error test this branch out to see if it works with arch linux?

I have tested it. It compiled successfully but I cant get it to run (using startx). It straight up crashes?

I launched my system without any display manager, logged in (using tty) and launched startx. My screen went black for about 5 seconds, then X11 shut down.

did you add cd as well in the .xinitrc file make sure it's correct like in the readme & can you share what's the error?

@vulnoryx
Copy link

What I got after the black screen:

X.Org X Server 1.21.1.13
X Protocol Version 11, Revision 0
Current Operating System: Linux oneshot 6.6.28-1-lts #1 SMP PREEMPT_DYNAMIC Hed, 17 Apr 2024 10:11:09 +0000 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-linux-lts root=UUID=f582a0be-5f32-4796-8c71-61da99135986 ru zswap.enabled=0 rootfstype=ext4 nvidia-dra.nodeset=1 loglevel=3 quiet

Current version of pixman: 0.43.4
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(WA) uarning, (EE) error, (NI) not implemented, (??) unknoun
(++) from command line, (!!) notice, (II) informational,
(==) Log file: "/home/vuln/.local/share/xorg/Xorg.1.log", Time: Mon Apr 29 18:56:35 2024
(==) Using config file: "/etc/X11/xorg.conf'
Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
loading material textures
loading texture 0
loading material textures
loading material textures
loading texture
loading material textures
loading material textures
oading texture 0
loading aterial textures
loading material textures
loading texture
loading material textures
loading material textures
loading texture 8
loading material textures
loading material textures
loading texture 0
waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.connection to X server lostonOuner) Aton id in failed request: x1

I don't get an error or anything which is strange.

The log file at "/home/vuln/.local/share/xorg/Xorg.1.log" does not really contain any valuable information and does not seem to contain any errors (Any (EE) before the lines).

my ~/.xinitrc looks just like in the README file:

cd ~/Downloads/git/HackMatrix
exec ~/Downloads/git/HackMatrix/matrix

The matrix.log file located at /home/vuln/logs/ is empty.

Are there any other locations where I can check the logs for errors?

@collinalexbell
Copy link
Owner

Is the log file not located at ~/Downloads/git/HackMatrix/logs? That is somewhat suspicious to me. It may mean that the project isn't getting started in the right directory. Could you try to install terminator, comment out the previous .xinitrc and add exec terminator instead and the manually cd into ~/Downloads/git/HackMatrix and run ./matrix. Terminator isn't a window manager, so it is possible to start a window manager from it.

@vulnoryx
Copy link

Is the log file not located at ~/Downloads/git/HackMatrix/logs? That is somewhat suspicious to me. It may mean that the project isn't getting started in the right directory.

Thats probably because I messed up the cd command once. (but fixed it afterwards)

The contents of ~/Downloads/git/HackMatrix/logs/matrix.log is also not really interesting:

[2024-04-28 16:00:28.776] [wm] [debug] WindowManager()
[2024-04-28 16:07:31.956] [wm] [debug] WindowManager()
[2024-04-28 16:09:22.875] [wm] [debug] WindowManager()
[2024-04-28 16:10:13.946] [wm] [debug] WindowManager()
[2024-04-28 16:10:30.507] [wm] [debug] WindowManager()
[2024-04-28 16:18:38.417] [wm] [debug] WindowManager()
[2024-04-28 16:21:05.613] [wm] [debug] WindowManager()
[2024-04-28 16:27:04.593] [wm] [debug] WindowManager()
[2024-04-29 18:56:36.223] [wm] [debug] WindowManager()
[2024-04-30 17:17:08.410] [wm] [debug] WindowManager()
[2024-04-30 17:18:19.183] [wm] [debug] WindowManager()
[2024-04-30 17:22:19.784] [wm] [debug] WindowManager()
[2024-04-30 17:38:13.425] [wm] [debug] WindowManager()
[2024-04-30 17:38:39.067] [wm] [debug] WindowManager()
[2024-04-30 17:42:15.034] [wm] [debug] WindowManager()
[2024-04-30 17:42:40.037] [wm] [debug] WindowManager()
[2024-04-30 20:47:26.080] [wm] [debug] WindowManager()
[2024-04-30 20:49:34.250] [wm] [debug] WindowManager()
[2024-04-30 20:53:37.512] [wm] [debug] WindowManager()
[2024-04-30 21:03:27.239] [wm] [debug] WindowManager()

Could you try to install terminator, comment out the previous .xinitrc and add exec terminator instead and the manually cd into ~/Downloads/git/HackMatrix and run ./matrix. Terminator isn't a window manager, so it is possible to start a window manager from it.

For some reason terminator does not work because of something unrelated, so I launched my other terminal kitty instead.

I cd into the HackMatrix directory and launch ./matrix.
The first time I tried, I got this error:

X Error of failed request:  BadAtom (invalid Atom parameter)
  Major opcode of failed request:  22 (X_SetSelectionOwner)
  Atom id in failed request:  0x1d9
  Serial number of failed request:  71
  Current serial number in output stream:  72

After that I got this error:

matrix: /usr/src/debug/glfw/glfw-3.4/src/x11_init.c:1099: _glfwGrabErrorHandlerX11: Assertion `_glfw.x11.errorHandler == NULL' failed.
Aborted (core dumped)

@collinalexbell
Copy link
Owner

It is interesting that my XServer doesn't throw a bad atom but yours does. The atom was certainly bad. I just merged a PR. Pull master and the bad atom crash should at least be fixed.

@vulnoryx
Copy link

vulnoryx commented May 1, 2024

The bad atom error is now fixed, and HackMatrix started.

What works:

  • rendering and interacting with the imgui window
  • getting in and out of mouse mode

The issues I encounter:

  • I have a gray background
  • no keypresses are actually registered (kinda)
  • after I type something and press enter, HackMatrix crashes (means I cant actually start any app)
  • everyhing else

The outputted error after crash is:

...
loading texture 0
loading material textures
textureUnit: 20
textureUnit: 21
no data
ERROR::SHADER::VERTEX::COMPILATION_FAILED
0(7) : error C7626: Expected same underlying base data type for (location = 2) -- first definition at 0(6)

ERROR::SHADER::PROGRAM::LINKING_FAILED
Vertex info
-----------
0(7) : error C7626: Expected same underlying base data type for (location = 2) -- first definition at 0(6)
(0) : error C2003: incompatible options for link

Fragment info
-------------
0(2) : warning C7050: "FragColor" might be used before being initialized

creating geometry shader
lightspace transform: 0.1,3, -2
lightIndex: 0
lightspace transform: -1,6, -15
lightIndex: 1
lightspace transform: 0.1,3, -2
lightIndex: 0
lightspace transform: -1,6, -15
lightIndex: 1
name: select-ide
appName: 
HAS ALPHA
e2freefrag: missing device name.
usage: e2freefrag [-c chunksize in kb] [-h] device_name
Segmentation fault (core dumped)

@collinalexbell
Copy link
Owner

collinalexbell commented May 1, 2024

Ok. Looks like a limitation of GLSL I didn't know about in some OpenGl implementations and I'll have to change the shaders to accommodate. I'll make a PR for it soon.

@collinalexbell
Copy link
Owner

collinalexbell commented May 1, 2024

Ok #66 should fix that shader issue for you, so just pull master again @vulnoryx

@vulnoryx
Copy link

vulnoryx commented May 2, 2024

I tried it and it launched :)

I can move around, things get rendered, but when I press v to launch dmenu, the wm crashes. (like issue #57)
The terminal outputs a segfault :/

note: when I lauch matrix using a terminal started by startx and the wm crashes, I return to the terminal with dmenu open.

@collinalexbell
Copy link
Owner

collinalexbell commented May 2, 2024

Hmmm. I can't reproduce on my machine so I personally won't be able to backtrace the segfault.

Do you know how to switch TTY and use tmux/gdb?

The way I debug segfaults is the following:

  • start terminal with startx
  • switch to tty2 (ctrl+alt+F2 (I have to also press fn to activate F2))
  • login
  • tmux
  • ctrl+b % to split terminal

In terminal 1:

  • cd <matrix dir>
  • ./devtools/gdb
  • run
  • ctrl+b to switch to split terminal

In terminal 2:

  • ./devtools/display to get back to tty1 (key presses don't work for tty1)

  • matrix should boot

  • reproduce segfault (should freeze)

  • ctrl+alt+F2 again to get to tty2

In terminal 1 (may need to press ctrl+b to get ther):

  • bt to print a backtrace

Any part of the stack trace that is from /src should be relevant.

@vulnoryx
Copy link

vulnoryx commented May 2, 2024

Do you know how to switch TTY and use tmux/gdb?

I know how to swich TTYs (in case a wm crashes or im testing a wm like yours) but I have never used debugging tools like tmux or gdb.

This could be a great opportunity to learn about those debuggers.
When I have time, I might try to backtrace the segfault.
When I find out the cause, I will inform you.

@collinalexbell
Copy link
Owner

collinalexbell commented May 2, 2024

Ok. Cool! gdb is pretty useful. I wrapped this one in a debugger script because it needs a DISPLAY environment variable to connect properly. If the matrix X session isn't the first session started on bootup (IE you started it on TTY2) then you may need to change the DISPLAY to = 2 in that devtools/gdb script. You can also run it from a terminal in another wm if you don't want to use a raw TTY (which will help you copy and paste the backtrace). I also have a logging ticket that I will work on soon that should print the backtrace in the logs.

@blacklightpy
Copy link
Contributor

I also had this issue, and I'm using Void Linux, musl edition.

I also had to set -DSPDLOG_FMT_EXTERNAL, because some distros use fmt-devel and build spdlog with that flag. Then programs depending on it will also have to set -DSPDLOG_FMT_EXTERNAL.

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

No branches or pull requests

6 participants