Jump to content

dkprojektai

Members
  • Content Count

    61
  • Joined

  • Last visited

Posts posted by dkprojektai


  1. Hello, I made some software in which on thread exception program exits(terminates) without any notice. What I do..

     

    Make thread...
     

      FThread := TWorkerThread.Create(true);
      FThread.FreeOnTerminate := true;
      FThread.Start;
    



    After, I work with dll in it...
     

    try
                  
       Try
    
           raise Exception.Create('Test Exception'); ----<<<< if here, no problem
    
           candidates:= Processor_analyze(proc,p,3*W, W, H,StrToInt(max_height)); ----<<<< call from dll
    
           raise Exception.Create('Test Exception'); ----<<<< if here, no problem
        
       except
          //
       end;
    
       raise Exception.Create('Test Exception'); ----<<<< if here - program terminates
    
    except
      //
    end;

     

    Can somebody help to solve? What to check? where to dig? Thanks.

     

    I have Delphi 10.2


  2. allocation number: 1804277
    program up time: 3:04 min
    type: UnicodeString
    address: $da9db60
    size: 26
    access rights: read/write
    code page: 1200
    reference counter: 1
    string length: 6
    contents: Detected text

    thread $85e8 (TOTPWorkerThread):
    671a52b3 madExcept32.dll madExceptDbg    1736 GetMemCallback
    004073e8 Main_program.exe    System          4758 @GetMem
    0040bd86 Main_program.exe    System         24650 @NewUnicodeString
    0040bfb7 Main_program.exe    System         25328 @UStrFromPWCharLen
    01268b1f Main_program.exe    Unit1          14371 TWorkerThread.Execute$ActRec.$2$Body
    0118353a Main_program.exe    OtlParallel     3440 TOmniParallelSimpleLoop.Execute[2]$ActRec.$0$Body
    01183054 Main_program.exe    OtlParallel     3380 TOmniParallelSimpleLoop.CreateForTask$ActRec.$0$Body
    0115b76f Main_program.exe    OtlTaskControl  1991 TOmniTaskExecutor.Asy_Execute
    0115a51e Main_program.exe    OtlTaskControl  1584 TOmniTask.InternalExecute
    0040a038 Main_program.exe    System         17320 TObject.GetInterface
    0040a081 Main_program.exe    System         17327 TObject.GetInterface
    00411d3b Main_program.exe    System         38375 TInterfacedObject.QueryInterface
    00410916 Main_program.exe    System         37361 @IntfCast
    0115a248 Main_program.exe    OtlTaskControl  1502 TOmniTask.Execute
    0114c624 Main_program.exe    OtlThreadPool    889 TOTPWorkerThread.ExecuteWorkItem
    0114c800 Main_program.exe    OtlThreadPool    918 TOTPWorkerThread.GetMsg
    0114c19f Main_program.exe    OtlThreadPool    846 TOTPWorkerThread.Execute
    004adbb7 Main_program.exe    madExcept            HookedTThreadExecute
    0053ca51 Main_program.exe    System.Classes 14945 ThreadProc
    0040bcd4 Main_program.exe    System         24423 ThreadWrapper
    004ada9d Main_program.exe    madExcept            CallThreadProcSafe
    004adb02 Main_program.exe    madExcept            ThreadExceptFrame
    755e0417 KERNEL32.DLL                         BaseThreadInitThunk

     

     

    I quess - convertion from widestring to string is the problem. But how to fix it?

     


  3. Hello, I have a memory leak (EurekaLog): Memory Leak: Type=UnicodeString: Ref count - 1, Content: "Archive info"; Total size=78; Count=3;

    It happens not every time.

     

    It found in:

    var
      result_text: IRecognitionResult;
    
    
    procedure TWorkerThread.Execute;
    begin
      
      ...
      OtlParallel.Parallel.For(0, 20,1).NumTasks(6).Execute(
      procedure (value: integer)
      var
        Recognition: string;
      begin
        ...
        Locking.EnterWriteLock;
        Try
          Recognition:= result_text.recognition_text >>>>> here is leak 
        Finally
          Locking.ExitWriteLock;
        End;
        ....
       end);
       ...
    
    end;
    
    
      IRecognitionResult = interface(IDispatch)
        ....
        function Get_text: String; safecall;
        property recognition_text: String read Get_text;
      end;

    Can somebody explain how to avoid this? I have tried to change line to this: Recognition := Copy(result_text.recognition_text,1,Pos(#0,result_text.recognition_text)-1)

    because dll returns info like "Archive info#0aaa,bf;ddf...", but it does not help.

     

    Thanks.


  4. I'm doubt. Here is full stack:

     

    0040f509 ANPR_VID.exe System         35017 DynArraySetLength
    0040f651 ANPR_VID.exe System         35119 @DynArraySetLength
    004c0572 ANPR_VID.exe System.Classes  7281 TStringList.SetCapacity
    004c0275 ANPR_VID.exe System.Classes  7172 TStringList.Grow
    004c033d ANPR_VID.exe System.Classes  7197 TStringList.InsertItem
    004bfed7 ANPR_VID.exe System.Classes  7008 TStringList.AddObject
    004bfe7d ANPR_VID.exe System.Classes  6995 TStringList.Add
    012816d4 ANPR_VID.exe Unit1          15764 TWorkerThread.Execute$ActRec.$2$Body
    0111970e ANPR_VID.exe OtlParallel     3440 TOmniParallelSimpleLoop.Execute[2]$ActRec.$0$Body
    01119228 ANPR_VID.exe OtlParallel     3380 TOmniParallelSimpleLoop.CreateForTask$ActRec.$0$Body
    010f1943 ANPR_VID.exe OtlTaskControl  1991 TOmniTaskExecutor.Asy_Execute
    010f06f2 ANPR_VID.exe OtlTaskControl  1584 TOmniTask.InternalExecute
    0040a6ec ANPR_VID.exe System         17320 TObject.GetInterface
    004124f3 ANPR_VID.exe System         38375 TInterfacedObject.QueryInterface
    004110ce ANPR_VID.exe System         37361 @IntfCast
    010e27f8 ANPR_VID.exe OtlThreadPool    889 TOTPWorkerThread.ExecuteWorkItem
    010e2373 ANPR_VID.exe OtlThreadPool    846 TOTPWorkerThread.Execute
    004d19c9 ANPR_VID.exe System.Classes 14945 ThreadProc
    0040c388 ANPR_VID.exe System         24423 ThreadWrapper
    755e0417 KERNEL32.DLL                      BaseThreadInitThunk


  5. Hello, I have an exception "DynArraySetLength" in code:

     

    var
    Locking: TOmniMREW;
    String_list: TStringList;
    
    procedure TWorkerThread.Execute;
    begin
      
      ...
      OtlParallel.Parallel.For(0, 20,1).NumTasks(6).Execute(
      procedure (value: integer)
      begin
        ...
        Locking.EnterReadLock;
        Try
          String_list.Add('text text'); ->>>> exception
        Finally
          Locking.ExitReadLock;
        End;
        ....
       end);
       ...
    
    end;

    What could be the problem?

     

    I Use Delphi 10.2.3 and Omnithreadlibrary 3.07.7

×