PB6.21 - Win11 - Library viewer crashes the IDE

Post bugs related to the IDE here
Kihon
New User
New User
Posts: 2
Joined: Fri Nov 07, 2025 1:41 pm

PB6.21 - Win11 - Library viewer crashes the IDE

Post by Kihon »

Hello everyone!
I`m new here but I want to report a possible issue with the PureBasic IDE.

Example:
On the OpenXMLDialog() page in the reference manual there is a dialog example called Gridbox example.
When I paste the code in the editor and I compile and run with default settings (with debug=on but without any special optimizations) the program starts to run as expected. But when I open the library viewer to inspect the XML page and I select the list item the whole IDE crashes while the compiled program still runs.

The other library views (Gadget, Window, Image) works as they should when one of the items is selected, but the Xml library page do not and crashes the IDE.

Win11
PureBasic 6.21 64bit
boddhi
Enthusiast
Enthusiast
Posts: 531
Joined: Mon Nov 15, 2010 9:53 pm

PB6.10+ : Library viewer with XML crashes the IDE

Post by boddhi »

Hello,

I don't know if this issue has already been answered in another post, but I am experiencing the same problem with the debugger (both standalone and integrated) crashing systematically when I try to display XML content via the library viewer.
This problem seems to have started with version 6.10 because it works correctly for versions x64 5.60, 5.73, 6.00, and 6.04, which I tested.
I am currently using version PB6.40b1 on Win10.
Below is the code provided in the help section, slightly modified, to illustrate the crash:

Code: Select all

#Window     = 0
#TreeGadget = 0
#XML        = 0
Procedure FillTree(*CurrentNode, CurrentSublevel)
  If XMLNodeType(*CurrentNode) = #PB_XML_Normal
    Text$ = GetXMLNodeName(*CurrentNode) + ": "
    If ExamineXMLAttributes(*CurrentNode)
      While NextXMLAttribute(*CurrentNode)
        Text$ + " Attribute:" + XMLAttributeName(*CurrentNode) + "=" + Chr(34) + XMLAttributeValue(*CurrentNode) + Chr(34) + " "
      Wend
    EndIf
    Text$+ " " + GetXMLNodeText(*CurrentNode)
    AddGadgetItem(#TreeGadget, -1, Text$, 0, CurrentSublevel)
    *ChildNode = ChildXMLNode(*CurrentNode)
    While *ChildNode <> 0
      FillTree(*ChildNode, CurrentSublevel + 1)
      *ChildNode = NextXMLNode(*ChildNode)
    Wend
  EndIf
EndProcedure

;FileName$ = OpenFileRequester("Choose XML file...", "", "XML files (*.xml)|*.xml|All files (*.*)|*.*", 0)
FileName$ = #PB_Compiler_Home+"Examples\Sources\Data\ui.xml"
If FileName$ <> ""
  If LoadXML(#XML, FileName$)
    If XMLStatus(#XML) <> #PB_XML_Success
      Message$ = "Error in the XML file:" + Chr(13)
      Message$ + "Message: " + XMLError(#XML) + Chr(13)
      Message$ + "Line: " + Str(XMLErrorLine(#XML)) + "   Character: " + Str(XMLErrorPosition(#XML))
      MessageRequester("Error", Message$)
    EndIf
    If OpenWindow(#Window, 0, 0, 500, 500, "XML Example", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
      TreeGadget(#TreeGadget, 10, 10, 480, 480)
      *MainNode = MainXMLNode(#XML)
      If *MainNode
        FillTree(*MainNode, 0)
      EndIf
      For i = 0 To CountGadgetItems(#TreeGadget) - 1
        SetGadgetItemState(#TreeGadget, i, #PB_Tree_Expanded)
      Next i
      ;
      ;
      ShowLibraryViewer("xml",#XML)
      ;
      ;
      Repeat
        Event = WaitWindowEvent()
      Until Event = #PB_Event_CloseWindow
    EndIf
  Else
    MessageRequester("Error", "The file cannot be opened.")
  EndIf
EndIf
Can anyone confirm this?
Thanks.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
HeX0R
Addict
Addict
Posts: 1257
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: PB6.21 - Win11 - Library viewer crashes the IDE

Post by HeX0R »

ouch, this is a nasty one!
It crashed the IDE and started creating uncountable pbcompiler.exe processes, better be careful before considering to try that snippet :mrgreen:
Post Reply