If a file had changed, a new OPEN message was sent, and the
client image ID was then changed, but the LOAD message was
sent with the previous image ID. So cserve2 would not be
able to honor that request.
this changes the internal encoding of font glyphs in evas to use 4bit
uncompressed if small, or 4bit rle (run length encoded) if larger.
this caves at least 50% of memory on fonts - and more if bigger. with
large fonts (40-80pixel size) we can save in the region of 80% of
memory used for glyphs. this also happesn to allow speedups in
In cserve2, a shortcut was taken to check if two images were the
same, using memcmp() on the Evas_Image_Load_Opts struct. But it
seems some empty areas in the struct are uninitialized, potentially
making memcmp() fail when the images were actually the same.
This is a minor issue since this function is called only when
bypassing the socket wait.
Also, memset load_opts to 0 and copy all the fields to avoid
the same warning in socket send().
I'm just wondering about the performance impact vs. memcpy/memcmp.
this makes efl ignore certain env vars for thnigs and entirely removes
user modules (that no one ever used) etc. etc. to ensure that *IF* an
app is setuid, there isn't a priv escalation path that is easy.
- Invalid alloc size (typo)
- Initialized value never read (set twice)
- Potential memleak (call free(msg) in case of send error)
- Null pointer dereference (check nullity)
There are still other warnings, but I believe these are false
Being annoyed by different types of eina critical macros - CRI, CRIT,
CRITICAL -, I concluded to unify them to one. Discussed on IRC and
finally, CRI was chosen to meet the consistency with other macros -
ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
Block SIGCHLD during select().
This fixes a bug with edje_cc when EVAS_CSERVE2=1: Fixes T464.
select() used to return prematurately with EINTR because the
app received some unexpected signals. In particular SIGCHLD
is received when a child terminates, but this is not a reason
to cancel the image load.
In theory, all blocked signals in pselect() should be pending
until pselect returns, so any SIGCHLD should still trigger
the app's signal handler.
CC: raster, cedric
Maniphest Tasks: T464
Differential Revision: https://phab.enlightenment.org/D357
Nothing extraordinary here.
Most potential crashes are extremely unlikely.
- Fix CID 1113444
- Fix CID 1113442
- Fix CID 1113441 (Logically dead code, can not be NULL)
- Fix CID 1113440: Explicit null dereferenced
This is actually an impossible situation.
Fixed by checking for nullity and printing out some error
messages instead of just crashing.
- Fix CID 1113439: Dereference after null check
Logically impossible code as both idxpath and datapath
must be either set or null at the same time.
Change the if logic to tell Coverity there's no bug.
- Fix CID 1113438 (Argument cannot be negative)
Fix wrong check of return value from shm_open.
- Fix CID 1113437 (Argument cannot be negative)
Fix wrong check of return value from shm_open.
- Fix CID 1113436 (Dereference null return value)
This case really shouldn't happen.
But the extra check does not hurt.
- Fix CID 1113435 (Dereference before null check)
Check for nullity after map open.
- Fix CID 1113434 (Extra sizeof expression)
Debug buggy debug tool :)
- Fix CID 1113433 (Uninitialized scalar variable)
Insignificant issue: only prints wrong debug logs :)
- Fix CID 1113431 (Uninitialized scalar value)
Check if (!found) only to print out logs. Not a big deal
if found was invalid.
- Fix CID 1039462 (Logically dead code)
Glyphs were previously using 3 shared buffers, now reduce to 2:
- Memory pool (mempool) containing the glyph drawable data
- Index table (Shared_Index / array) containing only the
indexes of the buffers in the mempool
- Glyph_Data table (array) containing the glyphs descriptors
AS WELL as the buffer indexes.
So, we just merge the two index tables into one by using directly
objects of type Glyph_Data for the referencing of the mempool
One socket message was sent per each glyph used ... which means
a LOT of messages when text is being redrawn.
Reduce this flow of messages by triggering send() only when
50+ items are being used.
Btw, USED is a bit useless as there is no UNUSED equivalent.
Also, slightly improve debug logs.
In the client, string_get() can cause a remapping of the
strings index & mempool. This means that all pointers to
string data are invalid past that call.
Solution: add a safe_get() function that prevents remap
during search. It might prove faster also, but will
return NULL more often.
Try to reconnect to cserve2 if the socket connection was lost.
Resend some messages if necessary.
Images reload seems to be working.
Actually, the images don't change over time, so the clients just
keep the previous references to their images.
FONT RELOAD IS NOT WORKING:
- Invalid glyph data
- Infinite loop in _glyph_map_remap_check()
When new glyphs are requested from the server, they are added to
the mempool. So it is necessary to remap the font.
Unfortunately, in case of server reboot, we did not keep the mempool
so the old glyphs that were not requested again will not be valid.
Let's reuse the logic from scalecache and call cserve2
functions when the scalecache should be used.
So, now, cserve2 server will not scale any image... This is
too computationally intensive for the server's main thread.
This is not optimal but makes a hell of a lot more sense for
the moment. (since cserve2 manages the SHM segments)
cserve2 does not support load_opts properly when opening an image.
As a result, when (pre)loading a JPEG file with specific load
options (eg. w, h, region and orientation), the image buffer might
have the wrong dimensions.
So, we need to use load_opts when computing file hash key.
And, pass these load options to the loader slave,
and use them while OPENING the image. This will set
properly the geometry.
Fixes test "Preload and Prescale" in elementary_test.
Pass around "animated" flag for images that can be animated.
Fallback to local cache if the image is animated.
Implementing support for animated images in cserve2 does
not seem to make a lot of sense considering each frame must
be requested independently in real time,... and to be honest
there doesn't seem to be any valid use case anyway :)
Images and Files can be discovered by the client scanner before they
are valid (aka. loaded or opened). We want clients to ignore all
shared objects that are not ready yet, as they are in an undefined
state (values and memory might be invalid).
Shared string indexes are not repacked, since they live in a
memory pool (where the indexes can be reused).
So, the index in the table is equal to their ID. Add initial
test to check if the item at index n has the ID n.