Go to file
José Roberto de Souza d5ebe804dd edje: Fix edje box crash
When a signal change a state of a edje box to a state that was already active
and we add/del a item of edje box a crash happen.

Example:
test.edc:

collections {
	group {
		name: "box_text";
		parts {
			part {
				name: "elm.box.buttons";
				type: BOX;
				description {
					state: "default" 0.0;
					min: 0 100;
					max: 9999 100;
					align: 0 0;
					box {
						layout: "horizontal";
						min: 1 1;
					}
					visible: 0;
				}
				description {
					state: "show" 0.0;
					inherit: "default" 0.0;
					visible: 1;
				}
			}
		}
		programs {
			program {
				signal: "show,buttons";
				source: "gui";
				action: STATE_SET "show" 0.0;
				transition: ACCELERATE 1;
				target: "elm.box.buttons";
			}
			program {
				signal: "hide,buttons";
				source: "gui";
				action: STATE_SET "default" 0.0;
				transition: ACCELERATE 1;
				target: "elm.box.buttons";
			}
		}
	}
}

test.c:

//Compile with:
//gcc -g test.c -o test `pkg-config --cflags --libs elementary edje ecore`

static int count = 0;

static Eina_Bool _fill(void *data)
{
	int i;
	Evas_Object *layout = data;
	Evas_Object *edje = elm_layout_edje_get(layout);

	edje_object_part_box_remove_all(edje, "elm.box.buttons", EINA_TRUE);
	elm_layout_signal_emit(layout, "show,buttons", "gui");

	printf("_fill()\n");

	for (i = 0; i < 5; i++, count++)
	{
		Evas_Object *btn;
		char buf[50];

		btn = elm_button_add(layout);
		snprintf(buf, sizeof(buf), "button %d", count);
		elm_object_text_set(btn, buf);
		edje_object_part_box_append(edje, "elm.box.buttons", btn);
		evas_object_show(btn);
	}

	return EINA_TRUE;
}

EAPI_MAIN int
elm_main(int argc, char **argv)
{
	Evas_Object *win, *bg, *layout;

	win = elm_win_add(NULL, "test", ELM_WIN_BASIC);
	elm_win_title_set(win, "Test");
	elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   	elm_win_autodel_set(win, EINA_TRUE);

	bg = elm_bg_add(win);
	elm_bg_color_set(bg, 255, 255, 255);
	evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_win_resize_object_add(win, bg);
	evas_object_show(bg);

	layout = elm_layout_add(win);
	elm_layout_file_set(layout, "test.edj", "box_text");
	evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_show(layout);

	_fill(layout);
	ecore_timer_add(5, _fill, layout);

	evas_object_resize(win, 800, 320);
	evas_object_show(win);

	elm_run();
   	elm_shutdown();

   	return 0;
}
ELM_MAIN()

(gdb) bt
0x00000000 in ?? ()
0xb7add287 in _edje_box_layout_calculate_coords ()
   from /usr/lib/libedje.so.1
0xb7add5cd in _edje_box_layout () from /usr/lib/libedje.so.1
0xb7c98ff7 in _evas_object_box_smart_calculate ()
   from /usr/lib/libevas.so.1
0xb7c97a36 in evas_object_smart_calculate () from /usr/lib/libevas.so.1
0xb7ae1b12 in _edje_part_recalc_single () from /usr/lib/libedje.so.1
0xb7ae3380 in _edje_part_recalc () from /usr/lib/libedje.so.1
0xb7ae59ff in _edje_recalc_do () from /usr/lib/libedje.so.1
0xb7b3603a in _edje_smart_calculate () from /usr/lib/libedje.so.1
0xb7c97be2 in evas_call_smarts_calculate () from /usr/lib/libevas.so.1
0xb7cc7d88 in evas_render_updates_internal () from /usr/lib/libevas.so.1
0xb7ba7c97 in _ecore_evas_x_render () from /usr/lib/libecore_evas.so.1
0xb7ba27c6 in _ecore_evas_idle_enter () from /usr/lib/libecore_evas.so.1
0xb7c27212 in _ecore_idle_enterer_call () from /usr/lib/libecore.so.1
0xb7c28d3d in _ecore_main_loop_iterate_internal ()
   from /usr/lib/libecore.so.1
