On Sat, 10 Feb 2024 11:01:54 +0100 Petter Reinholdtsen <p...@hungry.com> wrote:
[Petter Reinholdtsen]
> I do not use ssr much myself, and have not had time to test.

I applied the upstream commit in git branch fix-1040375-glinject and
tested it on Bookworm, but alas, the .so file still segfaults with a
useless backtrace.  I might have applied the commit incorrectly, as it
did not apply without changes, but hope not.  Perhaps someone
who understand what is happening can have a look?

--
Happy hacking
Petter Reinholdtsen



Hello,
looking through some bugs about crashes I came to this one
and found found it interesting.

If a proper backtrace is still helping one can get one by using
systemd-coredump.

Another nice way to debug early startup is using rr debugger.
(Plus the ability to debug back and forth.)


As far as I see the crash happens because it wants to print this message:

57                      GLINJECT_PRINT("Error: Can't open libdl.so!");

But unfortunately libstdc++ seems not yet prepared to output the error.


(rr) bt
#0  0x00007fbf7ff2fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007fbf7ff3074c in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, 
std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) () 
from /lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007fbf7ff30bdb in std::basic_ostream<char, std::char_traits<char> >& std::operator<< 
<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fbf805cef6f in InitGLInject () at ./glinject/Hook.cpp:57
#4  0x00007fbf805cf13f in dlsym (handle=0x7fbf8060d2e0, symbol=0x7fbf80185f7a 
"pthread_create") at ./glinject/Hook.cpp:231
#5  0x00007fbf80136dd7 in glvndSetupPthreads () at 
../src/util/glvnd_pthread.c:452
#6  0x00007fbf801351a9 in __glDispatchOnLoadInit () at 
../src/GLdispatch/GLdispatch.c:174
#7  0x00007fbf805de9ce in call_init (env=0x7ffeea4b1538, argv=0x7ffeea4b1528, argc=1, 
l=<optimized out>) at ./elf/dl-init.c:74
#8  call_init (l=<optimized out>, argc=1, argv=0x7ffeea4b1528, 
env=0x7ffeea4b1538) at ./elf/dl-init.c:26
#9  0x00007fbf805deab4 in _dl_init (main_map=0x7fbf8060d2e0, argc=1, 
argv=0x7ffeea4b1528, env=0x7ffeea4b1538) at ./elf/dl-init.c:121
#10 0x00007fbf805f4a70 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#11 0x0000000000000001 in ?? ()
#12 0x00007ffeea4b25ea in ?? ()
#13 0x0000000000000000 in ?? ()
(rr)

(For some reason with libstdc++6-dbgsym the backtrace gets less good.)



I guess upstream discussed this issue here:

  https://github.com/MaartenBaert/ssr/issues/947


And a package built from `fix-1040375-glinject` did no
longer show this crash to me.


Attached file shows my actions inside a minimal bookworm VM.

Kind regards,
Bernhard
# 2024-05-07 Bookworm/stable amd64 qemu VM

apt update
apt dist-upgrade
apt install systemd-coredump mc gdb rr mesa-utils git simplescreenrecorder-lib 
simplescreenrecorder-lib-dbgsym libglvnd0-dbgsym libstdc++6-dbgsym appstream
apt build-dep simplescreenrecorder-lib






mkdir /home/benutzer/source/simplescreenrecorder/orig -p
cd    /home/benutzer/source/simplescreenrecorder/orig
apt source simplescreenrecorder







benutzer@debian:~$ 
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/simplescreenrecorder/libssr-glinject.so 
/usr/bin/true
Speicherzugriffsfehler (Speicherabzug geschrieben)
benutzer@debian:~$ 


benutzer@debian:~$ coredumpctl list
Hint: You are currently not seeing messages from other users and the system.
      Users in groups 'adm', 'systemd-journal' can see all messages.
      Pass -q to turn off this notice.
