Hello all,

I am currently building the bluetooth stack support in solaris for usb 
bluetooth dongles using the libusb api as a part of my undergraduate final year 
project.

I have completed the hci-usb layer, hci layer, l2cap layer, sdp layer. I am 
currently doing the rfcomm layer.

My query is with the code, it has started to behave in an unpredictable manner,

for example,

In the main function i am first inquiring for devices, then extracting their 
human readable names, then connecting to them and going on up the various 
layers of the bluetooth stack.

here in the code, main function looks something like this,

.....
hci_inquiry(hd,req,resp);  // inquire for devices
print_inq(resp);        // extracts the human readable names of devices 
discovered
....


This code started crashing within the print_inq function after some time, now 
if i embed a malloc in between the two calls it works, 

.....
hci_inquiry(hd,req,resp);  // inquire for devices
malloc(sizeof(struct hci_evt)); 
// hci_evt is the structure holding info of incoming event pkts.
print_inq(resp);        // extracts the human readable names of devices 
discovered
....


can you tell why it is happening so.... and the runtime error is

sigsegv with mapper code ... - it actually shows the callstack to be at 
realfree.

i am sure it is not running out of memory because other commands and memory 
allocations work just fine.

Any help would be great because i believe this is a stupid error and don't want 
to waste too much time on this.

regards,
Anand B
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to