Bug 10169 - Build Error in scavenger.c
Build Error in scavenger.c
Status: RESOLVED FIXED
Product: Samba 4.0
Classification: Unclassified
Component: Other
4.0.9
x86 Linux
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-26 17:08 UTC by IT2
Modified: 2013-10-02 07:34 UTC (History)
0 users

See Also:


Attachments
source3/smbd/scavenger.c Patch from Volker Lendecke (1.26 KB, application/octet-stream)
2013-09-26 17:08 UTC, IT2
no flags Details
git-am fix that went into master. Applies cleanly to 4.0.x. (1.54 KB, patch)
2013-09-27 09:07 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description IT2 2013-09-26 17:08:19 UTC
Created attachment 9242 [details]
source3/smbd/scavenger.c Patch from Volker Lendecke

I tried to build samba 4.0.9 on a Debian Wheezy 7.1 x86 fresh install
and got this error:

[2717/3935] Compiling source3/smbd/scavenger.c
../source3/smbd/scavenger.c: In function ‘scavenger_timer’:
../source3/smbd/scavenger.c:482:3: error: format ‘%lu’ expects argument
of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’
[-Werror=format]
../source3/smbd/scavenger.c:490:3: error: format ‘%lu’ expects argument
of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’
[-Werror=format]
cc1: some warnings being treated as errors
Waf: Leaving directory `/root/samba-4.0.9/bin'
Build failed:  -> task failed (err #1):
        {task: cc scavenger.c -> scavenger_92.o}
make: *** [all] Fehler 1


Volker Lendecke patched it for me. I tested it and it works.

From a075eb64952d58749660a87049bb7e3d326c5968 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl@samba.org>
Date: Wed, 25 Sep 2013 06:24:19 -0700
Subject: [PATCH] smbd: Fix a 64-bit warning

---
 source3/smbd/scavenger.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/source3/smbd/scavenger.c b/source3/smbd/scavenger.c
index fe4e56e..0ca18c8 100644
--- a/source3/smbd/scavenger.c
+++ b/source3/smbd/scavenger.c
@@ -480,16 +480,16 @@ static void scavenger_timer(struct tevent_context *ev,
 					     ctx->msg.open_persistent_id);
 	if (!ok) {
 		DEBUG(2, ("Failed to cleanup share modes and byte range locks "
-			  "for file %s open %lu\n",
+			  "for file %s open %llu\n",
 			  file_id_string_tos(&ctx->msg.file_id),
-			  ctx->msg.open_persistent_id));
+			  (unsigned long long)ctx->msg.open_persistent_id));
 	}
 
 	status = smbXsrv_open_cleanup(ctx->msg.open_persistent_id);
 	if (!NT_STATUS_IS_OK(status)) {
-		DEBUG(2, ("Failed to cleanup open global for file %s open %lu:"
+		DEBUG(2, ("Failed to cleanup open global for file %s open %llu:"
 			  " %s\n", file_id_string_tos(&ctx->msg.file_id),
-			  ctx->msg.open_persistent_id, nt_errstr(status)));
+			  (unsigned long long)ctx->msg.open_persistent_id, nt_errstr(status)));
 	}
 }
Comment 1 Jeremy Allison 2013-09-27 09:07:34 UTC
Created attachment 9245 [details]
git-am fix that went into master. Applies cleanly to 4.0.x.

Actually this can be fixed in 4.0.next by doing:

git cherry-pick -x 31714c97845fff11b2997c86b5fc3a3bff8ed710

from master. This fix is already in 4.1.0.

Jeremy.
Comment 2 Jeremy Allison 2013-09-27 09:08:09 UTC
Re-assigning to Karolin for inclusion in 4.0.next. Patch was already reviewed by 2 Team members.

Jeremy.
Comment 3 Karolin Seeger 2013-09-27 09:13:41 UTC
(In reply to comment #2)
> Re-assigning to Karolin for inclusion in 4.0.next. Patch was already reviewed
> by 2 Team members.
> 
> Jeremy.

4.0 is already frozen, but this seems to be an obvious fix.
Apply?
Maybe 4.0.10 will be delayed anyway...
Comment 4 Jeremy Allison 2013-09-27 09:17:24 UTC
I would say yes. It's a build breakage on 32-bit Ubuntu systems which is a common platform.

Jeremy.
Comment 5 Karolin Seeger 2013-09-27 09:53:30 UTC
(In reply to comment #4)
> I would say yes. It's a build breakage on 32-bit Ubuntu systems which is a
> common platform.
> 
> Jeremy.

Pushed to autobuild-v4-0-test.
Comment 6 Karolin Seeger 2013-09-30 08:31:06 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > I would say yes. It's a build breakage on 32-bit Ubuntu systems which is a
> > common platform.
> > 
> > Jeremy.
> 
> Pushed to autobuild-v4-0-test.

Still problems with the autobuild...
Comment 7 Karolin Seeger 2013-10-02 07:34:04 UTC
Pushed to v4-0-test.
Closing out bug report.

Thanks!