[PATCH] s3-messaging/ctdb is broken in master

Ralph Boehme slow at samba.org
Sun Jul 10 11:36:31 UTC 2016


Hi!

It seems s3-messaging/ctdb is broken in master. After an smbd is
forked to handle a session it crashed when trying to do messaging with
ctdb but the IPC fd gives EBADF.

Turns out the commits

  3fe3226daa8488e0fa787c40359c3401b6f05fc0 and
  3fe3226daa8488e0fa787c40359c3401b6f05fc0^

introduced a regression.

With those two commits we now pass the ctdb-messaging object conn to
db_open() and save a reference to it to the private db_ctdb_ctx for
later use. Unfortunately, reinit_after_fork() destroys conn, leaving
us with an invalid reference.

Attached patchset fixes the issue for me, it adds proper
ctdb-messaging reinit functions that preserve the conn object and just
reinitialize the IPC fd.

Please review and push if ok.

Cheerio!
-slow
-------------- next part --------------
From 994e68d4ecf9b8dac684a55cba6403d1eb812dc3 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Sat, 9 Jul 2016 08:48:49 +0200
Subject: [PATCH 1/5] ctdbd_conn: split ctdbd_init_connection()

Split ctdbd_init_connection() into an internal function that does the
connection setup and only keep the conn object allocation in
ctdbd_init_connection().

This is in preperation of adding ctdbd_reinit_connection() which will
use the new internal function as well.

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/lib/ctdbd_conn.c | 45 ++++++++++++++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 15 deletions(-)

diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index d073c72..914f7ba 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -405,18 +405,12 @@ static int ctdbd_connection_destructor(struct ctdbd_connection *c)
  * Get us a ctdbd connection
  */
 