0xb7c2941f in ecore_main_loop_begin () from /usr/lib/libecore.so.1
0xb7e8def8 in elm_run () from /usr/lib/libelementary.so.1
0xb7f6f8ee in appcore_efl_main () from /usr/lib/libappcore-efl.so.1
0xb7644bb5 in app_efl_main () from /usr/lib/libcapi-appfw-application.so.0
0x08074c5a in main (argc=1, argv=0xbffffb64) at src/main_tizen.c:155

==2036== Jump to the invalid address stated on the next line
==2036==    at 0x0: ???
==2036==    by 0x44C35CC: _edje_box_layout (in /usr/lib/libedje.so.1.7.99)
==2036==    by 0x42E8FF6: _evas_object_box_smart_calculate (in /usr/lib/libevas.so.1.7.99)
==2036==    by 0x42E7A35: evas_object_smart_calculate (in /usr/lib/libevas.so.1.7.99)
==2036==    by 0x44C7B11: _edje_part_recalc_single (in /usr/lib/libedje.so.1.7.99)
==2036==    by 0x44C937F: _edje_part_recalc (in /usr/lib/libedje.so.1.7.99)
==2036==    by 0x44CB9FE: _edje_recalc_do (in /usr/lib/libedje.so.1.7.99)
==2036==    by 0x451C039: _edje_smart_calculate (in /usr/lib/libedje.so.1.7.99)
==2036==    by 0x42E7BE1: evas_call_smarts_calculate (in /usr/lib/libevas.so.1.7.99)
==2036==    by 0x4317D87: evas_render_updates_internal (in /usr/lib/libevas.so.1.7.99)
==2036==    by 0x4465C96: _ecore_evas_x_render (in /usr/lib/libecore_evas.so.1.7.99)
==2036==    by 0x44607C5: _ecore_evas_idle_enter (in /usr/lib/libecore_evas.so.1.7.99)
==2036==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

We called anim->start aftwards just to be sure to stick to something if
all fail.
2013-05-17 18:46:04 -03:00
cmakeconfig cmake : find_package should find Ecore modules using underline. Accepted 2013-05-15 15:19:48 +01:00
data Revert "eo_gdb.py: added eo_bt for eo_backtrace alias in an ugly way." 2013-05-08 22:06:10 +09:00
dbus-services merge ethumb. 2013-01-12 01:15:45 +00:00
doc Eo: Add reference functions for objects data 2013-05-01 10:37:08 +03:00
licenses add missing licenses references, fix copyright, add link result notice. 2013-01-16 21:48:14 +00:00
m4 Remove unneded special cases after lib rename 2013-05-04 10:38:55 -03:00
old Rename edbus->eldbus 2013-04-23 12:36:29 -03:00
pc Add pc file for evas drm engine. 2013-05-14 10:49:14 +01:00
pkgbuild we have spec files... lets add arch pkgbuild stuff too :) 2013-03-31 22:22:19 +09:00
po update po's 2013-05-07 10:26:43 +09:00
spec The OBS stuff is an utter catastrophe, so I'm trying to make this 2012-12-26 08:55:47 +00:00
src edje: Fix edje box crash 2013-05-17 18:46:04 -03:00
.arcconfig add .arcconfig for efl. 2013-02-26 22:06:12 +09:00
.gitignore add a global Efl_Config.h for everyone. 2013-04-24 23:43:33 +09:00
AUTHORS Rename edbus->eldbus 2013-04-23 12:36:29 -03:00
COMPLIANCE add a COMPLIANCE file for convenience. 2013-03-23 13:29:13 +09:00
COPYING Rename edbus->eldbus 2013-04-23 12:36:29 -03:00
ChangeLog Edje textblock: Fixed issue with quoted formats. (Fixes T113). 2013-05-16 11:04:01 +01:00
Makefile.am lcov-check: Enable branch coverage on newer lcov versions 2013-04-25 10:49:36 +01:00
NEWS Edje textblock: Fixed issue with quoted formats. (Fixes T113). 2013-05-16 11:04:01 +01:00
README README: call ldconfig after installing bullet. 2013-03-30 02:04:41 +09:00
autogen.sh lets remove cache files on autogen. 2012-11-12 14:44:30 +00:00
configure.ac Start on ecore_evas Drm code. 2013-05-14 10:49:14 +01:00

