added support to set thread names for debugging. this wraps the gnu
extension to set a thread name of up to 15 chars (16 inc nul byte).
eina_thread_name_set() is the new api.
@feature
in the process i found the autofoo wasnt enabling cpu affinity support
at all in reality, so i had to fix that at the same time.
Summary:
Check for valid rectangle
If any dst or src rectangle has zero width or height,
intersection should not return true.
@fix
Test Plan: Added test cases
Reviewers: cedric, herdsman, Hermet
Reviewed By: Hermet
Subscribers: shilpasingh, cedric
Differential Revision: https://phab.enlightenment.org/D2990
eina_str_join() is used a lot to contatenate paths, but the
separator should be '\' on Windows. So add 2 API and 2 defines for
more cross platform code
@feature
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
We mostly use in our code base ERR in conjunction with system related error. This
doesn't require any information from who did call that function to get debugged and
is creating way to much noise with little value.
Summary:
Implemenation of eina_matrix3_quaternion_get function
Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2786
This was a function I forgot to finish implement. Thanks Vivek to take care of it.
As it comes with a test case, is self contained and fix a missing bit of code I will
push it at this point in time of our release process. Sorry everyone for that late push.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Failing to load a module that does not exist is indeed not an error,
but failing to load a module that exists on disk happened probably
because of an error like "symbol not found".
Considering eina_module is most likely used by EFL itself, I believe
an internal linking failure is a warning worth reporting.
it is not an error. eina_module may be used on files that don't exist
and the caller may handle that as a "does not exist" error. it is not
good to go spewing out errors for this. it's debug at best.
@fix
The tag identifier should not be inside of the string "~".
Previous logic doesn't care that scenario,
the parser context can be corrupted and it will be no more useful.
@fix
@fix - this fixes eina sephamore lock/wait to not return just because
of a signal sent to the process - try again if the semaphore wait is
interrupted by a signal as opposed to a semaphore wakeup.
Summary:
When dlopen() fails, eina_module_load() print error information using dlerror().
But, it is printed with WRN. If EINA_LOG_LEVEL is lower than WRN,
application developer is hard to see which has a problem.
Reviewers: woohyun, Hermet, raster, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2536
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
@fix
this fixes the cpu count to count the numebr of available cores
correctly. before if core 0 happened to be off, we'd get 0 cpu cores
available due to the break
Summary:
Currently eina_inarray_search was using binary search to search elements
which would not work on unsorted array so modified it to work as linear search.
There is already a function eina_inarray_search_sorted to work on sorted array.
Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2501
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Using EINA_LOG_LEVEL=4 for standard debugging has now become
absolutely horrible (and slow!). Backtraces may make sense in
case of ERR and CRI messages, but are just pollution for other
levels.
WRN could be argued over but the old env variable is still there
so just use it if you want backtraces:
$ export EINA_LOG_BACKTRACE=2
In eina_debug.h we only include the eina headsers when all defines are true
for backtrace, dlopen, unwind, etc. We still use Eina_Bool here when these
cases are not met. I just hit this case and failed the build.
this makes eina_log give bt's for all error logs. this is very useful
in finding just where a problem happens. the problem int he past is
that these have not been too useful due to backtrace_symbols() being
"useless". thus use the eina_btlog tool i added too.
also started infra for a debug monitor that can use the backtrace
infra to collect runtime stats ANY TIME for a process (don't need to
run under a debugger).
@feat
Summary:
Added eina_crc function in eina to calculate crc for the key passed and
added eina_hash_crc function for hashing using crc
Signed-off-by: vivek <vivek.ellur@samsung.com>
Reviewers: Sergeant_Whitespace, cedric
Reviewed By: cedric
Subscribers: Sergeant_Whitespace, cedric
Differential Revision: https://phab.enlightenment.org/D2260
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Since the type of 'r' changed from unsigned short to unsigned int we
need to change its format as well.
Reviewers: stefan_schmidt, raster, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2446
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
At the moment there are no errors possible for safety checks.
This may change in the future (unlikely), so we have the eina_error
already exposed for that. However, there's no need for the string.
One more down towards a warningless build.
This is a late change that has been discussing on the ML as we don't want to release an API, we can't make faster.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Now the developer has to iterate the whole list to find the
index of the first occurence of the data.
I see that it is possible to get the index of the item for
the genlist widget, but for the eina_list not.
With these APIs it will be easier to implement *index_get
functions for the rest of widgets which contain items (Elm_List,
Elm_Ctxpopup etc.).
These functions returns the index of the given data or node in the eina_list.
Reviewers: Hermet, cedric
Subscribers: raster, cedric
Differential Revision: https://phab.enlightenment.org/D2189
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
eina_binbuf_manage_new provide the functionnality of both eina_binbuf_manage_new_length
and eina_binbuf_manage_read_only_new_length. Those function get deprecated.
Summary: Added new symbols, that will be escaped. There are '\"', '\t' and '\n'.
Reviewers: raster, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2130
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
It's better to realese the lock before returning NULL. Otherwise the program
is waiting indefinitely then crashing on Windows ("program not responding").
@fix
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
if you fork and even if you do ecore_fork_reset() a thread calling
ecore_main_loop_thread_safe_call_async(0 for example eill end up
resetting the mainloop thread id to itself (a non mainlopo thread) via
calling eina_main_loop_is() since pid changed. there is little point
in doing this so remove the pid tracking from eina and ensure mainloop
thread id is updated in ecore's fork reset.
@fix
We take a lock, search the list, and the release the lock before we
finish using the values of the list. While unlikely, the string could be
deleted in the meanwhile.
This patch fix the semaphore initialisation on posix plateform
there was a preconditon test which returned the semaphore
uninitialised when count_init was 1, this caused the semaphore to
be unusable on OSX plateform. Furthermore, it seems that we need to
unlink the semaphore before its initialisation on OSX as there seems
to have some kind of persistence of the semaphore accross execution.
warning, this patch change the signification of the parametter
count_init on linux plateform, this parametter is now consistent on
every plateform, with the meaning of setting the initial count value
of the semaphore.
This used to be on linux 1 -> the semaphore is shared and initialised
at 1 and 0 -> the semaphore is not initialised, thus, by side effect
not shared and initialised at 0.
This patch set on linux plateform the semaphore as systematically
shared
@fix
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
The new value is allocated using Eina_Mempool, it should be freed using
eina_mempool, not using libc free.
@fix
Signed-off-by: vivek <vivek.ellur@samsung.com>
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1940
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Apparently eina_tmpstr_strlen counts the null character as well. This
doesn't follow how strlen works, as the latter excludes it from the count.
This resulted in mistreatment of the string in _eina_file_escape, with
tmp_str paths that had "../".
This fix will do for now, but it is advised that we avoid using
eina_tmpstr_strlen, to prevent such confusions in the future.
Test Plan:
The following lines will throw a valgrind 'invalid read of size 1' error
prior this fix:
char *path = "home/mydir/../myfile";
Eina_Tmpstr *tmp_str = eina_tmpstr_add(path);
char *ret_path = eina_file_path_sanitize(path);
@fix
Reviewers: cedric, stefan_schmidt
Subscribers: tasn, cedric
Differential Revision: https://phab.enlightenment.org/D1929
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This reverts commit f52f562891.
This is reverted because it breaks eina_file_path_sanitize when using
"/../" in paths, for example:
eina_file_path_sanitize("/home/../mydir/myfile")
returns: "/mydir/myfili"
What invalid read size does this fix? Why was no test case specified?
Anyway, this change affects too much code to leave it in like this.
This should not be an ABI regression on the platform where it work (Unix). It is on Windows,
but the API was unusable at all without this change, so this is a necessary breakage to
unbreak things.
@fix
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Nothing was printed to journald before because sd_journal_send_with_location
expects file and line to be of the NAME=VALUE form.
Change-Id: I382b82b665558fddebae61b7d0a8d4de87638511
Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@globallogic.com>
Reviewers: kuri, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1865
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
@fix
this fixes the eina mmap safety handler to only handle what comes
from actual i/o errors (not actual corrupt/hw memory faults or invalid
objects), and if it's not a sigbus eina mmap should handle then pass
it onto the previous handler before eina mmap took over.
Previously Eina_Stringshare printf variant where returning NULL with ("%s", ""). This
is highly disturbing as you would have gotten "(null)", if you asked for ("s", NULL).
To clarify and make things logical, we now return "".
Summary:
eina_inarray_free was not called. So calling it to fix the memory leak.
@fix
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1808
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
While going through eina for understanding, wrote a program to understand
he differences between different eina inarray functions. Thought, this might
be useful for others too, so adding the same.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1803
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary: The first parameter must be the count of elements to be allocated.
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1660
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This is a quick fix.
It looks like OSX doesn't provide the same infra as linux for
cond_timedwait, but instead they provide directly a
relative time wait function. Since I don't have any build / test
environment for OSX, this is as far as I can go.
Arguably, OSX libc seems to use gettimeofday() for cond_timedwait,
so this should close T1701.
See the pthread cond implementation:
http://www.opensource.apple.com/source/Libc/Libc-167/pthreads.subproj/pthread_cond.c
Summary:
Schedule group is made for eina_sched_xxx.
It is grouped into Tools group.
Futher description is needed later.
Reviewers: raster, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1623
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Much confusion with this spaghetti code of #ifdefs and clocks.
So, we can't use CPU clocks for the timedwait, this doesn't make
sense (and it's explicit in the manpage, too).
But we can use CLOCK_MONOTONIC or CLOCK_MONOTONIC_RAW which are
much better than the wall clock (because of ntp updates, etc...)
The test case tests that the cond actually waited for as long as was
requested and for not too long either.
This is hopefully a final fix for T1701.
There seems to be an intent to check that UID==EUID
before calling getenv to get the temp directory.
But that was lost in commits 61478af3a6 and
then in e105abc99e.
XDG_RUNTIME_DIR gives us a nice securty benefit by only allowing the
same user to read wand write files.
In some configuration this is problematic though. If one looks at the
bug report this fixes for example you can see that there are build
scripts that use a special build user.
The way this has always worked on unix is that you can define your
own tempdir with TMPDIR. When I was making the original change towards
XDG_RUNTIME_DIR I expected some trouble with it but it worked quite
well so far.
To avoid breaking scripts out there and maybe configurations we
haven't tested yet give TMPDIR precedence over XDG_RUNTIME_DIR.
Fixes T1766