Segmentation fault when calling sdp_record_register()

醉酒当歌 提交于 2021-01-27 15:42:35

问题


I'm trying to register my Bluetooth service in SDP using BlueZ. I follow this tutorial. Code compiles successfully but when I run it, I get a segmentation fault (even with the code copy-pasted from the tutorial).

Part of stack trace:

{   "address": 140382101864854
,   "build_id": "a629c43f58d471aa12e35d3e63ee264c514a21ac"
,   "build_id_offset": 86422
,   "function_name": "sdp_device_record_register_binary"
,   "file_name": "/lib64/libbluetooth.so.3"
}
, {   "address": 140382101865504
,   "build_id": "a629c43f58d471aa12e35d3e63ee264c514a21ac"
,   "build_id_offset": 87072
,   "function_name": "sdp_device_record_register"
,   "file_name": "/lib64/libbluetooth.so.3"
}
, {   "address": 140382101865738
,   "build_id": "a629c43f58d471aa12e35d3e63ee264c514a21ac"
,   "build_id_offset": 87306
,   "function_name": "sdp_record_register"
,   "file_name": "/lib64/libbluetooth.so.3"
}

Did anyone have the same problem?


回答1:


This segmentation fault is coming from broken sdptool in Bluez 5.

Solution for this is given in answer for following Raspberry Pi stackoverflow question.

Failed to connect to SDP server on FF:FF:FF:00:00:00: No such file or directory



来源:https://stackoverflow.com/questions/53347346/segmentation-fault-when-calling-sdp-record-register

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!