HP Forums
[Free42] ASTO 00 bug - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: [Free42] ASTO 00 bug (/thread-14340.html)



[Free42] ASTO 00 bug - Werner - 01-09-2020 03:46 PM

Try this, Free42 2.5.11 iOS13.3 (but also on DM42 v3.14)

Code:
>LBL "TRY"
 1
 ENTER
 NEWMAT
 LSTO "REGS"
 "ABCDEF"
 ASTO 00
 RCL 00
 END

It ends up showing ""
Storing a number in R00 works.

I first thought this was a problem with LSTO, but it doesn't work even if you use STO "REGS" instead.

Cheers, Werner


RE: [Free42] ASTO 00 bug - Thomas Okken - 01-09-2020 04:38 PM

(01-09-2020 03:46 PM)Werner Wrote:  Try this, Free42 2.5.11 iOS13.3 (but also on DM42 v3.14)

Confirmed. It appears to happen whenever there is a copy of REGS on the stack; even RCL "REGS" "ABCDEF" ASTO 00 RCL 00 will do it.


RE: [Free42] ASTO 00 bug - Thomas Okken - 01-09-2020 06:30 PM

Code:
thomas@thomas-VirtualBox:~/free42$ git diff
diff --git a/common/core_sto_rcl.cc b/common/core_sto_rcl.cc
index 3ac0144b..1679e923 100644
--- a/common/core_sto_rcl.cc
+++ b/common/core_sto_rcl.cc
@@ -390,11 +390,11 @@ int generic_sto(arg_struct *arg, char operation) {
                 if (num >= size)
                     return ERR_SIZE_ERROR;
                 if (reg_x->type == TYPE_STRING) {
+                    if (!disentangle((vartype *) rm))
+                        return ERR_INSUFFICIENT_MEMORY;
                     vartype_string *vs = (vartype_string *) reg_x;
                     phloat *ds = rm->array->data + num;
                     int len, i;
-                    if (!disentangle((vartype *) rm))
-                        return ERR_INSUFFICIENT_MEMORY;
                     len = vs->length;
                     phloat_length(*ds) = len;
                     for (i = 0; i < len; i++)
thomas@thomas-VirtualBox:~/free42$

In a nutshell: when ASTO is called to modify REGS, the REGS variable and the X register are pointing at a shared instance of the matrix. The two variables have to be "disentangled" (shared memory with copy-on-write semantics), and this is currently being done halfway through the operation, while it should be done at the start. The result is that the string data gets written to one copy of the matrix (the wrong one), while the "this is a string" bit gets written to the other. Oops.

Tonight I'll take a closer look at generic_sto() to see if anything else like that is hiding in there, and then I'll release 2.5.13.


RE: [Free42] ASTO 00 bug - Werner - 01-09-2020 06:32 PM

Thanks Thomas!
Werner


RE: [Free42] ASTO 00 bug - Thomas Okken - 01-10-2020 01:18 AM

The update is done. It may take a while for the Android update to show up in the Play store, because of a "Violation of Families Policy Requirements." Wish me luck in trying to find out what that is all about...


RE: [Free42] ASTO 00 bug - Valentin Albillo - 01-10-2020 06:02 AM

(01-10-2020 01:18 AM)Thomas Okken Wrote:  The update is done. It may take a while for the Android update to show up in the Play store, because of a "Violation of Families Policy Requirements." Wish me luck in trying to find out what that is all about...

Perhaps this might help:

https://stackoverflow.com/questions/57027059/how-to-fix-issue-violation-of-families-policy-requirements

Regards.
V.


RE: [Free42] ASTO 00 bug - Thomas Okken - 01-10-2020 01:27 PM

They replied to my appeal, still not very informative, but this time they highlighted two sections of their regulations, namely:

"[Apps in the program must be] specifically designed for children or families"

and

"You should only select age groups that include both adults and children if you truly have designed your app for all ages."

I'll admit that my app was not "specifically designed for all ages," but that seems a meaningless notion when talking about a tool where form follows function. Unless a "child-appropriate" calculator must have a sky blue and pink color scheme or something?

I'm asking them to clarify. It seems like simply setting the app's target audience to exclude young children would get me past this hurdle, but this has a nasty dystopian vibe to me. Keep the kids stupid so they won't learn to question their elders, that kind of thing. It's not just sex and drugs and violence that kids must be shielded from, but anything that isn't commonly taught to their age group? Precocious children should just stop being precocious and act their age? Maybe I'm misunderstanding this or reading too much into it, but Google's poor communication sure isn't helping.


RE: [Free42] ASTO 00 bug - ijabbott - 01-10-2020 10:01 PM

(01-10-2020 01:27 PM)Thomas Okken Wrote:  "You should only select age groups that include both adults and children if you truly have designed your app for all ages."

I'll admit that my app was not "specifically designed for all ages," but that seems a meaningless notion when talking about a tool where form follows function. Unless a "child-appropriate" calculator must have a sky blue and pink color scheme or something?

Perhaps you should add a "Little Professor" mode? But that's TI, not HP. Smile


RE: [Free42] ASTO 00 bug - Thomas Okken - 01-10-2020 11:54 PM

(01-10-2020 10:01 PM)ijabbott Wrote:  Perhaps you should add a "Little Professor" mode? But that's TI, not HP. Smile

Yeah. When first run after installation, it should pop up a dialog box, asking "are you a child? (yes/no)" If the answer is yes, a pastel-hued skin is automatically selected, and all output is accompanied by text-to-speech using a high-pitched, patronizing voice. Big Grin


RE: [Free42] ASTO 00 bug - Valentin Albillo - 01-11-2020 12:38 AM

(01-10-2020 11:54 PM)Thomas Okken Wrote:  Yeah. When first run after installation, it should pop up a dialog box, asking "are you a child? (yes/no)" If the answer is yes, a pastel-hued skin is automatically selected, and all output is accompanied by text-to-speech using a high-pitched, patronizing voice. Big Grin

I happen to remember a 40 yo MS-DOS adventure game intended for adult audiences, the very first one of the "Leisure Suit Larry" series, which when executed would first ask the user a number of simple questions which supposedly only an adult would understand or know the answer.

If the user failed to give all correct answers, the game would give a "Shame on you" kind of message for trying to cheat and pass for an adult and would refuse to continue to the game. The questions varied randomly with every attempt at execution so running the program again would ask different questions. I don't know how effective it was but certainly it would bring a smile or two (and a lot of frustration to minors, I reckon).

Regards and have a nice weekend.
V.


RE: [Free42] ASTO 00 bug - Massimo Gnerucci - 01-11-2020 02:15 PM

(01-11-2020 12:38 AM)Valentin Albillo Wrote:  I happen to remember a 40 yo MS-DOS adventure game intended for adult audiences, the very first one of the "Leisure Suit Larry" series, which when executed would first ask the user a number of simple questions which supposedly only an adult would understand or know the answer.

If the user failed to give all correct answers, the game would give a "Shame on you" kind of message for trying to cheat and pass for an adult and would refuse to continue to the game. The questions varied randomly with every attempt at execution so running the program again would ask different questions. I don't know how effective it was but certainly it would bring a smile or two (and a lot of frustration to minors, I reckon).

I remember that well, too. Even though it's more 30 than 40 years ago.

Have a nice weekend, you all.


RE: [Free42] ASTO 00 bug - Thomas Okken - 01-13-2020 05:19 PM

(01-10-2020 01:27 PM)Thomas Okken Wrote:  "[Apps in the program must be] specifically designed for children or families"

and

"You should only select age groups that include both adults and children if you truly

I got the app approved by changing the target age range from 9+ to 13+. I guess that simply means that the app won't be "targeted" at preteens, but they will still be able to get it if they look for it. The app is still rated for "everyone."

The whole thing is very confusing, but Free42 for Android lives to see another day, another update...


RE: [Free42] ASTO 00 bug - Valentin Albillo - 01-13-2020 10:23 PM

.
Hi, Thomas:

(01-13-2020 05:19 PM)Thomas Okken Wrote:  The whole thing is very confusing, but Free42 for Android lives to see another day, another update...

Thank you very much for acting so quickly to fix the error and most especially for taking all the trouble with the Android store.

Your Free42 is an astonishingly awesome project, incredibly powerful and unbelievably fast and accurate, I love it.

Best regards.
V.


RE: [Free42] ASTO 00 bug - zeno333 - 01-13-2020 10:38 PM

It's good to know that our youth will not be corrupted by Free42...(This Google Family policy is insane and absurd...)