kreijack / xlibinput_calibrator

Touch calibrator for libinput
MIT License
21 stars 12 forks source link

Error: Segmentation Fault #6

Closed hrueger closed 1 year ago

hrueger commented 1 year ago

Hi @kreijack, I wanted to try this on a raspberry pi 4 with two touchscreens connected. After installing git, libx11-dev, libxi-dev and libxrandr-dev, it builds fine with make. However, when running ./xlibinput_calibrator or ./xlibinput_calibrator --list-devices, it immediately exits with Segmentation fault. Is that a known issue?

I'm using Pi OS 64bit, so arm64.

kreijack commented 1 year ago

Hi @hrueger, it is the first time that I hear a problem like your one. I think that it may be related to having two touchscreens connected.

I will check the code if I found something strange. In the mean time could you check what happens if only one touchscreen is connected ?

kreijack commented 1 year ago

I am sure that you already did, but please could you check if the environment variable DISPLAY is set ?

hrueger commented 1 year ago

Hi, I'll check that later today. I rebooted quite often and I'm using SSH, so maybe I forgot to set DISPLAY while testing this lib.

kreijack commented 1 year ago

Ok, in the meantime I updated the devel branch adding a better diagnosis when DISPLAY is not set correctly.

hrueger commented 1 year ago

By the way, I had to install libxrandr-dev, otherwise make fails:

~/xlibinput_calibrator/src$ make
g++ -MT main.o -MMD -MP -MF .d/main.Td -Wall -pedantic -std=c++17 -DHAVE_X11_XRANDR   -c -o main.o main.cc
mv -f .d/main.Td .d/main.d
g++ -MT gui_x11.o -MMD -MP -MF .d/gui_x11.Td -Wall -pedantic -std=c++17 -DHAVE_X11_XRANDR   -c -o gui_x11.o gui_x11.cc
gui_x11.cc:31:10: fatal error: X11/extensions/Xrandr.h: No such file or directory
   31 | #include <X11/extensions/Xrandr.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:47: gui_x11.o] Error 1

(just because the readme states that xrandr is optional)

hrueger commented 1 year ago

OK, it works perfectly now. Seems like I indeed missed to set the DISPLAY env variable after rebooting. Thanks for your tip ;-)

kreijack commented 1 year ago

By the way, I had to install libxrandr-dev, otherwise make fails:

~/xlibinput_calibrator/src$ make
g++ -MT main.o -MMD -MP -MF .d/main.Td -Wall -pedantic -std=c++17 -DHAVE_X11_XRANDR   -c -o main.o main.cc
mv -f .d/main.Td .d/main.d
g++ -MT gui_x11.o -MMD -MP -MF .d/gui_x11.Td -Wall -pedantic -std=c++17 -DHAVE_X11_XRANDR   -c -o gui_x11.o gui_x11.cc
gui_x11.cc:31:10: fatal error: X11/extensions/Xrandr.h: No such file or directory
   31 | #include <X11/extensions/Xrandr.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:47: gui_x11.o] Error 1

(just because the readme states that xrandr is optional)

Thank, this is an useful feedback; it is possible to avoid randr commenting the following line in src/Makefile

# uncomment the lines below if you want to use xrandr extension set
CXXFLAGS+= -DHAVE_X11_XRANDR

I have to point out this in the README.