Bug 7202 - applications that uses wins for name resolution crashes with samba 3.5.0
Summary: applications that uses wins for name resolution crashes with samba 3.5.0
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.5.0
Hardware: x86 Linux
: P3 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-03 04:04 UTC by Sergey Tereschenko
Modified: 2010-03-22 04:44 UTC (History)
1 user (show)

See Also:


Attachments
strace of ping command (2.90 KB, application/x-gzip)
2010-03-03 04:08 UTC, Sergey Tereschenko
no flags Details
another one strace (2.95 KB, application/x-gzip)
2010-03-03 04:18 UTC, Sergey Tereschenko
no flags Details
Patch (1.05 KB, patch)
2010-03-20 08:40 UTC, Volker Lendecke
metze: review+
Details
Backtrace of Chromium crash (3.27 KB, text/plain)
2010-03-21 05:40 UTC, Jonathan Liu
no flags Details
Backtrace of Chromium crash 2 (2.45 KB, text/plain)
2010-03-21 05:40 UTC, Jonathan Liu
no flags Details
valgrind --tool=memcheck of Chromium crash (5.23 KB, text/plain)
2010-03-21 05:52 UTC, Jonathan Liu
no flags Details
Patch (842 bytes, patch)
2010-03-21 11:53 UTC, Volker Lendecke
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Tereschenko 2010-03-03 04:04:55 UTC
i'm using wins for resolving host names in local network,
after upgrading to samba 3.5.0 applications crashes when using wins to resolving host names.
Comment 1 Sergey Tereschenko 2010-03-03 04:08:41 UTC
Created attachment 5444 [details]
strace of ping command

strace says "No such file or directory", but this file exists and readable by everybody
----
stat64("/etc/samba/smb.conf", 0xbfbff680) = -1 ENOENT (No such file or directory)
open("/etc/samba/smb.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
----
> ls -l /etc/samba/smb.conf
-rw-r--r-- 1 root root 9686 Mar  3 11:29 /etc/samba/smb.conf
Comment 2 Sergey Tereschenko 2010-03-03 04:18:37 UTC
Created attachment 5445 [details]
another one strace

seems like in previous strace log smb.conf don't exists, here it is, but with it nothing changes
Comment 3 Derrell Lipman 2010-03-03 07:48:17 UTC
Nothing has changed in libsmbclient to have affected this. To Jeremy, and component -> File Services.
Comment 4 Volker Lendecke 2010-03-20 08:40:19 UTC
Created attachment 5511 [details]
Patch

The attached patch fixes it for me. Can you try that?

Thanks,

Volker
Comment 5 Sergey Tereschenko 2010-03-20 09:23:17 UTC
yes, patch from Volker fixes this
Comment 6 Volker Lendecke 2010-03-20 09:49:18 UTC
Thanks for testing!

Reopening the bug, Karolin needs to merge it to v3-5-test after another developer (metze) has reviewed it.

Volker
Comment 7 Jonathan Liu 2010-03-20 09:56:20 UTC
The patch fixes the issue for me.
Comment 8 Sergey Tereschenko 2010-03-20 12:07:26 UTC
firefox and ping stop crashing after this patch, but chromium and sonata still crash
Comment 9 Volker Lendecke 2010-03-20 13:58:41 UTC
Any chance to run them under valgrind --tool=memcheck and send the output?

Volker
Comment 10 Jonathan Liu 2010-03-21 05:40:03 UTC
Created attachment 5513 [details]
Backtrace of Chromium crash
Comment 11 Jonathan Liu 2010-03-21 05:40:30 UTC
Created attachment 5514 [details]
Backtrace of Chromium crash 2
Comment 12 Jonathan Liu 2010-03-21 05:52:29 UTC
Created attachment 5516 [details]
valgrind --tool=memcheck of Chromium crash
Comment 13 Volker Lendecke 2010-03-21 10:07:29 UTC
Quick question: Is it possible that you compiled Samba on a box without pthread headers? Can you grep for HAVE_PTHREAD in include/config.h ?

Thanks,

Volker
Comment 14 Sergey Tereschenko 2010-03-21 10:31:34 UTC
(In reply to comment #13)
> Quick question: Is it possible that you compiled Samba on a box without pthread
> headers? Can you grep for HAVE_PTHREAD in include/config.h ?
> 
> Thanks,
> 
> Volker
> 

You asked me or Jonathan? :)
my grep:
#define HAVE_PTHREAD_H 1

also, do you need another one output of valgrind --memtool=check?
Comment 15 Volker Lendecke 2010-03-21 10:39:23 UTC
Hmm. You only have HAVE_PTHREAD_H and not HAVE_PTHREAD? That would be bad...

Looking at it, it seems that our PTHREAD detection is broken. I don't have a fix handy, but to make sure this would fix the chromium crash, can you insert a

#define HAVE_PTHREAD 1

into include/config.h after you ran ./configure and before you run make? If this fixes the chromium chrash, this would help me debugging it.

Thanks,

Volker
Comment 16 Sergey Tereschenko 2010-03-21 11:00:47 UTC
(In reply to comment #15)
> Hmm. You only have HAVE_PTHREAD_H and not HAVE_PTHREAD? That would be bad...
> 
> Looking at it, it seems that our PTHREAD detection is broken. I don't have a
> fix handy, but to make sure this would fix the chromium crash, can you insert a
> 
> #define HAVE_PTHREAD 1
> 
> into include/config.h after you ran ./configure and before you run make? If
> this fixes the chromium chrash, this would help me debugging it.
> 
> Thanks,
> 
> Volker
> 
after i manually add "#define HAVE_PTHREAD 1" into include/config.h
chromium and sonata stops crashing
Comment 17 Volker Lendecke 2010-03-21 11:38:05 UTC
Great, thanks! Expect a patch soon.

Volker
Comment 18 Volker Lendecke 2010-03-21 11:53:12 UTC
Created attachment 5522 [details]
Patch

This patch should fix this bug for multi-threaded apps as well.

Thanks!

Volker
Comment 19 Stefan Metzmacher 2010-03-21 12:28:18 UTC
Comment on attachment 5511 [details]
Patch

Looks good
Comment 20 Stefan Metzmacher 2010-03-21 12:33:57 UTC
Comment on attachment 5522 [details]
Patch

Looks good
Comment 21 Volker Lendecke 2010-03-21 13:34:08 UTC
Karolin, please add both patches

https://bugzilla.samba.org/attachment.cgi?id=5511
https://bugzilla.samba.org/attachment.cgi?id=5522

to v3-5-test.

Thanks,

Volker
Comment 22 Karolin Seeger 2010-03-22 04:23:37 UTC
(In reply to comment #21)
> Karolin, please add both patches
> 
> https://bugzilla.samba.org/attachment.cgi?id=5511
> https://bugzilla.samba.org/attachment.cgi?id=5522
> 
> to v3-5-test.
> 
> Thanks,
> 
> Volker
> 

Pushed both patches to v3-5-test.
Need to check whether it's an issue in 3.4 or not before closing.
Comment 23 Karolin Seeger 2010-03-22 04:44:17 UTC
Does not seem to be broken in 3.4.

Closing out bug report.

Thanks!