README

EFL 1.7.99

******************************************************************************

 FOR ANY ISSUES PLEASE EMAIL:
 enlightenment-devel@lists.sourceforge.net

******************************************************************************

EFL is a collection of libraries for handling many common tasks a
developer man have such as data structures, communication, rendering,
widgets and more.

VALGRIND DEPENDENCY:
------------------------------------------------------------------------------
EFL uses the concept of memory pools (mempool) and this will confuse
valgrind memcheck tool. By using memory pool, the memory is still
owned by EFL, then valgrind won't alert on memory leaks or use of
unused memory. EFL will use memcheck.h from valgrind to declare its
memory pools to valgrind, producing better debugging results.

However valgrind is only available to limited platforms, making us
hard to declare it a mandatory requirement. Based on
--with-profile={dev,debug} valgrind will be used if available or will
be issued a warning. You can force valgrind with --enable-valgrind, or
disable it and the warning with --disable-valgrind.

EFL does NOT link to valgrind libraries. Then there is NO runtime
dependency on valgrind.


BULLET PHYSICS DEPENDENCY:
------------------------------------------------------------------------------
EFL comes with EPhysics(a physics wrapper library) enabled by default, to
build it the user must have BulletPhysics engine installed.

More informations about BulletPhysics can be obtained in the upstream project
web site at: http://bulletphysics.org.

We have received many reports about BulletPhysics installation and distros
packages in bad shape, some without even a package. If your distro doesn't
ship a BulletPhysics package or you want to build it from source code follow the
instructions below:

* Required Packages:
You should have cmake installed. Bullet comes with autotools and cmake build
systems, do not use the autotools alternative, it's unstable, bogus and hasn't
been maintained for quite some time.

* Download the tarball from:
http://code.google.com/p/bullet/downloads/list

NOTE: the current supported version is 2.80 or greater.

* Compiling and Installing:
Uncompress it to(say) ~/bullet and:

$ cd ~/bullet/build
$ cmake .. -DBUILD_CPU_DEMOS=OFF -DBUILD_DEMOS=OFF -DBUILD_SHARED_LIBS=ON
$ make
$ sudo make install
$ sudo ldconfig

* Ubuntu Users:
Alternatively ubuntu users have the option to install the BulletPhysics from
our official EFL PPA:

https://launchpad.net/~efl/+archive/trunk

------------------------------------------------------------------------------
COMPILING AND INSTALLING:

  ./configure
  make
(do this as root unless you are installing in your users directories):
  make install

EFL build is based on "profiles". It will default to "dev" for
unreleased software and "release" for official tarballs. One can
change it with --with-profile=NAME, where NAME is one of:

  * dev: extra checks useful to test software.

  * debug: superset of dev, with debug features and assert().

  * release: optimizations and less checks so it runs faster.


CRYPTOGRAPHIC SYSTEM: EFL officially uses "openssl" library to do
signature, cipher and related. Alternatively one can use "gnutls"
(some distros are strict about licenses and want gnutls instead of
openssl) or disable it. One can change it with --with-crypto=NAME,
where NAME is one of: "openssl", "gnutls" and "none".