PDA

View Full Version : Mystery! CJSon module crashes on one system, works fine on other.



TheInsider
30-12-2023, 04:13
I have two Windows 10 Pro 64bit systems running with ThinBasic installed on each.

One is running on an AMD AMD A8-7600 CPU with 16gb RAM

The other is a Pentium(R) Dual-Core CPU (E5200 @ 2.50GHz) with 4gb RAM


The Pentium(R) Dual-Core system is the troublemaker. I can run all of the cjson scripts in 'SampleScripts' on the AMD system with no problems. ALL of them crash & exit when run on the Pentium system.

For example...
cjson_SalesOrder.tbasic crashes when it gets to this line: pOrder = cJSON_Parse(Load_File(APP_SourcePath & "cJson_SalesOrder.json"))
The four other sample scripts crash at the line: printl "Internal cJSon version.......:", cjson_version


Since I am trying to work with some json format data that I have downloaded (some weather statistics), I put together a tiny test script.

Uses "Console", "cjson"
Dim WXjson As New CCJson("C:\temp\WXjson.json")
printl "OK"
waitkey


This script works fine on my AMD system, but crashes on the Pentium system at this line: Dim WXjson As New CCJson("C:\temp\WXjson.json")


By 'crashes', I mean that the console window or the ThinDebug window just closes at that point. There are no error messages, etc.

I'm stumped as to what the glitch could be. Is there something about the older Pentium that could be incompatible with the cjson module?

ErosOlmi
30-12-2023, 14:00
Ciao,

quite difficult to understand. thinBasic CJSon module is based on the following library https://github.com/DaveGamble/cJSON but seems there is no limitation about CPU type.

What version of thinBasic are you using?
Just in case ... please download latest I'm working on from here: https://www.thinbasic.com/projects/thinbasic/thinBasic_1.11.7.0_20231228.zip
See if with this version it makes any difference.

Eros

TheInsider
30-12-2023, 23:30
Ciao,

quite difficult to understand. thinBasic CJSon module is based on the following library https://github.com/DaveGamble/cJSON but seems there is no limitation about CPU type.

What version of thinBasic are you using?
Just in case ... please download latest I'm working on from here: https://www.thinbasic.com/projects/thinbasic/thinBasic_1.11.7.0_20231228.zip
See if with this version it makes any difference.

Eros

Well, I was using the version at the top of the download page, 1.11.7.0 BETA.

The version in the link you supplied got it working. All the sample scripts work now. My own script as well. Couldn't be happier. Thank you!!


I've been converting some of my Autohotkey scripts to ThinBasic. The code is so much easier to comprehend & logical.

ErosOlmi
31-12-2023, 10:35
Great!

I was not sure new version would have solved the problem, I didn't remember any crash on that module.
Version you downloaded has a lot of new feature I'm finishing and finalize to version 1.12 that will be out by Jan 24

If you need anything else, just ask.

Ciao
Eros