[Gambas-bugtracker] Bug #2509: GB3 IDE freezes when loading debug profile.

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Tue Mar 22 12:19:43 CET 2022


http://gambaswiki.org/bugtracker/edit?object=BUG.2509&from=L21haW4-

Daniel S reported a new bug.

Summary
-------

GB3 IDE freezes when loading debug profile.

Type             : Bug
Priority         : Medium
Gambas version   : Master
Product          : Development Environment


Description
-----------

Tested version:
 - 3.17.0
 - 3.17.90 (20220320, commit: 0f0bb17a6d9312875b57ea3f632e745574c18978)

Hi,
I noticed a race condition when loading a debug profile, freezing the IDE and having to kill the Gambas IDE.

Steps to reproduce (at least on my virtual machine):
1. Start GB3
2. Load a project
3. Check Debug->Activate Profiling
4. Run the project.
5. IDE freezes. Had to be killed.
   Expected result: Opening of the profiling window of the run project.


I tried to find the problem, but just could discover that this is probably a racing condition:

Everything works as expected when putting a breakpoint just before the starting the "CProfileTask" (by debugging the GB3 IDE with a self compiled Gambas IDE) 
1. Load the GB3 project (~/gambas-master/app/src/gambas3)
2. Place a breakpoint at Sources/Debug/FProfile.class, line 53:
hTask = New CProfileTask(sPath) As "ProfileTask"
3. Run the GB3 project
4. Inside the debugged IDE: load a project (doesn't matter what), then run it and finally close it (by quitting it <Ctrl-Q>)
5. The debugger breaks on your breakpoint
6. Just continue to run with <F5>
7. The profiling shows up correctly.

To freeze the IDE:
Do the same as before, but without any breakpoints.
When quitting your project, the debugged GB3 IDE freezes.

I put some "debug messages" inside the CProfileTask.class, but only the first "CProfileTask: _New" got printed when run without any breakpoints. 
Both messages are printed with the breakpoint at Sources/Debug/FProfile.class, line 53.

Debug messages placed inside the CProfileTask.class:
-----------------------
Public Sub _new(sPath As String)
  
  Debug "CProfileTask: _New"
  $sPath = sPath
  
End

Public Sub Main() As Variant
  
  Debug "CProfileTask: _Main"
  LoadProfile()
  
  Return [$iTime, $iFunctime, $aFunc, $cFunc, $cLines, $cCount]
  
End
----------------------
The same happens when just trying to load a saved Profile with the Debug menu "Open Profile...".

It seems that the background Task CProfileTask is somehow not started. 

If somebody needs clarification, of course I will try to provide any additional information.

Regards,
Daniel


System information
------------------

Virtual machine (VmWare Workstation), running Debian (11.2 bullseye) with XFCE 4.16 as desktop environment. 
Latest updates applied.
/proc/version:  Linux version 5.10.0-12-amd64 (debian-kernel at lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.103-1 (2022-03-07)




More information about the Bugtracker mailing list