Get proxy properties after interface added, before reply, if
recieved interface removed message, it's safer to cancel
pending_call object of get_all_prop at proxy free process.
Signed-off-by: huangcaihua <huangcaihua@xiaomi.com>
Even if a proxy has already been added, the properties
should still be retrieved when adding the interface.
because the proxy maybe not got prop before.
Signed-off-by: huangcaihua <huangcaihua@xiaomi.com>
GDbus cache the proxy properties, for multi-thread, one thread gets
prop value which maybe freed by default loop thread.
Signed-off-by: huangcaihua <huangcaihua@xiaomi.com>
If the dbus disconnect message has been received,
it means that the current dbus connection is invalid.
The added disconnect message signal filter also needs to be free.
Signed-off-by: huangcaihua <huangcaihua@xiaomi.com>
Gdbus will get properties when received interface add message,
If not cancel the getting properties pendingcall, it maybe use
freed proxy which will be freed after received interface remove message.
Signed-off-by: huangcaihua <huangcaihua@xiaomi.com>
dbus_connection_send_with_reply returned pendingcall object, then set pendingcall notify function.
When dbus reply, it will call dbus pendingcall handle process, and call notify fuction.
For both thread, ensure that the dbus pendingcall notify is set to execute first, and then execute the dbus reply call notify pendingcall process
Signed-off-by: huangcaihua <huangcaihua@xiaomi.com>
When the dbus message returns too quickly, the dbus message may return
before dbus_pending_call_set_notify is executed, resulting in the
callback function not being executed.
Signed-off-by: xujianhang <xujianhang@xiaomi.com>
when proxy is removed, proxy_free will cancel this pendcall of proxy to avoid
calling pending_reply_cb after proxy was removed, otherwise it will caused used
after free.
==174637==ERROR: AddressSanitizer: heap-use-after-free on address 0xf507c524 at pc 0x5ada152d bp 0xef013f98 sp 0xef013f88
READ of size 4 at 0xf507c524 thread T0
#0 0x5ada152c in get_properties_reply_not_standard gdbus/client.c:1271
#1 0x5ada00b3 in method_call_reply gdbus/client.c:1110
#2 0x5a527468 in _dbus_pending_call_finish_completion dbus/dbus/dbus-pending-call.c:243
#3 0x5a4e753d in complete_pending_call_and_unlock dbus/dbus/dbus-connection.c:2332
#4 0x5a4f39d4 in dbus_connection_dispatch dbus/dbus/dbus-connection.c:4663
#5 0x5a6d5451 in message_dispatch gdbus/mainloop.c:55
#6 0x5a644109 in g_idle_dispatch glib/glib/gmain.c:6157
#7 0x5a6364a3 in g_main_dispatch glib/glib/gmain.c:3477
#8 0x5a63dbdd in g_main_context_dispatch glib/glib/gmain.c:4195
#9 0x5a63e6db in g_main_context_iterate glib/glib/gmain.c:4271
#10 0x5a63f998 in g_main_loop_run glib/glib/gmain.c:4471
#11 0x5ad2ddda in telephonytool_main /home/mage1/data/n62_sim_new/frameworks/telephony/telephony_tool.c:4465
#12 0x58f60272 in nxtask_startup sched/task_startup.c:70
#13 0x58ef82b8 in nxtask_start task/task_start.c:134
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
frameworks/utils/gdbus/polkit.c:139: multiple definition of polkit_check_authorization; /external/ofono/ofono/gdbus/polkit.c:157: first defined here
Signed-off-by: yintao <yintao@xiaomi.com>
ERROR: AddressSanitizer: attempting to call malloc_usable_size() for pointer which is not owned
#5 0x59c7dfb4 in filter_data_free gdbus/watch.c:221
#6 0x59c7f10c in filter_data_call_and_free gdbus/watch.c:324
#7 0x5aba939a in dbus_remove_all_watches gdbus/watch.c:824
#8 0x5ab6b274 in tapi_close /home/yintao/ofo/220tele/frameworks/telephony/tapi_manager.c:369
#9 0x5ab5238e in telephonytool_main /home/yintao/ofo/220tele/frameworks/telephony/telephony_tool.c:3422
Signed-off-by: yintao <yintao@xiaomi.com>