Summary:
Using `--disable-magic-debug` defines EINA_MAGIC_CHECK to always
evaluate to `1`. Eina_Binbuf's null-check relied solely on the
EINA_MAGIC_CHECK, and failed to pick up on the cases where `buf` was
passed as NULL. This has led to a segfault when a NULL `buf` was passed
in the test suite (see referenced ticket).
This fix adds an explicit NULL check.
Fixes https://phab.enlightenment.org/T7147
Reviewers: zmike
Reviewed By: zmike
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6592
Summary:
These three classes have essentially the same API, just different
underlying data types. This patch seeks to improve the docs for all
three while retaining or improving the consistency between them.
Several functions had completely incorrect documentation (looks like
cut-and-paste mistakes), others had missing or incorrectly named
parameter documentation, typographical errors, or other similar issues.
This also cleans up a lot of spelling and grammar errors, defines return
values as part of @return, and reformats/revises doxygen code for
consistency.
There are no changes to code, except some whitespace cleanup.
Reviewers: devilhorns
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6544
Summary:
It seems this function is no longer used since some rework. Clean it up.
lib/eina/eina_thread_queue.c:127:1: warning: ‘_eina_thread_queue_msg_block_real_free’ defined but not used [-Wunused-function]
Reviewers: devilhorns
Reviewed By: devilhorns
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6537
Summary:
Define return values as part of @return.
Clarify that the returned list of files are gnuplot filenames specifically.
Cleanup grammar throughout.
Reviewers: zmike, devilhorns
Reviewed By: devilhorns
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6502
when debugging was active, this would frequently result in the monitor thread
blocking in a read() call for a fd which had already been closed by the main
thread. the main thread would be waiting for the monitor thread to fail its read()
and destroy itself, but the read() would never end without an interrupt
this reworks the monitor thread destruction to stop relying on the thread to
remove its session from the session list and instead only access the list from
the main thread, allowing sessions to always be immediately destroyed
fix T7103
Summary:
This reverts commit e0f8e65d20 which changed the
behavior of eina_stringshare_nprintf() and was not really needed to fix T6903.
Reviewers: zmike, Jaehyun_Cho, devilhorns
Reviewed By: zmike
Subscribers: cedric, #committers
Tags: #efl
Maniphest Tasks: T6903
Differential Revision: https://phab.enlightenment.org/D6431
Summary:
I typod this in 14ae3e3dec and when using
mempools other than chained, this probably caused all apps to crash on
shutdown
Reviewers: ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6428
Summary:
somehow backtrace() is able to generate EINVAL in certain cases even though
this is not documented anywhere. these irrelevant errors should not be noticed
by users of the api during debugging, as this can cause some tests/apps to
randomly fail without explanation
@fix
Reviewers: ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6377
Summary:
this changes the explicit pthread usage (and reimplementation of eina_thread_create)
to just use eina function calls. it also causes the thread to start and stop when
profiling is enabled and resolves some possible errors which could occur after
a fork or when trying to compile under windows
pthread usage: this code appears to have been 100% copied from eina_thread.c, and it
isn't clear to me why existing eina_thread api was not used. this has no functional
benefit, but it makes the code more readable
thread lifetime: there is no need to have a thread running at all times for a feature
which will be rarely used and which must be explicitly enabled by the user
windows: this file previously generated a lot of compiler warnings from unused functions
and variables since nothing here is available under windows. the entire file is now
a giant #ifndef _WIN32 to avoid any compile warnings or unexpected runtime behavior
fix T7055
Depends on D6371
Reviewers: ManMower, vtorri, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Maniphest Tasks: T7055
Differential Revision: https://phab.enlightenment.org/D6372
Summary:
previously this used to mean 'the number of ms that a lock can wait for
until abort() is called once the lock is acquired' and it was useful
when trying to find contention issues with locks
unfortunately this required a bit of reading into the code to determine,
and it made the common case of setting values to 1 fail in some cases,
as this is a very short amount of time. also the documentation explicitly
gives '1' as an example setting for this variable, which will cause immediate
abort() in most cases when debugging was enabled since things are much slower
this variable now is the number of usec that a lock can wait for before abort()
is called, and the lowest value that will be checked for abort()ing is 100, meaning
that '1' is valid again
Depends on D6375
Reviewers: ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6376
Summary:
when debugging thread issues, it's not actually helpful to immediately
deadlock--this defeats any attempt at debugging. instead, call trylock first
in order to detect a possible deadlock and then throw an error which can be
caught by the user
Depends on D6374
Reviewers: ManMower, devilhorns
Reviewed By: devilhorns
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6375
there's no need to reimplement mempools here when we already have a great
mempool api
this makes the code slightly more readable
Differential Revision: https://phab.enlightenment.org/D6353
Summary:
casting here is safe, as before we check and return on size < 1.
Depends on D6379
Reviewers: devilhorns, Hermet
Reviewed By: Hermet
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6380
This reverts commit 0d91088d0f.
It also includes a workaround for OSX where RT signals aren't
supported due to kernel age (too old a fork of freebsd). fixes D6310
and T7029
This include is necessary according to POSIX. Without it, build
fails on certain platforms (QNX). It may already be included
implicitly in some of those files, but declare intent.
Fixes T6667.
Summary:
if profiling is not enabled then reaching this signal handler will always
result in a crash
moreover, the signal handler has no functional value if profiling is not active,
so do not add it until that point
fix T7028
@fix
Depends on D6311
Reviewers: ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Maniphest Tasks: T7028
Differential Revision: https://phab.enlightenment.org/D6312
fork() kills this entire subsystem and leaves its internals
in an inactive but allocated state, so it's necessary to explicitly restart
everything in order to guarantee behavior
@feature
Differential Revision: https://phab.enlightenment.org/D6307
this should not remain active after eina has been deactivated, so ensure
that everything stops as expected
ref T7019
Differential Revision: https://phab.enlightenment.org/D6306
this should not remain active after eina has been deactivated, so ensure
that everything stops as expected
ref T7019
Differential Revision: https://phab.enlightenment.org/D6305
this should not remain active after eina has been deactivated, so ensure
that everything stops as expected
ref T7019
Differential Revision: https://phab.enlightenment.org/D6304
this basically breaks all thread usage if it happens, so ensure that the
threads infrastructure stays active for as long as eina is active
@fix
Differential Revision: https://phab.enlightenment.org/D6303
eina is guaranteed to crash in any process without this call now that
eina_debug exists and requires threads
@fix
Differential Revision: https://phab.enlightenment.org/D6302
this should be done in a single location to avoid dependency conflicts
and make the code easier to read
Differential Revision: https://phab.enlightenment.org/D6301
Summary:
the 'first' member of this struct is used simultaneously across
threads and can have conflicting read/write operations occurring at this
time
as int operations are not guaranteed to be atomic, ensure that we are
using atomic operations or locking as necessary
@fix
Depends on D6299
Reviewers: ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6300
Summary:
this moves lock calls outside #ifdef blocks to make the code more
readable
no functional changes
Depends on D6298
Reviewers: ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6299
Summary:
this would deadlock in some cases
@fix
Depends on D6297
Reviewers: ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6298
Summary:
memset overwrites the thread value, triggering errors when running tools like
helgrind
attempting an operation on an invalid thread will cause errors naturally,
so zeroing the rest of the struct and ignoring the thread member is fine
Reviewers: ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6297
This reverts commit 8343de6ce3.
This borke mac os build, CI is spamming on irc channels and addtional
tests are failing. I would give this back to the drawingboard.
ref T7029
Differential Revision: https://phab.enlightenment.org/D6310
Summary:
these effectively prevent locks from being used to synchronize operations
between (non-main) threads, which restricts their usefulness and also
prevents our own unit tests from passing
fix T7004
Depends on D6267
Reviewers: devilhorns, ManMower
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Maniphest Tasks: T7004, T1984
Differential Revision: https://phab.enlightenment.org/D6285
Summary:
this lock/thread never gets destroyed, so it should not trigger failure cases
when that is always the case
@fix
Depends on D6266
Reviewers: stefan_schmidt, ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6267
Summary:
recursive locks are locked multiple times in the same thread, leading to
failure with the tracking infrastructure which was written prior to
the addition of recursive locks and assumed that locks would only be
taken exactly once
given that this debug info is meant to handle non-recursive locks,
it makes little sense to include them in the handling
@fix
Depends on D6264
Reviewers: stefan_schmidt, ManMower, devilhorns
Reviewed By: ManMower
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6265
Summary:
recursive writes are not inherently bad, so long as the pointer is
consistently re-set (handled automatically by macros), and they are nearly
unavoidable in some places such as eo/evas internals
issues may arise in a specific corner case of recursive writes when a pointer
has been hashed for garbage collection, so adjust the checks to watch for this
specific case instead of crashing on every case
fix T7005
Reviewers: devilhorns
Reviewed By: devilhorns
Subscribers: cedric, #committers
Tags: #efl
Maniphest Tasks: T7005
Differential Revision: https://phab.enlightenment.org/D6284
Summary:
a mutex can only have one type, so setting this type onto a recursive mutex
will unset the recursive attribute and cause deadlocks
ref T1984
@fix
Reviewers: stefan_schmidt, ManMower, devilhorns
Reviewed By: devilhorns
Subscribers: cedric, #committers
Tags: #efl
Maniphest Tasks: T1984
Differential Revision: https://phab.enlightenment.org/D6264
Summary:
eina_share_common contained extremely verbose printfs which rendered
the debug profile (./configure --with-profile=debug) almost unusable.
They have been turned into EINA_LOG_DBG in the eina_stringshare log domain
(when related to stringshares) and without domain when related to other
eina_share facilities.
Also, cleaned up some printfs which have been commented out for 8 years.
Fixes T7006
Test Plan:
The printfs are regular eina logs and can be filtered out by regular means.
The debug profile output is far more usable now.
Reviewers: zmike, devilhorns
Subscribers: cedric, #committers
Tags: #efl
Maniphest Tasks: T7006
Differential Revision: https://phab.enlightenment.org/D6288
Summary:
this is a valid return code which indicates success and is passed randomly to
one of the callers
@fix
Depends on D6267
Reviewers: stefan_schmidt, ManMower, devilhorns
Reviewed By: devilhorns
Subscribers: cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6268
Summary:
Adds documentation about internals of a couple functions and cleans up
some stray doxygen tags.
Reviewers: cedric
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6039
Summary:
Adds documentation for several routines, fixes some incorrect
documentation, cleans up grammar throughout, corrects a few remaining
spelling errors.
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D6021
Summary:
vsnprintf() returns "The number of characters that would have been written if n had been sufficiently large",
so if this is larger than the requested length, we pass the requested length to eina_stringshare_add_length,
to avoid reading uninitialised memory.
Fix T6903
Reviewers: zmike
Subscribers: cedric
Maniphest Tasks: T6903
Differential Revision: https://phab.enlightenment.org/D6011
Summary:
Revise wording of a few parameters, improve consistency of punctuation
and documentation body placement.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5918
Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Revises some descriptions, polishes wording, makes punctuation and
formatting more consistent, and straightens out some convoluted grammar
here and there.
There are a few places where the parameter documentation was incorrectly
cut-and-pasted from other routines, so this is fixed. Also, in
eina_matrixsparse_iterator_new() the docs say the elements are not
returned sequentially, but from the context and code I think it meant to
say they're not _consecutive_.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5924
Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
By default all Pthread are cancellable. This leads to strange behavior that
happen during shutdown and hasn't been figured out. Most likely fix for T6622.
Summary:
This copyedits the descriptions for several _add and _free APIs.
Phrasing is made a bit more concise, without losing the meaning, and
made more consistent so the distinctive differences between the routines
are easier to spot. Some paragraph spacing is added for clarity, for
similar reasons.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5851
Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Improve the verbage in the doxygen comments. Refer to the value being
changed as the 'previous' rather than the 'old' value, to be more
precise. Drop the phrase 'keeping API sane' as it is unnecessary and
is an odd thing to say. Try to avoid referring to 'your program' as we
shouldn't assume the reader's situation.
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D5834
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
'thiz' is not commonly used in EFL, more commonly used is a word or
abbreviation that is descriptive of the object being used ('hash' for
Eina_Hashes, 'str' for Eina_Strings, 'array' for Eina_Arrays, etc.)
Follow this convention by using 'rect' (as used already in various
places) instead of 'thiz' or 'r'.
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D5836
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
For all routines that can return NULL on error, mention this in the
function's @return docs. In cases where a small number of situations
result in this return, move the docs to the @return; in other cases just
state the NULL return briefly and leave the elaboration in the body.
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D5837
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
so the MAIN loop is actually an efl.app object. which inherits from
efl.loop. the idea is that other loops in threads will not be efl.app
objects. thread on the creator side return an efl.thread object.
inside the thread, like the mainloop, there is now an efl.appthread
object that is for all non-main-loop threads.
every thread (main loop or child) when it spawns a thread is the
parent. there are i/o pipes from parnet to child and back. so parents
are generally expected to, if they want to talk to child thread, so
use the efl.io interfaces on efl.thread, and the main loop's elf.app
class allows you to talk to stdio back to the parent process like the
efl.appthread does the same using the efl.io interfaces to talk to its
parent app or appthread. it's symmetrical
no tests here - sure. i have been holding off on tests until things
settle. that's why i haven't done them yet. those will come back in a
subsequent commit
for really quick examples on using this see:
https://phab.enlightenment.org/F2983118https://phab.enlightenment.org/F2983142
they are just my test code for this.
Please see this design document:
https://phab.enlightenment.org/w/efl-loops-threads/
Summary:
Adds missing @param docs and fixes an incorrectly documented one.
Clarifies difference between 'length' and 'position', specifying the
latter is a number between 0.0 and 1.0. Improves verbage here and there
for grammatical correctness and internal consistency.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5780
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
These routines all have slight permutations of the same basic note, but
are each formatted a bit differently. Fix that and a few punctuation
irregularities.
Similarly for a couple @warnings, and escalate one @note to a @warning
since what it describes might be a security issue so deserves
highlighting.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5779
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
The eina_matrix3_compose and eina_matrix3_multiply API's are
mathematically identical (even though the implementations are
reversed... weird), except that the latter also includes a fastpath for
identity matrices.
Having two functionally equivalent APIs is redundant, so ideally one or
the other would be dropped. But in order avoid API breakage, just have
one routine wrapper the other and eliminate the internal redundancy.
(Note that the parameter signatures of the two routines are different -
eina_matrix3_compose() takes the two input matrices first, and the
output matrix last, while eina_matrix3_multiply() takes the parameters
in the reverse order. This inconsistency in the API style could result
in accidentally erroneous usage and would be an argument for deprecation
of one of the two APIs.)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewers: cedric
Reviewed By: cedric
Differential Revision: https://phab.enlightenment.org/D5806
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
Some spelling/punctuation/grammar/formatting fixes to make the
rectangles doxygen more consistent. Simplify wording in several places,
including removing redundant documentation of return values. Reword the
rectangle cutting API's to be more clearly worded. Make clearer mention
of parameters that get changed by the function call, and ones that
allocate memory.
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5785
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
docs say return true on succesas, false on failure. adding a rect we
already added is not a failur. it's an optimization to a NOP. so fix.
this was brought up by and fixes T6669 ... but in the opposite way.
Summary:
Corrects some grammatical errors, and rephrases wording of some passages
for better clarity. Also fix a few doxygen formatting inconsistencies.
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5764
The documentation for these functions claims that passing a NULL array
results in doing nothing - that should also include logging nothing.
EINA_SAFETY_ON_NULL_RETURN() logs an ERR message and should be reserved
for usage when NULL is not actually a valid state.
Additionally, it's entirely possible to turn off EINA_SAFETY_CHECKS, at
which point these functions would stop behaving as the documentation
says they do. Not great.
Summary:
Ensure @return defines error returns consistently. In several cases the
errors were explained in the body but not mentioned in the @return docs.
Drop redundant return value documentation for clarity. Some routines
were defining the return values both in @return and in the doxygen body.
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5756
Summary:
The Eina_Matrix_Type enum is returned by eina_matrix4_type_get and
eina_matrix2_type_get; it is not Matrix3-specific. Update doxygen
accordingly.
Reviewers: devilhorns
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5744
Summary:
This fixes some typos and misspellings, massages grammar in a few
places, tidys up a little whitespace, and fixes incorrect docs in a spot
or two.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5745
Summary:
ecore_evas: remove debug
eina: unregister log level when done with
Fixes a constant memory leak.
eina: introduce EINA_HOT and EINA_COLD
These attributes respectivelly expand to __attribute__ ((hot)) and
__attribute__ ((cold)) when available. They allow to mark functions are
being hot/cold (frequently used or not) as well as to qualify labels
within a function (likely/unlikely branches).
eo: speed-up generated calls by removing call cache
The call cache needed to by thread-local, to avoid concurrency issues.
Problem with TLS is that is adds an extra overhead, which appears to be
greater than the optimization the cache provides.
Op is naturally atomic, because it is an unsigned integer. As such, it
cannot be tempered with while another thread is reading it. When
entering the generated function, the first operation done is reading
'op'. If we have concurrency, we will have access sequences returning
either EFL_NOOP or a VALID op, because 'op' is not set until the very
end of the function, when everything has been computed. As such, we now
use the 'op' atomic integer to instore a lock-free/wait-free mechanism,
which allows to drop the TLS nature of the cache, speeding up the access
to the cache, and therefore making functions execute faster.
We don't test anymore the generation count. This can be put as a
limitation. If means that if you call efl_object_shutdown() and
re-initialize it later with different data, opcodes will be invalid.
I am not sure there is any usecase for this to ever happen.
We could move all the caches in a dedicated section, that can be
overwritten after a call to efl_object_shutdown(), but I am not sure it
will be very portable.
Benchmark: mean over 3 executions of
ELM_TEST_AUTOBOUNCE=100 time elementary_test -to genlist
```
BEFORE AFTER
------------------------------------------------------------
time (ns) 11114111647.0 9147676220.0
frames 2872.3333333333335 2904.6666666666665
time per frame (ns) 3869364.6666666665 3149535.3333333335
user time (s) 11.096666666666666 9.22
cpu (%) 22.666666666666668 18.333333333333332
```
Ref T6580
Reviewers: raster, cedric
Subscribers: cedric, jpeg
Maniphest Tasks: T6580
Differential Revision: https://phab.enlightenment.org/D5738
we can't sensibly use things like massif to track memory if we bypass
itr with mmaping -1 fd anonymous memory... so if built with valgrind
support and running under valgrind, use malloc/calloc and free so
these tools actually do something useful for these bits of memory.
so xine module plus 2 eina dbug threads didnt set up signal
blocking/masks correctly. xine use ssigprocmask not pthread_sigmask
and the other 2 didnt even bother at all. fix this so these threads
all block most of these commnly caught signals so these threads never
get them
elsewhere in efl we moved to pthread_sigmask but eina debug didn't, so
mirror the changes here too. at this point in time when we are
initting eina debug this shouldnt really matter much as we're single
threaded until this pthread_Create is called. after that tough...
we're not. signals + threads is a nightmare though... horrible
horrible...
also eina_procmis was not threadsafe so cannto use loops in different
threads at all until this was made safe. needed to disable the old
ecore_event using code in for ecore futures and create a new efl loop
message future and handler instead ... but now a quick experiment with
multiple loops in 10 threads plus mainloop have timers at least work.
i need to test more like fd handlers etc etc. but it's a step.
This has been bugging me for some time but now we are triggering new errors internally
this is appearing to end users for problems they did not cause.
Additionally I was able to improve a couple of the errors by copying the
explanation from code comments into the error message.
Shorter error logs now too :)
Under some circumstances, eina crashes when attempting to display the
backtrace, because dladdr() may yield a dli_fname that is NULL. This is
especially annoying in realease, when the backtrace is shown by default
when CRI/ERR are thrown.
@fix
Efl.Future is an EO object which means even cancelling Efl.Future
objects requires EO. So this should be done before shutting down EO,
otherwise everything fails badly.
I believe Efl.Future is going to disappear soon, but the problem will
remain: if any promise/future uses EO or anything else outside of Eina
(so, basically anything) then it needs to be canceled before shutting
down the above layers. This is the same situation as with ecore events,
for which we've introduced ecore_event_type_flush.
Ping @cedric
Summary:
The Encoding key is no longer required, all desktop files are assumed to
be UTF-8 encoded. See details at:
https://standards.freedesktop.org/desktop-entry-spec/1.1/apc.html
Fix various typos and misspellings
lintian, Debian's package checker, uses strings to check for common typos
in compiled binaries. This change fixes the ones it identified in 1.20.6.
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5584
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
As the filename is now a stringshare, also make sure virtual
files use stringshares for the filename! Also when unmapping
we still need to test whether it is copied or not as unmap
will break on less tolerant architectures.
@fix T6449
valgrind does complain about this. i'm not sure it matters but it's
safer to 0 it out in case some field is being used that we don't think
is being used that we didn't set.
Summary:
In eina_log_level_check's annotation, parameter description is missing,
so warning is occurred on doxygen
Test Plan: API Doxygen Revision
Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho
Differential Revision: https://phab.enlightenment.org/D5375
Summary: Space character is located in wrong position, so it occur doxygen warning
Test Plan: API Doxygen Revision
Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho
Differential Revision: https://phab.enlightenment.org/D5374
Before this patch, the key would always be zero and the hash would solely
rely on the rbtree to be efficient. This improve the situation by using the pointer
as the key during hash computation.
Summary:
Some parameter's name are different in annotations and statements,
so it occurs doxygen warning.
To fix it, rename that parameters.
Test Plan: API Doxygen Revision
Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho
Differential Revision: https://phab.enlightenment.org/D5327
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Putting local variable "d" under preprocessor flag "EINA_SAFETY_CHECKS" to avoid below warning, if "EINA_SAFETY_CHECKS" is disabled.
1. local variable "d" is assigned but not used.
2. If warning 1 is resolved then variable "d" will be unused.
Reviewers: raster, cedric
Reviewed By: cedric
Subscribers: jpeg, rajeshps
Differential Revision: https://phab.enlightenment.org/D5321
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary: Unsigned integer should not be compared less than zero.
Test Plan: NA
Reviewers: cedric
Subscribers: shilpasingh, jpeg
Differential Revision: https://phab.enlightenment.org/D5274
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
eina_strbuf_append_strftime()
eina_strbuf_insert_strftime()
eina_strbuf_prepend_strftime() - macro
We need these functions for implementing generic format function
interface especially for calander.
Ref T6204
Summary:
Unsigned integer should not be compared to less than zero
@fix
Test Plan: NA
Reviewers: cedric
Reviewed By: cedric
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D5269
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Test Plan: run on XP
Reviewers: jpeg, cedric, ajwillia.ms
Reviewed By: ajwillia.ms
Subscribers: ajwillia.ms
Differential Revision: https://phab.enlightenment.org/D5245
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.
But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.
Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).
@feature
This makes sure that the call to madvise is safe. On Linux it's not too
much of an issue as checks are made inside madvise, and the worst that
can happen is an error is returned (EINVAL). Not great.
But if MAP_POPULATE is not present, as is the case on *BSD, then the
internal function _eina_file_map_populate() is used for the populate
rule. In that case actual data is read and we should make sure not to
trigger a segfault or bus error.
Also, this makes sure that in case of HugeTLB we actually populate all
pages, rather than one page out of 8 (we were jumping by 16Mb instead of
2Mb).
Note: Can we get the size of a HugeTLB at runtime? We're assuming 2Mb
which might very well not be the case!
See: https://wiki.debian.org/Hugepages
Tested by disabling MAP_POPULATE and observing crashes :)
@fix
Summary:
The code in eina_debug.c requires the eina_swapX() functions on big endian platforms, so include the required header.
Test Plan: Do build on big endian platform like ppc64 or s390x.
Subscribers: kubu, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5158
Well... that's just embarassing... semaphore_destroy() actually takes
the mach task as its first parameter, not the second. This core
amazingly worked very fine on macOS earlier than Sierra.
Fixes T5245
This is a helper that creates a promise, then a future and immediately
resolves the promise, this will let the future be dispatched as usual,
from a clean main loop context.
restrict mapping /dev/zero to only eina files having a sigbus
reported. the mmap was before all our file access used eina_file i
think thus the raw mmap of it. now walk all eina files and find the
candidate and only then if it exists flag is as having a faulty i/o
backing and map the zerto pages then return, otherwise call abort.
more restricted mapping and perhaps a fix for not trapping non-efl
issues.
@fix
since we have a sigbusd handler that flags an eina file with io errors
it has to walk the file cache and every file... taking locks. if those
locks were taking already in the current thread the sighandler was
called in... we'd deadlock. since this basicallly never happens (when
do we see i/o errors really? not much)... we never saw this as it'd
also reauire this race condition to happen too. but it is a problem
waiting to happen. this fixes that by moving to recrusive locks.
@fix
These helpers are similar to eina_value_X_new(), however do not
allocate the Eina_Value, rather return it.
These are useful when the value struct storage was already there but
needs to be initialized in a single line, like as stack variables or
when returning a value.
these utilities are very useful, but names became too long. Since they
do not conflict with anything else, shorten them.
Since they were available before as inline function, provide a macro
to rename them for old source that's compiled against newer library.
EINA_VALUE_EMPTY is basically a zeroed Eina_Value, handy for declaring
and returning.
To cope with the rest of efl, free/del/flush on NULL shouldn't
complain, so flusing an empty value should be quiet.
When a virtualized file is created the file->global_map will not
point to a mmapped region, thus it's not safe to use munmap() during
the file cleanup. Only use munmap() if the file is backed by a FD.
Fixes: T5234.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
bad endian... code... see the comment in the src about why i think
this is bad as obviously the buffer pointed to is a 64bit type always
that is a pointer to something...
no point - all we are doing is having a final fallback of any tag that
starts with ! that isnt a special one like !DOCTYPE, !-- comment and
![CDATA stuff... analysers dont like these pointless calls.
found by PVS studio
this actually wasn't a bug that would cause a crash. cloning an array
access would fail as the magic check would find its an accessor not an
array. indeed a bug... but we never used this anywhere i can find.
this was cast to the correct func ptr callabck in the accessor struct
as the clone method though.. thus everyhting was happy with it
seemingly.
found by PVS studio
@fix