Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Organizer close project segfault #579

Closed
msaf1980 opened this issue Jun 5, 2017 · 4 comments
Closed

Project Organizer close project segfault #579

msaf1980 opened this issue Jun 5, 2017 · 4 comments

Comments

@msaf1980
Copy link

msaf1980 commented Jun 5, 2017

Segmentation fault when close project with enabled Project Orginizer plugin

Program received signal SIGSEGV, Segmentation fault.
0x00007fffc78d2b25 in expand_path (utf8_expanded_path=0x7ec5c0 "", select=select@entry=0) at prjorg-sidebar.c:1168
1168		foreach_slist (elem, prj_org->roots)

(gdb) backtrace
#0  0x00007fffc78d2b25 in expand_path (utf8_expanded_path=0x7ec5c0 "", select=select@entry=0) at prjorg-sidebar.c:1168
#1  0x00007fffc78d2cf2 in expand_on_idle (ptr=0x1570780) at prjorg-sidebar.c:1224
#2  0x00007ffff5061d7a in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#3  0x00007ffff50620b8 in g_main_context_iterate.isra.24 () at /lib64/libglib-2.0.so.0
#4  0x00007ffff506238a in g_main_loop_run () at /lib64/libglib-2.0.so.0
#5  0x00007ffff73ef867 in gtk_main () at /lib64/libgtk-x11-2.0.so.0
#6  0x00007ffff79a4991 in main_lib (argc=2, argv=0x7fffffffde78) at libmain.c:1233
#7  0x00007ffff4a5cb35 in __libc_start_main () at /lib64/libc.so.6
#8  0x000000000040070e in _start ()

(gdb) info frame
Stack level 0, frame at 0x7fffffffdb60:
 rip = 0x7fffc78d2b25 in expand_path (prjorg-sidebar.c:1168); saved rip 0x7fffc78d2cf2
 called by frame at 0x7fffffffdb80
 source language c.
 Arglist at 0x7fffffffdac8, args: utf8_expanded_path=0x7ec5c0 "", select=select@entry=0
 Locals at 0x7fffffffdac8, Previous frame's sp is 0x7fffffffdb60
 Saved registers:
  rbx at 0x7fffffffdb28, rbp at 0x7fffffffdb30, r12 at 0x7fffffffdb38, r13 at 0x7fffffffdb40, r14 at 0x7fffffffdb48, r15 at 0x7fffffffdb50, rip at 0x7fffffffdb58

Simply workaround - add check for blank utf8_expanded_path (function expand_path in prjorg-sidebar.c)

static gboolean expand_path(gchar *utf8_expanded_path, gboolean select)
{
        GtkTreeIter root_iter, found_iter;
        gchar *utf8_path = NULL;
        gchar **path_split;
        GSList *elem;
        GtkTreeModel *model;

        /* Fix segfault on close project */
        if (utf8_expanded_path == NULL || *utf8_expanded_path == '\0')
            return FALSE;
        /* END - Fix segfault on close project */

        model = GTK_TREE_MODEL(s_file_store);
@elextr
Copy link
Member

elextr commented Jun 5, 2017

Duplicate of #549?

@msaf1980 msaf1980 closed this as completed Jun 5, 2017
@msaf1980
Copy link
Author

msaf1980 commented Jun 5, 2017

I think, that No. Null-check-already exist.

static gboolean expand_on_idle(ExpandData *expand_data)
{
GeanyDocument *doc = document_get_current();

    if (!prj_org)
            return FALSE;

    if (geany_data->app->project == expand_data->project &&
            expand_data->expanded_paths)
    {

@codebrainz
Copy link
Member

@msaf1980 what version are you using? If using from Git, can you make sure you're using the latest?

@msaf1980
Copy link
Author

msaf1980 commented Jun 5, 2017

1.30 from http://plugins.geany.org
Rebuild plugins from git master branch resolve this/

@msaf1980 msaf1980 closed this as completed Jun 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants