After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 154670 - Crash when opening Windows Network
Crash when opening Windows Network
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Module: smb
2.8.x
Other Linux
: High normal
: ---
Assigned To: gnome-vfs maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-10-06 11:52 UTC by Jon Kåre Hellan
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the bug (1.11 KB, patch)
2004-10-06 11:55 UTC, Jon Kåre Hellan
none Details | Review

Description Jon Kåre Hellan 2004-10-06 11:52:32 UTC
Nautilus segfaults when I open Windows Network.

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=275153. Forget about
smb.conf, that was a red herring.

The reason turned out to be that directory_load_one in nautilus-directory-async.c
was being called with info != NULL but info->name == NULL. It went on to call
is_dot_or_dot_dot(NULL), which segfaults.
Comment 1 Jon Kåre Hellan 2004-10-06 11:55:37 UTC
Created attachment 32282 [details] [review]
Patch to fix the bug

Tested here. Windows Network opened and looks OK.
Comment 2 Alexander Larsson 2004-10-06 12:13:22 UTC
Similar patch commited, but the interesting part is why it returned NULL in
info->name when doing the readdir().
Comment 3 Aschwin van der Woude 2004-10-06 12:36:12 UTC
So this bug can be closed?
Comment 4 Jon Kåre Hellan 2004-10-07 10:52:43 UTC
I can reproduce info->name becoming NULL by doing gnomevfs-ls smb:/// on this
particular network. The entry with NULL comes at the end of the list, i.e,


$ gnomevfs-ls smb:///
...
vale            (Regular, application/x-desktop)        size 0  mode 0000
(null)          (Regular, application/x-desktop)        size 0  mode 0000

Here's a backtrace:

  • #0 gnome_vfs_daemon_convert_from_corba_file_info
    at gnome-vfs-daemon-method.c line 76
  • #1 do_read_directory
    at gnome-vfs-daemon-method.c line 636
  • #2 gnome_vfs_directory_read_next
    at gnome-vfs-directory.c line 212
  • #3 list
    at gnomevfs-ls.c line 99
  • #4 main
    at gnomevfs-ls.c line 129

corba_info->name is "" at this point, and we call 
decode_corba_string_or_null (corba_info->name, TRUE),
converting "" to NULL
Comment 5 Jon Kåre Hellan 2004-10-07 11:09:22 UTC
Is the "" a bug? Should I try to debug inside gnome-vfs-daemon. If so, where do
I start?
Comment 6 Alexander Larsson 2004-10-07 14:55:58 UTC
Yeah. Please try. We shouldn't be returining files with empty names. Thats not a
valid filename.
Comment 7 Jon Kåre Hellan 2004-10-08 12:26:12 UTC
do_read_directory in smb-method.c receives a DirectoryHandle which looks like
this: {workgroups = 0x8063c84, dir = 0x0, path = 0x0}
workgroups contains a single element, which is the string ""
Comment 8 Jon Kåre Hellan 2004-10-08 18:40:30 UTC
And that directory handle results from a libsmbclient smb_context->readdir call
which returns
{smbc_type = 1, dirlen = 32, commentlen = 6,
  comment = 0x809f2ea "NOMAD", namelen = 1, name = ""}

Whatever the reason, it looks like gnome-vfs better be prepared to handle this.
Comment 9 Jon Kåre Hellan 2004-10-11 08:06:09 UTC
The packet on the wire agrees exactly with smb_context->readdir. Here's the
Ethereal dissection of the corresponding entry in the NetServerEnum2 Response
from the smb server:

Server Name: ""
Major Version: 0
Minor Version: 0
Server Type: 0x80001000
Server Comment: "NOMAD"
Comment 10 Alexander Larsson 2004-10-11 08:39:49 UTC
cvs ignores "" names.
Comment 11 Jon Kåre Hellan 2004-10-15 12:07:43 UTC
It was simply a Debian machine with a blank workgroup entry in smb.conf