Bug 5105 - corrupted gencache.tdb causes an infinite loop in libsmbclient
corrupted gencache.tdb causes an infinite loop in libsmbclient
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient
3.0.27
Other Linux
: P3 major
: none
Assigned To: Volker Lendecke
Samba QA Contact
:
: 4276 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-25 02:50 UTC by Mikhail Kshevetskiy
Modified: 2009-07-15 04:00 UTC (History)
1 user (show)

See Also:


Attachments
broken tdb file (66.05 KB, application/octet-stream)
2007-11-25 02:54 UTC, Mikhail Kshevetskiy
no flags Details
output of libsmbclient (debuglevel=10) (3.07 KB, text/plain)
2007-11-25 02:56 UTC, Mikhail Kshevetskiy
no flags Details
libsmbclient test application (1.56 KB, text/plain)
2007-11-25 03:00 UTC, Mikhail Kshevetskiy
no flags Details
proposed patch (4.53 KB, patch)
2007-11-25 03:42 UTC, Volker Lendecke
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kshevetskiy 2007-11-25 02:50:33 UTC
Opening "smb://14" ("14" is a workgroup name) via libsmbclient i get a 100% cpu usage. After the moving of gencache.tdb to the other directory the problem is disappear.
Comment 1 Mikhail Kshevetskiy 2007-11-25 02:54:32 UTC
Created attachment 2997 [details]
broken tdb file
Comment 2 Mikhail Kshevetskiy 2007-11-25 02:56:21 UTC
Created attachment 2998 [details]
output of libsmbclient (debuglevel=10)
Comment 3 Mikhail Kshevetskiy 2007-11-25 03:00:17 UTC
Created attachment 2999 [details]
libsmbclient test application
Comment 4 Volker Lendecke 2007-11-25 03:42:19 UTC
Created attachment 3000 [details]
proposed patch

The attached patch might solve this endless loop and replace it with "just" very high CPU load. The application should however still make progress.

This patch needs further discussion, you might want to follow samba-technical@samba.org.
Comment 5 Derrell Lipman 2007-12-12 12:54:31 UTC
Volker's taken this one.  It looks to be a general tdb issue rather than a problem in libsmbclient.  Reassigning.  (Volker, if it looks like there is also a libsmbclient problem, please let me know; otherwise I won't worry about this.)

Derrell
Comment 6 Derrell Lipman 2008-01-17 10:53:23 UTC
Volker, has this been resolved?

Derrell
Comment 7 Volker Lendecke 2008-01-17 10:57:24 UTC
No, I'm waiting for Tridge to give his ok with the patch.

Volker
Comment 8 Derrell Lipman 2009-01-03 09:52:42 UTC
Tridge, it looks like this patch has been awaiting your approval for a year.  If you get a chance, maybe you can take a look?
Comment 9 Karolin Seeger 2009-06-02 06:08:46 UTC
Tridge, re-assigning the bug to your for review.

Thanks!

Karolin
Comment 10 Karolin Seeger 2009-06-02 06:57:10 UTC
Re-assgning bug to Volker, as it seems he's going to implement another solution.
Comment 11 Volker Lendecke 2009-07-15 03:59:17 UTC
Ok, with http://git.samba.org/?p=samba.git;a=commitdiff;h=8a17cd810fa6c I've checked in a solution that makes gencache corruptions MUCH more unlikely. Gencache becomes a two-stage thing: One transient one without transactions and clear-if-first, and one permanent one with tdb transactions. This does not make it 100% impossible to run into a loop, but a restart of all samba/libsmbclient processes will solve it.

I'm closing this as fixed, although the fix will not be in production releases before 3.5.

Volker
Comment 12 Volker Lendecke 2009-07-15 04:00:13 UTC
*** Bug 4276 has been marked as a duplicate of this bug. ***