Page 1 of 1

BUG-v621 WebViewGadget example code crashes on Windows 11

Posted: Tue Mar 25, 2025 5:54 am
by skywalk
Windows 11 v24H2, all compiler options, crash after clicking button.
EDIT: Crashes with DEBUGGER ON. OK with DEBUGGER OFF.

Code: Select all

Procedure IncrementCallback(JsonParameters$)
  Static Count
  Debug #PB_Compiler_Procedure +": " + JsonParameters$
  Count + 1
  ProcedureReturn UTF8(~"{ \"count\": "+Str(Count)+ "}")
EndProcedure

Procedure ComputeCallback(JsonParameters$)
  Debug #PB_Compiler_Procedure +": " + JsonParameters$
  Dim Parameters(0)
  ; Extract the parameters from the JSON
  ParseJSON(0, JsonParameters$)
  ExtractJSONArray(JSONValue(0), Parameters())
  Debug "Parameter 1: " + Parameters(0)
  Debug "Parameter 2: " + Parameters(1)
  ProcedureReturn UTF8(Str(Parameters(0) + Parameters(1))) ;<-- CRASH WITH DEBUGGER
EndProcedure

OpenWindow(0, 100, 100, 400, 400, "Hello", #PB_Window_SystemMenu | #PB_Window_Invisible)
WebViewGadget(0, 0, 0, 400, 400)
SetGadgetText(0, "file://" + #PB_Compiler_Home + "examples/sources/Data/WebView/webview.html")
BindWebViewCallback(0, "increment", @IncrementCallback())
BindWebViewCallback(0, "compute", @ComputeCallback())
; Show the window once the webview has been fully loaded
HideWindow(0, #False)
Repeat 
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow

Re: [BUG-v621b2] WebViewGadget example code crashes on Windows 11

Posted: Tue Mar 25, 2025 9:20 am
by mk-soft
Windows 10 Pro works

Re: [BUG-v621b2] WebViewGadget example code crashes on Windows 11

Posted: Tue Mar 25, 2025 9:42 am
by Quin
As does Windows 10 IoT LTSC, 21H2.
Windows 11 24H2 does not.

Re: [BUG-v621b2] WebViewGadget example code crashes on Windows 11

Posted: Tue Mar 25, 2025 10:14 am
by CDXbow
Works OK on my laptop and desktop, both 64bit Win11 Pro version 22H2

Re: [Done] BUG-v621b2 WebViewGadget example code crashes on Windows 11

Posted: Sat Apr 12, 2025 2:29 pm
by Fred
I updated the webview component to lastest version, could you try with the next beta ?

Re: [Done] BUG-v621b2 WebViewGadget example code crashes on Windows 11

Posted: Mon Apr 14, 2025 7:20 pm
by skywalk
Hi, code is OK with DEBUGGER OFF, but still crashes below with DEBUGGER ON.

Code: Select all

Procedure IncrementCallback(JsonParameters$)
  Static Count
  Debug #PB_Compiler_Procedure +": " + JsonParameters$
  Count + 1
  ProcedureReturn UTF8(~"{ \"count\": "+Str(Count)+ "}")
EndProcedure

Procedure ComputeCallback(JsonParameters$)
  Debug #PB_Compiler_Procedure +": " + JsonParameters$
  Dim Parameters(0)
  ; Extract the parameters from the JSON
  ParseJSON(0, JsonParameters$)
  ExtractJSONArray(JSONValue(0), Parameters())
  Debug "Parameter 1: " + Parameters(0)
  Debug "Parameter 2: " + Parameters(1)
  ProcedureReturn UTF8(Str(Parameters(0) + Parameters(1))) ;<-- CRASH WITH DEBUGGER
EndProcedure

OpenWindow(0, 100, 100, 400, 400, "Hello", #PB_Window_SystemMenu | #PB_Window_Invisible)
WebViewGadget(0, 0, 0, 400, 400)
SetGadgetText(0, "file://" + #PB_Compiler_Home + "examples/sources/Data/WebView/webview.html")
BindWebViewCallback(0, "increment", @IncrementCallback())
BindWebViewCallback(0, "compute", @ComputeCallback())
; Show the window once the webview has been fully loaded
HideWindow(0, #False)
Repeat 
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow

Re: [Done] BUG-v621b2 WebViewGadget example code crashes on Windows 11

Posted: Mon Apr 14, 2025 9:02 pm
by Little John
skywalk wrote: Mon Apr 14, 2025 7:20 pm Hi, code is OK with DEBUGGER OFF, but still crashes below with DEBUGGER ON.
Confirmed with PB 6.21 beta 5 (x64) on Windows 11 Pro.

Re: [Done] BUG-v621b2 WebViewGadget example code crashes on Windows 11

Posted: Fri Apr 18, 2025 8:09 pm
by Little John
Little John wrote: Mon Apr 14, 2025 9:02 pm
skywalk wrote: Mon Apr 14, 2025 7:20 pm Hi, code is OK with DEBUGGER OFF, but still crashes below with DEBUGGER ON.
Confirmed with PB 6.21 beta 5 (x64) on Windows 11 Pro.
Still the same problem here with beta 6.

Re: BUG-v621b8 WebViewGadget example code crashes on Windows 11

Posted: Wed Jun 11, 2025 2:42 pm
by Marco2007
6.21 final -> no crash here:
Windows 11 Pro 64 bit, 24H2 - 26100.4349

Re: BUG-v621 WebViewGadget example code crashes on Windows 11

Posted: Sun Jun 22, 2025 3:40 pm
by skywalk
V621 still crashes with DEBUGGER ON.