* [Bluez-users] sdpd crashing (in uclinux) @ 2004-05-19 9:57 Jorge A. González 2004-05-19 10:15 ` Marcel Holtmann 0 siblings, 1 reply; 3+ messages in thread From: Jorge A. González @ 2004-05-19 9:57 UTC (permalink / raw) To: BlueZ Mailing List Hello I have already "ported" the bluez-utils to uclinux (over an ARM7DMI) and I realized than sdpd crash whenever other device tries to browse its services). I have printfed the code and followed it until I found out that it is the command sdp_put_unligned which is having a segmentation fault. I have seen that sdp_put_unligned is defined as a macro depending of the definition or not of 386 architecture. I will trie to play with the defines and to port hcidump in order to have more information but I would like to ask the list about this problem in the case I am not the first one. (I think my system is little endian, but I will also trie to be sure of it today) Thanks for your help! Jorge ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bluez-users] sdpd crashing (in uclinux) 2004-05-19 9:57 [Bluez-users] sdpd crashing (in uclinux) Jorge A. González @ 2004-05-19 10:15 ` Marcel Holtmann [not found] ` <1084991513.1845.117.camel@localhost> 0 siblings, 1 reply; 3+ messages in thread From: Marcel Holtmann @ 2004-05-19 10:15 UTC (permalink / raw) To: egroJorge; +Cc: BlueZ Mailing List Hi Jorge, > I have already "ported" the bluez-utils to uclinux (over an ARM7DMI) > and I realized than sdpd crash whenever other device tries to browse > its services). I have printfed the code and followed it until I found > out that it is the command sdp_put_unligned which is having a > segmentation fault. > I have seen that sdp_put_unligned is defined as a macro depending of > the definition or not of 386 architecture. I will trie to play with > the defines and to port hcidump in order to have more information but > I would like to ask the list about this problem in the case I am not the > first one. please start using bluez-libs-2.7 and bluez-utils-2.7, because the SDP stuff is now part of the core packages and I stopped maintaining the bluez-sdp package. The new Bluetooth library contains a bt_put_unaligned macro for general use and I used a slight different method for non i386 platforms. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <1084991513.1845.117.camel@localhost>]
* Re: [Bluez-users] sdpd crashing (in uclinux) [not found] ` <1084991513.1845.117.camel@localhost> @ 2004-05-19 22:33 ` Marcel Holtmann 0 siblings, 0 replies; 3+ messages in thread From: Marcel Holtmann @ 2004-05-19 22:33 UTC (permalink / raw) To: Jorge A. González; +Cc: BlueZ Mailing List Hi Jorge, > > please start using bluez-libs-2.7 and bluez-utils-2.7, because the SDP > > stuff is now part of the core packages and I stopped maintaining the > > bluez-sdp package. > > > > The new Bluetooth library contains a bt_put_unaligned macro for general > > use and I used a slight different method for non i386 platforms. > > I am using bluez-libs-2.7 and bluez-utils-2.7. When I refered to sdpd I > mean the one is located in bluez-utils-2.7/sdpd. Sorry for not saying it > before. > > The guilty instruction is: > sdp_put_unaligned(htons(rsp_count), (uint16_t *)pTotalRecordCount); > > in the line 315 of bluez-utils-2.7/sdpd/request.c > > When I reach this line (because other device is trying to browse the > local services) I get a SIGSEV so sdpd finish. > > The commands I use to reach this state are: > > #hcid -n -f /nfs/hcid.conf & > #hciattach -n /dev/tts/2 any 115200 flow & > #hciconfig hci0 up > #sdpd -n > > And the output of sdpd is: > > **** A pocket PC is trying to browse our local services > > Got a svc srch req > Seq type : 53 > Data size : 3 > Data type: 0x19 > No of elements : 1 > Expected count: 20 > Bytes scanned : 5 > Continuation State size : 0 > Checking svcRec : 0x0 > Checking svcRec : 0xb1a038 > Match count: 2 > ***** reached line 315 of request.c > SIGSEGV > > The instruction sdp_put_unaligned is replaced with the macro > bt_put_unaligned in the not i386 version and it is > "memcpy((ptr), &__tmp, sizeof(*(ptr))); " > which is crashing. There are other times that this macro is called and > works normally, so I suppose it is a problem with the pTotalRecordCount > pointer. > > I have found out than if just after the > pTotalRecordCount = (short*) pdata; > > I do: > > printf("pdata is %p and have %i\n", > pdata,*pdata); > --this work > > printf("pTotalRecordCount is %p and have %i\n", > pTotalRecordCount,*pTotalRecordCount)); > --this give me a SIGSEV!!!! > > but if I write this: > printf("pTotalRecordCount vale %p y contiene %i\n", > pTotalRecordCount,*((char*) pTotalRecordCount)); > this work! > > This make clear that the problem is with the type of the pointers, but I > have no idea of how to solve it, because pTotalRecordCount and similar > ones are casted to uint16_t when they crash. > > Besides these printf the only modification i have made to the code is > defining the SDP_UNIX_PATH as "/ram/sdp" instead than "/var/run/sdp" > because /ram is the only place where I have write access. > > My compiler is arm-elf-gcc, the CPU is ARM7DMI and the kernel version is > 2.4.22. > > I hope all this information help in figuring out the problem actually I have no idea why this fails. Does it help if you declare pTotalRecordCount as uint16_t instead of short? Do the old sdp_put_unaligned code for non i386 platforms from the bluez-sdp package is working correct? Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-05-19 22:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-19 9:57 [Bluez-users] sdpd crashing (in uclinux) Jorge A. González
2004-05-19 10:15 ` Marcel Holtmann
[not found] ` <1084991513.1845.117.camel@localhost>
2004-05-19 22:33 ` Marcel Holtmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox