Bug 445116

Summary: Samba network shares not mounting in gnome
Product: [Fedora] Fedora Reporter: martin coker <martincoker57>
Component: sambaAssignee: Tomáš Bžatek <tbzatek>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 9CC: alexl, mishu, mperrin, tbzatek, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: athlon   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-27 23:55:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
avoid null pointer deref none

Description martin coker 2008-05-03 23:32:20 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.14) Gecko/20080416 Fedora/2.0.0.14-1.fc8 Firefox/2.0.0.14

Description of problem:
I am unable to browse the network shares from the f9 gnome desktop. The networked computers show but any attempt to browse just hangs and hangs. I can however access the f9 shares from all of the other machines. I  can mount and access the network shares on other machines by command line using the  mount -t cifs option and specifying the ip, share and mount point.It is also posssible to mount the shares by using connect to server gui in places. So it  seems that there is nothing fundementally wrong with samba. I have  disabled SElinux and Firewall and have been comparing as much as I can  from the working f8 install. Having spent hours now trying to find out  what is wrong I am totally lost at what to look at next. I see the  following errors.
in May  3 10:07:43 LINSERVER kernel: gvfsd-smb-brows[5652]: segfault at  0 ip a601d8 sp 41065000 error 6 in libnss_wins.so.2[a29000+152000]messages
In samba log:
[2008/05/03 10:07:43,  0] lib/util_sock.c:get_peer_addr_internal(1601)
getpeername failed. Error was Transport endpoint is not connected
Any help much appreciated 

Version-Release number of selected component (if applicable):


How reproducible:
Always


Steps to Reproduce:
1.Open network in places
2.Click on any networked machine to browse its shares
3.

Actual Results:
Nautilus opens a window but cursor just spins nothing ever loads with the exception of accessing the f9 shares, they will display when opened from network.

Expected Results:
I should have been able to access shares from the f9 on the networked computers

Additional info:
In messages:
10:07:43 LINSERVER kernel: gvfsd-smb-brows[5652]: segfault at  0 ip a601d8 sp 41065000 error 6 in libnss_wins.so.2[a29000+152000]
In samba log:
[2008/05/03 10:07:43,  0] lib/util_sock.c:get_peer_addr_internal(1601)
getpeername failed. Error was Transport endpoint is not connected

Comment 1 martin coker 2008-05-03 23:41:37 UTC
For ref I am posting using the f8 install on the same machine amd64. 

Comment 2 martin coker 2008-05-06 09:44:59 UTC
I have also installed KDE desktop to try the same problem exist. If someone can
give me clarication I have been looking for all references to gvfs on the
machine but there does not seem to be any I see gfs and gfs2 in /etc/rc.d/rc.sysinit
# Mount all other filesystems (except for NFS and /proc, which is already
# mounted). Contrary to standard usage,
# filesystems are NOT unmounted in single user mode.
action $"Mounting local filesystems: " mount -a -t
nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
I have no idea what I am looking for but the reference here seems to be related
to filesystems. Just a thought.


Comment 3 martin coker 2008-05-06 09:55:46 UTC
Sorry when I say no referemces I do have a .gvfs folder in homes. I am quite
happy to try suggestions as f9 is totally useless as part of my network which
has several windows boxes. I addition I cannot access the network printer. Would
adding gvfs and gvfs2 to the above cause major hassles? Or even be worth trying?

Comment 4 Tomáš Bžatek 2008-05-06 10:00:45 UTC
The issue is caused by crashing gvfsd-smb-browse backend due to a bug in
libnss_wins. Only reproducible when wins is active resolver (/etc/nsswitch.conf). 

User can't see any application crashing, that's the way gvfs was designed.
Working on the fix.

Comment 5 Tomáš Bžatek 2008-05-06 10:04:07 UTC
Temporary solution might be editing /etc/nsswitch.conf and removing 'wins' from
the 'hosts:' line. (You can try little experimenting here.)

