Selon Bram Kuijvenhoven <[EMAIL PROTECTED]>: > fedorax wrote: > > Selon Joost van der Sluis <[EMAIL PROTECTED]>: > > > >> On Sat, 2007-05-26 at 15:00 +0200, fedorax wrote: > >> > >>> I've a strange bug. In this fonction ( Which was worked perfectly from > few > >>> months an never chage ). > >>> -------------------------- > >>> procedure TFunc_Sql.List_TablesSelectionChange(Sender: TObject; User: > >> boolean); > >>> begin > >>> If List_Tables.ItemIndex<0 then List_Tables.ItemIndex:=0; > >>> T_Name:=List_Tables.Items[List_Tables.ItemIndex]; // The selected table > >> name > >>> If SQLQuery.Active Then SQLQuery.Close; // Close the precedent query > >>> SQLQuery.SQL.Text:='Select * From '+ T_Name; > >>> SQLQuery.Open; //Open to list in DbGrid > >>> end; > >>> -------------------------- > >>> The line "If SQLQuery.Active Then SQLQuery.Close;" cause an access > >> violation > >>> and close the application without visible cause. > >> My guess is that you've destroyed/freed SQLQuery somewhere before this > >> code is called. > >> > >> Joost > >> > > Not that, the SQLComponent is put on the form and no instruction exist for > free > > it. Is it possible that a bug free a component without programmer ask to it > ? > > A component is freed when its Owner is destroyed (in this case the form), so > as long as you don't free the form or SQLQuery by hand, all should be ok. > > To track the cause of the exception, you probably need to get a stacktrace; > e.g. use GDB or Lazarus itself. Hint for GDB: > > break FPC_RAISEEXCEPTION > run > ... > bt > > You can insert ShowMessage of DebugLn statements to find out what your > application is doing. > > Regards, > > Bram >
I do as you say and i put here the firts part of ( very long ) bakctrace. may be somebody can understand this ? For me i just see a problem with a memory pointer and i'm remember that memory pointer system ha'd changed few day's ago ( Lazarus won't compile and stop in this fonction ). May be a bug was introduced at this time ? I'ts apear ever on the same line of code but never at the same time. Sometime i can move move in list a long time before crash, sometime just two clicks in list are sufficient to crash. And never on a specific location in the list. I forget to specify: The message 'access violation' and others appears only if the program is compiled with gdb active in options. Without gdb no message. The program freeze and nothing is displayed. ------------------------- Breakpoint 1, 0x080607e6 in fpc_raiseexception () (gdb) backtrace #0 0x080607e6 in fpc_raiseexception () #1 0x080a471e in SYSUTILS_RUNERRORTOEXCEPT$LONGINT$POINTER$POINTER () #2 0x080634e7 in SYSTEM_HANDLEERRORADDRFRAME$LONGINT$POINTER$POINTER () #3 0xbfef4a54 in ?? () #4 0x0012b000 in ?? () #5 0x000000cc in ?? () #6 0xbfef49f4 in ?? () #7 0xbfef4a54 in ?? () #8 0x006ff220 in ?? () #9 0x0806358d in SYSTEM_HANDLEERRORFRAME$LONGINT$POINTER () #10 0x00cd9000 in ?? () #11 0x00000002 in ?? () #12 0x00cd901c in ?? () ---Type <return> to continue, or q <return> to quit--- #13 0x08064d46 in SYSTEM_TRY_CONCAT_FREE_CHUNK$PMEMCHUNK_VAR$$PMEMCHUNK_VAR () #14 0x080635aa in SYSTEM_HANDLEERROR$LONGINT () #15 0x08065509 in SYSTEM_SYSFREEMEM_FIXED$PMEMCHUNK_FIXED$$LONGINT () #16 0x00cd9000 in ?? () #17 0x000000f0 in ?? () #18 0x00cd901c in ?? () #19 0x00000002 in ?? () #20 0x006ff020 in ?? () #21 0x00000001 in ?? () #22 0x08065626 in SYSTEM_SYSFREEMEM$POINTER$$LONGINT () #23 0x00cd9020 in ?? () #24 0x00000002 in ?? () #25 0x0806575c in SYSTEM_SYSFREEMEMSIZE$POINTER$LONGINT$$LONGINT () ---Type <return> to continue, or q <return> to quit--- #26 0x001135e0 in ?? () #27 0x00000002 in ?? () #28 0x08064758 in SYSTEM_FREEMEM$POINTER$LONGINT () #29 0x0824227a in BUFDATASET_TBUFDATASET_$__FREEBLOBBUFFER$PBLOBBUFFER () #30 0x00000009 in ?? () #31 0x082407cd in BUFDATASET_TBUFDATASET_$__INTERNALCLOSE () #32 0x082179c4 in SQLDB_TCUSTOMSQLQUERY_$__INTERNALCLOSE () #33 0x006ff020 in ?? () #34 0x0821c613 in DB_TDATASET_$__CLOSECURSOR () #35 0x006ff000 in ?? () #36 0x0821dc59 in DB_TDATASET_$__SETACTIVE$BOOLEAN () #37 0x08217443 in SQLDB_TCUSTOMSQLQUERY_$__SETACTIVE$BOOLEAN () #38 0x006ff020 in ?? () ---Type <return> to continue, or q <return> to quit--- > _________________________________________________________________ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives > _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
