View Full Version : Lazarus 0.9.30 (Win32) crashes when debigging program loading a DLL

11-04-2011, 11:16 PM
Hi all,
I am trying to debug a program with Lazarus 0.9.30 using Win32, but am getting a crash at the point where it tries to load a dll using LoadLibrary.

I have even tried doing a backtrace using GDB via command line:

G:\MyProg\1.0\bin>gdb Render.exe
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
Reading symbols from G:\MyProg\1.0\bin/Render.exe...done.
(gdb) break fpc_exceptions
Function "fpc_exceptions" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) run
Starting program: G:\MyProg\1.0\bin/Render.exe
[New Thread 6792.0x1f28]


but GDB is crashing out right after it seem to create a thread!

Any ideas?
This is really 'bugging' me! hahaha :P

Seriously though...this is kind of a show-stopper :(


12-04-2011, 12:53 AM
I have an update:

The DLL was compressed using PECompact and Lazarus/GDB didn't like that one little bit :)

Using the uncompressed version works a treat ;)

I hope this helps someone else too...


12-04-2011, 04:12 PM
To be honest, I am finding a few cracks in GDB where it may have been worth the dev team running some GDB on GDB because whenever I have some resource error from multiple threads in parallel, the error in the application seems to crash GDB... A noteworthy one is trying to alter window contexts and global OpenGl information from a child thread when OpenGl was initialized and stores its memory in the parent/main thread...

Personally, I find multi threading quite easy in itself but its hard to debug without GDB, even when I have my own libs in play for that. Ie: I know what line crashes everything, but I dont know why ;) On the bright side, GDB works on windows for you; I had a few issues getting mine functioanl on Win32, although in ubuntu its a cinch. If only ubuntu had support for multitouch, interfaces for it and support for win32 touch display drivers then I could finally get my 100% nix network... *SIGH*

14-04-2011, 02:44 AM
I get the same problems when I try to compile any SDL projects. A default app generated from scratch works ok, but SDL seems to be a bit of a challenge to add into anything for Mac OS X + Lazarus. (Which is pretty much ALL my current projects.)