Recent

Author Topic: HandleException Access violation  (Read 538 times)

tadryanom

  • New Member
  • *
  • Posts: 15
HandleException Access violation
« on: September 14, 2019, 03:28:40 pm »
Hello guys! I have a crash problem using multi thread in Lazarus, I am not sure of its origin. I am using the LibHIDAPI library to process the messages received via USB HID Raw, I also use the LibQtPas library, my environment is a Debian Linux system for ARM, respectively a Raspberry Pi computer.

Following is the error msg:
TApplication.HandleException Access violation
  Stack trace:
  $001DFF7C
  $00124AEC
  $00123984
  $001DF644
  $001E1090
  $002D0698
  $002C74D4
  $00044458
  $002C8638
  $00044458
  $00179690
  $002A0CE0
  $0029DFA4
  $002BCE40
  $002A6658
  $76DAFE3C
  $016F8798

I hope something useful can be obtained from this debug message. Sorry also if I posted in the wrong place.
« Last Edit: September 14, 2019, 08:49:08 pm by tadryanom »

Thaddy

  • Hero Member
  • *****
  • Posts: 8973
Re: HandleException Access violation
« Reply #1 on: September 14, 2019, 04:01:14 pm »
No. This doesn't give us enough information. Can you show some actual code, preferably compilable code?
Most people that want to use threading should learn to patch their jeans first: use a needle.

tadryanom

  • New Member
  • *
  • Posts: 15
Re: HandleException Access violation
« Reply #2 on: September 14, 2019, 04:08:46 pm »
Errors always vary depending on random situations.
I'll show some ...

1) ---------------------------
TApplication.HandleException Access violation
  Stack trace:
  $001DFC9C  TBASEMAP__TREECOMPAREID,  line 478 of maps.pp
  $0012480C  TAVLTREE__COMPARE,  line 1236 of laz_avl_tree.pp
  $001236A4  TAVLTREE__FIND,  line 753 of laz_avl_tree.pp
  $001DF364  TBASEMAP__FINDNODE,  line 319 of maps.pp
  $001E0DB0  TMAP__HASID,  line 718 of maps.pp
  $002D03B8  TQTGDIOBJECTS__REMOVEGDIOBJECT,  line 5151 of ./qt5/qtobjects.pas
  $002C71F4  TQTPEN__DESTROY,  line 1952 of ./qt5/qtobjects.pas
  $00044458
  $002C8358  TQTDEVICECONTEXT__DESTROY,  line 2326 of ./qt5/qtobjects.pas
  $00044458
  $001793B0  ENDPAINT,  line 240 of ./include/winapi.inc
  $002A0A00  TQTWIDGET__SLOTPAINT,  line 4180 of ./qt5/qtwidgets.pas
  $0029DCC4  TQTWIDGET__EVENTFILTER,  line 2690 of ./qt5/qtwidgets.pas
  $002BCB60  TQTABSTRACTSCROLLAREA__EVENTFILTER,  line 17066 of ./qt5/qtwidgets.pas
  $002A6378  TQTWINDOWAREA__SCROLLVIEWEVENTFILTER,  line 6740 of ./qt5/qtwidgets.pas
  $76D7EE3C
  $01BFAA60

