The moment I execute a ROPS (RemObject PascalScript) script inside a
VST (VirtualStringTree/Editor) I'm getting a seg fault.

I use an Editor to edit node columns' value. When the editor is done
it raises that OnEdited VST event (in which the ROPS function is
called and execute properly) and then the Editor object call
GetNextEditableNode. Inside the editor there is a FTree private var to
have the pointer on the VST that called this editor.

If I change the node by clicking with the mouse I have no problems
(the key press event of the editor is not raised), but if I use the
keyboard I have a seg fault.

Here sample of code... FTree after EndEditNode which execute a ROPS
script is garbaged... Now, is this a serious ROPS or VST problem or
something else?

procedure TVTOptionsEditor.EditKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
 CanAdvance: Boolean;
 node: PVirtualNode;
 temp: PVirtualNode;
 offset: Integer;
begin
 case Key of
   VK_RETURN,
   VK_UP,
   VK_DOWN:
     begin
       CanAdvance := Shift = [];
       if FEdit is TComboBox then
         CanAdvance := CanAdvance and not TComboBox(FEdit).DroppedDown;
       if CanAdvance then
       begin
         FTree.EndEditNode;
         with FTree do
         begin
           FocusedNode := GetNextEditableNode(FTree, Key <> VK_UP, False,
             False);
...
end;

I removed class function to simple function to test, it changed
nothing (just in case it caused problems)

class function TVTOptionsEditor.GetNextEditableNode(vst: TVirtualStringTree;
 const ascending, priceRequired, prodRequired: Boolean): PVirtualNode;
var
 data: ^TOptionsTreeData;
begin
 with vst do
 begin
   Result := FocusedNode;
...
end;


Here is the backtrace. The only thing I can say is that the FTree
variable has garbages (from the caller right to here; evidently).

Program received signal SIGSEGV, Segmentation fault.
$005c3a64 in TVTOPTIONSEDITOR__GETNEXTEDITABLENODE (VST=$746c7573,
ASCENDING=true, PRICEREQUIRED=false, PRODREQUIRED=false,
   pvmt=$8bef8) at uVTOptionsEditors.pas:288
288     uVTOptionsEditors.pas: No such file or directory.
       in uVTOptionsEditors.pas
Current language:  auto; currently pascal
(gdb) bt
#0  $005c3a64 in TVTOPTIONSEDITOR__GETNEXTEDITABLENODE (VST=$746c7573,
ASCENDING=true, PRICEREQUIRED=false,
   PRODREQUIRED=false, pvmt=$8bef8) at uVTOptionsEditors.pas:288
#1  $005c34b9 in TVTOPTIONSEDITOR__EDITKEYDOWN (SENDER=$13a9ce0,
KEY=13, SHIFT=[], this=$8bf90) at uVTOptionsEditors.pas:136
#2  $004a53cd in TWINCONTROL__KEYDOWN (KEY=13, SHIFT=[],
this=$13a9ce0) at wincontrol.inc:3598
#3  $004a5406 in VTREF133_VMT_CONTROLS_TWINCONTROL$$193 () at
wincontrol.inc:3607
#4  $004a572f in VTREF136_VMT_CONTROLS_TWINCONTROL$$194 () at
wincontrol.inc:3743
#5  $004a72c7 in TWINCONTROL__CNKEYDOWN (MESSAGE={MSG = 48384,
CHARCODE = 13, UNUSED = 30676, KEYDATA = 1835009, RESULT = 0},
   this=$13a9ce0) at wincontrol.inc:4789
#6  $0040c5c9 in SYSTEM_TOBJECT_$__DISPATCH$formal ()
#7  $004a72b0 in VTREF186_VMT_CONTROLS_TCONTROL$$139 () at wincontrol.inc:4777
#8  $004a4deb in VTREF124_VMT_FORMS_TCUSTOMFORM$$237 () at wincontrol.inc:3399
#9  $005c33db in TVTOPTIONSEDITOR__EDITWINDOWPROC (MESSAGE=
     {MSG = 48384, WPARAM = 2010382349, LPARAM = 1835009, RESULT = 0,
WPARAMLO = 13, WPARAMHI = 30676, LPARAMLO = 1, LPARAMHI = 28, RESULTLO
= 0, RESULTHI = 0}, this=$8bf90) at uVTOptionsEditors.pas:106
#10 $0053238b in DELIVERMESSAGE (TARGET=$13a9ce0, MESSAGE=
     {MSG = 48384, WPARAM = 2010382349, LPARAM = 1835009, RESULT = 0,
WPARAMLO = 13, WPARAMHI = 30676, LPARAMLO = 1, LPARAMHI = 28, RESULTLO
= 0, RESULTHI = 0}) at Win32Proc.pp:572
#11 $0047a4d4 in VTREF35_VMT_WIN32INT_TWIN32WIDGETSET$$185 () at
win32callback.inc:1841
#12 $77d48734 in USER32!GetDC () from /cygdrive/c/WINDOWS/system32/user32.dll
#13 $00090434 in ?? ()
#14 $00000100 in ?? ()
#15 $0000000d in ?? ()
#16 $001c0001 in ?? ()
#17 $004789d0 in CHECKMOUSEMOVEMENT () at win32callback.inc:156
#18 $77d48816 in USER32!GetDC () from /cygdrive/c/WINDOWS/system32/user32.dll
#19 $004789d0 in CHECKMOUSEMOVEMENT () at win32callback.inc:156
#20 $77d489cd in USER32!GetWindowLongW () from
/cygdrive/c/WINDOWS/system32/user32.dll
#21 $00000000 in ?? () from
#22 $004789d0 in CHECKMOUSEMOVEMENT () at win32callback.inc:156
#23 $77d496c7 in USER32!DispatchMessageA () from
/cygdrive/c/WINDOWS/system32/user32.dll
#24 $0006fe58 in ?? ()
#25 $00000001 in ?? ()
#26 $0006fe78 in ?? ()
#27 $0047c666 in TWIN32WIDGETSET__APPPROCESSMESSAGES (this=$1) at
win32object.inc:327
#28 $0047c666 in TWIN32WIDGETSET__APPPROCESSMESSAGES (this=$126bc8) at
win32object.inc:327
#29 $004237f9 in VTREF255_VMT_INTERFACEBASE_TWIDGETSET$$24 () at
application.inc:920
#30 $00423bd4 in RUNMESSAGE (parentfp=$6ff10) at application.inc:1035
#31 $00423b2f in TAPPLICATION__RUNLOOP (this=$10eb80) at application.inc:1045
#32 $0042cc53 in TWIDGETSET__APPRUN (ALOOP=$423af0
<TAPPLICATION__RUNLOOP>, this=$126bc8) at interfacebase.inc:42
#33 $00423aea in VTREF258_VMT_INTERFACEBASE_TWIDGETSET$$22 () at
application.inc:1024
#34 $00402983 in VTREF3_VMT_CONTROLS_TCONTROL$$116 () at iec.lpr:106
#35 $004174cb in SYSTEM_EXE_ENTRY ()
(gdb)

--
Alexandre Leclerc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to