This API is what could be used by all EFL library for their exposed
type (Evas_Object, Ecore_Timer, Ecore_Animator, Eio_File, ...). The
purpose of Eina_Object is to provide an "obscure" pointer that is
infact an ID with a generation count that will never be dereferenced
directly.
This provide the benefit of always accessing a living object
with 1/256 chance to being the expected generation of it, that will
always be of the right type.
It also provide asynchronous repacking ability (still highly
inefficient, but not really hard to improve), simple inheritance
with constructor/destructor and link between object.
All this implementation is highly open for comment, idea, review,
fix and change. I didn't got the time to write a sample test right
now. Maybe will come tomorrow. Same for docs.
SVN revision: 58562
TODO: fix docs (but today, eina doc need some love again)
use iconv and handle encoding (can get entity-to-utf8 from evas)
description of what to do at :
http://marc.info/?l=enlightenment-devel&m=129975452006699&w=3
NOTE: this mean this API is not stable yet and will be broken soon.
SVN revision: 58387
the only restriction here is that eina_error_msg_register cannot be used internally by eina prior to stringshare init, but since this does not happen currently there is no problem :)
SVN revision: 57861
Fix a compilation failure when --disable-posix-threads
--disable-valgrind are passed to configure
When --disable-posix-threads --disable-valgrind are passed
to configure, a label is at the end of a block. Just add a
return to fix that problem.
SVN revision: 57290
Added standalone continuation bytes tests.
Added isolated starting sequences tests
Added incomplete sequences tests
Added Overlong representations tests.
And I think that's it. Still need to add tests for surrogate pairs.
SVN revision: 57123
It's the functions from Evas_Encoding that have been renamed.
I also added support for 6byte UTF-8 conversion (Eina_Unicode->UTF-8).
SVN revision: 57093
* use uintptr_t where needed.
Please someone check if the compilation is still good on linux (I'm on
Windows), to see if a header must be included for uintptr_t or not.
SVN revision: 55479
Subject: [E-devel] [PATCH] eina share common check for node type
Hello, recentely I've been experiencing a lot of segfaults when running
an Elementary application which uses a genlist with some swallowed parts
in which I put some elm icons (png files).
When running it I often get crashes... Debugging it I found this:
=========
CRI<14207>: eina_share_common.c:561 _eina_share_common_node_from_str()
*** Eina Magic Check Failed !!!
Input handle is wrong type
Expected: 98761254 - Eina Stringshare Node
Supplied: 6e657070 - (unknown)
*** NAUGHTY PROGRAMMER!!!
*** SPANK SPANK SPANK!!!
*** Now go fix your code. Tut tut tut!
//DEBUG: Node referencies 622869060 (slen: 1145307236)
Program received signal SIGSEGV, Segmentation fault.
eina_share_common_del (share=0x65c810, str=0x7ffff1219150
"5hhu %5hu '%
s'\n")
at eina_share_common.c:858
858 node->references--;
=========
So it seems that edje tries to delete an invalid eina_share_common
string (is this a bug that should be fixed or is it
theme-dependent?),
and so the "node" pointer in eina share is not valid...
However eina never checks for its validity, so it seg-faults...
The attached patch fix this issue, setting the node to null when its
magic is not valid, and then always checking for its validity.
Is this fine?
Full stack trace:
#0 eina_share_common_del (share=0x65c810, str=0x7ffff1219150 "5hhu %5hu
'%s'\n")
at eina_share_common.c:858
#1 0x00007ffff120e047 in eina_stringshare_del (str=0x7ffff1219150
"5hhu
%5hu '%s'\n")
at eina_stringshare.c:632
#2 0x00007ffff1e1f7bc in _edje_text_recalc_apply (ed=0x95b900,
ep=0x70c3a0,
params=0x70c500, chosen_desc=<value optimized out>) at
edje_text.c:556
#3 0x00007ffff1de402d in _edje_part_recalc (ed=0x95b900,
ep=0x70c3a0,
flags=3)
at edje_calc.c:2007
#4 0x00007ffff1de4d86 in _edje_recalc_do (ed=0x95b900) at
edje_calc.c:268
#5 0x00007ffff1e25c7d in edje_object_part_swallow (obj=<value
optimized
out>,
part=0x7fffe001484c "elm.swallow.icon", obj_swallow=0x7fffe0017860)
at edje_util.c:2300
#6 0x00007ffff1b5d5fc in _item_realize (it=0x7fffe0016ed0,
in=10,
calc=1)
at elm_genlist.c:1489
#7 0x00007ffff1b5db89 in _item_block_recalc (itb=0x95b6a0,
in=<value
optimized out>,
qadd=<value optimized out>, norender=<value optimized out>) at
elm_genlist.c:1609
#8 0x00007ffff1b5e329 in _queue_proecess (wd=0x721b70,
norender=<value
optimized out>)
at elm_genlist.c:2425
#9 0x00007ffff1b5e567 in _item_queue (wd=0x721b70, it=<value
optimized
out>)
at elm_genlist.c:2476
#10 0x00007ffff1b5ead9 in elm_genlist_item_append (obj=<value
optimized
out>,
itc=0x7ffff2977040, data=0x8fed90, parent=0x0,
flags=ELM_GENLIST_ITEM_NONE,
func=<value optimized out>, func_data=0x0) at elm_genlist.c:2528
[eina-share-common-del-check-for-node.patch text/x-patch
(1.2KB)]
Index: src/lib/eina_share_common.c
===================================================================
--- src/lib/eina_share_common.c(revisione 55018)
+++ src/lib/eina_share_common.c(copia locale)
@@ -558,7 +558,7 @@
const size_t offset = offsetof(Eina_Share_Common_Node, str);
node = (Eina_Share_Common_Node *)(str - offset);
- EINA_MAGIC_CHECK_SHARE_COMMON_NODE(node, node_magic, );
+ EINA_MAGIC_CHECK_SHARE_COMMON_NODE(node, node_magic, node
= NULL);
return node;
(void) node_magic; /* When magic are disable, node_magic is
unused, this remove a warning. */
@@ -821,6 +821,7 @@
SHARE_COMMON_LOCK_BIG();
node = _eina_share_common_node_from_str(str,
share->node_magic);
+ if (!node) return str;
node->references++;
DBG("str=%p refs=%u", str, node->references);
@@ -847,6 +848,9 @@
SHARE_COMMON_LOCK_BIG();
node = _eina_share_common_node_from_str(str,
share->node_magic);
+ if (!node)
+ return;
+
slen = node->length;
eina_share_common_population_del(share, slen);
if (node->references > 1)
@@ -901,6 +905,7 @@
return -1;
node = _eina_share_common_node_from_str(str,
share->node_magic);
+ if (!node) return 0;
return node->length;
}
SVN revision: 55265
NOTE: to prevent ABI break, I added the old symbol in eina_abi.c.
So binary/library using eina_array_clean should continue to work
without any problem.
SVN revision: 55068
Passing null to the second parameter is the only way to unset the data,
so it should not have EINA_ARG_NONNULL to the data parameter
SVN revision: 54997
Including eina_log.h in eina_inlist.c
Removing warning:
warning: implicit declaration of function ‘EINA_LOG_ERR’
If you do not include it, and compile eina with safety checks disabled,
Evas and Elementary will not find the EINA_LOG_ERR symbol when
compiling
SVN revision: 54995
Subject: Re: [e-users] eina: sandbox violation on emerge
On 11/21/2010 12:14 AM, P Purkayastha wrote:
> Hi,
> it seems eina is triggering a sandbox violation on emerge. Essentially
> it tries to remove a file present in / while installing. Seems to be
> something new added in revision r54731:
>
http://trac.enlightenment.org/e/changeset/54731/trunk/eina/src/modules/mp
> The build log is attached.
Replacing the $(controllerdir) with $(DESTDIR)$(controllerdir) makes
portage happy, and the installation succeeds:
cd "$S/src/modules/mp"
find . -name Makefile.am -exec sed -i -e '/rm -f
\$(controllerdir)/s/\$/\$(DESTDIR)\$/' {} \;
SVN revision: 54853
rest of the iterator API and usage.
WARNING !!! THIS IS REALLY BAD BUT FOR CONSISTENCY, I THINK THAT THIS
API BREAK WAS NEEDED. IN FACT IT'S MORE AN ABI BREAK AS IT WILL NOT
TRIGGER WARNING OR ERROR IN CURRENT PROGRAM USING
eina_tiler_iterator_new SO YOU ARE WARNED !
Reported by playya <frederik.sdun@googlemail.com>.
SVN revision: 54153
*all struct members are aligned and spaced
*all post-function macros are force-spaced
*all post-function macros are parsed
*all macro definitions are backslash aligned
SVN revision: 53775
When we push a memory to the trash stack we mark it as unaccessable. So we
should mark it as accessible before returning it to the user.
SVN revision: 53427
Because mempools generally allocate a big memory area and distribute chunks of
that area to the users, valgrind can not know about logical invalid access. By
using some valgrind macros we can tell valgrind about mempools and which area
can be accessed or not.
To start with I have just done valgrind integration on chained mempool but soon
it will be done for one_big too.
The code below is an example on which valgrind wouldn't complain without this
patch:
@code
#include <Eina.h>
int
main(int argc, char *argv[])
{
int i, *pool[4];
Eina_Mempool *mp;
eina_init();
mp = eina_mempool_add("chained_mempool", "test", NULL, sizeof(int), 4);
for (i = 0; i < 4; i++) {
pool[i] = eina_mempool_malloc(mp, sizeof(int));
*pool[i] = i;
}
printf("Valid mp pointer: pool[0] = %d\n", *pool[0]);
eina_mempool_free(mp, pool[0]);
printf("Freed mp pointer: pool[0] = %d\n", *pool[0]);
for (i = 1; i < 4; i++)
eina_mempool_free(mp, pool[i]);
eina_mempool_del(mp);
eina_shutdown();
return 0;
}
@endcode
SVN revision: 53405
* it is valid to use eina_log_threads_enable() without
eina_threads_init(), so call eina_log_threads_init() in that case.
* pthread_spin_init() returns 0 on success! check that and report any errors.
SVN revision: 53169