Commit Graph

33 Commits

Author SHA1 Message Date
Carsten Haitzler 07138e1e1d ecore exe - fig signal block to unblock again - some sys dont on exec
it seems some libc's or systes dont reset signal mask blocks on
exec(). this unblocks manuaklly jus befor eexec, moves blocking to
before fork and adds a "nuke all signal handlers" in the child process.

fixes T8797
2020-08-28 13:50:49 +01:00
Carsten Haitzler 31c343b77c efl/ecore exe - more paranoia - block sig handlers between fork + exec
in theory signal handlers could kick in after fork and before exec...
so block them until we're exec'd or exited so they don't change any
program state.
2020-08-21 09:18:23 +01:00
Carsten Haitzler 4b4c208d99 ecore - don't do anything with heap between fork and exec
this avoids a possibgle deadlock if a malloc impl is holding a lock
and has not released it at the time we fork.

@fix
2020-08-20 08:52:32 +01:00
Elyes HAOUAS 1fd0435f21 Get rid of trailing whitespaces (4 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12002
2020-06-23 10:29:14 +02:00
Carsten Haitzler 72a8a2ce40 ecore_exe/efl_exe - implement exit with parent on bsds with procctl 2020-01-15 12:14:31 +00:00
Carsten Haitzler cf9b1fda05 ecore exe - remove useless fd closing before _exit()
we call _exit() right after closing some fd's - don't bother. they
might already be closed anyway and they will all be closed at exit
either way...
2019-12-11 15:28:12 +00:00
Carsten Haitzler 1127409564 eina - add portable close all fd's we don't need function
close all fd's starting at a given fd and then leving out an exception
list specially passed, if any. useful for fork+exec. this uses it in
efl's fork+exec paths.

@feat
2019-11-27 16:52:49 +00:00
Mike Blumenkrantz 632bd45825 efl.loop_timer: rename all methods/properties/events
Summary:
avoid potential future conflict by not using conflict-able names

ref T7731

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7731

Differential Revision: https://phab.enlightenment.org/D8256
2019-03-08 16:38:46 +01:00
Andy Williams 9a4eedb078 Remove all ocurrences of SPANK from our user facing errors.
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 :)
2017-12-22 11:18:46 +00:00
Carsten Haitzler 04a01c13af ecore/efl loop. remove internal ecore_timer legacy api usage for eflloop
efl.loop was still using legacy ecore_timer_* calls inside. of course
this is a big no-no if we are to allow multiple loops, so clean this
up and convert them to efl.loop.timers.
2017-12-21 17:55:03 +09:00
Carsten Haitzler 5dd52fd09b ecore - begin moving data into the efl loop data in the object
we really should have data inside the loop object, so begin moving it
one small thing at a time. this is the basics that will allow multiple
efl loops. make an eo efl object and class for fd handlers that is efl loop
bound make fd handlers really bound to their parent loop and not global  as
well as have a nice class/obj. create an message queue per loop and
put legacy ecore events on top of it... and a lot more.

this is not 100% done, but it's a lot of the core and groundwork.
various ecore_timer_add(), ecore_diler_add() etc. need changes.

The following still need doing:

  ecore_timer (internal usage for sure)
  ecore_idler (internal usage for sure)
  ecore_idle_enterer
  ecore_idle_exiter
  ecore_pollers? (is the new efl loop stuff ok?)
  ecore_exe (fork/spawn from any thread and track exe from that thread?)
  ecore_signal code
  ecore_throttle (should we have a single global too? we have per loop)
  ecore_app ? (should every loop be given its own argv/argc?)

Lots of internal ecore code uses/calls these legacy calls and we
should have efl loop replacements and/or use the ones we have

The following will bedifferently designed for loop to loop
control/messaging/ipc:

  ecore_thread
  ecore_pipe
2017-12-15 14:16:53 +09:00
Mike Blumenkrantz 7cdbe6e029 ecore: reformat ecore_exe_posix.c 2017-11-21 12:31:30 -05:00
Carsten Haitzler d136961e3e ecore exe - add an "isolate io"f lag for sending io to /dev/null
this is useful for security to disallow child processes access to
stdio/err of the parent process.