TIME                         PID  UID  GID SIG     COREFILE EXE            SIZE
Tue 2024-05-07 00:10:28 CEST 994 1000 1000 SIGSEGV present  /usr/bin/true 89.0K
benutzer@debian:~$ 



benutzer@debian:~$ coredumpctl gdb --debugger-argument=-q 994
Hint: You are currently not seeing messages from other users and the system.
      Users in groups 'adm', 'systemd-journal' can see all messages.
      Pass -q to turn off this notice.
           PID: 994 (true)
           UID: 1000 (benutzer)
           GID: 1000 (benutzer)
        Signal: 11 (SEGV)
     Timestamp: Tue 2024-05-07 00:10:28 CEST (1min 26s ago)
  Command Line: /usr/bin/true
    Executable: /usr/bin/true
 Control Group: /user.slice/user-1000.slice/session-3.scope
          Unit: session-3.scope
         Slice: user-1000.slice
       Session: 3
     Owner UID: 1000 (benutzer)
       Boot ID: 4df23299079540e38e42560b3966b576
    Machine ID: 55a5ad9df1d547f38d7696343d9fde7d
      Hostname: debian
       Storage: 
/var/lib/systemd/coredump/core.true.1000.4df23299079540e38e42560b3966b576.994.1715033428000000.zst
 (present)
  Size on Disk: 89.0K
       Message: Process 994 (true) of user 1000 dumped core.
                
                Stack trace of thread 994:
                #0  0x00007f988d92fd9a _ZNSo6sentryC1ERSo (libstdc++.so.6 + 
0x12fd9a)
                #1  0x00007f988d93074c 
_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l 
(libstdc++.so.6 + 0x13074c)
                #2  0x00007f988d930bdb 
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc (libstdc++.so.6 + 
0x130bdb)
                #3  0x00007f988de97f6f _Z12InitGLInjectv (libssr-glinject.so + 
0x8f6f)
                #4  0x00007f988de9813f dlsym (libssr-glinject.so + 0x913f)
                #5  0x00007f988d789dd7 n/a (libGLdispatch.so.0 + 0x42dd7)
                #6  0x00007f988d7881a9 n/a (libGLdispatch.so.0 + 0x411a9)
                #7  0x00007f988dea79ce call_init (ld-linux-x86-64.so.2 + 0x49ce)
                #8  0x00007f988dea7ab4 _dl_init (ld-linux-x86-64.so.2 + 0x4ab4)
                #9  0x00007f988debda70 _dl_start_user (ld-linux-x86-64.so.2 + 
0x1aa70)
                ELF object binary architecture: AMD x86-64

