Page MenuHomePhabricator

crash in drop callback will crash WM
Closed, ResolvedPublic

Description

Working on drag and drop in ecrire. If I have a crash in the drop callback, it takes out the window manger and desktop. Main menu no longer appears, cannot move or close windows. You can still re-open them. May not be a crash per se, but hangs the WM. Does not seem any means to resume other than to restart X, new E session.

Sample code, add to any window and drag a file into it to crash, or prevent WM from further action. Please keep that in mind before hand as you will have to restart E. Maybe best to test in a VM etc.

This is bad code intended to cause a crash

static Eina_Bool
_drop_cb(void *data, Evas_Object *obj EINA_UNUSED, Elm_Selection_Data *event)
{
  char *crash = NULL;
  const char *file = event->data;
  sprintf(crash,"%s",file);
}

elm_drop_target_add(elm_win,
                       ELM_SEL_FORMAT_IMAGE,
                       NULL,
                       NULL,
                       NULL,
                       NULL,
                       NULL,
                       NULL,
                       _drop_cb,
                       NULL);
zmike added a comment.Aug 15 2017, 9:01 AM

Drag a file from where?