public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Stuart Pook <linux-bluetooth4@pook.es>
Cc: BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: Re: bluez git + Linksys USBBT100 + 2.6.30-rc2 -> Segmentation fault
Date: Sun, 19 Apr 2009 23:05:28 +0300	[thread overview]
Message-ID: <20090419200528.GA18068@jh-x301> (raw)
In-Reply-To: <49EB7950.4000802@pook.es>

Hi Stuart,

On Sun, Apr 19, 2009, Stuart Pook wrote:
> :; cat /var/lib/bluetooth/00:0C:41:E1:FF:30/config
> mode off
> class 0x080104
> onmode off
> discovto 60
<snip>
> I guess that if you have read this far then you have found the solution 
> as I did
> mv /var/lib/bluetooth/00:0C:41:E1:FF:30/config /var/lib/bluetooth/00:0C:41:E1:FF:30/config.old
>
> /var/lib/bluetooth/00:0C:41:E1:FF:30/config was recreated containing
>
> : root; cat /var/lib/bluetooth/00:0C:41:E1:FF:30/config
> class 0x480104
>
> I guess that this is why my USBBT100 never (?) worked with bluez.

Yep. The reason is that you have somehow managed to get "onmode off" to
your config file. There's just one place (in storage.c) where the value of
onmode gets written and it looks like
         if (strcmp(mode, "off") != 0)
                 textfile_put(filename, "onmode", mode);
so it should be impossible for the value "off" to be stored. Maybe some old
bluez version has been buggy and allowed it or then the file has been
modified manually.

Anyway, if you look at the adapter_up function (in src/adapter.c) you'll
see that it calls itself recursively in the case that the last mode was
"off", but copies "onmode" to the previously stored mode before that. So,
if the stored "onmode" is actually "off" the adapter_up function will keep
calling itself indefinitely (until the daemon crashes).

I've just pushed a fix to git which falls back to the default "connectable"
mode if the stored onmode if for some reason "off". This should prevent
the infinite recursion of adapter_up:
http://git.kernel.org/?p=bluetooth/bluez.git;a=commitdiff;h=e40a1ccc50d87981b20d3ab0f1bec4209fee4247

Johan

  reply	other threads:[~2009-04-19 20:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-05 12:02 bluez 4.34 + Linksys USBBT100 + hcitool scan -> core dump Stuart Pook
2009-04-05 17:04 ` Stuart Pook
2009-04-05 17:22   ` Johan Hedberg
2009-04-19 19:19     ` bluez git + Linksys USBBT100 + 2.6.30-rc2 -> Segmentation fault Stuart Pook
2009-04-19 20:05       ` Johan Hedberg [this message]
2009-04-19 21:12         ` Stuart Pook
2009-04-19 21:38           ` Johan Hedberg
2009-04-19 22:05             ` Stuart Pook
2009-04-20 17:45             ` Stuart Pook
2009-04-05 17:19 ` bluez 4.34 + Linksys USBBT100 + hcitool scan -> core dump Johan Hedberg
2009-04-06 21:20   ` Stuart Pook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090419200528.GA18068@jh-x301 \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth4@pook.es \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox