Bugs item #2113904, was opened at 2008-09-16 12:22
Message generated for change (Comment added) made by lebert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=2113904&group_id=11005

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Program
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bert Wesarg (lebert)
Assigned to: Nobody/Anonymous (nobody)
Summary: coredump if macro re-defines itself

Initial Comment:
If you define a function, which loads a macro file, which re-defines the 
current function, nedit segfaults. Because it unconditionally calls 
ProgramFree() on the yet overridden symbol.

This bug is hardly triggered, but if you memset(0) the prog->code in the 
FreeProgram() function before XtFree(), it hits you right away.

To reproduce:

===autoload.nm===
define bug {
    load_macro_file($file_path $file_name)

    t_print("yuhuu\n")
}
===autoload.nm===

===bug.menu===
nedit.macroCommands: \
        bug [EMAIL PROTECTED] Macro:F2::: {\n\
                bug()\n\
        }\n
===bug.menu===

than run:

NEDIT_HOME=$PWD ./source/nedit -import bug.menu autoload.nm

and hit F2

The only solution for now is, to remove the call to FreeProgram(). 
Unfortunately, this is in contradiction to bug #2078867 "memory leak in 
readCheckMacroString() ".



----------------------------------------------------------------------

>Comment By: Bert Wesarg (lebert)
Date: 2008-09-16 20:16

Message:
As a immediate fix, I would propose to just disable the FreeProgram() call
in case of re-definition of a macro symbol.

File Added: disable-FreeProgram.patch.txt

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-09-16 12:46

Message:
Thanks for confirmation, and good to know that there are more places.

Any ideas what we can do? A reference count for the Program comes to my
mind plus my pseudo frame idea from the other bug.


----------------------------------------------------------------------

Comment By: Tony Balinski (ajbj)
Date: 2008-09-16 12:42

Message:
You can get much the same effect by reloading a macro file, or redefining a
macro menu item whose code is in charge of a dialog box currently being
displayed. I've been bitten by this often enough, hitting Apply on the menu
entry dialog while that menu entry is already executing something.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=2113904&group_id=11005
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to