diff options
author | Mingli Yu <Mingli.Yu@windriver.com> | 2018-09-25 12:01:27 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-09-25 00:57:30 -0700 |
commit | 23d794b58661807307a3c4af3f3da1fc1027f41b (patch) | |
tree | afe5df55f69d064f7b878770503249427ad87eef | |
parent | b82388509c68df69cc0e0199774be6a51641df01 (diff) | |
download | meta-openembedded-23d794b58661807307a3c4af3f3da1fc1027f41b.tar.gz |
lksctp-tools: fix ptest Segmentation fault
Initialize the variable event properly
to fix the below Segmentation fault:
# cd /usr/lib64/lksctp-tools/ptest
# ./test_1_to_1_events
test_1_to_1_events.c 1 PASS : COMM_UP notification on client socket - SUCCESS
test_1_to_1_events.c 2 PASS : COMM_UP notification on server socket - SUCCESS
test_1_to_1_events.c 3 BROK : Got a datamsg, expecting notification
DUMP_CORE sctputil.c: 187
[ 1468.733938] test_1_to_1_eve[2376]: segfault at 0 ip 0000561a4a3d5079 sp 00007ffd49101580 error 6 in test_1_to_1_events[561a4a3d4000+2000]
[ 1468.734479] Code: ff bf 0a 00 00 00 e8 e6 ef ff ff b9 c9 00 00 00 48 8d 15 61 13 00 00 bf 01 00 00 00 31 c0 48 8d 35 c7 0f 00 00 e8 97 f0
Segmentation fault
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 45 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/lksctp-tools/lksctp-tools/0001-test_1_to_1_events.c-initialize-event-properly.patch b/meta-networking/recipes-support/lksctp-tools/lksctp-tools/0001-test_1_to_1_events.c-initialize-event-properly.patch new file mode 100644 index 000000000..621e6f469 --- /dev/null +++ b/meta-networking/recipes-support/lksctp-tools/lksctp-tools/0001-test_1_to_1_events.c-initialize-event-properly.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From e1e670defb84d51efdd124e5f3fa166a1a4b7c1d Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <Mingli.Yu@windriver.com> | ||
3 | Date: Tue, 25 Sep 2018 11:39:43 +0800 | ||
4 | Subject: [PATCH] test_1_to_1_events.c: initialize event properly | ||
5 | |||
6 | Initialize event properly to avoid below | ||
7 | Segmentation fault when run below test | ||
8 | related to AUTH_NO_AUTH. | ||
9 | |||
10 | # ./test_1_to_1_events | ||
11 | test_1_to_1_events.c 1 PASS : COMM_UP notification on client socket - SUCCESS | ||
12 | test_1_to_1_events.c 2 PASS : COMM_UP notification on server socket - SUCCESS | ||
13 | test_1_to_1_events.c 3 BROK : Got a datamsg, expecting notification | ||
14 | DUMP_CORE sctputil.c: 187 | ||
15 | [ 1468.733938] test_1_to_1_eve[2376]: segfault at 0 ip 0000561a4a3d5079 sp 00007ffd49101580 error 6 in test_1_to_1_events[561a4a3d4000+2000] | ||
16 | [ 1468.734479] Code: ff bf 0a 00 00 00 e8 e6 ef ff ff b9 c9 00 00 00 48 8d 15 61 13 00 00 bf 01 00 00 00 31 c0 48 8d 35 c7 0f 00 00 e8 97 f0 | ||
17 | Segmentation fault | ||
18 | |||
19 | Upstream-Status: Pending | ||
20 | |||
21 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | ||
22 | --- | ||
23 | src/func_tests/test_1_to_1_events.c | 2 ++ | ||
24 | 1 file changed, 2 insertions(+) | ||
25 | |||
26 | diff --git a/src/func_tests/test_1_to_1_events.c b/src/func_tests/test_1_to_1_events.c | ||
27 | index 46439bf..a086832 100644 | ||
28 | --- a/src/func_tests/test_1_to_1_events.c | ||
29 | +++ b/src/func_tests/test_1_to_1_events.c | ||
30 | @@ -92,9 +92,11 @@ main(int argc, char *argv[]) | ||
31 | /* Create the client socket. */ | ||
32 | clt_sk = test_socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); | ||
33 | |||
34 | + memset(&event, 0, sizeof(event)); | ||
35 | event.sctp_data_io_event = 1; | ||
36 | event.sctp_association_event = 1; | ||
37 | event.sctp_shutdown_event = 1; | ||
38 | + event.sctp_authentication_event = 1; | ||
39 | len = sizeof(struct sctp_event_subscribe); | ||
40 | test_setsockopt(svr_sk, SCTP_EVENTS, &event, len); | ||
41 | test_setsockopt(clt_sk, SCTP_EVENTS, &event, len); | ||
42 | -- | ||
43 | 2.7.4 | ||
44 | |||
diff --git a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.18.bb b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.18.bb index cc2f835a9..70cea6c7b 100644 --- a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.18.bb +++ b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.18.bb | |||
@@ -21,6 +21,7 @@ SRC_URI = " \ | |||
21 | file://0001-build-remove-v4.12-secondary-defines-in-favor-of-HAV.patch \ | 21 | file://0001-build-remove-v4.12-secondary-defines-in-favor-of-HAV.patch \ |
22 | file://0001-build-fix-probing-for-HAVE_SCTP_SENDV.patch \ | 22 | file://0001-build-fix-probing-for-HAVE_SCTP_SENDV.patch \ |
23 | file://0001-build-0b0dce7a36fb-actually-belongs-to-v4.19.patch \ | 23 | file://0001-build-0b0dce7a36fb-actually-belongs-to-v4.19.patch \ |
24 | file://0001-test_1_to_1_events.c-initialize-event-properly.patch \ | ||
24 | file://run-ptest \ | 25 | file://run-ptest \ |
25 | file://v4test.sh \ | 26 | file://v4test.sh \ |
26 | file://v6test.sh \ | 27 | file://v6test.sh \ |