Reading symbols from /usr/bin/true...
(No debugging symbols found in /usr/bin/true)
[New LWP 994]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/bin/true'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f988d92fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) set width 0
(gdb) set pagination off
(gdb) bt
#0  0x00007f988d92fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007f988d93074c in std::basic_ostream<char, std::char_traits<char> >& 
std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, 
std::char_traits<char> >&, char const*, long) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007f988d930bdb in std::basic_ostream<char, std::char_traits<char> >& 
std::operator<< <std::char_traits<char> >(std::basic_ostream<char, 
std::char_traits<char> >&, char const*) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007f988de97f6f in InitGLInject() () from 
/usr/lib/x86_64-linux-gnu/simplescreenrecorder/libssr-glinject.so
#4  0x00007f988de9813f in dlsym () from 
/usr/lib/x86_64-linux-gnu/simplescreenrecorder/libssr-glinject.so
#5  0x00007f988d789dd7 in ?? () from /lib/x86_64-linux-gnu/libGLdispatch.so.0
#6  0x00007f988d7881a9 in ?? () from /lib/x86_64-linux-gnu/libGLdispatch.so.0
#7  0x00007f988dea79ce in call_init (env=0x7ffd0dda97b8, argv=0x7ffd0dda97a8, 
argc=1, l=<optimized out>) at ./elf/dl-init.c:74
#8  call_init (l=<optimized out>, argc=1, argv=0x7ffd0dda97a8, 
env=0x7ffd0dda97b8) at ./elf/dl-init.c:26
#9  0x00007f988dea7ab4 in _dl_init (main_map=0x7f988ded62e0, argc=1, 
argv=0x7ffd0dda97a8, env=0x7ffd0dda97b8) at ./elf/dl-init.c:121
#10 0x00007f988debda70 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#11 0x0000000000000001 in ?? ()
#12 0x00007ffd0ddab6de in ?? ()
#13 0x0000000000000000 in ?? ()
(gdb) noshare
(gdb) pipe share | grep -E "ssr|libGLdispatch"
Reading symbols from 
/usr/lib/x86_64-linux-gnu/simplescreenrecorder/libssr-glinject.so...
Reading symbols from /lib/x86_64-linux-gnu/libGLdispatch.so.0...
(gdb) bt
(gdb) bt
#0  0x00007f988d92fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007f988d93074c in std::basic_ostream<char, std::char_traits<char> >& 
std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, 
std::char_traits<char> >&, char const*, long) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007f988d930bdb in std::basic_ostream<char, std::char_traits<char> >& 
std::operator<< <std::char_traits<char> >(std::basic_ostream<char, 
std::char_traits<char> >&, char const*) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007f988de97f6f in InitGLInject () at ./glinject/Hook.cpp:57
#4  0x00007f988de9813f in dlsym (handle=0x7f988ded62e0, symbol=0x7f988d7d8f7a 
"pthread_create") at ./glinject/Hook.cpp:231
#5  0x00007f988d789dd7 in glvndSetupPthreads () at 
../src/util/glvnd_pthread.c:452
#6  0x00007f988d7881a9 in __glDispatchOnLoadInit () at 
../src/GLdispatch/GLdispatch.c:174
#7  0x00007f988dea79ce in call_init (env=0x7ffd0dda97b8, argv=0x7ffd0dda97a8, 
argc=1, l=<optimized out>) at ./elf/dl-init.c:74
#8  call_init (l=<optimized out>, argc=1, argv=0x7ffd0dda97a8, 
env=0x7ffd0dda97b8) at ./elf/dl-init.c:26
#9  0x00007f988dea7ab4 in _dl_init (main_map=0x7f988ded62e0, argc=1, 
argv=0x7ffd0dda97a8, env=0x7ffd0dda97b8) at ./elf/dl-init.c:121
#10 0x00007f988debda70 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#11 0x0000000000000001 in ?? ()
#12 0x00007ffd0ddab6de in ?? ()
#13 0x0000000000000000 in ?? ()
(gdb)




































benutzer@debian:~$ rr record bash
rr: Saving execution to trace directory `/home/benutzer/.local/share/rr/bash-0'.
benutzer@debian:~$ 
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/simplescreenrecorder/libssr-glinject.so 
/usr/bin/true
Speicherzugriffsfehler (Speicherabzug geschrieben)
benutzer@debian:~$ exit
exit
benutzer@debian:~$ 

benutzer@debian:~$ rr pack bash-0
rr: Packed trace directory `/home/benutzer/.local/share/rr/bash-0'.
benutzer@debian:~$ rr ps bash-0
PID     PPID    EXIT    CMD
1189    --      139     bash
1190    1189    0       dircolors -b
1192    1189    -11     /usr/bin/true




rr replay -p 1192 bash-0
set width 0
set pagination off
directory 
/home/benutzer/source/simplescreenrecorder/orig/simplescreenrecorder-0.4.4
cont
bt
tb InitGLInject
reverse-cont
reverse-cont



benutzer@debian:~$ rr replay -p 1192 bash-0
benutzer@debian:~$ 
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/simplescreenrecorder/libssr-glinject.so 
/usr/bin/true
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/benutzer/.local/share/rr/bash-0/mmap_pack_12_true...
(No debugging symbols found in 
/home/benutzer/.local/share/rr/bash-0/mmap_pack_12_true)
Really redefine built-in command "restart"? (y or n) [answered Y; input not 
from terminal]
Really redefine built-in command "jump"? (y or n) [answered Y; input not from 
terminal]
Remote debugging using 127.0.0.1:5386

--------------------------------------------------
 ---> Reached target process 1192 at event 1527.
--------------------------------------------------
Reading symbols from /lib64/ld-linux-x86-64.so.2...
Reading symbols from 
/usr/lib/debug/.build-id/0e/221d13cd73dac3d7b782778a5f325252903c3e.debug...
BFD: warning: system-supplied DSO at 0x6fffd000 has a section extending past 
end of file
0x00007fbf805f4a40 in _start () from /lib64/ld-linux-x86-64.so.2
(rr) set width 0
(rr) set pagination off
(rr) directory 
/home/benutzer/source/simplescreenrecorder/orig/simplescreenrecorder-0.4.4
Source directories searched: 
/home/benutzer/source/simplescreenrecorder/orig/simplescreenrecorder-0.4.4:$cdir:$cwd
(rr) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007fbf7ff2fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
(rr) bt
#0  0x00007fbf7ff2fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007fbf7ff3074c in std::basic_ostream<char, std::char_traits<char> >& 
std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, 
std::char_traits<char> >&, char const*, long) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007fbf7ff30bdb in std::basic_ostream<char, std::char_traits<char> >& 
std::operator<< <std::char_traits<char> >(std::basic_ostream<char, 
std::char_traits<char> >&, char const*) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fbf805cef6f in InitGLInject () at ./glinject/Hook.cpp:57
#4  0x00007fbf805cf13f in dlsym (handle=0x7fbf8060d2e0, symbol=0x7fbf80185f7a 
"pthread_create") at ./glinject/Hook.cpp:231
#5  0x00007fbf80136dd7 in glvndSetupPthreads () at 
../src/util/glvnd_pthread.c:452
#6  0x00007fbf801351a9 in __glDispatchOnLoadInit () at 
../src/GLdispatch/GLdispatch.c:174
#7  0x00007fbf805de9ce in call_init (env=0x7ffeea4b1538, argv=0x7ffeea4b1528, 
argc=1, l=<optimized out>) at ./elf/dl-init.c:74
#8  call_init (l=<optimized out>, argc=1, argv=0x7ffeea4b1528, 
env=0x7ffeea4b1538) at ./elf/dl-init.c:26
#9  0x00007fbf805deab4 in _dl_init (main_map=0x7fbf8060d2e0, argc=1, 
argv=0x7ffeea4b1528, env=0x7ffeea4b1538) at ./elf/dl-init.c:121
#10 0x00007fbf805f4a70 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#11 0x0000000000000001 in ?? ()
#12 0x00007ffeea4b25ea in ?? ()
#13 0x0000000000000000 in ?? ()
(rr) tb InitGLInject
Temporary breakpoint 1 at 0x7fbf805cb4f0 (2 locations)
(rr) reverse-cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007fbf7ff2fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
(rr) reverse-cont
Continuing.

