Skip to contentSkip to conversation

bluez from git: does not compile, bluetoothd crashes

PATCH Pavel Machek 2 participants 3 messages Sep 14, 2018 – Sep 15, 2018 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi!

I have version e4cf43fc62b4e4dbabc72d4e44e095d7a9087992.

It did not compile, so I did this:

gcc --version
gcc (Debian 4.9.2-10+deb8u1) 4.9.2

monitor/display.h +2 -0
index 12d13f8..ca85dcc 100644
@@ -70,6 +70,7 @@ struct bitfield_data {
 	const char *str;
 };
 
+#ifdef WANT_BITFIELD
 inline uint64_t print_bitfield(int indent, uint64_t val,
 				const struct bitfield_data *table)
 {
@@ -85,6 +86,7 @@ inline uint64_t print_bitfield(int indent, uint64_t val,
 
 	return mask;
 }
+#endif
 
 int num_columns(void);
 
monitor/packet.c +1 -0
index aca0761..21fc1dc 100644
@@ -26,6 +26,7 @@
 #include <config.h>
 #endif
 
+#define WANT_BITFIELD
 #include <stdio.h>
 #include <errno.h>
 #include <ctype.h>

Possibly not nicest fix but it got me version that compiled.

I was trying to play with btle, but bluetoothd crashed. That can't be good.

pavel@amd:~/denx/bt/bluez$ sudo src/bluetoothd
*** Error in `src/bluetoothd': free(): invalid size: 0x08162908 ***

Syslog says:

pavel@amd:~/denx/bt/bluez$ sudo tail /var/log/syslog
Sep 14 18:38:59 amd dbus[2801]: [system] Activating via systemd:
service name='org.bluez' unit='dbus-org.bluez.service'
Sep 14 18:38:59 amd systemd[1]: Starting Bluetooth service...
Sep 14 18:38:59 amd bluetoothd[8731]: Bluetooth daemon 5.23
Sep 14 18:38:59 amd dbus[2801]: [system] Successfully activated
service 'org.bluez'
Sep 14 18:38:59 amd systemd[1]: Started Bluetooth service.
Sep 14 18:38:59 amd bluetoothd[8731]: Starting SDP server
Sep 14 18:39:00 amd bluetoothd[8731]: Bluetooth management interface
1.14 initialized
Sep 14 18:39:00 amd bluetoothd[8731]: Sap driver initialization
failed.
Sep 14 18:39:00 amd bluetoothd[8731]: sap-server: Operation not
permitted (1)
Sep 14 18:39:01 amd dbus[2801]: [system] Failed to activate service
'org.freedesktop.hostname1': timed out

Any ideas?

Thanks,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#1 lore raw

Hi Pavel,

Quoted 8 lines · Pavel Machek

Hi!

I have version e4cf43fc62b4e4dbabc72d4e44e095d7a9087992.

It did not compile, so I did this:

gcc --version
gcc (Debian 4.9.2-10+deb8u1) 4.9.2

What is the compilation error?

Quoted 52 lines
monitor/display.h +2 -0
index 12d13f8..ca85dcc 100644
@@ -70,6 +70,7 @@ struct bitfield_data {
        const char *str;
 };
 
+#ifdef WANT_BITFIELD
 inline uint64_t print_bitfield(int indent, uint64_t val,
                                const struct bitfield_data *table)
 {
@@ -85,6 +86,7 @@ inline uint64_t print_bitfield(int indent, uint64_t val,
 
        return mask;
 }
+#endif
 
 int num_columns(void);
 
monitor/packet.c +1 -0
index aca0761..21fc1dc 100644
@@ -26,6 +26,7 @@
 #include <config.h>
 #endif
 
+#define WANT_BITFIELD
 #include <stdio.h>
 #include <errno.h>
 #include <ctype.h>

Possibly not nicest fix but it got me version that compiled.

I was trying to play with btle, but bluetoothd crashed. That can't be good.

pavel@amd:~/denx/bt/bluez$ sudo src/bluetoothd
*** Error in `src/bluetoothd': free(): invalid size: 0x08162908 ***

Syslog says:

pavel@amd:~/denx/bt/bluez$ sudo tail /var/log/syslog
Sep 14 18:38:59 amd dbus[2801]: [system] Activating via systemd:
service name='org.bluez' unit='dbus-org.bluez.service'
Sep 14 18:38:59 amd systemd[1]: Starting Bluetooth service...
Sep 14 18:38:59 amd bluetoothd[8731]: Bluetooth daemon 5.23
Sep 14 18:38:59 amd dbus[2801]: [system] Successfully activated
service 'org.bluez'
Sep 14 18:38:59 amd systemd[1]: Started Bluetooth service.
Sep 14 18:38:59 amd bluetoothd[8731]: Starting SDP server
Quoted 8 lines
Sep 14 18:39:00 amd bluetoothd[8731]: Bluetooth management interface
1.14 initialized
Sep 14 18:39:00 amd bluetoothd[8731]: Sap driver initialization
failed.
Sep 14 18:39:00 amd bluetoothd[8731]: sap-server: Operation not
permitted (1)
Sep 14 18:39:01 amd dbus[2801]: [system] Failed to activate service
'org.freedesktop.hostname1': timed out

Try running with valgrind perhaps we are not handling the timeout properly.

Quoted 7 lines

Any ideas?

Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw

HI!

Quoted 8 lines
Quoted 6 lines

I have version e4cf43fc62b4e4dbabc72d4e44e095d7a9087992.

It did not compile, so I did this:

gcc --version
gcc (Debian 4.9.2-10+deb8u1) 4.9.2

What is the compilation error?

Does it compile for you? For me it says:

CC monitor/broadcom.o
CCLD monitor/btmon
monitor/control.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/packet.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/lmp.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/ll.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/l2cap.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/sdp.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/avctp.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/avdtp.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/a2dp.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/rfcomm.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/bnep.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/intel.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
monitor/broadcom.o: In function `print_bitfield':
/data/pavel/denx/bt/bluez/monitor/display.h:75: multiple definition of `print_bitfield' monitor/display.o:/data/pavel/denx/bt/bluez/monitor/display.h:75:
first defined here
collect2: error: ld returned 1 exit status Makefile:4375: recipe for target 'monitor/btmon' failed

Quoted 35 lines
Quoted 35 lines
monitor/display.h +2 -0
index 12d13f8..ca85dcc 100644
@@ -70,6 +70,7 @@ struct bitfield_data {
        const char *str;
 };
 
+#ifdef WANT_BITFIELD
 inline uint64_t print_bitfield(int indent, uint64_t val,
                                const struct bitfield_data *table)
 {
@@ -85,6 +86,7 @@ inline uint64_t print_bitfield(int indent, uint64_t val,
 
        return mask;
 }
+#endif
 
 int num_columns(void);
 
monitor/packet.c +1 -0
index aca0761..21fc1dc 100644
@@ -26,6 +26,7 @@
 #include <config.h>
 #endif
 
+#define WANT_BITFIELD
 #include <stdio.h>
 #include <errno.h>
 #include <ctype.h>

Possibly not nicest fix but it got me version that compiled.

Quoted 7 lines
Quoted 5 lines

I was trying to play with btle, but bluetoothd crashed. That can't be good.

pavel@amd:~/denx/bt/bluez$ sudo src/bluetoothd
*** Error in `src/bluetoothd': free(): invalid size: 0x08162908 ***

Try running with valgrind perhaps we are not handling the timeout properly.

Not sure what is going on. It happened on a first try, but it did not happen after that, so I don't know how to reproduce it :-(.

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html