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

SIGSEGV on WebServer::closeSocket() #5

Closed
spelle opened this issue Apr 20, 2016 · 4 comments
Closed

SIGSEGV on WebServer::closeSocket() #5

spelle opened this issue Apr 20, 2016 · 4 comments

Comments

@spelle
Copy link

spelle commented Apr 20, 2016

Hello,

I'm having an issue (SIGSEGV) within the WebServer::closeSocket()

(gdb) bt
#0  0x00007fffe80000a8 in ?? ()
#1  0x00007ffff7bb16df in WebServer::closeSocket (client=0x7ffff001d620) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1522
#2  0x00007ffff7bb66dd in WebServer::freeClientSockData (c=0x7ffff001d620)
    at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:49
#3  0x00007ffff7bb0c7c in WebServer::poolThreadProcessing (this=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1350
#4  0x00007ffff7bb6749 in WebServer::startPoolThread (t=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:84
#5  0x00007ffff73bb6aa in start_thread (arg=0x7ffff7f52700) at pthread_create.c:333
#6  0x00007ffff70f0e9d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

More specifically on following line :
int n=SSL_shutdown(client->ssl);

Certificate has been generated like this :

$ openssl rsa -in privkey.pem > crt.pem    
$ openssl x509 -in cert.pem >> crt.pem

When commenting the webServer->setUseSSL(true, "crt.pem");, it works.

Cheers,

@titi38
Copy link
Owner

titi38 commented Apr 20, 2016

Hello Sébastien,
I recently made some improvements. Could you try with the pre-version 1.2,
available in the git branch "v1.2_devel" ? Let me know.
Thanks a lot. Cheers

2016-04-20 22:55 GMT+02:00 Sébastien PELLÉ notifications@github.com:

Hello,

I'm having an issue (SIGSEGV) within the WebServer::closeSocket()

(gdb) bt
#0 0x00007fffe80000a8 in ?? ()
#1 0x00007ffff7bb16df in WebServer::closeSocket (client=0x7ffff001d620) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1522
#2 0x00007ffff7bb66dd in WebServer::freeClientSockData (c=0x7ffff001d620)
at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:49
#3 0x00007ffff7bb0c7c in WebServer::poolThreadProcessing (this=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1350
#4 0x00007ffff7bb6749 in WebServer::startPoolThread (t=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:84
#5 0x00007ffff73bb6aa in start_thread (arg=0x7ffff7f52700) at pthread_create.c:333
#6 0x00007ffff70f0e9d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

More specifically on following line :
int n=SSL_shutdown(client->ssl);

Certificate has been generated like this :

$ openssl rsa -in privkey.pem > crt.pem
$ openssl x509 -in cert.pem >> crt.pem

Cheers,
Hello,

I'm having an issue (SIGSEGV) within the WebServer::closeSocket()

(gdb) bt
#0 0x00007fffe80000a8 in ?? ()
#1 0x00007ffff7bb16df in WebServer::closeSocket (client=0x7ffff001d620) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1522
#2 0x00007ffff7bb66dd in WebServer::freeClientSockData (c=0x7ffff001d620)
at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:49
#3 0x00007ffff7bb0c7c in WebServer::poolThreadProcessing (this=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1350
#4 0x00007ffff7bb6749 in WebServer::startPoolThread (t=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:84
#5 0x00007ffff73bb6aa in start_thread (arg=0x7ffff7f52700) at pthread_create.c:333
#6 0x00007ffff70f0e9d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

More specifically on following line :
int n=SSL_shutdown(client->ssl);

Certificate has been generated like this :

$ openssl rsa -in privkey.pem > crt.pem
$ openssl x509 -in cert.pem >> crt.pem

Cheers,


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#5

@spelle
Copy link
Author

spelle commented Apr 21, 2016

Hi,

I made what you said :

$ ldd beehive_portal
linux-vdso.so.1 =>  (0x00007ffd9a16e000)
libnavajo.so.1 => /usr/local/lib/libnavajo.so.1 (0x00007f86952ab000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8694f10000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8694cf8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8694ada000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8694710000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f86944a6000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f8694062000)
libpam.so.0 => /lib/x86_64-linux-gnu/libpam.so.0 (0x00007f8693e54000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f8693c39000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8693931000)
/lib64/ld-linux-x86-64.so.2 (0x000055dde5177000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f869372c000)
libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x00007f8693507000)
$ ll /usr/local/lib/libnavajo.*
-rw-r--r-- 1 root root 3,0M mars  30 21:13 /usr/local/lib/libnavajo.a
lrwxrwxrwx 1 root root   14 mars  31 15:37 /usr/local/lib/libnavajo.so -> libnavajo.so.1
lrwxrwxrwx 1 root root   18 mars  31 15:37 /usr/local/lib/libnavajo.so.1 -> libnavajo.so.1.2.0
-rw-r--r-- 1 root root 1,6M mars  30 21:13 /usr/local/lib/libnavajo.so.1.2.0

