In few words: my code was working good compiled with 64bit version of lazarus. I opened the same project with 32bit and I had this problem. I reopened the same files (already modified with 32 bit version) with 64bit, and I had a lot of issues. GDB crashing and exe project remaining in memory with no hope to close it from taskmanager, reboot was necessary.
I created a new project copying the units and everything started to work fine.
So I tried also to copy lpi, lpr, lps, res files coming from an old 64 bit version (not touched from the 32) in the ruined project and it came back to work fine (compiling with 64bit).
Yes, I am pretty sure that it is a bug, but it is very difficult to create a minimal project to reproduce it.