Comment 6 martin coker 2008-05-06 11:42:23 UTC
many thanks I will play around. it may be my fault. I have added wins to
nsswitch as the normal set up with samba since fc5 just a habit i suppose. nice
to know however that this is actually a bug, i was beginning to just think it
was me out there having the problem. switching into f9 now.

Comment 7 Tomáš Bžatek 2008-05-06 12:21:23 UTC
Changing ownership to samba folks as this looks like crash inside libnss_wins.so
Easily reproducible by invoking gvfs-ls smb://MYGROUP (must exist)

This is backtrace of gvfsd-smb-browse:
#0  0x00bfbae0 in _nss_wins_gethostbyname_r (hostname=0x8a2e22c "EXCALIBUR",
he=0xb7d96668, buffer=0xb7d96320 "@\021\216", buflen=512, h_errnop=0xb7d96690)
    at nsswitch/wins.c:143
#1  0x00bfbb6f in _nss_wins_gethostbyname2_r (name=0x8a2e22c "EXCALIBUR", af=2,
he=0xb7d96668, buffer=0xb7d96320 "@\021\216", buflen=512, 
    h_errnop=0xb7d96690) at nsswitch/wins.c:408
#2  0x0083d63e in gaih_inet () from /lib/libc.so.6
#3  0x0083efe4 in getaddrinfo () from /lib/libc.so.6
#4  0x001e8b08 in internal_resolve_name (name=<value optimized out>,
name_type=<value optimized out>, sitename=<value optimized out>, 
    return_iplist=<value optimized out>, return_count=<value optimized out>,
resolve_order=<value optimized out>) at libsmb/namequery.c:1256
#5  0x001e9be0 in resolve_name_list (ctx=<value optimized out>, name=<value
optimized out>, name_type=<value optimized out>, 
    return_ss_arr=<value optimized out>, p_num_entries=<value optimized out>) at
libsmb/namequery.c:1688
#6  0x001a2052 in cli_connect (cli=<value optimized out>, host=<value optimized
out>, dest_ss=<value optimized out>) at libsmb/cliconnect.c:1509
#7  0x0012d062 in SMBC_server (ctx=<value optimized out>, context=<value
optimized out>, connect_if_not_found=<value optimized out>, 
    server=<value optimized out>, share=<value optimized out>,
pp_workgroup=<value optimized out>, pp_username=<value optimized out>, 
    pp_password=<value optimized out>) at libsmb/libsmb_server.c:383
#8  0x00128f93 in SMBC_opendir_ctx (context=<value optimized out>, fname=<value
optimized out>) at libsmb/libsmb_dir.c:647
#9  0x0804e62c in g_object_unref () at gobject.c:1737
#10 0x0804eed6 in g_object_unref () at gobject.c:1737
#11 0x0805760d in g_object_unref () at gobject.c:1737
#12 0x0805337d in g_object_unref () at gobject.c:1737
#13 0x08050a9e in g_object_unref () at gobject.c:1737
#14 0x009c9b06 in g_thread_pool_thread_proxy (data=<value optimized out>) at
gthreadpool.c:265
#15 0x009c846f in g_thread_create_proxy (data=<value optimized out>) at
gthread.c:635
#16 0x0091e32f in start_thread () from /lib/libpthread.so.0


Comment 8 Simo Sorce 2008-05-06 12:35:08 UTC
Tomas the trasce seem to be incomplete, any chance you can provide a trace that
show wxactly where the code segfaults ?

Comment 9 martin coker 2008-05-06 12:49:44 UTC
Removing wins does not help at all. The network will show but no machines are
present. As a side note I have just noticed that control of the smb and nmd
daemons in sysconfig services does not work, the status of both just shows
unknown and start stop does not function enable re-enable just brings up the
message that they are being refreshed but this never completes to running. May
not be related but interesting.

Comment 10 Simo Sorce 2008-05-06 13:07:06 UTC
Remember you have to restart nautilus/gvfs after you change nsswitch.conf,
changes in that file are not picked up until process restart.
Also I so not see how smbd or nmbd are relevant in client code.

