Hello,

I tried out eio and there seems to be a bug / race with the eio...ls
functions. Running the following code on some large tree (for example
e source) will after 100-1000 directories result in this:

ERR<8329>:ecore ecore.c:459 _ecore_magic_fail()
*** ECORE ERROR: Ecore Magic Check Failed!!!
*** IN FUNCTION: ecore_pipe_write()
ERR<8329>:ecore ecore.c:461 _ecore_magic_fail()   Input handle pointer is NULL!
ERR<8329>:ecore ecore.c:472 _ecore_magic_fail() *** NAUGHTY PROGRAMMER!!!

It does not always happen after the same number of directories, nor
does it happen on small trees.
Exactly the same happens with eio_file_ls or eio_file_direct_ls.
Attached is the code that triggers the problem for me.

Thanks
hendrik
#include <stdlib.h>
#include <stdio.h>
#include <Eina.h>
#include <Ecore.h>
#include <Eio.h>

Eina_Array *dirs;
int count = 0;


void list_file(void *data, Eio_File *handler, const Eina_File_Direct_Info *info)
{
	if (info->type == EINA_FILE_DIR)
		eina_array_push(dirs, strdup(info->path));
}

void list_error(void *data, Eio_File *handler, int error)
{
	printf("error [%s]\n",strerror(error));
}

void list_done(void *data, Eio_File *handler)
{
	char *next;
	
	count++;
	
	if (eina_array_count(dirs)) {
		next = eina_array_pop(dirs);
		printf("%s - %d\n", next, count);
		eio_file_stat_ls(next, NULL, list_file, list_done, list_error, NULL);
	}
	else
		ecore_main_loop_quit();
}

int main(int argc, char *argv[])
{

	if (!eina_init())
		goto eina_error;
	if (!ecore_init())
		goto ecore_error;
	if (!eio_init())
		goto eio_error;
		
	dirs = eina_array_new(128);
	
	eio_file_stat_ls(argv[1], NULL, list_file, list_done, list_error, NULL);
	
	ecore_main_loop_begin();

	eio_shutdown();
	
	eio_error :
	ecore_shutdown();
	
	ecore_error :
	eina_shutdown();
	
	eina_error :

	return EXIT_SUCCESS;
}
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to