2020-06-07 13:35:33

by Przemysław Fierek

[permalink] [raw]
Subject: Segmentation fault in the mesh/node.c

Hi,


After rebase on the latest BlueZ version our functional tests failed on
SEGV in the `node.c` file. Seems that call two D-Bus functions `join`
and `leave` one after the other (before receive `join_complete`) causes
SEGV.

In the attached files there is the backtrace and the diff with my
changes (adds extra some logs).


Best regards,

Przemysław Fierek



Attachments:
segv.txt (30.00 kB)
node.c.diff (2.34 kB)
Download all attachments

2020-06-07 14:08:01

by bluez.test.bot

[permalink] [raw]
Subject: RE: Segmentation fault in the mesh/node.c


This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While we are preparing for reviewing the patches, we found the following
issue/warning.

Test Result:
checkpatch Failed

Outputs:
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#22:
11:58:15 =================================== FAILURES ===================================

- total: 0 errors, 1 warnings, 74 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPLIT_STRING

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.



---
Regards,
Linux Bluetooth

2020-06-07 14:08:01

by bluez.test.bot

[permalink] [raw]
Subject: RE: Segmentation fault in the mesh/node.c


This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While we are preparing for reviewing the patches, we found the following
issue/warning.

Test Result:
checkgitlint Failed

