[GH-ISSUE #632] Barrier is crashing on resume from suspend #501

Open
opened 2026-05-05 06:33:04 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @vitek on GitHub (Apr 21, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/632

Operating Systems

Server: ubuntu 16.04

Client: ubuntu 16.04

Barrier Version

barriers 2.3.2-snapshot/11edf04107bec4ea7159c4dab6949adfe4be9bee

Steps to reproduce bug

  1. suspend server machine
  2. wait some time
  3. resume server machine
  4. sometimes barriers process crashes

Other info

[2020-04-20T22:16:56] INFO: switch from "vitja-desktop" to "vitja-yatop" at 1919,46
[2020-04-20T22:16:56] INFO: leaving screen
[2020-04-20T22:16:56] INFO: screen "vitja-desktop" updated clipboard 0
[2020-04-20T22:16:56] INFO: screen "vitja-desktop" updated clipboard 1
[2020-04-20T22:16:56] INFO: switch from "vitja-yatop" to "vitja-desktop" at 2,31
[2020-04-20T22:16:56] INFO: entering screen
[2020-04-21T10:33:06] NOTE: client "mchome" is dead
[2020-04-21T10:33:06] NOTE: client "vitja-yatop" is dead
Segmentation fault (core dumped)
(master) vitja@vitja-desktop:~/work/barrier/build$ gdb ./bin/barriers core 
GNU gdb (Ubuntu 8.2-0ubuntu1~16.04.1) 8.2
Copyright (C) 2018 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:
<http://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 ./bin/barriers...done.
[New LWP 21740]
[New LWP 21738]
[New LWP 21739]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./bin/barriers -f --no-tray --name vitja-desktop --enable-crypto -c /home/vitja'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fa1e0340b64 in SSL_write () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
[Current thread is 1 (Thread 0x7fa1ddfb5700 (LWP 21740))]
(gdb) bt
#0  0x00007fa1e0340b64 in SSL_write () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#1  0x000000000046fbeb in SecureSocket::secureWrite (this=this@entry=0x243ebb0, buffer=0x7fa1d8033b70, size=size@entry=8, wrote=@0x7fa1ddfb4d64: 0) at /home/vitja/work/barrier/src/lib/net/SecureSocket.cpp:294
#2  0x000000000046fd4a in SecureSocket::doWrite (this=0x243ebb0) at /home/vitja/work/barrier/src/lib/net/SecureSocket.cpp:243
#3  0x000000000046d15c in TCPSocket::serviceConnected (this=0x243ebb0, job=<optimized out>, read=<optimized out>, write=<optimized out>, error=<optimized out>) at /home/vitja/work/barrier/src/lib/net/TCPSocket.cpp:559
#4  0x000000000046d550 in TSocketMultiplexerMethodJob<TCPSocket>::run (this=<optimized out>, read=<optimized out>, write=<optimized out>, error=<optimized out>)
    at /home/vitja/work/barrier/src/./lib/net/TSocketMultiplexerMethodJob.h:78
#5  0x000000000046b085 in SocketMultiplexer::serviceThread (this=0x235d740) at /home/vitja/work/barrier/src/lib/net/SocketMultiplexer.cpp:219
#6  0x0000000000472ebb in Thread::threadFunc (vjob=0x2360010) at /home/vitja/work/barrier/src/lib/mt/Thread.cpp:157
#7  0x000000000040d83f in ArchMultithreadPosix::doThreadFunc (this=0x7fff911dc758, thread=0x235da40) at /home/vitja/work/barrier/src/lib/arch/unix/ArchMultithreadPosix.cpp:718
#8  0x000000000040d93b in ArchMultithreadPosix::threadFunc (vrep=0x235da40) at /home/vitja/work/barrier/src/lib/arch/unix/ArchMultithreadPosix.cpp:698
#9  0x00007fa1e12e46ba in start_thread (arg=0x7fa1ddfb5700) at pthread_create.c:333
#10 0x00007fa1df60141d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) frame 1
#1  0x000000000046fbeb in SecureSocket::secureWrite (this=this@entry=0x243ebb0, buffer=0x7fa1d8033b70, size=size@entry=8, wrote=@0x7fa1ddfb4d64: 0) at /home/vitja/work/barrier/src/lib/net/SecureSocket.cpp:294
294	        wrote = SSL_write(m_ssl->m_ssl, buffer, size);
(gdb) p m_ssl
$1 = (Ssl *) 0x23fb050
(gdb) p m_ssl->m_ssl
$2 = (SSL *) 0x0

It looks like socket object is used in not thread-safe way.

https://github.com/debauchee/barrier/blob/master/src/lib/net/SecureSocket.cpp#L294

Originally created by @vitek on GitHub (Apr 21, 2020). Original GitHub issue: https://github.com/debauchee/barrier/issues/632 ### Operating Systems ### Server: ubuntu 16.04 Client: ubuntu 16.04 ### Barrier Version ### barriers 2.3.2-snapshot/11edf04107bec4ea7159c4dab6949adfe4be9bee ### Steps to reproduce bug ### 1. suspend server machine 2. wait some time 3. resume server machine 4. sometimes barriers process crashes ### Other info ### ``` [2020-04-20T22:16:56] INFO: switch from "vitja-desktop" to "vitja-yatop" at 1919,46 [2020-04-20T22:16:56] INFO: leaving screen [2020-04-20T22:16:56] INFO: screen "vitja-desktop" updated clipboard 0 [2020-04-20T22:16:56] INFO: screen "vitja-desktop" updated clipboard 1 [2020-04-20T22:16:56] INFO: switch from "vitja-yatop" to "vitja-desktop" at 2,31 [2020-04-20T22:16:56] INFO: entering screen [2020-04-21T10:33:06] NOTE: client "mchome" is dead [2020-04-21T10:33:06] NOTE: client "vitja-yatop" is dead Segmentation fault (core dumped) (master) vitja@vitja-desktop:~/work/barrier/build$ gdb ./bin/barriers core GNU gdb (Ubuntu 8.2-0ubuntu1~16.04.1) 8.2 Copyright (C) 2018 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: <http://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 ./bin/barriers...done. [New LWP 21740] [New LWP 21738] [New LWP 21739] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `./bin/barriers -f --no-tray --name vitja-desktop --enable-crypto -c /home/vitja'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007fa1e0340b64 in SSL_write () from /lib/x86_64-linux-gnu/libssl.so.1.0.0 [Current thread is 1 (Thread 0x7fa1ddfb5700 (LWP 21740))] (gdb) bt #0 0x00007fa1e0340b64 in SSL_write () from /lib/x86_64-linux-gnu/libssl.so.1.0.0 #1 0x000000000046fbeb in SecureSocket::secureWrite (this=this@entry=0x243ebb0, buffer=0x7fa1d8033b70, size=size@entry=8, wrote=@0x7fa1ddfb4d64: 0) at /home/vitja/work/barrier/src/lib/net/SecureSocket.cpp:294 #2 0x000000000046fd4a in SecureSocket::doWrite (this=0x243ebb0) at /home/vitja/work/barrier/src/lib/net/SecureSocket.cpp:243 #3 0x000000000046d15c in TCPSocket::serviceConnected (this=0x243ebb0, job=<optimized out>, read=<optimized out>, write=<optimized out>, error=<optimized out>) at /home/vitja/work/barrier/src/lib/net/TCPSocket.cpp:559 #4 0x000000000046d550 in TSocketMultiplexerMethodJob<TCPSocket>::run (this=<optimized out>, read=<optimized out>, write=<optimized out>, error=<optimized out>) at /home/vitja/work/barrier/src/./lib/net/TSocketMultiplexerMethodJob.h:78 #5 0x000000000046b085 in SocketMultiplexer::serviceThread (this=0x235d740) at /home/vitja/work/barrier/src/lib/net/SocketMultiplexer.cpp:219 #6 0x0000000000472ebb in Thread::threadFunc (vjob=0x2360010) at /home/vitja/work/barrier/src/lib/mt/Thread.cpp:157 #7 0x000000000040d83f in ArchMultithreadPosix::doThreadFunc (this=0x7fff911dc758, thread=0x235da40) at /home/vitja/work/barrier/src/lib/arch/unix/ArchMultithreadPosix.cpp:718 #8 0x000000000040d93b in ArchMultithreadPosix::threadFunc (vrep=0x235da40) at /home/vitja/work/barrier/src/lib/arch/unix/ArchMultithreadPosix.cpp:698 #9 0x00007fa1e12e46ba in start_thread (arg=0x7fa1ddfb5700) at pthread_create.c:333 #10 0x00007fa1df60141d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109 (gdb) frame 1 #1 0x000000000046fbeb in SecureSocket::secureWrite (this=this@entry=0x243ebb0, buffer=0x7fa1d8033b70, size=size@entry=8, wrote=@0x7fa1ddfb4d64: 0) at /home/vitja/work/barrier/src/lib/net/SecureSocket.cpp:294 294 wrote = SSL_write(m_ssl->m_ssl, buffer, size); (gdb) p m_ssl $1 = (Ssl *) 0x23fb050 (gdb) p m_ssl->m_ssl $2 = (SSL *) 0x0 ``` It looks like socket object is used in not thread-safe way. https://github.com/debauchee/barrier/blob/master/src/lib/net/SecureSocket.cpp#L294
gitea-mirror added the
bug
label 2026-05-05 06:33:04 -06:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 24, 2020):

This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.

<!-- gh-comment-id:698060848 --> @github-actions[bot] commented on GitHub (Sep 24, 2020): This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#501
No description provided.