New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valgrind reported warnings #408
Comments
Some of them seem to be related to random number generation, where unitialized values might be used intentionally. Others might be bugs. However, can you provide more information? I think valgrind has some setting to provide more information. Are some reproducers available? |
valgrind is already being called with BTW logs above are obtained using valgrind for OSX. Now I've tested in Linux and got less than those:
We run the demo of our mediasoup project (which uses usrsctp for SCTP/DataChannel support) with valgrind. Did you mean that? Thanks. |
I think valgrind on MacOS gives more false positives than on Linux. So let's focus on the issue reported on Linux. Could you provide the source code where you call something like |
Hi, all the usrsctp related code is here. And here an example of // Set SCTP_ENABLE_STREAM_RESET.
struct sctp_assoc_value av;
av.assoc_value =
SCTP_ENABLE_RESET_STREAM_REQ | SCTP_ENABLE_RESET_ASSOC_REQ | SCTP_ENABLE_CHANGE_ASSOC_REQ;
ret = usrsctp_setsockopt(this->socket, IPPROTO_SCTP, SCTP_ENABLE_STREAM_RESET, &av, sizeof(av)); |
AFAIS in #define SCTP_FIND_STCB(inp, stcb, assoc_id) { \
if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||\
(inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { \
SCTP_INP_RLOCK(inp); \
stcb = LIST_FIRST(&inp->sctp_asoc_list); \
if (stcb) { \
SCTP_TCB_LOCK(stcb); \
} \
SCTP_INP_RUNLOCK(inp); \
} else if (assoc_id > SCTP_ALL_ASSOC) { \
stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); \
if (stcb == NULL) { \
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT); \
error = ENOENT; \
break; \
} \
} else { \
stcb = NULL; \
} \
} Such a
struct sctp_inpcb *inp = NULL;
inp = (struct sctp_inpcb *)so->so_pcb; And checking how such a |
The above code is correct, I think. Could you replace https://github.com/sctplab/usrsctp/blob/master/usrsctplib/netinet/sctp_usrreq.c#L5425:
by
and retest if this fixes this issue? |
Confirmed that, with those changes applied, the valgrind Linux warnings no longer happen :) |
Thanks for testing and providing feedback. Working on a fix. |
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in #408
16163a3 fixes this issue. |
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408 MFC after: 1 week git-svn-id: svn+ssh://svn.freebsd.org/base/head@355172 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408 MFC after: 1 week
Thanks! |
* freebsd/current/master: Add driver for temperature sensors found in RK32898, RK3328 and RK3399 SoC's. Really ignore the SCTP association identifier on 1-to-1 style sockets as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408 MFC after: 1 week git-svn-id: https://svn.freebsd.org/base/head@355172 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408 MFC after: 1 week
as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408 MFC after: 1 week git-svn-id: svn+ssh://svn.freebsd.org/base/head@355172 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Really ignore the SCTP association identifier on 1-to-1 style sockets as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
Really ignore the SCTP association identifier on 1-to-1 style sockets as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408 git-svn-id: https://svn.freebsd.org/base/stable/11@360749 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Really ignore the SCTP association identifier on 1-to-1 style sockets as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
* freebsd/12-stable/master: MFC r355268: Add a description for the TCP sysctl variable rfc6675_pipe. It was introduced by r290122, but no documentation was provided. This is taken from https://reviews.freebsd.org/D21798, since it is not related to the feature added there. MFC r355266: In order for the TCP Handshake to support ECN++, and further ECN-related improvements, the ECN bits need to be exposed to the TCP SYNcache. This change is a minimal modification to the function headers, without any functional change intended. MFC r355265: When changing the MTU of an SCTP path, not only cancel all ongoing RTT measurements, but also scheldule new ones for the future. MFC r355264: Update the hostcache also for PTB messages received for SCTP/IPv6. The corresponding code for SCTP/IPv4 was introduced in https://svnweb.freebsd.org/base?view=revision&revision=317597 MFC r355172: Really ignore the SCTP association identifier on 1-to-1 style sockets as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408 MFC r355135: Plug two mbuf leaks during INIT-ACK handling. One leak happens when there is not enough memory to allocate the the resources for streams. The other leak happens if the are unknown parameters in the received INIT-ACK chunk which require reporting and the INIT-ACK requires sending an ABORT due to illegal parameter combinations. Hopefully this fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19083 MFC r354774: Add boundary and overflow checks to the formulas used in the TCP CUBIC congestion control module. MFC r354773: Improve TCP CUBIC specific after idle reaction. The adjustments are inspired by the Linux stack, which has had a functionally equivalent implementation for more than a decade now. MFC r362204 MFC r353482: Add missing include which breaks builds without VIMAGE. MFC r354772: Implement a TCP CUBIC-specific after idle reaction. This patch addresses a very common case of frequent application stalls, where TCP runs idle and looses the state of the network. MFC r353518: Separate out SCTP related dtrace code. MFC r353488: Rename sctp_dtrace_declare.h to sctp_kdtrace.h MFC r353480: Use event handler in SCTP MFC r350588: SCTP related cleanup MFC r362258, r362279: file 5.39
Really ignore the SCTP association identifier on 1-to-1 style sockets as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408 git-svn-id: https://svn.freebsd.org/base/stable/12@362860 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Really ignore the SCTP association identifier on 1-to-1 style sockets as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in sctplab/usrsctp#408
By running an application using usrsctp with Valgrind, here the Valgrind warnings. Probably many of them are not important at all. Anyway:
The text was updated successfully, but these errors were encountered: