after a fork, any existing connection objects can no longer be used,
but it's up to the user to destroy them. internally, this prevents
existing connections from ever being returned as valid connections
and creates new ones after a fork
also destroy fd handlers for connections to ensure that no data is
accidentally clobbered before the connections are cleaned up
Summary: Add omitted description to eldbus signal handler for doxygen warning
Test Plan: API Doxygen Revision
Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho
Differential Revision: https://phab.enlightenment.org/D5379
Summary:
Whatever the dbus_connection_send_with_reply returns, the serial value
should be checked, because if the seral value is invalid a process could be aborted.
There is backtrace as below.
The dbus_connection_send_with_reply could return TRUE
even though it has a problem. Please refer to following comment:
/* Refuse to send fds on a connection that cannot handle
them. Unfortunately we cannot return a proper error here, so
the best we can do is return TRUE but leave *pending_return
as NULL. */
Test Plan:
There is not a exact reproduce step. If the Tizen login manager is relaunched
repeatedly, then the dbus and other service processes are relaunched.
If a service process tries to use dbus when the dbus has problem as above,
then it could be possilbe to get above backtrace.
Reviewers: raster, zehortigoza
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5053
@fix
this is generally unnecessary noise as the majority of the time i see
this it's because the message was canceled by the caller... thats not
an error though then... it's intended. less debug noise to sift through.
Summary:
This patch set changes eldbus to use idle_enterer from idler.
If an application does not give idle time, then the eldbus cannot have chance to work.
Reviewers: raster, cedric
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D4443
remove setters that do not make sense, they are set in the constructor
functions and cannot be changed.
define the Eldbus_Connection_Type in .eo, properly type functions
using it.
It has been discussed on the ML (thread: "[RFC] rename efl_self") and
IRC, and has been decided we should rename it to this in order to avoid
confusion with the already established meaning of self which is very
similar to what we were using it for, but didn't have complete overlap.
Kudos to Marcel Hollerbach for initiating the discussion and
fighting for it until he convinced a significant mass. :)
This commit breaks API, and depending on compiler potentially ABI.
@feature
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.
Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.
Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
Coverity reports that we do not check the return value of
_eldbus_model_proxy_load here. We likely should be checking that in
case the model proxy fails to load so we can return proper values here.
Fixes Coverity CID1355233
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This implements a new builtin, stringshare, which is replaced with the right
pointer to Eina_Strinshare as necessary. This allows simplifying binding code
(it can call the proper eina APIs, deal with lifetime etc).
It also removes the extern Eina.Stringshare typedef from eina_types.eot, which
was actually incorrect and would generate invalid code in binding generators.
@feature @fix
Now when dealing with pointer types, we will not get pointer to
pointer semantics in callbacks and eina_promise_owner_value_set
for Eina_Promise.
It will work as expected:
Eina_Promise_Owner* promise = eina_promise_add();
void* p = malloc(sizeof(T));
eina_promise_owner_value_set(promise, p, &free);
Complex types (i.e. list, array, hash, accessor etc.) now do not require
pointers with them anymore (the pointer is implied) and the same goes for
class handles. Eolian now explicitly disallows creating pointers to these
as well. This is the first part of the work to remove pointers from Eolian
completely, with the goal of simplifying the DSL (higher level) and therefore
making it easier for bindings (as well as easier API usage).
@feature
if an application is connected to the session bus, being disconnected
should indicate that the session has been terminated and all applications
in that session should also be terminated
this ensures that no zombie processes will remain after the session bus dies
Efl - efl_model_base changed to use eina_promise
Eio - eio_model use efl_model_base with promise
Eldbus - elddbus models use promise now
Elementary - elm_view_list and elm_view_form use new models with promise
updated all related examples and tests
so ecore uses ecore system modules ... that use eldbus. eldbus inits
ecore. this is a vicious cycle. eldbus shouldnt init ecore. it's a
dependency but should be provided outside of initting eldbus. this all
led to hack-arounds on initting eldbus in these ecore modules that
just break things like shutting down eldbus when still in use.
this ensures any pending messages are canceled on ecore module shutdown.
this ensures every ecore module fully inits and shuts down eldbus as
they should so refcounting the inits works.
this stops eldbus from inittign ecore to avoid the circuluar dependency.
this stops lots of CRI/ERR complaints eg if you run elua with no
cmdline options.
this is just better.
@fix
I just ran my script (email to follow) to migrate all of the EFL
automatically. This commit is *only* the automatic conversion, so it can
be easily reverted and re-run.
DBus bool type is a uint32_t not a uint8_t, just changing how read
and write, not chaging how it is stored in eina_value to save some
bytes of RAM.
This fix the stack overflow pointed out here: https://phab.enlightenment.org/T3089
@fix
changes zmike made to e's systray make e abort due to libdbus seeing
the bus name as invalid. it actually is. it's
/org/ayatana/NotificationItem/steam for example - instead of
or.whatever.blah - thuis e aborts continually if you run steam at all.
eldbus should be more crash-proof thus this adds checks so dbus fun
doesnt cause an app to crash if it happens to call incorrect dbus names.
@fix
Summary:
there is a problem with _eldbus_message_iter_arguments_vget.
Assume: We have a array of type y, there are 3 elements in the array.
Lets say we are iterating with
printf("%c", dbus_message_iter_get_arg_type(iter));
and
dbus_message_iter_next(iter);
throuw the iter.
You will see that this will output yyy. As we are having 3 times v.
While the signature of the message iterator is y.
If you now call eldbus_message_iter_arguments_get(message, "y", &cont)
it will return false, with the errormessage in line 766, reason for this
is that the type of the signature iterator differs from the message
iterator. Because of the upper example.
So all in all: The signature given to the method has not to be equal to
the signature of the message iterator, it has to be equal to the
iterated signature, which cannot be found easily with the eldbus api.
The solution is to only iterate in the message iterator that long until
the signature iterator is at the end, if the type differs in this
region, give a error and return false. Otherwise return true.
The sad thing about this is that it is a behaviour break, but the
behaviour is borked, so its a fix.
I tested this over a week now, without any problem in efl/elm/e.
Reviewers: stefan_schmidt, zmike
Reviewed By: stefan_schmidt
Subscribers: zmike, ceolin, simotek, DaveMDS, cedric
Projects: #efl
Differential Revision: https://phab.enlightenment.org/D3074
Summary:
When we call dbus_connection_send_with_reply, the dbus_pending
can be NULL. In this case, the next call dbus_pending_call_set_notify
will cause application crash.
We should check if dbus_pending is NULL before calling dbus API.
@fix
Reviewers: cedric
Subscribers: englebass, cedric, seoz
Differential Revision: https://phab.enlightenment.org/D3081
Summary:
Previous implementation assumed that fallback interface path should be changed
on every method call. This is generally not needed since real request
path can be obtained directly from dbus message passed as method call
paremeter.
This patch reverts this behaviour and additionally fix broken Property and Introspect
interface handling of fallback interface.
Reviewers: raster, lucasdemarchi, cedric
Subscribers: cedric, seoz
Differential Revision: https://phab.enlightenment.org/D3016
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Subtracting two unsigned values results in an unsigned value, which means
abs() will have no effect.
This also means that if base is smaller than size, we'll have an
unsigned int underflow.
I did it this way (with the if) because it looked like base might be
smaller than size. However, please remove the if (and don't reinstate
the abs) if this is not the case.
Summary: Eina_Value must be allocated with eina_value_new() to be freed by eina_value_free().
@fix
Reviewers: felipealmeida, larryolj, cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1927
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
If user try to remove the last reference of proxy, object, connection
or eldbus(lib) inside of message callback it was causing the
eldbus_pending_dispatch() being called 2 times, one because of the
eldbus_cancel() that is triggered when the last reference of the
message parent is removed and another after the return of the user
callback.
==6545== Invalid read of size 8
==6545== at 0x52F784E: eldbus_cbs_free_dispatch (eldbus_core.c:266)
==6545== by 0x53064AA: eldbus_pending_dispatch (eldbus_pending.c:227)
==6545== by 0x5305961: cb_pending (eldbus_pending.c:74)
==6545== by 0x6B29DB1: ??? (in /usr/lib/libdbus-1.so.3.8.9)
==6545== by 0x6B2D280: dbus_connection_dispatch (in /usr/lib/libdbus-1.so.3.8.9)
==6545== by 0x52F93B4: eldbus_idler (eldbus_core.c:773)
==6545== by 0x4E4B300: _ecore_call_task_cb (ecore_private.h:305)
==6545== by 0x4E4B78F: _ecore_idler_all_call (ecore_idler.c:143)
==6545== by 0x4E4EA73: _ecore_main_loop_spin_core (ecore_main.c:1768)
==6545== by 0x4E4EAF1: _ecore_main_loop_spin_timers (ecore_main.c:1802)
==6545== by 0x4E4ED01: _ecore_main_loop_iterate_internal (ecore_main.c:1925)
==6545== by 0x4E4D03B: ecore_main_loop_begin (ecore_main.c:983)
==6545== Address 0x701aa78 is 104 bytes inside a block of size 128 free'd
==6545== at 0x4C2B200: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6545== by 0x530655B: eldbus_pending_dispatch (eldbus_pending.c:241)
==6545== by 0x5306763: eldbus_pending_cancel (eldbus_pending.c:259)
==6545== by 0x52F29DB: _eldbus_proxy_clear (eldbus_proxy.c:146)
==6545== by 0x52F3057: _eldbus_proxy_unref (eldbus_proxy.c:244)
==6545== by 0x52F3393: eldbus_proxy_unref (eldbus_proxy.c:264)
==6545== by 0x401039: on_get_playlists (banshee.c:53)
==6545== by 0x5306493: eldbus_pending_dispatch (eldbus_pending.c:225)
==6545== by 0x5305961: cb_pending (eldbus_pending.c:74)
==6545== by 0x6B29DB1: ??? (in /usr/lib/libdbus-1.so.3.8.9)
==6545== by 0x6B2D280: dbus_connection_dispatch (in /usr/lib/libdbus-1.so.3.8.9)
==6545== by 0x52F93B4: eldbus_idler (eldbus_core.c:773)
Now we will remove the pending from parent pending list before
call the user callback, this way only the pending messages will
be canceled.
Also we need increase the eldbus reference before call
dbus_connection_dispatch() or user could remove the last reference of
eldbus inside of a message callback when we still are
holding one reference of the connection.
@fix
ref T1908
Summary: Fix Coverity CID1256952: reports a null derefence here due to
eldbus_message_new returning NULL, thus causing a null dereference
when trying to set reply->dbus_msg
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Some problems with the actual implementation:
- the reply should not be writable, as it can only be read.
- if an error happen dbus_connection_send_with_reply_and_block()
will return NULL so we need check before use it
- all other send calls remove one reference of the message
Now also it is creating a error message, so the caller can know why it fail.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: This adds the actual code to send a dbus message and block
while waiting for a reply.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: This function will send a message to dbus and block while
waiting for a reply
NB: This is needed for our 'port to libinput', and for our 'opening up the
drm card without systemd' efforts
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: This adds a public facing API function to make dbus calls
which will block and wait for a reply. This is needed for a couple of
use cases in our Wayland efforts (libinput, etc).
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: This just adds the function prototype into the eldbus private
header. It will be used in the new proxy function
"eldbus_proxy_send_and_block"
Signed-off-by: Chris Michael <cp.michael@samsung.com>