[Geany-Devel] Segmentation fault when auto-close plug-in is enable [patch]

n@sk0 arrtedone at xxxxx
Wed Oct 23 12:29:27 UTC 2013


Before read : Keep in mind that i am *not* C/C++ "native" developer, and 
all message below can be just rant.

After little testing and debugging, i found that :
In on_editor_notify() function, user_data is not a valid pointer :
on_editor_notify(GObject *obj, gint scn, SCNotification *nt, gpointer 
user_data)
{
     AutocloseUserData *data = user_data;
     ...
}

After I playing for a while with this and reading demoplugin.c source, i 
found that in the autoclose.c, PluginCallback[] (line:829) is missing 
the definition for "editor-notify" event,so i added it, recompile plugin 
and now all seems to work correctly.

P.S.: I add the patch file as attachment to this mail, becouse for now i 
do not have any expiriance in commiting patches on GitHub, but tonight i 
will fix this big mistake :)

On 23/10/13 13:00, Lex Trotman wrote:
>
> Looking at the line that failed, first guess would be failure to check 
> doc is valid before using it.
>
> Cheers
> Lex
>
>
> On 23 October 2013 20:20, n at sk0 <arrtedone at gmail.com 
> <mailto:arrtedone at gmail.com>> wrote:
>
>     There is strange behaviour when Auto-close plug-in is enabled.
>
>     Steps to reproduce :
>     1. open Geany
>     2. Enable auto-close plug-in
>     3. open several files for edit
>     4. Click Ctrl+W (close document)
>     --
>
>     Expected result :
>     Currently opened document is closed.
>     --
>
>     Actual result :
>     Segmentation fault
>     --
>
>     See attached gdb backtrace for more info.
>
>     Debug info :
>     Geany-INFO: Geany 1.24 (git >= ef33175), en_US.UTF-8
>     Geany-INFO: GTK 2.24.22, GLib 2.36.3
>     Geany-INFO: System data dir: /usr/local/share/geany
>     Geany-INFO: User config dir: /home/nask0/.config/geany
>     Geany-INFO: System plugin path: /usr/local/lib/geany
>     Geany-INFO: Added filetype CUDA (57).
>     Geany-INFO: Added filetype Rust (58).
>     Geany-INFO: Added filetype Scala (59).
>     Geany-INFO: Added filetype Graphviz (60).
>     Geany-INFO: Added filetype Cython (61).
>     Geany-INFO: Added filetype Genie (62).
>     Geany-INFO: Added filetype Clojure (63).
>     Geany-INFO: Added filetype Go (64).
>     Geany-INFO: Disabling terminal support
>     Geany-INFO: Loaded:   /usr/local/lib/geany/addons.so (Addons)
>     Geany-INFO: Loaded:   /usr/local/lib/geany/autoclose.so (Auto-close)
>     Geany-INFO: Loaded:   /usr/local/lib/geany/geanylipsum.so
>     (GeanyLipsum)
>     Geany-INFO: Loaded:   /usr/local/lib/geany/geanyvc.so (GeanyVC)
>     Geany-INFO: Loaded:   /usr/local/lib/geany/htmlchars.so (HTML
>     Characters)
>     Geany-INFO: Loaded:   /usr/local/lib/geany/geanyprj.so (Project)
>     Geany-INFO: Loaded:   /usr/local/lib/geany/splitwindow.so (Split
>     Window)
>     Geany-INFO: Loaded:   /usr/local/lib/geany/treebrowser.so
>     (TreeBrowser)
>     Geany-INFO: Loaded:   /usr/local/lib/geany/xmlsnippets.so (XML
>     Snippets)
>
>
>     _______________________________________________
>     Devel mailing list
>     Devel at lists.geany.org <mailto:Devel at lists.geany.org>
>     https://lists.geany.org/cgi-bin/mailman/listinfo/devel
>
>
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20131023/65039a31/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: autoclose.c.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20131023/65039a31/attachment.bin>


More information about the Devel mailing list