Temporary breakpoint 1.2, InitGLInject () at ./glinject/Hook.cpp:48
48      void InitGLInject() {
(rr) list
43      int (*g_glinject_real_XNextEvent)(Display*, XEvent*) = NULL;
44
45      static GLInject *g_glinject = NULL;
46      static std::mutex g_glinject_mutex;
47
48      void InitGLInject() {
49              std::lock_guard<std::mutex> lock(g_glinject_mutex);
50
51              if(g_glinject != NULL)
52                      return;
(rr) 
53
54              // part 1: get dlsym and dlvsym
55              eh_obj_t libdl;
56              if(eh_find_obj(&libdl, "*/libdl.so*")) {
57                      GLINJECT_PRINT("Error: Can't open libdl.so!");
58                      exit(1);
59              }
60              if(eh_find_sym(&libdl, "dlsym", (void**) 
&g_glinject_real_dlsym)) {
61                      GLINJECT_PRINT("Error: Can't get dlsym address!");
62                      eh_destroy_obj(&libdl);
(rr) list Global.h:59
58
59      #define GLINJECT_PRINT(message) { \
60              std::cerr << "[SSR-GLInject] " << message << std::endl; \
61      }
62
(rr) next
49              std::lock_guard<std::mutex> lock(g_glinject_mutex);
(rr) next
51              if(g_glinject != NULL)
(rr) next
56              if(eh_find_obj(&libdl, "*/libdl.so*")) {
(rr) next
57                      GLINJECT_PRINT("Error: Can't open libdl.so!");
(rr) next

Program received signal SIGSEGV, Segmentation fault.
0x00007fbf7ff2fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
(rr) tb eh_find_obj
Temporary breakpoint 2 at 0x7fbf805cc2f0: file ./glinject/elfhacks.c, line 120.
(rr) reverse-cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007fbf7ff2fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
(rr) reverse-cont
Continuing.

Temporary breakpoint 2, eh_find_obj (obj=0x7ffeea4b13e0, soname=0x7fbf805d3636 
"*/libdl.so*") at ./glinject/elfhacks.c:120
120             obj->phdr = NULL;
(rr) next
122             dl_iterate_phdr(eh_find_callback, obj);
(rr) b eh_find_callback
Breakpoint 3 at 0x7fbf805cc010: eh_find_callback. (2 locations)
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
(rr) display find->name
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
(rr) next
57              } else if (fnmatch(find->name, info->dlpi_name, 0))
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
(rr) display info->dlpi_name
2: info->dlpi_name = 0x7fbf8060d8a8 ""
(rr) print info
$1 = (struct dl_phdr_info *) 0x7ffeea4b1340
(rr) print *info
$2 = {dlpi_addr = 94382553178112, dlpi_name = 0x7fbf8060d8a8 "", dlpi_phdr = 
0x55d7268e2040, dlpi_phnum = 13, dlpi_adds = 18, dlpi_subs = 0, dlpi_tls_modid 
= 0, dlpi_tls_data = 0x0}
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x6fffd5ae "linux-vdso.so.1"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf805d8140 
"/usr/lib/x86_64-linux-gnu/simplescreenrecorder/libssr-glinject.so"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf805d86f0 "/lib/x86_64-linux-gnu/libc.so.6"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf805d8c10 "/lib/x86_64-linux-gnu/libX11.so.6"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf805d9150 "/lib/x86_64-linux-gnu/libXfixes.so.3"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf805d9690 "/lib/x86_64-linux-gnu/libOpenGL.so.0"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf805d9bd0 "/lib/x86_64-linux-gnu/libGLU.so.1"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf8026a510 "/lib/x86_64-linux-gnu/libstdc++.so.6"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf8026aa50 "/lib/x86_64-linux-gnu/libgcc_s.so.1"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x55d7268e2318 "/lib64/ld-linux-x86-64.so.2"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf8026b050 "/lib/x86_64-linux-gnu/libxcb.so.1"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf8026b610 "/lib/x86_64-linux-gnu/libGLdispatch.so.0"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf8026bb90 "/lib/x86_64-linux-gnu/libm.so.6"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf800f2600 "/lib/x86_64-linux-gnu/libXau.so.6"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf800f2b40 "/lib/x86_64-linux-gnu/libXdmcp.so.6"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf800f3170 "/lib/x86_64-linux-gnu/libbsd.so.0"
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf800f36f0 "/lib/x86_64-linux-gnu/libmd.so.0"
(rr) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007fbf7ff2fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
(rr) disa 3
(rr) tb eh_find_obj
Temporary breakpoint 4 at 0x7fbf805cc2f0: file ./glinject/elfhacks.c, line 120.
(rr) reverse-cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007fbf7ff2fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
(rr) reverse-cont
Continuing.

Temporary breakpoint 4, eh_find_obj (obj=0x7ffeea4b13e0, soname=0x7fbf805d3636 
"*/libdl.so*") at ./glinject/elfhacks.c:120
120             obj->phdr = NULL;
(rr) ena 3
(rr) cont
Continuing.

Breakpoint 3.1, eh_find_callback (info=info@entry=0x7ffeea4b1340, 
size=size@entry=64, argptr=argptr@entry=0x7ffeea4b13e0) at 
./glinject/elfhacks.c:54
54              if (find->name == NULL) {
1: find->name = 0x7fbf805d3636 "*/libdl.so*"
2: info->dlpi_name = 0x7fbf8060d8a8 ""
(rr) print info
$3 = (struct dl_phdr_info *) 0x7ffeea4b1340
(rr) print/x *info
$4 = {dlpi_addr = 0x55d7268e2000, dlpi_name = 0x7fbf8060d8a8, dlpi_phdr = 
0x55d7268e2040, dlpi_phnum = 0xd, dlpi_adds = 0x12, dlpi_subs = 0x0, 
dlpi_tls_modid = 0x0, dlpi_tls_data = 0x0}
(rr) when-tid
Current tid: 5605
(rr) shell cat /proc/5605/maps | grep -E "^55d7268e2"
55d7268e2000-55d7268e4000 r--p 00000000 08:01 785072                     
/home/benutzer/.local/share/rr/bash-0/mmap_pack_12_true
(rr)



(rr) pipe share | grep std
Reading symbols from /lib/x86_64-linux-gnu/libstdc++.so.6...
(rr) bt
#0  0x00007fbf7ff2fd9a in std::basic_ostream<char, std::char_traits<char> 
>::sentry::sentry (this=0x7ffeea4b1370, __os=...) at 
/build/gcc-12-bTRWOB/gcc-12-12.2.0/build/x86_64-linux-gnu/libstdc++-v3/include/bits/ostream.tcc:51
#1  0x00007fbf7ff3074c in std::__ostream_insert<char, std::char_traits<char> > 
(__out=..., __s=__s@entry=0x7fbf805d307c "[SSR-GLInject] ", __n=15) at 
/build/gcc-12-bTRWOB/gcc-12-12.2.0/build/x86_64-linux-gnu/libstdc++-v3/include/bits/ostream_insert.h:83
#2  0x00007fbf7ff30bdb in std::operator<< <std::char_traits<char> > (__out=..., 
__s=0x7fbf805d307c "[SSR-GLInject] ") at 
/build/gcc-12-bTRWOB/gcc-12-12.2.0/build/x86_64-linux-gnu/libstdc++-v3/include/ostream:620
#3  0x00007fbf805cef6f in std::__relocate_a_1<char*, char*> (__alloc=..., 
__result=<optimized out>, __last=<optimized out>, __first=<optimized out>) at 
/usr/include/c++/12/bits/stl_uninitialized.h:1117
#4  std::__relocate_a<char**, char**, std::allocator<char*> > (__alloc=..., 
__result=<optimized out>, __last=<optimized out>, __first=<optimized out>) at 
/usr/include/c++/12/bits/stl_uninitialized.h:1133
#5  std::vector<char*, std::allocator<char*> >::_S_do_relocate (__alloc=..., 
__result=<optimized out>, __last=<optimized out>, __first=<optimized out>) at 
/usr/include/c++/12/bits/stl_vector.h:490
#6  std::vector<char*, std::allocator<char*> >::_S_relocate (__alloc=..., 
__result=<optimized out>, __last=<optimized out>, __first=<optimized out>) at 
/usr/include/c++/12/bits/stl_vector.h:507
#7  std::vector<char*, std::allocator<char*> >::_M_realloc_insert<char* const&> 
(this=0x7ffeea4b1370, __position=0x0) at /usr/include/c++/12/bits/vector.tcc:479
#8  0xb44edc13e7e63600 in ?? ()
#9  0x0000000000000000 in ?? ()




benutzer@debian:~$ ldd /usr/bin/true
        linux-vdso.so.1 (0x00007ffec3fd3000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f25045a9000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f250479f000)
benutzer@debian:~$ 


benutzer@debian:~$ ldd /usr/bin/ls
        linux-vdso.so.1 (0x00007ffcee8b0000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 
(0x00007fdf4adb9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdf4abd8000)
        libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 
(0x00007fdf4ab3e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fdf4ae18000)
benutzer@debian:~$ 


benutzer@debian:~$ ldd /usr/bin/glxgears
        linux-vdso.so.1 (0x00007ffd4cb69000)
        libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007f2b22d38000)
        libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f2b22bf6000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2b22b17000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2b22936000)
        libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 
(0x00007f2b2287d000)
        libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f2b22847000)
        libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f2b2281d000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2b22dd2000)
        libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f2b22818000)
        libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 
(0x00007f2b22600000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f2b225ea000)
        libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f2b22809000)
benutzer@debian:~$ 



























cd source/simplescreenrecorder
cp orig/ try1 -a
cd try1/simplescreenrecorder-0.4.4

wget 
https://github.com/MaartenBaert/ssr/commit/83b8f9f5d9c9ab06152657e57f85b6f71954a6b9.patch
patch -p1 < 83b8f9f5d9c9ab06152657e57f85b6f71954a6b9.patch