-int ctdbd_init_connection(TALLOC_CTX *mem_ctx,
-			  const char *sockname, int timeout,
-			  struct ctdbd_connection **pconn)
+static int ctdbd_init_connection_internal(TALLOC_CTX *mem_ctx,
+					  const char *sockname, int timeout,
+					  struct ctdbd_connection *conn)
 {
-	struct ctdbd_connection *conn;
 	int ret;
 
-	if (!(conn = talloc_zero(mem_ctx, struct ctdbd_connection))) {
-		DEBUG(0, ("talloc failed\n"));
-		return ENOMEM;
-	}
-
 	conn->timeout = timeout;
 
 	if (conn->timeout == 0) {
@@ -426,31 +420,52 @@ int ctdbd_init_connection(TALLOC_CTX *mem_ctx,
 	ret = ctdbd_connect(sockname, &conn->fd);
 	if (ret != 0) {
 		DEBUG(1, ("ctdbd_connect failed: %s\n", strerror(ret)));
-		goto fail;
+		return EIO;
 	}
 	talloc_set_destructor(conn, ctdbd_connection_destructor);
 
 	ret = get_cluster_vnn(conn, &conn->our_vnn);
-
 	if (ret != 0) {
 		DEBUG(10, ("get_cluster_vnn failed: %s\n", strerror(ret)));
-		goto fail;
+		return EIO;
 	}
 
 	if (!ctdbd_working(conn, conn->our_vnn)) {
 		DEBUG(2, ("Node is not working, can not connect\n"));
-		ret = EIO;
-		goto fail;
+		return EIO;
 	}
 
 	generate_random_buffer((unsigned char *)&conn->rand_srvid,
 			       sizeof(conn->rand_srvid));
 
 	ret = register_with_ctdbd(conn, conn->rand_srvid, NULL, NULL);
-
 	if (ret != 0) {
 		DEBUG(5, ("Could not register random srvid: %s\n",
 			  strerror(ret)));
+		return EIO;
+	}
+
+	return 0;
+}
+
+int ctdbd_init_connection(TALLOC_CTX *mem_ctx,
+			  const char *sockname, int timeout,
+			  struct ctdbd_connection **pconn)
+{
+	struct ctdbd_connection *conn;
+	int ret;
+
+	if (!(conn = talloc_zero(mem_ctx, struct ctdbd_connection))) {
+		DEBUG(0, ("talloc failed\n"));
+		return ENOMEM;
+	}
+
+	ret = ctdbd_init_connection_internal(mem_ctx,
+					     sockname,
+					     timeout,
+					     conn);
+	if (ret != 0) {
+		DEBUG(0, ("ctdbd_init_connection_internal failed\n"));
 		goto fail;
 	}
 
-- 
2.5.0


From 7dca8c76317b48a0ce87a78e2572295e5fb691da Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Sat, 9 Jul 2016 08:59:09 +0200
Subject: [PATCH 2/5] ctdbd_conn: add ctdbd_reinit_connection()

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/include/ctdbd_conn.h |  3 +++
 source3/lib/ctdbd_conn.c     | 24 ++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h
index 11e71ba..bbebbce 100644
--- a/source3/include/ctdbd_conn.h
+++ b/source3/include/ctdbd_conn.h
@@ -33,6 +33,9 @@ struct messaging_rec;
 int ctdbd_init_connection(TALLOC_CTX *mem_ctx,
 			  const char *sockname, int timeout,
 			  struct ctdbd_connection **pconn);
+int ctdbd_reinit_connection(TALLOC_CTX *mem_ctx,
+			    const char *sockname, int timeout,
+			    struct ctdbd_connection *conn);
 
 uint32_t ctdbd_vnn(const struct ctdbd_connection *conn);
 
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 914f7ba..b95b4a8 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -477,6 +477,30 @@ int ctdbd_init_connection(TALLOC_CTX *mem_ctx,
 	return ret;
 }
 
+int ctdbd_reinit_connection(TALLOC_CTX *mem_ctx,
+			    const char *sockname, int timeout,
+			    struct ctdbd_connection *conn)
+{
+	int ret;
+
+	ret = ctdbd_connection_destructor(conn);
+	if (ret != 0) {
+		DBG_ERR("ctdbd_connection_destructor failed\n");
+		return EIO;
+	}
+
+	ret = ctdbd_init_connection_internal(mem_ctx,
+					     sockname,
+					     timeout,
+					     conn);
+	if (ret != 0) {
+		DBG_ERR("ctdbd_init_connection_internal failed\n");
+		return EIO;
+	}
+
+	return 0;
+}
+
 int ctdbd_conn_get_fd(struct ctdbd_connection *conn)
 {
 	return conn->fd;
-- 
2.5.0


From 2a539f22a2f897141811fc5f7202bb911f31d242 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Sat, 9 Jul 2016 13:20:01 +0200
Subject: [PATCH 3/5] s3-messaging/ctdb: split messaging_ctdbd_init()

Split out and internal function from messaging_ctdbd_init() that does
the connection setup. Keep the conn object allocation in
messaging_ctdbd_init().

This is in preperation of adding messaging_ctdbd_reinit() which will use
the new internal function as well.

messaging_ctdbd_init_internal() has a new reinit flag,
messaging_ctdbd_init() calls with reinit=false resulting in unmodified
behaviour.

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/lib/messages_ctdbd.c | 80 +++++++++++++++++++++++++++++---------------
 1 file changed, 53 insertions(+), 27 deletions(-)

diff --git a/source3/lib/messages_ctdbd.c b/source3/lib/messages_ctdbd.c
index 1645ccf..5a9fefc 100644
--- a/source3/lib/messages_ctdbd.c
+++ b/source3/lib/messages_ctdbd.c
@@ -174,41 +174,40 @@ static void messaging_ctdbd_readable(struct tevent_context *ev,
 	ctdbd_socket_readable(conn);
 }
 
-int messaging_ctdbd_init(struct messaging_context *msg_ctx,
-			 TALLOC_CTX *mem_ctx,
-			 struct messaging_backend **presult)
+static int messaging_ctdbd_init_internal(struct messaging_context *msg_ctx,
+					 TALLOC_CTX *mem_ctx,
+					 struct messaging_ctdbd_context *ctx,
+					 bool reinit)
 {
-	struct messaging_backend *result;
-	struct messaging_ctdbd_context *ctx;
 	struct tevent_context *ev;
 	int ret, ctdb_fd;
 
-	if (!(result = talloc(mem_ctx, struct messaging_backend))) {
-		DEBUG(0, ("talloc failed\n"));
-		return ENOMEM;
-	}
-
-	if (!(ctx = talloc(result, struct messaging_ctdbd_context))) {
-		DEBUG(0, ("talloc failed\n"));
-		TALLOC_FREE(result);
-		return ENOMEM;
-	}
-
-	ret = ctdbd_init_connection(ctx, lp_ctdbd_socket(),
-				    lp_ctdb_timeout(), &ctx->conn);
-
-	if (ret != 0) {
-		DBG_DEBUG("ctdbd_init_connection failed: %s\n",
-			  strerror(ret));
-		TALLOC_FREE(result);
-		return ret;
+	if (reinit) {
+		ret = ctdbd_reinit_connection(ctx,
+					      lp_ctdbd_socket(),
+					      lp_ctdb_timeout(),
+					      ctx->conn);
+		if (ret != 0) {
+			DBG_ERR("ctdbd_reinit_connection failed: %s\n",
+				strerror(ret));
+			return ret;
+		}
+	} else {
+		ret = ctdbd_init_connection(ctx,
+					    lp_ctdbd_socket(),
+					    lp_ctdb_timeout(),
+					    &ctx->conn);
+		if (ret != 0) {
+			DBG_ERR("ctdbd_init_connection failed: %s\n",
+				strerror(ret));
+			return ret;
+		}
 	}
 
 	ret = register_with_ctdbd(ctx->conn, MSG_SRVID_SAMBA, NULL, NULL);
 	if (ret != 0) {
 		DBG_DEBUG("Could not register MSG_SRVID_SAMBA: %s\n",
 			  strerror(ret));
-		TALLOC_FREE(result);
 		return ret;
 	}
 
@@ -217,7 +216,6 @@ int messaging_ctdbd_init(struct messaging_context *msg_ctx,
 	if (ret != 0) {
 		DEBUG(10, ("register_with_ctdbd failed: %s\n",
 			   strerror(ret)));
-		TALLOC_FREE(result);
 		return ret;
 	}
 
@@ -227,7 +225,6 @@ int messaging_ctdbd_init(struct messaging_context *msg_ctx,
 	ctx->fde = tevent_add_fd(ev, ctx, ctdb_fd, TEVENT_FD_READ,
 				 messaging_ctdbd_readable, ctx->conn);
 	if (ctx->fde == NULL) {
-		TALLOC_FREE(result);
 		return ENOMEM;
 	}
 
@@ -237,6 +234,35 @@ int messaging_ctdbd_init(struct messaging_context *msg_ctx,
 
 	set_my_vnn(ctdbd_vnn(ctx->conn));
 
+	return 0;
+}
+
+int messaging_ctdbd_init(struct messaging_context *msg_ctx,
+			 TALLOC_CTX *mem_ctx,
+			 struct messaging_backend **presult)
+{
+	struct messaging_backend *result;
+	struct messaging_ctdbd_context *ctx;
+	struct tevent_context *ev;
+	int ret, ctdb_fd;
+
+	if (!(result = talloc(mem_ctx, struct messaging_backend))) {
+		DEBUG(0, ("talloc failed\n"));
+		return ENOMEM;
+	}
+
+	if (!(ctx = talloc(result, struct messaging_ctdbd_context))) {
+		DEBUG(0, ("talloc failed\n"));
+		TALLOC_FREE(result);
+		return ENOMEM;
+	}
+
+	ret = messaging_ctdbd_init_internal(msg_ctx, mem_ctx, ctx, false);
+	if (ret != 0) {
+		TALLOC_FREE(result);
+		return ret;
+	}
+
 	result->send_fn = messaging_ctdb_send;
 	result->private_data = (void *)ctx;
 
-- 
2.5.0


From ad46324491a66d625fecb28c6d74a1eb13e719af Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Sat, 9 Jul 2016 14:30:35 +0200
Subject: [PATCH 4/5] s3-messaging/ctdb: add messaging_ctdbd_reinit()

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/include/messages.h   |  3 +++
 source3/lib/ctdb_dummy.c     |  7 +++++++
 source3/lib/messages_ctdbd.c | 16 ++++++++++++++++
 3 files changed, 26 insertions(+)

diff --git a/source3/include/messages.h b/source3/include/messages.h
index 8bbe026..2eaf146 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -79,6 +79,9 @@ struct messaging_backend {
 int messaging_ctdbd_init(struct messaging_context *msg_ctx,
 			 TALLOC_CTX *mem_ctx,
 			 struct messaging_backend **presult);
+int messaging_ctdbd_reinit(struct messaging_context *msg_ctx,
+			   TALLOC_CTX *mem_ctx,
+			   struct messaging_backend *backend);
 struct ctdbd_connection *messaging_ctdbd_connection(void);
 
 bool message_send_all(struct messaging_context *msg_ctx,
diff --git a/source3/lib/ctdb_dummy.c b/source3/lib/ctdb_dummy.c
index ec0bcc4..8b617ba 100644
--- a/source3/lib/ctdb_dummy.c
+++ b/source3/lib/ctdb_dummy.c
@@ -83,6 +83,13 @@ int messaging_ctdbd_init(struct messaging_context *msg_ctx,
 	return ENOSYS;
 }
 
+int messaging_ctdbd_reinit(struct messaging_context *msg_ctx,
+			   TALLOC_CTX *mem_ctx,
+			   struct messaging_backend *backend)
+{
+	return ENOSYS;
+}
+
 struct ctdbd_connection *messaging_ctdbd_connection(void)
 {
 	return NULL;
diff --git a/source3/lib/messages_ctdbd.c b/source3/lib/messages_ctdbd.c
index 5a9fefc..519f4e6 100644
--- a/source3/lib/messages_ctdbd.c
+++ b/source3/lib/messages_ctdbd.c
@@ -269,3 +269,19 @@ int messaging_ctdbd_init(struct messaging_context *msg_ctx,
 	*presult = result;
 	return 0;
 }
+
+int messaging_ctdbd_reinit(struct messaging_context *msg_ctx,
+			   TALLOC_CTX *mem_ctx,
+			   struct messaging_backend *backend)
+{
+	struct messaging_ctdbd_context *ctx = talloc_get_type_abort(
+		backend->private_data, struct messaging_ctdbd_context);
+	int ret;
+
+	ret = messaging_ctdbd_init_internal(msg_ctx, mem_ctx, ctx, true);
+	if (ret != 0) {
+		return ret;
+	}
+
+	return 0;
+}
-- 
2.5.0


From d3e77d7ef3c3c8512961c706caad9cb906637144 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Sat, 9 Jul 2016 14:33:52 +0200
Subject: [PATCH 5/5] s3-messaging: use messaging_ctdbd_reinit() in
 messaging_reinit()

This is the last step to fix a regression introduced by

  3fe3226daa8488e0fa787c40359c3401b6f05fc0 and
  3fe3226daa8488e0fa787c40359c3401b6f05fc0^

where we pass the ctdb-messaging object conn to db_open() and add a
reference to it to the private db_ctdb_ctx for later use. Unfortunately
reinit_after_fork() destroys conn, leaving us with an invalid reference.

The previous patches added new lower level functions
messaging_ctdbd_reinit() and ctdbd_reinit_connection(), finally use them
them from messaging_reinit(). They preserve the conn object and simply
reinitialize the IPC fd.

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/lib/messages.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 65e975e..5d90947 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -416,11 +416,9 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
 		return map_nt_error_from_unix(ret);
 	}
 
-	TALLOC_FREE(msg_ctx->remote);
-
 	if (lp_clustering()) {
-		ret = messaging_ctdbd_init(msg_ctx, msg_ctx,
-					   &msg_ctx->remote);
+		ret = messaging_ctdbd_reinit(msg_ctx, msg_ctx,
+					     msg_ctx->remote);
 
 		if (ret != 0) {
 			DEBUG(1, ("messaging_ctdbd_init failed: %s\n",
-- 
2.5.0

-------------- next part --------------
3fe3226

(gdb) bt full
#0  0x00007fede22023ba in waitpid () at /lib64/libc.so.6
#1  0x00007fede217d9cb in do_system () at /lib64/libc.so.6
#2  0x00007fede3886c37 in smb_panic_s3 (why=0x7fede3660a2f "cluster_fatal") at ../source3/lib/util.c:804
        cmd = 0x55c0c93cf040 "/bin/sleep 999999999"
        result = 1
        __FUNCTION__ = "smb_panic_s3"
#3  0x00007fede637388a in smb_panic (why=0x7fede3660a2f "cluster_fatal") at ../lib/util/fault.c:166
#4  0x00007fede365b1ab in cluster_fatal (why=0x7fede3661248 "cluster dispatch daemon msg write error\n") at ../source3/lib/ctdbd_conn.c:83
        __FUNCTION__ = "cluster_fatal"
#5  0x00007fede365d1fe in ctdbd_migrate (conn=0x55c0c93b67b0, db_id=2663557248, key=...) at ../source3/lib/ctdbd_conn.c:765
        req =
          {hdr = {length = 68, ctdb_magic = 1129595970, ctdb_version = 1, generation = 0, operation = 0, destnode = 0, srcnode = 0, reqid = 1953525552}, flags = 1, db_id = 2663557248, callid = 4
278190081, hopcount = 0, keylen = 12, calldatalen = 0, data = ""}
        hdr = 0x5e46400000001
        iov = {{iov_base = 0x7ffd1fb22c60, iov_len = 56}, {iov_base = 0x7ffd1fb22ec0, iov_len = 12}}
        nwritten = -1
        ret = 32512
        __FUNCTION__ = "ctdbd_migrate"
        __func__ = "ctdbd_migrate"
#6  0x00007fede3658901 in fetch_locked_internal (ctx=0x55c0c93c0a00, mem_ctx=0x55c0c93b7770, key=..., tryonly=false) at ../source3/lib/dbwrap/dbwrap_ctdb.c:1125
        result = 0x55c0c93ccb20
        crec = 0x55c0c93ccbd0
        ctdb_data = {dptr = 0x0, dsize = 0}
        migrate_attempts = 1
        migrate_start = {tv_sec = 1467374898, tv_usec = 620159}
        chainlock_start = {tv_sec = 1467374898, tv_usec = 620162}
        ctdb_start_time = {tv_sec = 1467374898, tv_usec = 620190}
        chainlock_time = 1.7e-05
        ctdb_time = 0
        duration_msecs = 32749
        lockret = 0
        ret = -445468530
        __FUNCTION__ = "fetch_locked_internal"
#7  0x00007fede3658d84 in db_ctdb_fetch_locked (db=0x55c0c93c0900, mem_ctx=0x55c0c93b7770, key=...) at ../source3/lib/dbwrap/dbwrap_ctdb.c:1207
        ctx = 0x55c0c93c0a00
#8  0x00007feddfb6a42e in dbwrap_fetch_locked_internal (db=0x55c0c93c0900, mem_ctx=0x55c0c93b7770, key=..., db_fn=0x7fede3658cd3 <db_ctdb_fetch_locked>) at ../lib/dbwrap/dbwrap.c:224
        rec = 0x0
        lock_order = 0x55c0c93ccaa0
#9  0x00007feddfb6a4ce in dbwrap_fetch_locked (db=0x55c0c93c0900, mem_ctx=0x55c0c93b7770, key=...) at ../lib/dbwrap/dbwrap.c:238
#10 0x00007fede3896994 in serverid_register (id=..., msg_flags=51) at ../source3/lib/serverid.c:106
        db = 0x55c0c93c0900
        key = {pid = 11702, task_id = 0, vnn = 0}
        data = {unique_id = 140659741386337, msg_flags = 0}
        rec = 0x7fede6074e10
        tdbkey = {dptr = 0x7ffd1fb22ec0 "\266-", dsize = 12}
        tdbdata = {dptr = 0x7ffd1fb22f30 "x\fنgH\330\005\204\336\353\345\355\177", dsize = 140659741386582}
        status = {v = 531771120}
        ret = false
        __FUNCTION__ = "serverid_register"
---Type <return> to continue, or q <return> to quit---
#11 0x00007fede5ebde9b in smbd_process (ev_ctx=0x55c0c93b59c0, msg_ctx=0x55c0c93b5ab0, sock_fd=45, interactive=false) at ../source3/smbd/process.c:3947
        trace_state = {ev = 0x55c0c93b59c0, frame = 0x55c0c93b7770, profile_idle = {start = 0, stats = 0x0}}
        client = 0x55c0c93b5d80
        sconn = 0x55c0c93c8050
        xconn = 0x0
        locaddr = 0x0
        remaddr = 0x0
        ret = 32749
        status = {v = 0}
        tv = {tv_sec = 1467374898, tv_usec = 615121}
        now = 131118484986151210
        chroot_dir = 0x0
        rc = -477542990
        __func__ = "smbd_process"
        __FUNCTION__ = "smbd_process"
#12 0x000055c0c73ef233 in smbd_accept_connection (ev=0x55c0c93b59c0, fde=0x55c0c93cecf0, flags=1, private_data=0x55c0c93cec60) at ../source3/smbd/server.c:765
        status = {v = 0}
        s = 0x0
        msg_ctx = 0x55c0c93b5ab0
        addr =
          {ss_family = 2, __ss_align = 0, __ss_padding = "@7\262\037\375\177\000\000\000\000\000\000\000\000\000\000\030\b<\311\300U\000\000p1\262\037\375\177\000\000\360\060\262\037\375\177\000
\000\357\376\066\346\355\177\000\000\030\b<\311\300U\000\000p1\262\037\375\177\000\000\203\003\000\000\000\000\000\000\066\350\r\000\000\000\000\000\220\061\262\037\375\177\000\000X6\212\343\355
\177\000\000-]vW\000\000\000\000\270\061\262\037\375\177\000"}
        in_addrlen = 16
        fd = 45
        pid = 0
        __FUNCTION__ = "smbd_accept_connection"
#13 0x00007fede38a3bc6 in run_events_poll (ev=0x55c0c93b59c0, pollrtn=1, pfds=0x55c0c93be340, num_pfds=7) at ../source3/lib/events.c:257
        pfd = 0x55c0c93be348
        flags = 1
        state = 0x55c0c93a65a0
        pollfd_idx = 0x55c0c93b5b80
        fde = 0x55c0c93cecf0
        __FUNCTION__ = "run_events_poll"
#14 0x00007fede38a3e54 in s3_event_loop_once (ev=0x55c0c93b59c0, location=0x55c0c73f5bac "../source3/smbd/server.c:1130") at ../source3/lib/events.c:326
        state = 0x55c0c93a65a0
        timeout = 899912
        num_pfds = 7
        ret = 1
        poll_errno = 0
#15 0x00007fede53178c7 in _tevent_loop_once (ev=0x55c0c93b59c0, location=0x55c0c73f5bac "../source3/smbd/server.c:1130") at ../lib/tevent/tevent.c:533
        ret = 21952
        nesting_stack_ptr = 0x0
#16 0x00007fede5317b18 in tevent_common_loop_wait (ev=0x55c0c93b59c0, location=0x55c0c73f5bac "../source3/smbd/server.c:1130") at ../lib/tevent/tevent.c:637
        ret = 446046453
#17 0x00007fede5317be3 in _tevent_loop_wait (ev=0x55c0c93b59c0, location=0x55c0c73f5bac "../source3/smbd/server.c:1130") at ../lib/tevent/tevent.c:656
#18 0x000055c0c73f0016 in smbd_parent_loop (ev_ctx=0x55c0c93b59c0, parent=0x55c0c93bbad0) at ../source3/smbd/server.c:1130
        trace_state = {frame = 0x55c0c93b6eb0}
        ret = 0
---Type <return> to continue, or q <return> to quit---
        __FUNCTION__ = "smbd_parent_loop"
#19 0x000055c0c73f19c8 in main (argc=1, argv=0x7ffd1fb23748) at ../source3/smbd/server.c:1785
        is_daemon = true
        interactive = false
        Fork = true
        no_process_group = false
        log_stdout = false
        ports = 0x0
        profile_level = 0x0
        opt = -1
        pc = 0x55c0c93a64d0
        print_build_options = false
        main_server_id = {pid = 11690, task_id = 0, vnn = 0, unique_id = 8008771305405527304}
        long_options =
            {{longName = 0x0, shortName = 0 '\000', argInfo = 4, arg = 0x7fede2704000 <poptHelpOptions>, val = 0, descrip = 0x55c0c73f5ca9 "Help options:", argDescrip = 0x0}, {longName = 0x55c0c
73f5cb7 "daemon", shortName = 68 'D', argInfo = 0, arg = 0x0, val = 1000, descrip = 0x55c0c73f5cbe "Become a daemon (default)", argDescrip = 0x0}, {longName = 0x55c0c73f5cd8 "interactive", short
Name = 105 'i', argInfo = 0, arg = 0x0, val = 1001, descrip = 0x55c0c73f5ce8 "Run interactive (not a daemon)", argDescrip = 0x0}, {longName = 0x55c0c73f5d07 "foreground", shortName = 70 'F', arg
Info = 0, arg = 0x0, val = 1002, descrip = 0x55c0c73f5d18 "Run daemon in foreground (for daemontools, etc.)", argDescrip = 0x0}, {longName = 0x55c0c73f5d49 "no-process-group", shortName = 0 '\00
0', argInfo = 0, arg = 0x0, val = 1003, descrip = 0x55c0c73f5d60 "Don't create a new process group", argDescrip = 0x0}, {longName = 0x55c0c73f5d81 "log-stdout", shortName = 83 'S', argInfo = 0,
arg = 0x0, val = 1004, descrip = 0x55c0c73f5d8c "Log to stdout", argDescrip = 0x0}, {longName = 0x55c0c73f5d9a "build-options", shortName = 98 'b', argInfo = 0, arg = 0x0, val = 98, descrip = 0x
55c0c73f5da8 "Print build options", argDescrip = 0x0}, {longName = 0x55c0c73f5dbc "port", shortName = 112 'p', argInfo = 1, arg = 0x7ffd1fb23310, val = 0, descrip = 0x55c0c73f5dc1 "Listen on the
 specified ports", argDescrip = 0x0}, {longName = 0x55c0c73f5ddf "profiling-level", shortName = 80 'P', argInfo = 1, arg = 0x7ffd1fb23318, val = 0, descrip = 0x55c0c73f5def "Set profiling level"
, argDescrip = 0x55c0c73f5e03 "PROFILE_LEVEL"}, {longName = 0x0, shortName = 0 '\000', argInfo = 4, arg = 0x7fede3f17120 <popt_common_samba>, val = 0, descrip = 0x55c0c73f5e11 "Common samba opti
ons:", argDescrip = 0x0}, {longName = 0x0, shortName = 0 '\000', argInfo = 0, arg = 0x0, val = 0, descrip = 0x0, argDescrip = 0x0}}
        parent = 0x55c0c93bbad0
        frame = 0x55c0c93a55b0
        status = {v = 0}
        ev_ctx = 0x55c0c93b59c0
        msg_ctx = 0x55c0c93b5ab0
        server_id = {pid = 11692, task_id = 0, vnn = 0, unique_id = 14978511694116981671}
        se = 0x55c0c93bbd90
        profiling_level = 0
        np_dir = 0x55c0c93c62b0 "/opt/samba/var/lock/msg.lock"
        smbd_shim_fns =
          {cancel_pending_lock_requests_by_fid = 0x7fede5e9a4f1 <smbd_cancel_pending_lock_requests_by_fid>, send_stat_cache_delete_message = 0x7fede5ea4831 <smbd_send_stat_cache_delete_message>,
 change_to_root_user = 0x7fede5e82620 <smbd_change_to_root_user>, become_authenticated_pipe_user = 0x7fede5e826d4 <smbd_become_authenticated_pipe_user>, unbecome_authenticated_pipe_user = 0x7fed
e5e827c4 <smbd_unbecome_authenticated_pipe_user>, contend_level2_oplocks_begin = 0x7fede5f19ef2 <smbd_contend_level2_oplocks_begin>, contend_level2_oplocks_end = 0x7fede5f19f65 <smbd_contend_lev
el2_oplocks_end>, become_root = 0x7fede5e829e0 <smbd_become_root>, unbecome_root = 0x7fede5e82a09 <smbd_unbecome_root>, exit_server = 0x7fede5f0de2d <smbd_exit_server>, exit_server_cleanly = 0x7
fede5f0de4a <smbd_exit_server_cleanly>}
        __FUNCTION__ = "main"
(gdb)


More information about the samba-technical mailing list