Bug 12112 - libsmbclient users hang and eat cpu on captive portals and incorrect host entries
libsmbclient users hang and eat cpu on captive portals and incorrect host ent...
Status: RESOLVED DUPLICATE of bug 12105
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient
4.3.9
All All
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-04 15:25 UTC by seb128
Modified: 2016-08-04 16:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description seb128 2016-08-04 15:25:50 UTC
There are several reports on gvfs-smb eating cpu on the gnome/ubuntu/redhat etc bug trackers,
https://bugzilla.gnome.org/show_bug.cgi?id=762580
https://bugzilla.redhat.com/show_bug.cgi?id=1303300
https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1572260

it's easy to reproduce on Ubuntu Xenial with smbclient (samba 4.3.9)

* edit /etc/hosts 
* add a line "1.2.3.4 BUG"
* try to "smbclient -L BUG"

-> smbclient hangs and eat CPU, it seems trying to connect in loop to the invalid host


Description from the redhat bugzilla about a more standard user situation

"I discovered that part of the problem is my ISP. They offer a "feature" to provide customers with a special search site whenever they type an invalid address into their browser. This is implemented on the DNS level. So when gvfs-smb  tries to connect to the non-existing host MYGROUP.localdomain, instead of a DNS error my ISP returns the IP of their search site, which gvfs-smb is then trying to connect to and that causes CPU usage to rise to 100%."

Reply from one of the gvfs hackers

"Thanks for your bug report. It sounds like a bug in samba, because gvfs just call SMBC_opendir_ctx and it hangs there...

See backtrace in time of hang:
Thanks for your bug report. It sounds like a bug in samba, because gvfs just call SMBC_opendir_ctx and it hangs there...

See backtrace in time of hang:
...
#1  0x00007fe4b2713d26 in async_connect_send () from /usr/lib64/samba/libsmb-transport-samba4.so
#2  0x00007fe4b782df47 in open_socket_out_connected () from /lib64/libsmbconf.so.0
#3  0x00007fe4b5ca8be4 in tevent_common_loop_immediate () from /lib64/libtevent.so.0
#4  0x00007fe4b5cada2e in epoll_event_loop_once () from /lib64/libtevent.so.0
#5  0x00007fe4b5cac137 in std_event_loop_once () from /lib64/libtevent.so.0
#6  0x00007fe4b5ca838d in _tevent_loop_once () from /lib64/libtevent.so.0
#7  0x00007fe4b5ca95ff in tevent_req_poll () from /lib64/libtevent.so.0
#8  0x00007fe4b8ce31ee in tevent_req_poll_ntstatus () from /lib64/libtevent-util.so.0
#9  0x00007fe4b7cb3980 in cli_connect_nb () from /usr/lib64/samba/liblibsmb-samba4.so
..."
Comment 1 Ralph Böhme 2016-08-04 16:00:23 UTC

*** This bug has been marked as a duplicate of bug 12105 ***
Comment 2 Jeremy Allison 2016-08-04 16:01:02 UTC
Hmmm. Is it possible this is a duplicate of 12105:

https://bugzilla.samba.org/show_bug.cgi?id=12105

Please check the above and report back.