Background:
I recently had a distressing bug in an Adnroid implementation I am
working on. I searched everywhere I could think of for this bug and its
solution, but never found it. I eventually found and fixed the bug
myself. I will detail the bug and the fix here.
The big question is: Can I find out if this bug has been reported and/or
fixed in the current Android code, and if so, how? (And how much work is
involved)
I am pretty sure I could create an Android development tree from the
latest download for the latest version, and simply look at that code - that
would tell me if it has been fixed.
However, I am after more information than that! Things like: When (what
version, and what date/time) was it fixed (if it was fixed). What other
(possibly related) bugs were fixed at the same time? etc.
Bug:
Running Android 2.3.5_r1 (with a Linux 2.6.39 kernel underneath - but
AFAIK, irrelevant to this particular bug).
Attempting to activate a BT "dongle" (based on an Atheros chipset - and
again AFAIK, irrelevant to this particular bug.)
The system would "crash" with a "jump to location 0" fault.
Fix:
Within the source file
/frameworks/base/core/jni/android_server_BluetoothEventLoop.cpp:
In function static int register_agent( ...... )
The declaration for variable oob was "bool oob = TRUE"
Changing this declaration to:
dbus_bool_t oob = TRUE;
Fixed it.
Now, I can see how this error would not crash certain systems, depending on
the differences between architectures, compilers and implementations, and
yet crashed my system.
To the best of my knowledge, and not with absolute certainty, the operative
typedef for bool here was:
typedef enum { false=0, true=!false } bool;
whereas dbus_bool_t is defined as:
typedef dbus_uint32_t dbus_bool_t;
As you can see, the actual implementation of type bool could vary based on
the system and the compiler.
So, where could I go to find out if this fix was "re-inventing the wheel"
or if this bug (and fix) should still be reported, and to whom?
I am also interested in other fixes that might be similar to this one, as I
am again experiencing a "jump to 0" fault crash within the Bluetooth stack
on this system (different operation) and am loathe to spend the days it
took to find that first bug if it has already been reported and fixed.
I would love to be able to just find the file involved, go to it, and make
the required fix.
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel