Page MenuHomePhabricator

efl-mono: examples initialized with Components.Basic fail to run
Open, HighPublic

Description

Build the Core Events tutorial:
https://git.enlightenment.org/tools/examples.git/tree/reference/csharp/core/src/core_event.cs
It currently initializes UI components, but it does not have to, so change the last line to:

example.Launch(Efl.Csharp.Components.Basic);

After this change, the program does not run anymore. It prints this:

CRI<50219>: ../src/lib/eina/eina_share_common.c:559 _eina_share_common_node_from_str() *** Eina Magic Check Failed at 0x55953ad2440c !!!
    Input handle is wrong type.
    Expected: 98761254 - Eina Stringshare Node
    Supplied: 00005595 - (unknown)


CRI<50219>:eina_stringshare ../src/lib/eina/eina_stringshare.c:573 eina_stringshare_del() EEEK trying to del non-shared stringshare "/home/xartigas/repos/examples/build-debug/subprojects/csharp-core/src/efl_reference_core_event.exe"

And locks up.

segfaultxavi triaged this task as High priority.

A guess into the blue, is it possible that in efl_csharp_application.cs:102 the command line args are not stringshares, but ecore expects stringshares ? (This was changed at some point, and c# was likely not adjusted)

The problem is with the marshalling of array<stringshare>, which is the value expected by CommandLine.SetCommandArray. It is being generated as Eina.Array<System.String>. While we don't expect C# users to deal with stringshares directly, they should be marshalled correctly instead of just being passed to C.

It works with UI because elm_init does this call for us and when we call, it never tries to use the strings as stringshare.