Getting SCIM working with GTK over DirectFB



Hi all,


Just wanted to let you all know an issue that I was facing with
building the SCIM with GTK-DirectFB and the resolution for the same.


1) Build DirectFB with multicore support. ( Build the appropriate
linux-fusion module for your DirectFB version and configure directfb
with --enable-multi)
2) Build GTK and all the other dependent packages ( cairo, pango,
glib,atk, gtk in order).
3) Build SCIM with the GTK libs build above ( set the PKG_CONFIG_PATH,
LD_LIBRARY_PATH accordingly )


Invoking SCIM will crash the application. This happens due to the
daemon() call in scim/scim-panel-gtk.

Background of the Issue:

The multi-core support in directfb is provided libfusion and the
fusion kernel module. Libfusion organizes the shared memory data into
"WORLD"s. libfusion registers a fork handler for handling the fusion
world data. The actions possible are :

1) FORK - Copies the fusion data from the parent to the child
2) CLOSE - Closes the fusion world associated with the thread in the
child process.


The default action is (2), closing the world.


Now when SCIM/scim-panel-gtk, is invoked as daemon (by default it is),
the daemon() will do a fork() and only the child process returns to do
the work. Now, the fork handler for fusion lib has closed the fusion
world for this process. Thus this will end up in accessing a "closed
world" data, which ends up in a crash.

The Fix

There is no directfb API to change the fork handler action behaviour
for fusion lib. We have to call the libfusion function directly from
the scim to change the behavior to FORK the data.

fusion_world_set_fork_action( dfb_core_world(NULL), FFA_FORK );

or the Work around

Do not start scim/scim-panel-gtk as daemon. May need to change the
code to just return without doing anything in scim_daemon().


Thanks

Suzuki


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]