dpkg-buildpackage -b -j8

dpkg -i simplescreenrecorder-lib_0.4.4-3_amd64.deb 
simplescreenrecorder-lib-dbgsym_0.4.4-3_amd64.deb


benutzer@debian:~$ 
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/simplescreenrecorder/libssr-glinject.so 
/usr/bin/true
[SSR-GLInject] Hooked dlsym PLT entry in '/lib/x86_64-linux-gnu/libX11.so.6'.
[SSR-GLInject] Hooked XDestroyWindow PLT entry in 
'/lib/x86_64-linux-gnu/libX11.so.6'.
[SSR-GLInject] Hooked dlsym PLT entry in '/lib/x86_64-linux-gnu/libGLX.so.0'.
[SSR-GLInject] Hooked dlsym PLT entry in 
'/lib/x86_64-linux-gnu/libGLdispatch.so.0'.
benutzer@debian:~$ 




















mkdir /home/benutzer/source/simplescreenrecorder-git -p
cd    /home/benutzer/source/simplescreenrecorder-git
git clone https://salsa.debian.org/multimedia-team/simplescreenrecorder
cd simplescreenrecorder
git checkout fix-1040375-glinject
dpkg-buildpackage -b -j6

dpkg -i simplescreenrecorder-lib_0.4.4-4_amd64.deb 
simplescreenrecorder-lib-dbgsym_0.4.4-4_amd64.deb


benutzer@debian:~$ 
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/simplescreenrecorder/libssr-glinject.so 
/usr/bin/true
[SSR-GLInject] Hooked dlsym PLT entry in '/lib/x86_64-linux-gnu/libX11.so.6'.
[SSR-GLInject] Hooked XDestroyWindow PLT entry in 
'/lib/x86_64-linux-gnu/libX11.so.6'.
[SSR-GLInject] Hooked dlsym PLT entry in '/lib/x86_64-linux-gnu/libGLX.so.0'.
[SSR-GLInject] Hooked dlsym PLT entry in 
'/lib/x86_64-linux-gnu/libGLdispatch.so.0'.
benutzer@debian:~$ 











https://github.com/MaartenBaert/ssr/issues/947

Reply via email to