Crash IDE

Post bugs related to the IDE here
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Crash IDE

Post by Denis »

I use a personal launcher to run PB.
The IDE crashes systematically when it cannot find the main project file and I answer yes to search for it.
Instead of loading the .pbi file, I tried to open the .pbp project file ....

The crash happens both in X86C and X64C and even with the 5.73 LTS X64 and X86 version.

I know it's a mistake but the crash is there

OS : Microsoft Windows 11 Professionnel Build : 22000 (64 bits)
~ Carte mère ~
Fabricant : FUJITSU CLIENT COMPUTING LIMITED
Modèle : ESPRIMO D7010
~ Processeur ~
Nom : Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 threads)
Description : Intel64 Family 6 Model 165 Stepping 5
~ Mémoire physique ~
Quantité totale : 32 go



Image
Crash_IDE_17_juin_2022

Image
PB 6.00 beta 10 X64C

Image
PB 5.73 LTS X86
A+
Denis
User avatar
Bisonte
Addict
Addict
Posts: 1232
Joined: Tue Oct 09, 2007 2:15 am

Re: Crash IDE

Post by Bisonte »

please delete the folder "PureBasic" in WindowsInstallDrive:\Users\YourUsername\AppData\Roaming\ and try it again. Maybe only the config is corrupt.

:!: But dont forget to make a copy of the folder, because all the configs are in there ! :!:
PureBasic 6.10 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: Crash IDE

Post by Denis »

Hi Bisonte,

the way i use to run PB is not a standard one.

inside \Users\YourUsername\AppData\Roaming\ PureBasic, I have 21 subfolder, each for a project, ie each subfolder has its one configs to run PB (differents tools etc.). For example, Gdiplus projet has 3 files

-GdiPlus.prefs
-GdiPlus_Templates.prefs
-GdiPlus_Tools.prefs

Every time I run a project with my tool, the prefs files used by PB are the ones linked to the project.
My launcher works correctly, the IDE crash only appears when a PB file is lacking and I upload a pbp file by mistake (xml format) instead of the .pb/.pbi file.

So, I don't think the configuration is at fault because if I load the missing file (.pb), no crash happens.

Thanks anyway
A+
Denis
User avatar
ChrisR
Addict
Addict
Posts: 1150
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Crash IDE

Post by ChrisR »

Hi Denis,
Difficult without code and without reproducing, to understand the error.
To understand, I would have built and debugged the IDE with a first break point on line 422 in \PureBasicIDE\ProcedureBrowser.pb
If needed, here is how I build it: https://www.purebasic.fr/english/viewto ... 57#p579657
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: Crash IDE

Post by Denis »

Salut ChrisR,

i will try tomorow

May be my english is too bad ...


My PB launcher loads PB with the prefs files depending on the project I am opening.
So the IDE opens correctly but in one of my projects, it looks for a PB file that doesn't exist because it has another name (it's a new project misconfigured on my part).
I do yes to search for it but by mistake I loaded the pbp (xml) file instead of the PB file and that's when it crashes.
If I load the right file everything goes fine.

So the crash happens if I load a pbp file instead of the missing file.


Sorry, So in French

Mon launcheur PB charge PB avec les fichiers prefs dépendant du projet que j'ouvre.
Donc L'IDE s'ouvre correctement mais dans un de mes projets, il cherche un fichier PB qui n'existe pas car il porte un autre nom (c'est un nouveau projet mal configuré de ma part).
Je fais oui pour le rechercher mais par erreur j'ai chargé le fichier pbp (xml) au lieu du fichier PB et c'est la que ça plante.
Si je charge le bon fichier tout se passe bien.

Donc le crash se produit si je charge un fichier pbp en lieu et place du fichier absent.
C'est vraiment par erreur de ma part.

Code i use to load IDE

Code: Select all

                  IDE$ + "Purebasic.exe"
                  
                  Params$  = "/P "  + Get_pref_Ide_FileName_From_Project(Projet$) +
                  " /A " + Get_Toolpref_Ide_FileName_From_Project(Projet$)  +
                  " /T " + Get_Templatespref_Ide_FileName_From_Project(Projet$)
                  RepertoireCourant$  = GetPathPart(IDE$)
                  
                  RunProgram(IDE$, Projet$ + " " + Params$, RepertoireCourant$)
A+
Denis
User avatar
ChrisR
Addict
Addict
Posts: 1150
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Crash IDE

Post by ChrisR »

Hi Denis,
Following our PM, I managed to reproduce the bug
It's a bit twisted, it shouldn't happen often but it is always good to fix it, so I summarize here.

Here are the steps to reproduce the crash:
. Create a project (ex: CrashIDE.pbp)
. Add a file to the project (ex: CrashIDE.pb)
. Close Purebasic
. Delete the .pb file included in the project (CrashIDE.pb).
. Open the projet from explorer.
. On opening, the file (CrashIDE.pb) is not found, it offers to search for it.
. Answer yes and select the project (CrashIDE.pbp), by mistake instead of selecting a .pb file
. We get the error Invalid Memory Access.

To reproduce, without all these steps:
Open from explorer the project CrashIDE.pbp below and when it offers to search for the missing file, select the same project CrashIDE.pbp

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://www.purebasic.com/namespace" version="1.0" creator="PureBasic 6.00 Beta 10 (Windows - x64)">
  <section name="config">
    <options closefiles="1" openmode="0" name="CrashIDE"/>
  </section>
  <section name="data">
    <explorer view="C:\ProgramData\PureBasic\Examples\" pattern="0"/>
    <log show="1"/>
    <lastopen date="2022-06-21 11:15" user="ChrisR" host="PC-CHRISR"/>
  </section>
  <section name="files">
    <file name="CrashIDE.pb">
      <config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
      <fingerprint md5="d41d8cd98f00b204e9800998ecf8427e"/>
    </file>
  </section>
  <section name="targets">
    <target name="Default Target" enabled="1" default="1">
      <inputfile value=""/>
      <outputfile value=""/>
      <options xpskin="1" debug="1" optimizer="0"/>
    </target>
  </section>
</project>
Last edited by ChrisR on Tue Jun 21, 2022 11:11 am, edited 1 time in total.
User avatar
ChrisR
Addict
Addict
Posts: 1150
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Crash IDE

Post by ChrisR »

It seems to be fixed if in UserInterface.pb I change at line 2157

Code: Select all

        If CurrentTool
          CurrentTool\EventHandler(EventGadgetID)
        EndIf
by

Code: Select all

        If *ActiveSource And CurrentTool
          CurrentTool\EventHandler(EventGadgetID)
        EndIf
But it needs to be checked and to create a Pull Request if it's good.
Post Reply