Still having a SIGSEGV :

[2016-04-21 20:37:25] >  WebServer : Listen on port 8443
[2016-04-21 20:37:30] >  WebServer: Connection from IP: 127.0.0.1

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7ed1700 (LWP 2770)]
0x00007fffe00000a8 in ?? ()
(gdb) bt
#0  0x00007fffe00000a8 in ?? ()
#1  0x00007ffff7bb16df in WebServer::closeSocket (client=0x7ffff001c970) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1522
#2  0x00007ffff7bb66dd in WebServer::freeClientSockData (c=0x7ffff001c970)
    at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:49
#3  0x00007ffff7bb0c7c in WebServer::poolThreadProcessing (this=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1350
#4  0x00007ffff7bb6749 in WebServer::startPoolThread (t=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:84
#5  0x00007ffff73bb6aa in start_thread (arg=0x7ffff7ed1700) at pthread_create.c:333
#6  0x00007ffff70f0e9d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) 

I try to look at it more in depth this week-end.

Cheers,

@titi38
Copy link
Owner

titi38 commented Apr 23, 2016

Hi,
This issue is now fixed in the v1.2_devel branch. Thanks for reporting.
SSL still doesn't work with websockets (it will work with the upcoming
released version 1.2 )
Cheers

2016-04-21 22:39 GMT+02:00 Sébastien PELLÉ notifications@github.com:

Hi,

I made what you said :

$ ldd beehive_portal
linux-vdso.so.1 => (0x00007ffd9a16e000)
libnavajo.so.1 => /usr/local/lib/libnavajo.so.1 (0x00007f86952ab000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8694f10000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8694cf8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8694ada000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8694710000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f86944a6000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f8694062000)
libpam.so.0 => /lib/x86_64-linux-gnu/libpam.so.0 (0x00007f8693e54000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f8693c39000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8693931000)
/lib64/ld-linux-x86-64.so.2 (0x000055dde5177000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f869372c000)
libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x00007f8693507000)
$ ll /usr/local/lib/libnavajo.*
-rw-r--r-- 1 root root 3,0M mars 30 21:13 /usr/local/lib/libnavajo.a
lrwxrwxrwx 1 root root 14 mars 31 15:37 /usr/local/lib/libnavajo.so -> libnavajo.so.1
lrwxrwxrwx 1 root root 18 mars 31 15:37 /usr/local/lib/libnavajo.so.1 -> libnavajo.so.1.2.0
-rw-r--r-- 1 root root 1,6M mars 30 21:13 /usr/local/lib/libnavajo.so.1.2.0

Still having a SIGSEGV :

[2016-04-21 20:37:25] > WebServer : Listen on port 8443
[2016-04-21 20:37:30] > WebServer: Connection from IP: 127.0.0.1

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7ed1700 (LWP 2770)]
0x00007fffe00000a8 in ?? ()
(gdb) bt
#0 0x00007fffe00000a8 in ?? ()
#1 0x00007ffff7bb16df in WebServer::closeSocket (client=0x7ffff001c970) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1522
#2 0x00007ffff7bb66dd in WebServer::freeClientSockData (c=0x7ffff001c970)
at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:49
#3 0x00007ffff7bb0c7c in WebServer::poolThreadProcessing (this=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/src/WebServer.cc:1350
#4 0x00007ffff7bb6749 in WebServer::startPoolThread (t=0x61dd60) at /home/sherpa/Workspaces/workspace-Arduino/libnavajo/include/libnavajo/WebServer.hh:84
#5 0x00007ffff73bb6aa in start_thread (arg=0x7ffff7ed1700) at pthread_create.c:333
#6 0x00007ffff70f0e9d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb)

I try to look at it more in depth this week-end.

Cheers,


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#5 (comment)

@titi38 titi38 closed this as completed Apr 23, 2016
@spelle
Copy link
Author

spelle commented Apr 23, 2016

Ok. Thanks a lot Thierry.

I will give a try asap.

Thanks for your work. I must admit that this is the only webserver I can run : I hate Java ;-)

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

2 participants