@feature
2017-09-23 22:44:17 +09:00
Carsten Haitzler dc137aba43 ecore exe - fix fix malloc fail handling
for both ecore_exe_win32.c and ecore_exe_posix.c when the rare case
(basically almost never) that malloc fails for the exe read/err
buffers also set the data size to 0 so it doesn't lie with a NULL ptr
for data.

@fix
2017-09-15 07:44:58 +09:00
Cedric BAIL a10a1fa641 ecore: update buffer size before allocation, not after. 2017-09-14 11:46:28 -07:00
Cedric BAIL 024c6a9fc3 efl: silent warnings shown on solaris due to missing header files. 2017-09-14 09:59:02 -07:00
Carsten Haitzler f53ea559a1 ecore_exe - fix failed finalize fork to reutrn NULL not ecore_exe_free
dont delete the obj during finalize... just retyurn NULL to fail.
fork() failed for me so i found this... ask not why fork failed... but
it did... and thus found this error handling case.

@fix
2017-09-02 22:33:00 +09:00
Carsten Haitzler fe6dc2000d ecore exe - pisix - handle malloc fails
handle malloc fails better
@fix
2017-07-24 16:59:53 +09:00
Carsten Haitzler b47cbdcb65 ecore_exe - handle realloc failures by complaining and rolling back
@fix
2017-07-24 14:10:17 +09:00
Cedric BAIL 712f7e878b ecore: use new API eina_file_close_on_exec. 2017-04-18 16:55:31 -07:00
Carsten Haitzler b3361f1aad ecore exe - handle scope data get null returns when ppl do bad things
peolpe using ecore_exe in threads... for example.
2016-12-01 08:49:25 +09:00
Carsten Haitzler 973eaedf51 improve responsivness of timer sleeping threads for vsync with prctl
prctl allows us on some platforms to request a thread be woken up more
agressively e.g. due to a timeout bu setting timerslack. since we use
a dedicated thread just for vsync events, this is a very good idea to
ask the kernel to be as exact as possible for this thread as it only
wakes up once per frame (or should only) and accuracy is important. so
use this.

also improve prctl checks to be more explicit in configure.ac and use
these ifdefs in ecore exe too where prctl is used as well.

@feature
2016-10-28 22:58:36 +09:00
Vitor Sousa f02ff462e7 efl callbacks: update some events calls to no longer trigger legacy callbacks 2016-08-30 13:59:59 -03:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Carsten Haitzler 84a4870d5b ecore exe: don't allocate inside fork to avoid issues with mem debuggers
so i've been doing some debugging and having a mem debugger that
preloads and tracks allocs means you need locks, but locks can do
nasty things after forks + threads.... esp if threads held locks.

this allows mem debugging with preloads easily and doesn't muck things
up.
2016-04-18 21:46:25 +09:00
Tom Hacohen f21ade6123 Automatic migration to Eo4.
I just ran my script (email to follow) to migrate all of the EFL
automatically. This commit is *only* the automatic conversion, so it can
be easily reverted and re-run.
2016-03-03 09:58:08 +00:00
Srivardhan Hebbar 01e42f86ab ecore_exe: correcting spelling mistake in comment.
Summary:
Corrected the spelling mistake of mechanism.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3152

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-09 10:00:32 +02:00
Srivardhan Hebbar 826998c15e ecore_exe: fix memory leak on realloc.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3091

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-09-23 14:03:34 -07:00
Tom Hacohen 1a58ad78ab Ecore exe: Mark obj as unused. 2014-09-02 13:23:41 +01:00
Tom Hacohen e5ed4b7f04 Ecore exe: Fix ecore_exe_send (on posix). 2014-09-02 12:56:54 +01:00
Tom Hacohen 686acd88f7 Ecore exe: refactor and fix compilation on windows.
This is the first step towards splitting it nicely. This fixes
compilation on windows (or so it seems from my testing) and takes out
all the platform specific code (posix included) out of the main source
file.
2014-08-27 15:14:17 +01:00