Bug 629973 - python module loader overrides/blocks application signal handlers
Summary: python module loader overrides/blocks application signal handlers
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libpeas
Version: 14
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bastien Nocera
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 629990 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-03 12:27 UTC by Daniel Berrangé
Modified: 2010-09-03 13:09 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-09-03 12:53:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2010-09-03 12:27:28 UTC
Description of problem:
If you have a application using libpeas for plugins, the moment any python plugin is activated, the application signal handlers are broken. In particular Ctrl-C is now fubar.


Version-Release number of selected component (if applicable):
libpeas-0.5.4-1.fc14.x86_64

How reproducible:
Always, with python plugins

Steps to Reproduce:
1. cat > peas.c <<EOF
#include <libpeas/peas.h>
#include <unistd.h>

int main(int argc, char **argv) {
    PeasEngine *peas = NULL;
    PeasExtensionSet *peasExt;
    gchar **peasPath;
    int i;

    g_type_init();

    peasPath = g_new0(gchar *, 2);
    peasPath[0] = g_strdup("./plugins");
    peasPath[1] = NULL;
    g_mkdir_with_parents(peasPath[0], 0777);

    peas = peas_engine_new("Demo",
                           "demo",
                           (const gchar **)peasPath);

    const GList *plugins = peas_engine_get_plugin_list(peas);
    for (i = 0 ; i < g_list_length((GList *)plugins) ; i++) {
        PeasPluginInfo *plugin = g_list_nth_data((GList*)plugins, i);
        peas_engine_load_plugin(peas, plugin);
    }

    peasExt = peas_extension_set_new(peas,
				     PEAS_TYPE_ACTIVATABLE,
				     NULL);

    peas_extension_set_call(peasExt, "activate");

    while (1) {
      sleep(1);
    }
}
EOF
2. gcc -Wall `pkg-config --libs --cflags libpeas-1.0` -o peas peas.c
3. ./peas
4. Use Ctrl-C to interrupt
5. mkdir plugins/hello
6. cat > plugins/hello/hello.py <<EOF
from gi.repository import GObject
from gi.repository import Peas

class HelloPlugin(GObject.GObject, Peas.Activatable):
    __gtype_name__ = 'HelloPlugin'

    object = GObject.property(type=GObject.GObject)

    def do_activate(self):
        print "Hello World\n"

    def do_deactivate(self):
        print "Goodbye\n"

    def do_update_state(self):
        print "Wibble\n"

EOF
7. cat > plugins/hello/hello.demo-plugin <<EOF
[Demo Plugin]
Module=hello
Loader=python
IAge=2
Name=Hello
Description=Hello
EOF
8. ./peas
9. Ctrl-C
  
Actual results:
Unable to Ctrl-C the demo program at step 9

strace shows it overriding SIGINT handlers

$ strace ./peas 2>&1 | grep SIGINT
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0x369750bec0, [], SA_RESTORER, 0x360500f440}, {SIG_DFL, [], 0}, 8) = 0


Expected results:
Plugin engine does not mess with application signal handlers

Additional info:

Comment 1 Bastien Nocera 2010-09-03 12:53:37 UTC
libpeas is a moving target. Please file the bugs upstream.

Comment 2 Daniel Berrangé 2010-09-03 13:09:15 UTC
*** Bug 629990 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.