Attention is currently required from: daniel, dexter, laforge, pespin.
jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email )
Change subject: stream_cli: Correctly setup and free osmo_io client instance
......................................................................
Patch Set 8:
(1 comment)
Patchset:
PS7:
> First, the iofd must be freed and cannot be reused, otherwise it will not function correctly. […]
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I91a6a76b9ff96034a7b333edf87af27490202932
Gerrit-Change-Number: 35979
Gerrit-PatchSet: 8
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 07 Mar 2024 09:30:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly <andreas(a)eversberg.eu>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: daniel, dexter, laforge, pespin.
jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email )
Change subject: stream_cli: Correctly setup and free osmo_io client instance
......................................................................
Patch Set 7:
(1 comment)
Patchset:
PS7:
> I think the question daniel is racing:In the old code (pre 7e6d2e0f99ff095f4714f03b1ed991d6c9cb9c61) […]
First, the iofd must be freed and cannot be reused, otherwise it will not function correctly.
And yes, if osmo_stream_cli_open() is called again without closing, it runs into a memory leak. To guard against that, I added osmo_stream_cli_close_iofd() before calling osmo_iofd_setup().
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I91a6a76b9ff96034a7b333edf87af27490202932
Gerrit-Change-Number: 35979
Gerrit-PatchSet: 7
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 07 Mar 2024 09:30:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly <andreas(a)eversberg.eu>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: jolly, pespin.
Hello Jenkins Builder, daniel, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-netif/+/36124?usp=email
to look at the new patch set (#8).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: stream_{client,server} example: Cleanup on exit
......................................................................
stream_{client,server} example: Cleanup on exit
In order to detect memory leaks while debugging, stream server/client
and keyboard is closed on exit.
Related: OS#5753
Change-Id: I9dbb7f46b2a798e88ad4df8ff73c6ee40c07b843
---
M examples/stream-client.c
M examples/stream-server.c
2 files changed, 34 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/24/36124/8
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/36124?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I9dbb7f46b2a798e88ad4df8ff73c6ee40c07b843
Gerrit-Change-Number: 36124
Gerrit-PatchSet: 8
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: daniel, dexter, jolly, laforge, pespin.
Hello Jenkins Builder, daniel, dexter, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email
to look at the new patch set (#8).
The following approvals got outdated and were removed:
Code-Review+1 by dexter, Code-Review+1 by laforge, Code-Review+1 by pespin, Code-Review-1 by daniel, Verified+1 by Jenkins Builder
Change subject: stream_cli: Correctly setup and free osmo_io client instance
......................................................................
stream_cli: Correctly setup and free osmo_io client instance
Free osmo_io instance when calling osmo_stream_cli_close().
Also free osmo_io instance when calling osmo_stream_cli_open() if not
freed, to prevent memory leaks.
osmo_iofd_notify_connected() must be called before any registration
of read or write, because osmo_io_iouring does not allow this.
Change-Id: I91a6a76b9ff96034a7b333edf87af27490202932
---
M src/stream_cli.c
1 file changed, 22 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/79/35979/8
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I91a6a76b9ff96034a7b333edf87af27490202932
Gerrit-Change-Number: 35979
Gerrit-PatchSet: 8
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )
Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
......................................................................
osmo_io: Guard osmo_iofd_register() with invalid file descriptor
Let's return an error if both osmo_iofd_setup() and osmo_iofd_register()
are called with an invalid file descriptor like -1. Either one of them
must have been called with a valid file descriptor.
Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
---
M src/core/osmo_io.c
1 file changed, 19 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/36188/1
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 5a5e05c..d5fd008 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -673,6 +673,12 @@
if (fd >= 0)
iofd->fd = fd;
+ if (iofd->fd < 0) {
+ /* this might happen if both osmo_iofd_setup() and osmo_iofd_register() are called with -1 */
+ LOGPIO(iofd, LOGL_ERROR, "Cannot register io_fd using invalid fd == %d\n", iofd->fd);
+ return -EBADF;
+ }
+
if (osmo_iofd_ops.register_fd)
rc = osmo_iofd_ops.register_fd(iofd);
if (rc)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/36189?usp=email )
Change subject: osmo_iofd_register: Guard against calls from wrong state
......................................................................
osmo_iofd_register: Guard against calls from wrong state
Right now the IOFD_FLAG_CLOSED flag represents a mixture of both
closed and registered state. What we want to prevent against is
repeat calls to osmo_iofd_register() of an io_fd that's already
registered.
Since osmo_iofd_register() itself will un-set the IOFD_FLAG_CLOSED, we
can use it to guard against such invalid duplicate registration
attempts.
Change-Id: I422fc5eded41831663413e7118d4e012013a9ac9
---
M src/core/osmo_io.c
1 file changed, 24 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/36189/1
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index d5fd008..c1d206b 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -670,6 +670,12 @@
{
int rc = 0;
+ /* guard against repeat calls to osmo_iofd_register from the wrong state. */
+ if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) {
+ LOGPIO(iofd, LOGL_ERROR, "Attempting to re-register an already registered io_fd\n");
+ return -EINVAL;
+ }
+
if (fd >= 0)
iofd->fd = fd;
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36189?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I422fc5eded41831663413e7118d4e012013a9ac9
Gerrit-Change-Number: 36189
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36187?usp=email )
Change subject: Revert "xua + ipa: Add support for I/O in OSMO_IO mode"
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/36187?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I708a5fe0481b14e1b0cdc86149ffc86ee7b5be59
Gerrit-Change-Number: 36187
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 07 Mar 2024 08:45:21 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: daniel, jolly, pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email )
Change subject: stream_cli: Correctly setup and free osmo_io client instance
......................................................................
Patch Set 7:
(1 comment)
Patchset:
PS7:
> The memory leak does happen, if all of my patches in gerrit (libosmo-netif) are applied. […]
I think the question daniel is racing:In the old code (pre 7e6d2e0f99ff095f4714f03b1ed991d6c9cb9c61) you could probably call osmo_stream_cli_open() successively twice or more times, and only the first time a new osmo_io_fd would be setup/allocated. Now, we don't have that guard anymore, and it means that multiple successive calls (whether legal or not) would allocate multiple iofd and leak them.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I91a6a76b9ff96034a7b333edf87af27490202932
Gerrit-Change-Number: 35979
Gerrit-PatchSet: 7
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 07 Mar 2024 08:11:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly <andreas(a)eversberg.eu>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: comment