miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Segmentation fault miniupnpc-libevent Ubuntu 14.04

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation
View previous topic :: View next topic  
Author Message
jikard0



Joined: 05 Feb 2015
Posts: 8

PostPosted: Thu Feb 05, 2015 4:04 pm    Post subject: Segmentation fault miniupnpc-libevent Ubuntu 14.04 Reply with quote

Hello

After successful compile of miniupnpc-libevent. I run it and get
Segmentation fault.
Below is the output from gdb

# gdb ././upnpc-libevent
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
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 help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./upnpc-libevent ...done.
(gdb) run
Starting program: ./upnpc-libevent
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
local address : 10.0.10.103
Using libevent 2.0.21-stable
Using Libevent with backend method epoll.
READY ! 200
root_desc_location='http:\/\/10.0.10.1:2828/gateway.xml'

Program received signal SIGSEGV, Segmentation fault.
evhttp_request_get_response_code (req=req@entry=0x0) at http.c:3638
3638 return req->response_code;
(gdb)


Upnp enabled device(in my case mikrotik) return proper response with HTTP code 200.

Any ideas?

Regards
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1587

PostPosted: Thu Feb 05, 2015 5:50 pm    Post subject: Reply with quote

please give "backtrace" (bt command of gdb)
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jikard0



Joined: 05 Feb 2015
Posts: 8

PostPosted: Fri Feb 06, 2015 7:06 am    Post subject: backtrace Reply with quote

# gdb ./upnpc-libevent
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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 ./pnpc-libevent...done.
(gdb) run
Starting program: /home/juka/workspace-cpp/ppsp-miniupnp/upnpc-libevent
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
local address : 10.0.10.103
Using libevent 2.0.21-stable
Using Libevent with backend method epoll.
UUUUU
READY ! 200
root_desc_location='http://10.0.10.1:2828/gateway.xml'

Program received signal SIGSEGV, Segmentation fault.
evhttp_request_get_response_code (req=req@entry=0x0) at http.c:3638
3638 return req->response_code;
(gdb) bt full
#0 evhttp_request_get_response_code (req=req@entry=0x0) at http.c:3638
No locals.
#1 0x0000000000402773 in upnpc_soap_response (req=0x0, pvoid=0x607970)
at miniupnpc-libevent.c:449
len = <optimized out>
data = <optimized out>
input_buffer = <optimized out>
d = 0x607970
code = <optimized out>
#2 0x00007ffff7bad418 in bufferevent_readcb (fd=<optimized out>,
event=<optimized out>, arg=0x609990) at bufferevent_sock.c:195
bufev = 0x609990
bufev_p = 0x609990
input = <optimized out>
res = <optimized out>
what = <optimized out>
howmuch = <optimized out>
readmax = <optimized out>
#3 0x00007ffff7ba2bfc in event_process_active_single_queue (activeq=0x607650,
base=0x607040) at event.c:1350
ev = 0x6099a0
count = 1
#4 event_process_active (base=<optimized out>) at event.c:1420
---Type <return> to continue, or q <return> to quit---
activeq = 0x607650
i = <optimized out>
c = 0
#5 event_base_loop (base=0x607040, flags=0) at event.c:1621
evsel = 0x7ffff7dd7c00 <epollops>
tv = {tv_sec = 50, tv_usec = 0}
tv_p = <optimized out>
res = <optimized out>
done = 0
retval = 0
__func__ = "event_base_loop"
#6 0x0000000000401d4b in main (argc=<optimized out>, argv=<optimized out>)
at upnp.cpp:239
sa = {__sigaction_handler = {sa_handler = 0x404200 <sighandler(int)>,
sa_sigaction = 0x404200 <sighandler(int)>}, sa_mask = {__val = {
0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
upnp = {base = 0x607040, ssdp_socket = 6, ev_ssdp_recv = 0x607690,
ev_ssdp_writable = 0x6078c0, discover_device_index = 1,
devices = 0x607970,
ready_cb = 0x404220 <ready(int, upnpc_t*, upnpc_device_t*, void*)>,
soap_cb = 0x403f60 <soap(int, upnpc_t*, upnpc_device_t*, void*)>,
cb_data = 0x7fffffffdb10, local_address = 0x607670 "10.0.10.103",
local_port = 50001}
---Type <return> to continue, or q <return> to quit---
multicast_if = <optimized out>
(gdb)
(gdb) bt
#0 evhttp_request_get_response_code (req=req@entry=0x0) at http.c:3638
#1 0x0000000000402773 in upnpc_soap_response (req=0x0, pvoid=0x607970)
at miniupnpc-libevent.c:449
#2 0x00007ffff7bad418 in bufferevent_readcb (fd=<optimized out>,
event=<optimized out>, arg=0x609990) at bufferevent_sock.c:195
#3 0x00007ffff7ba2bfc in event_process_active_single_queue (activeq=0x607650,
base=0x607040) at event.c:1350
#4 event_process_active (base=<optimized out>) at event.c:1420
#5 event_base_loop (base=0x607040, flags=0) at event.c:1621
#6 0x0000000000401d4b in main (argc=<optimized out>, argv=<optimized out>)
at upnp.cpp:239
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1587

PostPosted: Fri Feb 06, 2015 9:27 am    Post subject: Reply with quote

I dont understand why req=0x0 ...
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jikard0



Joined: 05 Feb 2015
Posts: 8

PostPosted: Fri Feb 06, 2015 9:29 am    Post subject: Reply with quote

Exactly, i sniff it and answer is classical 200 OK
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1587

PostPosted: Fri Feb 06, 2015 9:48 am    Post subject: Reply with quote

Have you tried with another libevent2 library ?
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jikard0



Joined: 05 Feb 2015
Posts: 8

PostPosted: Fri Feb 06, 2015 10:28 am    Post subject: Reply with quote

i tried with official libevent-2.0.22-stable as also with your fork of libevent from
https://github.com/miniupnp/libevent.git(master and upnp_ext branches)
Back to top
View user's profile Send private message
jikard0



Joined: 05 Feb 2015
Posts: 8

PostPosted: Fri Feb 06, 2015 10:29 am    Post subject: Reply with quote

Oo i forgot with all version which i tried(above) i get same error.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1587

PostPosted: Fri Feb 06, 2015 11:51 am    Post subject: Reply with quote

check with this patch :  https://github.com/miniupnp/miniupnp/commit/37c649257baa822781cd71d9b80671f08a00288a
at least it won't crash
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jikard0



Joined: 05 Feb 2015
Posts: 8

PostPosted: Fri Feb 06, 2015 12:16 pm    Post subject: Reply with quote

Yes it wont crash.
However i will continue investigating why this not work as expected.
Thank you for help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.