Age | Commit message (Collapse) | Author | Files | Lines |
|
The compiling option __FORTIFY_SOURCE=2 introduced
a false ***buffer overflow*** detection when the
flexible array 'pattern' was initilized in globset.
The compiler is only complaining when the array is
in a struct that is in a struct like
struct { ...; struct { ...; char name[1]; }}
To avoid these false detections, it is enougth
to ellipsese the dimension of the array. Seems
to be the now standard way of declaring flexible
arrays when it was before an extension. So now:
struct { ...; struct { ...; char name[]; }}
works even when __FORTIFY_SOURCE=2.
Bug-AGL: SPEC-2292
Change-Id: I4b4a5df505a5357f92b9ab1657175911198ca582
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The load of dynamic bindings becomes removable.
This is a step in direction of a tiny binder library.
Also refactor AGL_DEVEL
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Change-Id: If283f431fd8a831429e717b2770464cb54476dc7
|
|
Bindings version 2 will become legacy soon.
This patch allows their removal
Change-Id: Iecad3abd0ddd714e5d55c0b935be756a29d1ca37
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: Idbadb9b7b801cb61d527addb5d3137aeb4cf6311
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
The new termination function can allow the restart
because it doesn't abort the waiting jobs.
So after calling 'jobs_exit', all threads stop.
The function 'job_start' returns.
The threads that are in blocking state, i.e. in
a call to 'jobs_enter' or 'jobs_call' are stopped.
An error status -1 with errno=EINTR is returned in
that case.
But before returning, that function calls the exit
handler if any.
Change-Id: I85a4b1976b09b18804eb681af940531ae5ace6c3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
When running gcov the running script is
sometime blocking.
GDB tells:
Thread 1 (Thread 0x7ff14e783b40 (LWP 1318)):
#0 0x00007ff14ccf334c in __lll_lock_wait_private () from /lib64/libc.so.6
#1 0x00007ff14cc70598 in malloc () from /lib64/libc.so.6
#2 0x000000000046523a in gcov_do_dump ()
#3 0x00000000004653f4 in __gcov_exit ()
#4 0x00000000004632df in _GLOBAL__sub_D_00100_1_wrap_json_get_error_position () at ../../src/wrap-json.c:1250
#5 0x00007ff14e5b5916 in _dl_fini () from /lib64/ld-linux-x86-64.so.2
#6 0x00007ff14cc255ec in __run_exit_handlers () from /lib64/libc.so.6
#7 0x00007ff14cc2571c in exit () from /lib64/libc.so.6
#8 0x00000000004069fc in on_sigchld (signum=17, info=0x7ffc3f43fa70, uctx=0x7ffc3f43f940) at ../../src/main-afb-daemon.c:411
#9 <signal handler called>
#10 0x00007ff14cc6e527 in _int_malloc () from /lib64/libc.so.6
#11 0x00007ff14cc710a2 in calloc () from /lib64/libc.so.6
#12 0x00007ff14d454ff7 in json_object_new_int () from /lib64/libjson-c.so.4
...
It means that allocating memory in exit handlers
can block!
The work around here is to force the daemon to exit
properly, i.e., not in a signal handler, by calling hello/exit
from test script -at the very end-.
Change-Id: Iee289fb1af8479628df895aac7eb021cedda4f2c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The warning maybe-uninitialized is emited only
when the optimisation level is greater than 0.
For this reason, the error was not discovered
development process. The build config is tuned
to detect that error and the error is fixed.
Change-Id: I14c8ffe6daa3d498268cfadeab20300895b3360e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
With the introduction of more compilation flags,
it becomes interesting to use a configuration
file.
The configuration file is usually "config.h".
So that renaming avoids future ambiguity.
It also reflects better what the module does.
Change-Id: I952adc1e1bf469132dc224900bd9140ccc51c58b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
This change allows to downsize the binder by
removing its internal hooking and tracing features.
Change-Id: Ifb080a7426216f6c6b1c8f8e5bf8ddd52df40a3e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
The following new switches are added:
- USE_SIG_MONITOR_DUMPSTACK activate dump stack on error
- USE_SIG_MONITOR_SIGNALS activate handling of signals
- USE_SIG_MONITOR_FOR_CALL activate monitoring of calls
- USE_SIG_MONITOR_TIMERS activate monitoring of call expiration
All enabled by default
Change-Id: I2231e5f2a8db469b7258ce14530f72b4c5f38b00
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Improves security of the binder by using
secure_getenv instead of getenv.
Change-Id: Iffd56ca65251763aacb0b9dbbaa768619cd92dd4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The event loop is renamed evmgr for "event manager"
with the intention (1) still use evloop in jobs (2)
to provide an abstract event manager/handler/loop
abstraction.
Change-Id: Ib1955f661f98df80e1c7be99e9fe26a1e06d78f6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
- The new version of 'systemd_get_event_loop' dont depends
anymore on jobs but returns a unique systemd event loop
for any threads.
- The event loop of jobs now use system.h function instead
of the opposite.
- The function 'jobs_get_sd_event' is removed
- The function 'jobs_acquire_event_manager' is introduced.
It is designed to that the current thread can manipulate
the single event manager
Change-Id: I31fe48dfe0f2cfa4d468e49338d36fea6e7e8081
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Files "afb-systemd.[ch]" are renamed "systemd.[ch]"
and their functions "afb_systemd_*" are renamed "systemd_*"
Change-Id: I8362a2ca8b71945b54c6ab9a7ead51d9c50bc8e2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: Iaa7f71dc7e5d8d525463619b4da980c827722909
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Minor cleanup
Change-Id: Iddcaf85cdc30f74e54016ce300380b33662fbc04
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
It can be usefull for debugging with gdb to
avoid the use of valgrind in the test.
This can be done by setting the environment
NOVALGRIND to any not empty value.
Also add more temporary files to ignore.
Change-Id: I853eb566607aa7ec87c356ee3acd9b1fa658b659
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
At runtime CFLAG _FORTIFY_SOURCE can provide false positive during its
checking. Change _FORTIFY_SOURCE level to 1 to avoid wrong comportement
of the package.
Change-Id: Ice4b386c253c87903e58f82a446416831cb4c6bf
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
|
|
In rare circumstances during intialization threads should wait instead
of using a null event loop. This is because no one has needed event loop at
this stage of initialization.
Change-Id: I05b6ddbc05bec50958d0981213219b1d641401a5
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
|
|
At the end, the case is never reached because
json_object_to_json_string_ext only produces
valid JSON strings and a string terminated by
'\' isn't a valid JSON string.
Change-Id: I58a6dc4d9c014487ff2dc85f7eb3dbf33ffea6b1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Added the tuto-5 that show how to benefit from the
new 'binding-object' header and its new class 'base_api_t'.
Change-Id: I81e6fd8dc5899b8e93d75530d902c0e12fba72a9
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
|
|
Base the class afb::base_api_t on the raw wrapper
class afb::api
Change-Id: Idbc4786d548ffcb0062a85b686c196758e49823c
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
|
|
New 'api' wrapper for 'afb_api_t' related functions.
Change-Id: I695b65ff3d27b0ecc0f95f660a13b7a98fd92223
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
|
|
Added move semantic and remove invalidation method as it's not used anymore
since we drop the support of APIv2.
Change-Id: If53840010d6f24d410712915051386190f55b504
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
|
|
The function was defined as many time as the header was included.
Making it a weak function fix the issue.
Also, a plain old C cast is required to make this constexpr valid.
Change-Id: I278f376e00ec6728272df4fde8ca8984195dd533
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
|
|
This new constexpr initialisation method accepts
a callback receiving a afb::req instead of a
afb_req_t.
Change-Id: I752e670b5545a9d7956987984e725b468196a6e9
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
It used the legacy callback definition of apiv2 instead
of the apiv3 one.
Change-Id: Iab281131a923ae59cfbbb50cf72fd4a5c3f11d65
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
|
|
The C++ interface is currently used only in APIv3.
Change-Id: Id1a3bca5dc8e69c1af229871e7f33192395230e7
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
|
|
Prefer the system path to include headers.
Change-Id: I08a64e8d27808084ea4592988f36b7e5099a7fc6
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
|
|
You can implement a C++ binding API by inheriting
the templated base class 'base_api_t' and overriding
the methods you want.
At the same time, the c++ files are now located in
in their own subdirectory: afb/c++
Change-Id: Ie02535961ec6b4b5ae21390cb520acb1fdc44c9e
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
|
|
Requests are already sequenced on need (noconcurrency
flag of bindings). Sequencing messages until their
completion has a side effect when dealing with events
and synchronous calls: event -> call -> reply locked
until event completion (see SPEC-2219).
This change could be reverted if events are converted
to jobs (see SPEC-2215).
Bug-AGL: SPEC-2219
Change-Id: Ia577bc54ba38291817fd5ed3e3dda1b67b2818b7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: I95fa03c430b9f488b3b5b9a9bdfc50a1ff0f0421
Signed-off-by: ronan <ronan.lemartret@iot.bzh>
|
|
The version of libmicrohttpd required is 0.9.60
at least.
Change-Id: Ia0784f5433d63d4de50654dd7577a8767578c069
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The improvement was able to track the bug
SPEC-2163 by launching:
- ./stress-server.sh --ws --valgrind
- ./stress-clients.sh --null --count 20
Bug-AGL: SPEC-2163
Change-Id: I04634f0e98ab7a28df7c1d34ecc0d9c1faf43d57
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
This changes takes care to increment the
the count of reference before using it.
Bug-AGL: SPEC-2163
Change-Id: Ia7882427eeae933eeb5030aad025ebb1da129d6f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: I3aaa92b2bfb01699ee8ae609272e93032b6f1a9d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: I53c43380902f96b7a46a6a131a956965d7cf6fbc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The internal functions blocking threads
for implementing call_sync were not releasing
the event loop, leading to deafness of the
binder.
Include a tuto-4 that reproduce the issue
on a binder with the bug and that also shows
interesting usages of the binder.
Bug-AGL: SPEC-2161
Change-Id: I83ad4d55d721a6046e798a5e06967df4dd5a7284
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
* changes:
hello3: Fix warning unused variable
afb-hsrv: Avoid call to getnameinfo
jobs: Remove conditionnal REMOVE_SYSTEMD_EVENT
jobs: Separate internal threads from others
jobs: Refactor event loop handling
afb-proto-ws: Serialize incoming message
|
|
The variable 'calling' was not used anymore.
Change-Id: I3a041cee57b2682374084003415d13a77a554fba
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
Calling getnameinfo may block the program
a long time (5s) when address is zero.
Bug-AGL: SPEC-2133
Change-Id: Id52b2989c5e996363fd4b6f39049f059a6ee97a2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The removal of the systemd event loop will be made
in later changes.
Change-Id: Ia6c52feb4969f360c31cbfc50ae991f1767f007d
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
Foreign threads, that are not started by jobs,
are allowed to use synchronous jobs_call/job_leave
(directly or indirectly).
This commit ensure that those foreign thread will
neither acquire the eventloop nor execute jobs.
Includes a tiny cleanup of remain usage.
Bug-AGL: SPEC-2089
Change-Id: I2ad7fcfe2c276e34bdc4ec0c2aa3a4207bea1854
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
This improves the arbitration of the single event
loop across threads.
Before introduction of using 'evenfd' there was
several event loop. At the current time, there
is only one. At the end, there will probably
remain only one.
Bug-AGL: SPEC-2089
Change-Id: Iac9db7cbe15b4c9c76e6e9a8f6e641ed2a9039e0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Enforce serialisation for a connection
Bug-AGL: SPEC-2089
Change-Id: Id9f261b7cc02fda78922dc511856c34b7c5bf56d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
app-framework-binder dependency on libmicrohttpd version
has been set at least to 0.9.62
Change-Id: If6af70611a5cd6236068781437e4bcbd28f368b7
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
|
|
|
|
Change-Id: I170e127ebf96d2accfdd6d6a4ec322afeaa2782f
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
Fix 1: afb_api_v3_verbose doesn't exist
Fix 2: afb_api_vverbose isn't declared
Fix 3: Ensure implicit cast of "api" and "req"
Using presupposed knowledge of internals of afb_api_t
and afb_req_t is bad when dealing with implicit
conversion in C++ and is generally not the way to
go.
Change-Id: I2630faa5ea0ae315ca95e4fd6ed6ae1a0beb01a5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Fixing names and number of samples in packaging
could be avoided.
Change-Id: I57355e68be45e1a4fdd6d76bcd44dea57ca63813
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|