Comment 11 martin coker 2008-05-06 13:10:16 UTC
Yes I have logged out and logged back in under different users and have done
restart as well still no change. I only mention it as something is hanging these
in the desktop gui. This is not a problem at command line.

Comment 12 Guenther Deschner 2008-05-06 15:00:55 UTC
Created attachment 304638 [details]
avoid null pointer deref

This patch should fix it.

Comment 13 martin coker 2008-05-06 15:56:14 UTC
Will this patch be released through updates? If not how can I test this please?

Comment 14 Simo Sorce 2008-05-06 16:13:55 UTC
As soon as we get at least one confirmation it fixes the problem, we might
release an update.
But most probably we will commit the fix upstream and just release it s a bundle
with 3.2.0-rc1


Comment 15 martin coker 2008-05-06 16:27:49 UTC
Many thanks I will sit back and wait till then.

Comment 16 Tomáš Bžatek 2008-05-06 17:04:18 UTC
I've just made testing build of samba packages including the fix mentioned
above. I can't repro the bug anymore.

If you're brave enough, you can try downloading updated packages from koji build
system: http://koji.fedoraproject.org/koji/taskinfo?taskID=597621 (i386 only).
Otherwise please wait until official F9 packages are available.

Please close the bug once you confirmed the issue is gone.

Comment 17 martin coker 2008-05-06 17:50:54 UTC
I would be brave but the f9 is running x86 64 so I suppose I will have to
wait.Many many thanks to all I will make sure I close off once I am sure it is
all ok.

Comment 18 Bug Zapper 2008-05-14 10:36:43 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 19 Mike Perrin 2008-05-15 18:22:43 UTC
I have what seems to be a related problem with FC9 on an i386 Athlon 1000/266,
but I am unable to discover a W2000 computer nor a Trendnet TS-U200 storage
server using the Places -> Network browser. Probably for the same reason I am
unable to connect to the shares through Places -> Connect to Server using the
server name but I can connect by specifying the IP address. When I connect to
the W2000 SP4 machine, I see the share contents normally. When I connect to the
TS-U200, the share folders are empty (0 items) in the nautilus window. The
TS-U200 is running samba version 2.2.8a.

Upgrading to the following packages from
http://koji.fedoraproject.org/koji/taskinfo?taskID=597621 did not help:
libsmbclient-3.2.0-1.pre3.10.fc9.i386.rpm
samba-client-3.2.0-1.pre3.10.fc9.i386.rpm
samba-common-3.2.0-1.pre3.10.fc9.i386.rpm
samba-domainjoin-gui-3.2.0-1.pre3.10.fc9.i386.rpm
samba-winbind-3.2.0-1.pre3.10.fc9.i386.rpm

It all works perfectly in F8. The F8 and original F9 smb.conf files are identical.

Comment 20 Mike Perrin 2008-05-16 02:16:23 UTC
My problem may be related to the gnome keyring. The following error messages
occur in /var/log/messages when I connect to the shares. The first three
messages at 19:00:22, 19:00:22 and 19:00:29 are from a connect to the W2000
machine that did result in access to the C$ (C: drive) folders and files. The
message at 19:01:42 came from a connect to a TS-U200 public share that produced
a "0 items" nautilus window of the share. The final three messages at 12:02:27,
19:02:27 and 19:02:32 are from the connection to a user/password protected share
on the TS-U200. That connection also produced in a "0 items" nautilus window. No
similar error messages occur with Fedora 8.

May 15 19:00:22 morework gnome-keyring-daemon[2127]: couldn't read 4 bytes from
client: 
May 15 19:00:22 morework gnome-keyring-daemon[2127]: couldn't read 4 bytes from
client: 
May 15 19:00:29 morework gnome-keyring-daemon[2127]: couldn't read 4 bytes from
client: 
May 15 19:01:42 morework gnome-keyring-daemon[2127]: couldn't read 4 bytes from
client: 
May 15 19:02:27 morework gnome-keyring-daemon[2127]: couldn't read 4 bytes from
client: 
May 15 19:02:27 morework gnome-keyring-daemon[2127]: couldn't read 4 bytes from
client: 
May 15 19:02:32 morework gnome-keyring-daemon[2127]: couldn't read 4 bytes from
client: 