2) ---------------------------
*** Error in `tkacesso': free(): invalid pointer: 0x00da6530 ***

3) ---------------------------
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $002C83F8  TQTDEVICECONTEXT__DESTROYOBJECTS,  line 2376 of ./qt5/qtobjects.pas
  $002C81D4  TQTDEVICECONTEXT__DESTROY,  line 2326 of ./qt5/qtobjects.pas
  $002C7E34  TQTDEVICECONTEXT__CREATE,  line 2274 of ./qt5/qtobjects.pas
  $001F192C  TQTWIDGETSET__BEGINPAINT,  line 80 of ./qt5/qtwinapi.inc
  $001785E0  BEGINPAINT,  line 42 of ./include/winapi.inc
  $002A06E0  TQTWIDGET__SLOTPAINT,  line 4148 of ./qt5/qtwidgets.pas
  $0029DB40  TQTWIDGET__EVENTFILTER,  line 2690 of ./qt5/qtwidgets.pas
  $002BC9DC  TQTABSTRACTSCROLLAREA__EVENTFILTER,  line 17066 of ./qt5/qtwidgets.pas
  $002A61F4  TQTWINDOWAREA__SCROLLVIEWEVENTFILTER,  line 6740 of ./qt5/qtwidgets.pas
  $76D73E3C
  $02708178
TApplication.HandleException Access violation
  Stack trace:
  $002C83F8  TQTDEVICECONTEXT__DESTROYOBJECTS,  line 2376 of ./qt5/qtobjects.pas
  $002C81D4  TQTDEVICECONTEXT__DESTROY,  line 2326 of ./qt5/qtobjects.pas
  $002C7E34  TQTDEVICECONTEXT__CREATE,  line 2274 of ./qt5/qtobjects.pas
  $001F192C  TQTWIDGETSET__BEGINPAINT,  line 80 of ./qt5/qtwinapi.inc
  $001785E0  BEGINPAINT,  line 42 of ./include/winapi.inc
  $002A06E0  TQTWIDGET__SLOTPAINT,  line 4148 of ./qt5/qtwidgets.pas
  $0029DB40  TQTWIDGET__EVENTFILTER,  line 2690 of ./qt5/qtwidgets.pas
  $002BC9DC  TQTABSTRACTSCROLLAREA__EVENTFILTER,  line 17066 of ./qt5/qtwidgets.pas
  $002A61F4  TQTWINDOWAREA__SCROLLVIEWEVENTFILTER,  line 6740 of ./qt5/qtwidgets.pas
  $76D73E3C
  $02708178

I can't understand why. I checked in my code all memory allocation and deallocation and everything looks OK.

Heap dump by heaptrc unit
4 memory blocks allocated : 496/504
4 memory blocks freed     : 496/504
0 unfreed memory blocks : 0
True heap size : 98304
True free heap : 98304
« Last Edit: September 14, 2019, 04:15:20 pm by tadryanom »

Thaddy

  • Hero Member
  • *****
  • Posts: 8973
Re: HandleException Access violation
« Reply #3 on: September 14, 2019, 04:24:05 pm »
This is still not sufficient (no real code).
Most people that want to use threading should learn to patch their jeans first: use a needle.

tadryanom

  • New Member
  • *
  • Posts: 15
Re: HandleException Access violation
« Reply #4 on: September 14, 2019, 04:37:48 pm »
Follows the project...


tadryanom

  • New Member
  • *
  • Posts: 15
Re: HandleException Access violation
« Reply #5 on: September 15, 2019, 01:17:42 am »
They encountered a problem with my junk code?

jamie

  • Hero Member
  • *****
  • Posts: 1997
Re: HandleException Access violation
« Reply #6 on: September 15, 2019, 03:20:06 pm »
You have that problem too ?  :)

tadryanom

  • New Member
  • *
  • Posts: 15
Re: HandleException Access violation
« Reply #7 on: September 16, 2019, 03:14:59 pm »
Can you tell me the reason for these strange errors while running by parsing the source code? Sorry, my code is bad.

tadryanom

  • New Member
  • *
  • Posts: 15
Re: HandleException Access violation
« Reply #8 on: September 16, 2019, 06:23:14 pm »
You have that problem too ?  :)

Have you had any similar problems?? Do you know its origin and/or how to solve it?

jamie

  • Hero Member
  • *****
  • Posts: 1997
Re: HandleException Access violation
« Reply #9 on: September 16, 2019, 06:53:33 pm »
I don't have a target to test with but its my guess you are not properly interfacing with the USB libs correctly..

 You need to disable parts of your code step by step until you get code that compiles and runs without bombing.

 I would start with the USB end of it.