[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to debug segfault


On Thursday, 25 January 2018 18:57:28 CET Orion Poplawski wrote:
> I'm trying to debug a segfault in libssh used by x2goclient.
> 

Hi,

> I'm starting with this valgrind report:
> 
> x2go-DEBUG-../src/sshmasterconnection.cpp:2199> New exec channel created.

I've just looked at 

https://code.x2go.org/gitweb?p=x2goclient.git;a=blob;f=src/
sshmasterconnection.cpp;h=be327c683d28e0e054c570281c1cb2854132d7a6;hb=refs/
heads/master

I see no call for ssh_init() nor ssh_finalize()

> [2018/01/25 10:05:34.194015, 3] ssh_socket_un
> ==22928==    by 0x4CA6BA: SshMasterConnection::sshConnect()
> (sshmasterconnection.cpp:847)
> ==22928==    by 0x4D8203: SshMasterConnection::run()
> (sshmasterconnection.cpp:637) ==22928==    by 0x71B511E:
> QThreadPrivate::start(void*) (qthread_unix.cpp:338) ==22928==    by
> 0x762BE24: start_thread (pthread_create.c:308)

Esepecially, I don't see:

#include <libssh/callbacks.h>
..
ssh_threads_set_callbacks(ssh_threads_get_pthread());
ssh_init();


http://api.libssh.org/master/libssh_tutor_threads.html


Maybe that is done somewhere else, but make sure it is done. I would suggest 
to set a gdb watchpoint on that poll pointer so see when it is being freed ...



	Andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx



References:
Trying to debug segfaultOrion Poplawski <orion@xxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org