Comment 21 Tomáš Bžatek 2008-05-16 09:11:47 UTC
The gnome-keyring-daemon messages are not critical and should not make any
problem if you don't see any error message windows.
https://bugzilla.redhat.com/show_bug.cgi?id=418731

Samba 3.2.0-pre series client has known issue when connecting to Samba 2.2.x
server: https://bugzilla.redhat.com/show_bug.cgi?id=443047

The other problem not seeing windows computers in the network might be active
firewall blocking SMB broadcast packets.

Comment 22 Mike Perrin 2008-05-16 15:57:03 UTC
Tomas,

Thanks for the existing bug pointers. I will have to wait for the Samba team to
resolve 443047 before I upgrade my primary workstation to F9. I don't want to
replace a perfectly good flash card file server appliance because of a version
compatibility problem.

You were right about about the SMB broadcast packets, but this was occurring
with the firewall disabled. I was finally able to browse the network and
discover the servers when I enabled the firewall with eth0 selected as a trusted
interface. After that, I could disable the firewall and still find the servers
as long as I left eth0 selected as a trusted interface. To verify, I went back
to the default configuration by re-enabling, deselecting eth0, then disabling,
and the SMB servers could no longer be found.

This workaround is not necessary in F8.


Comment 23 martin coker 2008-05-24 14:45:45 UTC
Sorry to have been away for a couple of weeks. I have now performed a clean
install of f9 x86 64 and have updated everything now that the release is out.
The problem is still there with log message:
May 24 15:14:00 LINSERVER kernel: gvfsd-smb-brows[5220]: segfault at 0 ip
7f36505a81d8 sp 4232d000 error 6 in libnss_wins.so.2[7f3650571000+152000]

I note other messages above and I had already set eth0 to trusted even when the
firewall was disabled.

So it would seem that the fix has not yet made it to the repo?
It would help if someone could confirm that this is the position. I had hoped
that by the time that the release of f9 that this bug would have been sorted.  
I am able to mount shares manually ok and access seems ok that way. Using gnome
any share accessed manually is being mounted to the desktop. Nautilus will see
the shares on this machine and can access them ok again mounting to the desktop.
It is just this same problem of not being able to browse the networked computers
in nautilus. It is a real pain as apart from 2 boxes all the rest are ip
addressed by dhcp so this is really means that f9 is totally impractical for my
network.

Once again sorry to have been away. Please advise if there is any way I can help.
















Comment 24 martin coker 2008-05-30 09:18:48 UTC
Does anyone know Where can I get the source code for libnss_wins.so.2 for the
x8664 f9 from? I have been googling till my eyes are bleeding. I would like to
see if I could patch this myself it would be a good way to start learning a bit
about programming. It would appear that if there is a fix for this it has not
made it into the 64 bit repos. 

Comment 25 martin coker 2008-05-31 10:40:49 UTC
Samba browse problem in desktop has now been fixed on x86_64 with the latest
samba updates(r1 14). I can now see and access networked machines in nautilus
Many thanks to all involved. Now to see if I can get a networked printer to work
and f9 is in business.

Comment 26 John Poelstra 2008-06-27 23:55:07 UTC
thanks for your update

Comment 27 Mike Perrin 2008-10-25 17:34:52 UTC
File browsing to my Trendnet TS-U200 samba 2.2.8a server is still broken (comment #19 above) with samba-client and samba-common updated to 3.2.4-0.21.fc9.i386. File browsing to a W2000 SP4 machine works fine.

BTW, this bug now exists in Ubuntu 8.10-beta which is using the 3.2.x versions.