Outputs:
16: B1 Line exceeds max length (90>80): "11:58:15 =================================== FAILURES ==================================="
17: B1 Line exceeds max length (90>80): "11:58:15 _______________________ test_remove_storage_after_leave ________________________"
19: B1 Line exceeds max length (105>80): "11:58:15 application = <bluez_tests.fixtures.application.<locals>._Application object at 0x7f0cf3fb1050>"
21: B1 Line exceeds max length (89>80): "11:58:15 node_storage = <class 'bluez_tests.fixtures.node_storage.<locals>.NodeStorage'>"
23: B1 Line exceeds max length (90>80): "11:58:15 async def test_remove_storage_after_leave(application, meshd, node_storage):"
28: B1 Line exceeds max length (86>80): "11:58:15 with node_storage() as storage, node_storage(backup=True) as backup:"
35: B1 Line exceeds max length (89>80): "11:58:15 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _"
36: B1 Line exceeds max length (92>80): "11:58:15 /usr/local/lib/python3.7/dist-packages/bluetooth_mesh/application.py:721: in leave"
38: B1 Line exceeds max length (91>80): "11:58:15 /usr/local/lib/python3.7/dist-packages/bluetooth_mesh/interfaces.py:309: in leave"
40: B1 Line exceeds max length (95>80): "11:58:15 /usr/local/lib/python3.7/dist-packages/dbus_next/aio/proxy_object.py:79: in method_fn"
41: B1 Line exceeds max length (85>80): "11:58:15 BaseProxyInterface._check_method_return(msg, intr_method.out_signature)"
42: B1 Line exceeds max length (89>80): "11:58:15 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _"
44: B1 Line exceeds max length (84>80): "11:58:15 msg = <dbus_next.message.Message object at 0x7f0cf41a8fd0>, signature = ''"
50: B1 Line exceeds max length (114>80): "11:58:15 E dbus_next.errors.DBusError: Message recipient disconnected from message bus without replying"
52: B1 Line exceeds max length (88>80): "11:58:15 /usr/local/lib/python3.7/dist-packages/dbus_next/proxy_object.py:59: DBusError"
53: B1 Line exceeds max length (90>80): "11:58:15 ------------------------------ Captured log setup ------------------------------"
55: B1 Line exceeds max length (325>80): "11:58:15 09:58:06.393 MESHD INFO Starting: ['gosu', 'root', 'env', 'SEGFAULT_SIGNALS=abrt segv fpe', 'LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so', '/usr/libexec/bluetooth/bluetooth-meshd', '--config=/tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config', '--io=tcpserver:65254', '--debug']"
56: B1 Line exceeds max length (130>80): "11:58:15 09:58:06.402 MESHD.stderr INFO 2020-06-05 09:58:06.399 main.c:126 ready_callback D-Bus ready"
57: B1 Line exceeds max length (139>80): "11:58:15 09:58:06.402 MESHD.stderr INFO 2020-06-05 09:58:06.399 main.c:107 request_name_callback Request name success"
58: B1 Line exceeds max length (218>80): "11:58:15 09:58:06.402 MESHD.stderr INFO 2020-06-05 09:58:06.399 mesh.c:276 mesh_init Loading node configuration from /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config"
62: B1 Line exceeds max length (150>80): "11:58:15 09:58:06.409 MESHD.stderr INFO 2020-06-05 09:58:06.403 mesh-io-tcpserver.c:435 tls_ctx_init TLS initialization: done"
63: B1 Line exceeds max length (169>80): "11:58:15 09:58:06.409 MESHD.stderr INFO 2020-06-05 09:58:06.403 mesh-io-tcpserver.c:234 get_fd_info Server bind -> addr:0.0.0.0 port:65254 fd:6"
64: B1 Line exceeds max length (156>80): "11:58:15 09:58:06.409 MESHD.stderr INFO 2020-06-05 09:58:06.403 mesh-io-tcpserver.c:580 tcpserver_io_init Started mesh on tcp port 65254"
65: B1 Line exceeds max length (160>80): "11:58:15 09:58:06.409 MESHD.stderr INFO 2020-06-05 09:58:06.403 mesh.c:296 mesh_init mesh/mesh.c:mesh_init() io 0x56413d49e9c0"
66: B1 Line exceeds max length (161>80): "11:58:15 09:58:06.410 MESHD.stderr INFO 2020-06-05 09:58:06.404 mesh.c:881 mesh_dbus_init Added Network Interface on /org/bluez/mesh"
69: B1 Line exceeds max length (90>80): "11:58:15 ------------------------------ Captured log call -------------------------------"
70: B1 Line exceeds max length (94>80): "11:58:15 09:58:06.434 APPLICATION WARNING Import 83bf3b46-8103-45a2-8bcc-e70d8d0b46d3"
71: B1 Line exceeds max length (170>80): "11:58:15 09:58:06.436 MESHD.stderr INFO 2020-06-05 09:58:06.435 mesh.c:778 import_call mesh/mesh.c:import_call() Import local node request"
72: B1 Line exceeds max length (144>80): "11:58:15 09:58:06.437 MESHD.stderr INFO 2020-06-05 09:58:06.435 node.c:1720 node_import mesh/node.c:node_import()"
73: B1 Line exceeds max length (147>80): "11:58:15 09:58:06.437 MESHD.stderr INFO 2020-06-05 09:58:06.435 node.c:267 node_new new elements: 0x56413d4ca930"
74: B1 Line exceeds max length (181>80): "11:58:15 09:58:06.438 MESHD.stderr INFO 2020-06-05 09:58:06.438 node.c:1283 get_app_properties mesh/node.c:get_app_properties() path /com/silvair/application"
75: B1 Line exceeds max length (194>80): "11:58:15 09:58:06.438 MESHD.stderr INFO 2020-06-05 09:58:06.438 node.c:1129 get_element_properties mesh/node.c:get_element_properties() path /com/silvair/application/element0"
76: B1 Line exceeds max length (151>80): "11:58:15 09:58:06.439 MESHD.stderr INFO 2020-06-05 09:58:06.438 node.c:1214 convert_node_to_storage db_node->elements 0x56413d4c9840"
77: B1 Line exceeds max length (296>80): "11:58:15 09:58:06.440 MESHD.stderr INFO 2020-06-05 09:58:06.438 mesh-config-json.c:1706 mesh_config_create mesh/mesh-config-json.c:mesh_config_create() New node config /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json"
78: B1 Line exceeds max length (201>80): "11:58:15 09:58:06.450 MESHD.stderr INFO 2020-06-05 09:58:06.450 net-keys.c:493 net_key_beacon_refresh mesh/net-keys.c:net_key_beacon_refresh() Setting SNB: IVI: 00000000, IVU: 0, KR: 0"
79: B1 Line exceeds max length (221>80): "11:58:15 09:58:06.451 MESHD.stderr INFO 2020-06-05 09:58:06.450 util.c:52 print_packet mesh/util.c:print_packet() 51086.450 Set SNB Beacon to: 2b01003ecaff672f67337000000000a502cffc80248d4c"
80: B1 Line exceeds max length (186>80): "11:58:15 09:58:06.451 MESHD.stderr INFO 2020-06-05 09:58:06.450 mesh-config-json.c:565 mesh_config_net_key_add mesh/mesh-config-json.c:mesh_config_net_key_add() netKey 0000"
81: B1 Line exceeds max length (185>80): "11:58:15 09:58:06.451 MESHD.stderr INFO 2020-06-05 09:58:06.451 net.c:778 mesh_net_set_friend_mode mesh/net.c:mesh_net_set_friend_mode() mesh_net_set_friend_mode - 0"
82: B1 Line exceeds max length (179>80): "11:58:15 09:58:06.452 MESHD.stderr INFO 2020-06-05 09:58:06.451 net.c:292 trigger_heartbeat mesh/net.c:trigger_heartbeat() trigger_heartbeat: 0001 --> 0"
83: B1 Line exceeds max length (166>80): "11:58:15 09:58:06.453 MESHD.stderr INFO 2020-06-05 09:58:06.453 cfgmod-server.c:1263 cfgmod_server_init mesh/cfgmod-server.c:cfgmod_server_init() 00"
84: B1 Line exceeds max length (183>80): "11:58:15 09:58:06.454 MESHD.stderr INFO 2020-06-05 09:58:06.453 mesh.c:712 create_node_ready_cb mesh/mesh.c:create_node_ready_cb() Calling JoinComplete (create)"
85: B1 Line exceeds max length (160>80): "11:58:15 09:58:06.461 STORAGE INFO /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json"
86: B1 Line exceeds max length (164>80): "11:58:15 09:58:06.468 STORAGE INFO /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json.bak"
88: B1 Line exceeds max length (149>80): "11:58:15 09:58:06.475 MESHD.stderr INFO 2020-06-05 09:58:06.475 mesh.c:659 leave_call mesh/mesh.c:leave_call() Leave"
89: B1 Line exceeds max length (294>80): "11:58:15 09:58:06.475 MESHD.stderr INFO 2020-06-05 09:58:06.475 mesh-config-json.c:2329 mesh_config_destroy_nvm mesh/mesh-config-json.c:mesh_config_destroy_nvm() Delete node config /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3"
90: B1 Line exceeds max length (262>80): "11:58:15 09:58:06.476 MESHD.stderr INFO 2020-06-05 09:58:06.476 util.c:151 del_fobject mesh/util.c:del_fobject() RM /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json.bak"
91: B1 Line exceeds max length (258>80): "11:58:15 09:58:06.477 MESHD.stderr INFO 2020-06-05 09:58:06.476 util.c:151 del_fobject mesh/util.c:del_fobject() RM /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json"
92: B1 Line exceeds max length (251>80): "11:58:15 09:58:06.477 MESHD.stderr INFO 2020-06-05 09:58:06.476 util.c:145 del_fobject mesh/util.c:del_fobject() RMDIR /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3"
93: B1 Line exceeds max length (139>80): "11:58:15 09:58:06.477 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:296 free_node_dbus_resources Node: 0x56413d4cadb0"
94: B1 Line exceeds max length (143>80): "11:58:15 09:58:06.477 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:306 free_node_dbus_resources elements: 0x56413d4ca930"
95: B1 Line exceeds max length (159>80): "11:58:15 09:58:06.478 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:278 free_element_path el: 0x56413d49f3d0, path: 0x56413d4cac50"
96: B1 Line exceeds max length (123>80): "11:58:15 09:58:06.478 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:343 free_node_resources log1"
97: B1 Line exceeds max length (123>80): "11:58:15 09:58:06.478 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:345 free_node_resources log2"
98: B1 Line exceeds max length (123>80): "11:58:15 09:58:06.479 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:347 free_node_resources log3"
99: B1 Line exceeds max length (123>80): "11:58:15 09:58:06.479 MESHD.stderr INFO 2020-06-05 09:58:06.477 node.c:353 free_node_resources log4"
100: B1 Line exceeds max length (142>80): "11:58:15 09:58:06.479 MESHD.stderr INFO 2020-06-05 09:58:06.477 node.c:2414 node_finalize_new_node Nnnnode: 0x56413d4cadb0"
101: B1 Line exceeds max length (139>80): "11:58:15 09:58:06.479 MESHD.stderr INFO 2020-06-05 09:58:06.477 node.c:296 free_node_dbus_resources Node: 0x56413d4cadb0"
102: B1 Line exceeds max length (143>80): "11:58:15 09:58:06.480 MESHD.stderr INFO 2020-06-05 09:58:06.477 node.c:306 free_node_dbus_resources elements: 0x56413d498010"
106: B1 Line exceeds max length (120>80): "11:58:15 09:58:06.481 MESHD.registers DEBUG RAX: 0000000000000000 RBX: 0005000600070007 RCX: 0000000000000000"
107: B1 Line exceeds max length (120>80): "11:58:15 09:58:06.481 MESHD.registers DEBUG RDX: 0000000000000000 RSI: 000056413c31ba70 RDI: 000056413d498010"
108: B1 Line exceeds max length (120>80): "11:58:15 09:58:06.481 MESHD.registers DEBUG RBP: 000056413c31ba70 R8 : 0000000000000019 R9 : 0000000000000019"
109: B1 Line exceeds max length (120>80): "11:58:15 09:58:06.481 MESHD.registers DEBUG R10: 000056413c37a2ae R11: 0000000000000246 R12: 0000000000000000"
110: B1 Line exceeds max length (120>80): "11:58:15 09:58:06.482 MESHD.registers DEBUG R13: 000056413d4cdf20 R14: 000056413d49e1a0 R15: 0000000000000001"
113: B1 Line exceeds max length (91>80): "11:58:15 09:58:06.482 MESHD.registers DEBUG RIP: 000056413c347330 EFLAGS: 00010202"
115: B1 Line exceeds max length (81>80): "11:58:15 09:58:06.483 MESHD.registers DEBUG CS: 0033 FS: 0000 GS: 0000"
117: B1 Line exceeds max length (119>80): "11:58:15 09:58:06.483 MESHD.registers DEBUG Trap: 0000000d Error: 00000000 OldMask: 00004002 CR2: 00000000"
119: B1 Line exceeds max length (100>80): "11:58:15 09:58:06.484 MESHD.registers DEBUG FPUCW: 0000037f FPUSW: 00000000 TAG: 00000000"
122: B1 Line exceeds max length (108>80): "11:58:15 09:58:06.485 MESHD.registers DEBUG ST(0) 0000 0000000000000000 ST(1) 0000 0000000000000000"
123: B1 Line exceeds max length (108>80): "11:58:15 09:58:06.485 MESHD.registers DEBUG ST(2) 0000 0000000000000000 ST(3) 0000 0000000000000000"
124: B1 Line exceeds max length (108>80): "11:58:15 09:58:06.485 MESHD.registers DEBUG ST(4) 0000 0000000000000000 ST(5) 0000 0000000000000000"
125: B1 Line exceeds max length (108>80): "11:58:15 09:58:06.485 MESHD.registers DEBUG ST(6) 0000 0000000000000000 ST(7) 0000 0000000000000000"
127: B1 Line exceeds max length (130>80): "11:58:15 09:58:06.486 MESHD.registers DEBUG XMM0: 00000000000000000000000000ffff00 XMM1: 00000000000000000000000000ffff00"
128: B1 Line exceeds max length (130>80): "11:58:15 09:58:06.486 MESHD.registers DEBUG XMM2: 00000000000000000000000000ffff00 XMM3: 00000000000000000000000000ffff00"
129: B1 Line exceeds max length (130>80): "11:58:15 09:58:06.486 MESHD.registers DEBUG XMM4: 00000000000000000000000000ffff00 XMM5: 00000000000000000000000000ffff00"
130: B1 Line exceeds max length (130>80): "11:58:15 09:58:06.487 MESHD.registers DEBUG XMM6: 00000000000000000000000000ffff00 XMM7: 00000000000000000000000000ffff00"
131: B1 Line exceeds max length (130>80): "11:58:15 09:58:06.487 MESHD.registers DEBUG XMM8: 00000000000000000000000000ffff00 XMM9: 00000000000000000000000000ffff00"
132: B1 Line exceeds max length (130>80): "11:58:15 09:58:06.487 MESHD.registers DEBUG XMM10: 00000000000000000000000000ffff00 XMM11: 00000000000000000000000000ffff00"
133: B1 Line exceeds max length (130>80): "11:58:15 09:58:06.487 MESHD.registers DEBUG XMM12: 00000000000000000000000000ffff00 XMM13: 00000000000000000000000000ffff00"
134: B1 Line exceeds max length (130>80): "11:58:15 09:58:06.487 MESHD.registers DEBUG XMM14: 00000000000000000000000000ffff00 XMM15: 00000000000000000000000000ffff00"
137: B1 Line exceeds max length (116>80): "11:58:15 09:58:06.509 MESHD.backtrace INFO l_queue_foreach /home/user/bluez/ell/queue.c:441 (discriminator 3)"
139: B1 Line exceeds max length (113>80): "11:58:15 09:58:06.510 MESHD.backtrace DEBUG 440: for (entry = queue->head; entry; entry = entry->next)"
140: B1 Line exceeds max length (97>80): "11:58:15 09:58:06.511 MESHD.backtrace DEBUG 441: function(entry->data, user_data);"



---
Regards,
Linux Bluetooth