Bug 8999 - swat - goes blank on button click and logs panic internal error
Summary: swat - goes blank on button click and logs panic internal error
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.6.3
Hardware: x86 Linux
: P5 major
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
: 10339 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-06-15 02:03 UTC by km234
Modified: 2014-05-13 09:42 UTC (History)
2 users (show)

See Also:


Attachments
samba log and swat browser screenshots (36.21 KB, application/zip)
2012-06-15 02:03 UTC, km234
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description km234 2012-06-15 02:03:40 UTC
Created attachment 7649 [details]
samba log and swat browser screenshots

System:
ubuntu-12.04-server-i386
samba 3.6.3-2ubuntu2.2
swat 3.6.3-2ubuntu2.2
openbsd-inetd 0.20091229-1ubuntu1
default, unmodified smb.conf
default system installation without any changes
root account for swat

Bug:
- open swat in Firefox or IE on a network computer
- click "View" section (attachment view1.png)
- click "Full View" button - screen goes blank (attachment view2.png)

Note:
- all other swat functions react with blank screen and no changes are submitted
- samba logs panic and internal errors when swat is used (attached)
- the same computer/setup works fine with samba/swat 3.5.8
Comment 1 Kai Blin 2012-06-15 22:47:48 UTC
I'll see if I can reproduce this with 3.6-test from git on my system, or on vanilla 12.04 ubuntu.
Comment 2 Kai Blin 2012-06-15 23:37:30 UTC
Ok, can't repro with current v3-6-test HEAD on ubuntu 10.04. Will attempt with 12.04 over the weekend
Comment 3 km234 2012-06-16 08:05:52 UTC
Thank you for quick response. There was no problem in ubuntu 11.04 with samba 3.5.8. In ubuntu 12.04 "SWAT is no longer actively maintained" and maybe some dependencies are broken?
Comment 4 Kai Blin 2012-06-18 10:54:13 UTC
(In reply to comment #3)
> Thank you for quick response. There was no problem in ubuntu 11.04 with samba
> 3.5.8. In ubuntu 12.04 "SWAT is no longer actively maintained" and maybe some
> dependencies are broken?

It appears like that piece of text was part of the swat package description since 2009 (http://anonscm.debian.org/viewvc/pkg-samba/trunk/samba/debian/control?revision=2576&view=markup), so I wouldn't worry about that too much. :)
Comment 5 Kai Blin 2012-06-18 22:06:54 UTC
Ok, can't reproduce this with a fresh 12.04 install. What does your smb.conf look like?
Comment 6 km234 2012-06-19 01:21:58 UTC
smb.conf is default and unmodified, you can see it on the attached view1.png

I have just installed ubuntu 12.04-desktop-i386, samba, swat and openbsd-inetd, and everything is OK, but the same setup does not work on ubuntu 12.04-server-i386.

Did you install server or desktop? Is it i386?
What tests would you suggest?
Comment 7 km234 2012-06-19 04:33:40 UTC
I did a couple of ubuntu 12.04 server re-installs and noticed when the problem develops. If you select Samba Server option during installation, it will also install related packages like e.g. Winbind, then for some reason Swat will not work. If you don't select the option and later manually install only samba, openbsd-inetd and swat, it will work fine.

While I know now how to get around the problem on fresh install, I would appreciate your help in resolving the issue on my original server setup.
Comment 8 Kai Blin 2012-06-19 05:37:21 UTC
(In reply to comment #7)
> I did a couple of ubuntu 12.04 server re-installs and noticed when the problem
> develops. If you select Samba Server option during installation, it will also
> install related packages like e.g. Winbind, then for some reason Swat will not
> work. If you don't select the option and later manually install only samba,
> openbsd-inetd and swat, it will work fine.
> 
> While I know now how to get around the problem on fresh install, I would
> appreciate your help in resolving the issue on my original server setup.

Ok, for that I first need to be able to replicate the problem, which I at the moment can't.

Can you give me a step-by-step guide on how to install ubuntu-server 12.04 so swat crashes?
Comment 9 km234 2012-06-19 08:38:10 UTC
Thank you again for your assistance. The following steps will reproduce the problem:

run "ubuntu-12.04-server-i386.iso"
"Install Ubuntu Server"
Partitioning - Guided - use entire disk
No automatic updates
Software selection: select -> "Samba file server"
Install Grub on MBR: Yes
reboot and login
sudo passwd root
su
apt-get update
apt-get install openbsd-inetd
apt-get install swat

Next, open Swat on a network computer
click "View" section
click "Full View" button
Comment 10 Kai Blin 2012-06-19 08:57:53 UTC
Ok, that's pretty much what I did, just using the 64bit installer. Let me retry with the 32bit version.
Comment 11 Kai Blin 2012-06-19 22:35:38 UTC
Ok, my installation procedure is:

run "ubuntu-12.04-server-i386.iso"
"Install Ubuntu Server"
Partitioning - Guided - use entire disk
No automatic updates
Software selection: select -> "Samba file server"
Install Grub on MBR: Yes
reboot and login
sudo -i
passwd
aptitude update
aptitude safe-upgrade # updated samba packages and new kernel
aptitude install openbsd-inetd swat
reboot # to start new kernel

I do see the crash as well, investigating now.
Comment 12 Kai Blin 2012-06-19 23:56:41 UTC
Ok, an easier way to reproduce this under gdb works like this:

GET /viewconfig HTTP/1.1
Authorization: Basic <base64 of user:pass>


then grab the xsrf and xsrf_time values in the form displayed...

GET /viewconfig?full_view=Full+View&xsrf=<xsrf>&xsrf_time=<xsrf_time> HTTP/1.1
Authorization: Basic <base64 of user:pass>
Comment 13 Kai Blin 2012-06-19 23:58:17 UTC
The crash does not happen if you build the v-3-6-test branch from current git. Possibly a packaging problem?

Backtrace is 
(gdb) bt
#0  0xb72340c0 in ?? ()
#1  0xb7d7923c in _talloc_free () from /usr/lib/i386-linux-gnu/libtalloc.so.2
#2  0x80215875 in smb_iconv_close ()
#3  0x80204d65 in ?? ()
#4  0x802051d8 in smb_iconv_convenience_reinit ()
#5  0x801f2bf5 in init_iconv ()
#6  0x801f2c32 in lazy_initialize_conv ()
#7  0x801f35e5 in convert_string_talloc ()
#8  0x80074c99 in cgi_load_variables ()
#9  0x80071e3c in main ()

but installing the samba-dbg package didn't get me debug symbols. Very strange.
Comment 14 km234 2012-06-20 00:51:45 UTC
The setup's option "Samba file server" includes: samba, cifs-utils, smbclient, smbfs and winbind. In this environment Swat fails. However later removing cifs-utils, smbclient, smbfs and winbind does not "repair" it. It is definitely a setup's packaging problem, because if I don't select the option and install only samba and swat manually, it's OK.

I hope you can find a solution.
Comment 15 km234 2012-06-22 01:52:05 UTC
I found a workaround for the problem on a system with the option "Samba file server" installed. A diff of package list on "good" and "bad" systems revealed that libpam-smbpass was included by the Ubuntu setup option. Removing  libpam-smbpass has restored normal Swat operation.

Is libpam-smbpass broken?
Comment 16 Kai Blin 2012-06-23 07:16:33 UTC
Ok, confirming I can toggle the crash by installing/uninstalling libpam-smbpass.
Now trying a from source build with libpam-smbpass installed.
Comment 17 Kai Blin 2012-06-25 21:26:20 UTC
Ok, so this seems to be a bug in libpam-smbpass, which includes a static copy of close_iconv_convenience if I read the nm output right...

0008fe20 t close_iconv_convenience

No idea how to fix that in the 3.6 build system.
Comment 18 Timm 2012-10-19 16:54:28 UTC
(In reply to comment #17)
> 
> No idea how to fix that in the 3.6 build system.


Hi,

any news on this ? I am observing the same problem on a fresh ubuntu server installation version 12.04.1. I did the LAMP installation including samba server during the setup.

First, I always got empty, blank pages when trying to alter, enter or modifying anything on teh swat page. Indeed, as Kai Blin reports, I was also able to come around that problem by deinstalling libpam-smbpass (it was installed in version 
2:3.6.3-2ubuntu2.3) - now swat works so far...

What is this libpam-smbpass at teh end responsible for - "pluggable authentication module for Samba" doesn't tell me too much. Will I be able to run my samba shares reliably and safe without it ?

Thanks and kind regards,
Timm
Comment 19 Timm 2012-10-19 16:56:25 UTC
forgot to say: it's a 64bit installation...

Timm
Comment 20 tyler 2012-12-14 00:02:06 UTC
(In reply to comment #19)
> forgot to say: it's a 64bit installation...
> 
> Timm

I would like to report the same findings on a freshly installed Ubuntu Server 12.04.1 x64 machine that I chose the Samba File server options during installation.

It is freshly updated including all updates, and I installed xinetd instead of the  openbsd-inetd that was initially installed (no special reason for xinetd other than troubleshooting this issue and trying to rule things out).

I get mostly blank pages (thin gray bar, empty window area inside html) when I use any of the submit buttons, and the Globals and Shares (and others?) pages don't have the options available to add or change shares, or other configuration options.

libpam-smbpass description from apt-cache show libpam-smbpass:

Filename: pool/main/s/samba/libpam-smbpass_3.6.3-2ubuntu2_amd64.deb
Size: 759098
MD5sum: 83f1037093f3de393e3b0b90e6608d07
SHA1: ace475230bb622e37cb8371ac0ac1b8bf9114e01
SHA256: 89efb620bac5b721b476bfd763265fa011e9dd02fd04ca307df1b6b84cab2ae9
Description-en: pluggable authentication module for Samba
 This is a module for PAM that enables a system administrator to migrate
 user passwords from the Unix password database to the SMB password
 database as used by Samba, and to subsequently keep the two databases in
 sync.  Unlike other solutions, it does this without needing users to log
 in to Samba using cleartext passwords, or requiring them to change their
 existing passwords.

"apt-get remove libpam-smbpass" seems to allow SWAT to start working properly again... with unknown consequences.. though I'm assuming it will only affect certain configurations, and not others.

I assume that configurations not needing to use linux usernames & passwords for samba share access may not be affected by the removal of libpam-smbpass, but this is just a guess.  Maybe there are other tools that can do it (apparently not as "safely" or "conveniently" as libpam-pass (as mentioned in its package description).  Perhaps we can get this fixed sometime.. as its been lingering most likely since 12.04 was released, nearly 8 months now.
Comment 21 Jordan Mack 2013-05-22 17:05:12 UTC
I know I'm a little late to the party, but I just wanted to mention that noted fix of uninstalling libpam-smbpass worked for me as well. I'm running Ubuntu Server 13.04 64-bit.
Comment 22 Matthias 2014-04-16 17:58:03 UTC
(In reply to comment #21)
> I know I'm a little late to the party, but I just wanted to mention that noted
> fix of uninstalling libpam-smbpass worked for me as well. I'm running Ubuntu
> Server 13.04 64-bit.

I have to confirm that the bug has not been fixed after almost two years!
Comment 23 Björn Jacke 2014-04-16 20:42:59 UTC
uninstalling libpam-smbpass is a workaround. apart from that swat is no longer part of samba recent samba releases and it was deprecated to use it since many years already. We'll close this bug now.
Comment 24 Björn Jacke 2014-05-13 09:42:47 UTC
*** Bug 10339 has been marked as a duplicate of this bug. ***