TMapViewer Example Access Violation on Snow Leopard lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- IndianaJones · 2011-07-14 13:07 Hi all, I have tried the TMapViewer example on the Mac. But I got Access Violation. Here is the backtrace of the TMapViewer example. Can anyone have ever test with the Mac? Thanks. GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul  3 01:19:56 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB.  Type "show warranty" for details. This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ............ done (gdb) break fpc_raiseexception Breakpoint 1 at 0x2048f (gdb) run Starting program: /Users/cemzafer/lazarus- libs/mapviewer/example/project1 Reading symbols for shared libraries .+++++++++++..................... ..................................................................... done Reading symbols for shared libraries . done Reading symbols for shared libraries . done This binary has no thread support compiled in. Recompile the application with a thread-driver in the program uses clause before other units using thread. Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000004 0x0029273f in TTHREADPOOL__TERMINATE (this=0x0) at /Users/cemzafer/lazarus-libs/mapviewer/kcThreadPool.pas:299 299     for i := 0 to FPool.Count - 1 do (gdb) Current language:  auto; currently pascal (gdb) bt #0  0x0029273f in TTHREADPOOL__TERMINATE (this=0x0) at /Users/cemzafer/lazarus-libs/mapviewer/kcThreadPool.pas:299 #1  0x0006142c in TMAPVIEWER__DESTROY (vmt=0x1, this=0xa943b0) at /Users/cemzafer/lazarus-libs/mapviewer/kcMapViewer.pas:493 #2  0x0007470f in CLASSES_TCOMPONENT_$__DESTROYCOMPONENTS () #3  0x001158ab in DESTROY (this=0xa93f10, vmt=0x0) at control.inc:4259 #4  0x00107217 in DESTROY (this=0xa93f10, vmt=0x0) at wincontrol.inc:6402 #5  0x00117bb8 in DESTROY (this=0xa93f10, vmt=0x0) at customcontrol.inc:60 #6  0x00033325 in DESTROY (this=0xa93f10, vmt=0x0) at scrollingwincontrol.inc:257 #7  0x00033f79 in DESTROY (this=0xa93f10, vmt=0x1) at customform.inc:128 #8  0x0001f1c5 in SYSTEM_TOBJECT_$__FREE () #9  0x00030d0b in BEFOREFINALIZATION () at forms.pp:1737 #10 0x00024152 in SYSTEM_INTERNALEXIT () #11 0x00027195 in SYSTEM_NOTHREADERROR () #12 0x0029297f in TCUSTOMTHREAD__CREATE (AOWNER=0xae3560, vmt=0x3ec85c, this=0xa8a720) at /Users/cemzafer/lazarus- libs/mapviewer/kcThreadPool.pas:336 #13 0x002920ef in TTHREADPOOL__CREATE (FTHREADS=5, vmt=0x3ec770, this=0xae3560) at /Users/cemzafer/lazarus- libs/mapviewer/kcThreadPool.pas:212 #14 0x000612b4 in TMAPVIEWER__CREATE (AOWNER=0xa93f10, vmt=0x1, this=0xa943b0) at /Users/cemzafer/lazarus- libs/mapviewer/kcMapViewer.pas:475 #15 0x0007d6e0 in CLASSES_TREADER_$__READCOMPONENT$TCOMPONENT$$TCOMPONENT () #16 0x0007dd09 in CLASSES_TREADER_$__READDATA$TCOMPONENT () #17 0x0007418e in CLASSES_TCOMPONENT_$__READSTATE$TREADER () #18 0x0007f8f6 in CLASSES_TREADER_$__READROOTCOMPONENT$TCOMPONENT$$TCOMPONENT () #19 0x000be425 in INITCOMPONENT (CLASSTYPE=0x2db968, parentfp=0xbffff6f8) at lresources.pp:3090 #20 0x000be255 in INITLAZRESOURCECOMPONENT (INSTANCE=0xa93f10, ROOTANCESTOR=0x2d11b8) at lresources.pp:3110 #21 0x000b658b in INITRESOURCECOMPONENT (INSTANCE=0xa93f10, ROOTANCESTOR=0x2d11b8) at lresources.pp:801 #22 0x00038127 in CREATE (this=0xa93f10, AOWNER=0xa922f0, vmt=0x0) at customform.inc:1886 #23 0x0003a75e in CREATE (this=0xa93f10, THEOWNER=0xa922f0, vmt=0x1) at customform.inc:2843 #24 0x00042db4 in CREATEFORM (this=0xa922f0, INSTANCECLASS=0x2db968, REFERENCE=@0x40b4c0) at application.inc:2132 #25 0x00010d78 in PASCALMAIN () at Project1.lpr:14 #26 0x0002de85 in SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR () #27 0x00010ce9 in _start () #28 0x00010c18 in start () ---------------------------------------------------------------------- IndianaJones · 2011-07-14 16:48 The problem is related with the cThreads, so adding cThreads to the lpr, the problem was suppressed. So I have done another test with the Linux(GTK2) and the source works fine except thread and the same source code doesnt work in Mac OS X, the following line gives the error. In the kcMapViewerDESynapse unit    inherited DownloadFile(Url, str); but the same source works fine in GTK2. Thanks.