• MPY setprompt

    From Analog@21:2/123 to G00r00 on Tue Feb 4 21:18:05 2020
    g00r00,

    Maybe I'm not using this feature correctly, but I'm trying to replace a
    prompt using MPY.

    Specifically, I'm trying to set the prompt 417, General Invalid Password.
    I've tried two ways:

    1. bbs.setprompt(417, "This is the prompt"). This corrupts the memory and shows a bunch of garbage to the screen, probably a memory pointer dump.

    2. bbs.setprompt("417", "This is the prompt"). This one does not change the prompt text at all.

    Am I doing something wrong here?

    Cheers,

    |20|15┌─|16|08┤ |08De|07ad|15be|07a|08tz b|07b|15s
    |08└─┘├─┐ |08:>.|07A|08rk |0710|08:|07101|08/|0714|08.
    |04■ |08└|20|15─|16|08┘ |08:>.|10A|02gn |1046|08:|101|08/|10123|08.
    |04A|07n|15al|07o|08g |08:>.|12F|04sx |1221|08:|122|08/|12123|08. |15.|04p|07HENOM|15. |08:>.|15S|07ci |1577|08:|151|08/|15131|08. |04░▒░|08▒██▄▌|08:>.|11T|03qw |111337|08:|113|08/|1113|08.

    --- Mystic BBS v1.12 A44 2020/02/02 (Linux/64)
    * Origin: deadbeatz.org (21:2/123)
  • From Analog@21:2/123 to g00r00 on Wed Feb 5 21:51:43 2020
    1. bbs.setprompt(417, "This is the prompt"). This corrupts the memory
    and shows a bunch of garbage to the screen, probably a memory pointer dump.


    g00r00,

    More on this issue:
    If I do a
    bbs.setprompt(417, "TestText")
    then do a
    p = bbs.getprompt(417)
    bbs.writeln("Prompt: " + p)
    It will write "TestText"

    However, if I then prompt for a password which is invalid, which will
    fire the prompt 417 text, here's the output:

    [snip]
    p: TestText


    Password:****.......


    TextTextt�Lm�����'l__S���Lm�

    ��i}>sh�wherex���Lm�

    ����
    P��Lm�����X%X�� Tƨ��msg_delete`��Lm� [snip]

    It then corrupts the memory and hangs me up.
    A few times it's left ghosts and one time is said something to effect of "Unable to delete string"
    So there is some sort of memory corruption here. Can you take a look? It's probably referencing the shared pointer value of the original string and
    since the data size has changed, causing a memory overflow.

    Linux x64, Mystic A44 2020/02/02

    |20|15┌─|16|08┤ |08De|07ad|15be|07a|08tz b|07b|15s
    |08└─┘├─┐ |08:>.|07A|08rk |0710|08:|07101|08/|0714|08.
    |04■ |08└|20|15─|16|08┘ |08:>.|10A|02gn |1046|08:|101|08/|10123|08.
    |04A|07n|15al|07o|08g |08:>.|12F|04sx |1221|08:|122|08/|12123|08. |15.|04p|07HENOM|15. |08:>.|15S|07ci |1577|08:|151|08/|15131|08. |04░▒░|08▒██▄▌|08:>.|11T|03qw |111337|08:|113|08/|1113|08.

    --- Mystic BBS v1.12 A44 2020/02/02 (Linux/64)
    * Origin: deadbeatz.org (21:2/123)
  • From g00r00@21:1/108 to Analog on Thu Feb 6 13:18:12 2020
    g00r00,

    More on this issue:

    Thank you I will test this. Did you recompile Python before using Mystic Python or are you using the Python that comes "out of the box" with your
    Linux distribution?

    Also which Linux OS are you using?

    Just in case I can't reproduce it on my Linux machine I want to gather as
    much info as I can.

    --- Mystic BBS v1.12 A44 2020/02/04 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From Analog@21:2/123 to g00r00 on Thu Feb 6 13:09:46 2020
    Thank you I will test this. Did you recompile Python before using Mystic Python or are you using the Python that comes "out of the box" with your Linux distribution?

    g00r00, yes 100% from scratch compiled for Mystic. No other problems with Python.

    Also which Linux OS are you using?

    Ubuntu 18.04 LTS x64 server (headless). If you desire, I can send you the script (it's tiny) I'm using. The desire is to make a custom prompt for new users vs how I have the same prompt laid out for my regular board.

    Cheers and thanks,

    |20|15┌─|16|08┤ |08De|07ad|15be|07a|08tz b|07b|15s
    |08└─┘├─┐ |08:>.|07A|08rk |0710|08:|07101|08/|0714|08.
    |04■ |08└|20|15─|16|08┘ |08:>.|10A|02gn |1046|08:|101|08/|10123|08.
    |04A|07n|15al|07o|08g |08:>.|12F|04sx |1221|08:|122|08/|12123|08. |15.|04p|07HENOM|15. |08:>.|15S|07ci |1577|08:|151|08/|15131|08. |04░▒░|08▒██▄▌|08:>.|11T|03qw |111337|08:|113|08/|1113|08.

    --- Mystic BBS v1.12 A44 2020/02/02 (Linux/64)
    * Origin: deadbeatz.org (21:2/123)
  • From g00r00@21:1/108 to Analog on Thu Feb 6 18:53:54 2020
    g00r00, yes 100% from scratch compiled for Mystic. No other problems with Python.
    Ubuntu 18.04 LTS x64 server (headless). If you desire, I can send you the

    Perfect thank you.

    No need to send the script. I don't anticipate having issues reproducing this. I changed the entire prompt system in A44 and there were lots of broken pieces because of it that I had to fix in pre-alpha. Unfortunately this is probably just something I didn't test/correct.

    --- Mystic BBS v1.12 A44 2020/02/04 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From g00r00@21:1/108 to Analog on Sat Feb 8 12:51:36 2020
    Ubuntu 18.04 LTS x64 server (headless). If you desire, I can send you the script (it's tiny) I'm using. The desire is to make a custom prompt for new users vs how I have the same prompt laid out for my regular board.

    I've changed my mind after not being able to reproduce the issue (unless I create a circulate script execution in which case that will crash the BBS).

    Can you paste your exact script and tell me how/where you are calling it?

    --- Mystic BBS v1.12 A44 2020/02/04 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From Analog@21:2/123 to g00r00 on Sat Feb 8 13:38:54 2020
    I've changed my mind after not being able to reproduce the issue (unless
    I create a circulate script execution in which case that will crash the BBS).

    Can you paste your exact script and tell me how/where you are calling it?

    Sure.
    A. Create a menu:
    Action 1: GY set_prompt
    Action 2: -P testpassword

    In MPY set_prompt script:
    [snip]

    import mystic_bbs as bbs
    bbs.setprompt(417, "Invalid Password g00r00")

    [snip]

    Go to the menu, it will prompt for a password. Type in something wrong. It
    will dump a bunch of garbage to the screen on mine and sometimes crash the
    user offline.

    |20|15┌─|16|08┤ |08De|07ad|15be|07a|08tz b|07b|15s
    |08└─┘├─┐ |08:>.|07A|08rk |0710|08:|07101|08/|0714|08.
    |04■ |08└|20|15─|16|08┘ |08:>.|10A|02gn |1046|08:|101|08/|10123|08.
    |04A|07n|15al|07o|08g |08:>.|12F|04sx |1221|08:|122|08/|12123|08. |15.|04p|07HENOM|15. |08:>.|15S|07ci |1577|08:|151|08/|15131|08. |04░▒░|08▒██▄▌|08:>.|11T|03qw |111337|08:|113|08/|1113|08.

    --- Mystic BBS v1.12 A44 2020/02/02 (Linux/64)
    * Origin: deadbeatz.org (21:2/123)
  • From Analog@21:2/123 to g00r00 on Sat Feb 8 13:44:27 2020
    I've changed my mind after not being able to reproduce the issue (unless
    I create a circulate script execution in which case that will crash the BBS).

    Just for completeness on why I'm doing this. I have a few prompts that are XY located for my popup boxes. Some of those prompts are used other places that don't have the same popup box support layout. Since the password menu action will prompt up to 3 times, I want to have prompt 417 shown in a particular region for that menu so it's not overrunning the ansi.

    If you want to see how I'm using it let me know and I'll turn on the menu and you could drop by and check it out.

    Thanks as always!

    |20|15┌─|16|08┤ |08De|07ad|15be|07a|08tz b|07b|15s
    |08└─┘├─┐ |08:>.|07A|08rk |0710|08:|07101|08/|0714|08.
    |04■ |08└|20|15─|16|08┘ |08:>.|10A|02gn |1046|08:|101|08/|10123|08.
    |04A|07n|15al|07o|08g |08:>.|12F|04sx |1221|08:|122|08/|12123|08. |15.|04p|07HENOM|15. |08:>.|15S|07ci |1577|08:|151|08/|15131|08. |04░▒░|08▒██▄▌|08:>.|11T|03qw |111337|08:|113|08/|1113|08.

    --- Mystic BBS v1.12 A44 2020/02/02 (Linux/64)
    * Origin: deadbeatz.org (21:2/123)
  • From g00r00@21:1/108 to Analog on Sat Feb 8 22:10:03 2020
    Sure.
    A. Create a menu:
    Action 1: GY set_prompt
    Action 2: -P testpassword

    In MPY set_prompt script:
    [snip]

    import mystic_bbs as bbs
    bbs.setprompt(417, "Invalid Password g00r00")

    Okay, I tested this on Windows without issues, but it does seem to act up in Linux/64 for whatever reason. I will research more, thank you

    --- Mystic BBS v1.12 A44 2020/02/04 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From Analog@21:2/123 to g00r00 on Sat Feb 8 20:52:47 2020
    Okay, I tested this on Windows without issues, but it does seem to act
    up in Linux/64 for whatever reason. I will research more, thank you

    thank goodness! I was really starting to think I was crazy.

    |20|15┌─|16|08┤ |08De|07ad|15be|07a|08tz b|07b|15s
    |08└─┘├─┐ |08:>.|07A|08rk |0710|08:|07101|08/|0714|08.
    |04■ |08└|20|15─|16|08┘ |08:>.|10A|02gn |1046|08:|101|08/|10123|08.
    |04A|07n|15al|07o|08g |08:>.|12F|04sx |1221|08:|122|08/|12123|08. |15.|04p|07HENOM|15. |08:>.|15S|07ci |1577|08:|151|08/|15131|08. |04░▒░|08▒██▄▌|08:>.|11T|03qw |111337|08:|113|08/|1113|08.

    --- Mystic BBS v1.12 A44 2020/02/02 (Linux/64)
    * Origin: deadbeatz.org (21:2/123)
  • From g00r00@21:1/108 to Analog on Sun Feb 9 01:07:43 2020
    Okay, I tested this on Windows without issues, but it does seem to ac up in Linux/64 for whatever reason. I will research more, thank you

    thank goodness! I was really starting to think I was crazy.

    I just uploaded the first A45 prealphas where this should be fixed!

    --- Mystic BBS v1.12 A44 2020/02/04 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From Analog@21:2/123 to g00r00 on Sun Feb 9 07:04:21 2020
    I just uploaded the first A45 prealphas where this should be fixed!

    What was it? A size mismatch on the memory block for the string?

    |20|15┌─|16|08┤ |08De|07ad|15be|07a|08tz b|07b|15s
    |08└─┘├─┐ |08:>.|07A|08rk |0710|08:|07101|08/|0714|08.
    |04■ |08└|20|15─|16|08┘ |08:>.|10A|02gn |1046|08:|101|08/|10123|08.
    |04A|07n|15al|07o|08g |08:>.|12F|04sx |1221|08:|122|08/|12123|08. |15.|04p|07HENOM|15. |08:>.|15S|07ci |1577|08:|151|08/|15131|08. |04░▒░|08▒██▄▌|08:>.|11T|03qw |111337|08:|113|08/|1113|08.

    --- Mystic BBS v1.12 A44 2020/02/02 (Linux/64)
    * Origin: deadbeatz.org (21:2/123)
  • From Analog@21:2/123 to g00r00 on Sun Feb 9 07:25:02 2020
    I just uploaded the first A45 prealphas where this should be fixed!

    g00r00,

    Can confirm A45 fixes the setprompt bug on Linux 64 bit. Thanks!!!

    |20|15┌─|16|08┤ |08De|07ad|15be|07a|08tz b|07b|15s
    |08└─┘├─┐ |08:>.|07A|08rk |0710|08:|07101|08/|0714|08.
    |04■ |08└|20|15─|16|08┘ |08:>.|10A|02gn |1046|08:|101|08/|10123|08.
    |04A|07n|15al|07o|08g |08:>.|12F|04sx |1221|08:|122|08/|12123|08. |15.|04p|07HENOM|15. |08:>.|15S|07ci |1577|08:|151|08/|15131|08. |04░▒░|08▒██▄▌|08:>.|11T|03qw |111337|08:|113|08/|1113|08.

    --- Mystic BBS v1.12 A45 2020/02/09 (Linux/64)
    * Origin: deadbeatz.org (21:2/123)
  • From g00r00@21:1/108 to Analog on Sun Feb 9 13:01:27 2020
    I just uploaded the first A45 prealphas where this should be fixed!

    What was it? A size mismatch on the memory block for the string?

    No just a type issue. I accidentally sent a memory reference to a Pascal AnsiString to Python instead of a C-style char array pointer. Pascal strings work as a char array pointer if you reference them by pointer to the first character which is what I originally used, but that type is limited to 255 characters.

    When I extended each prompt size from 250 to unlimited I needed to change it from a string pointer reference to a pchar but mistakenly used an ansistring. For some reason that worked (ish) in Windows so I didn't notice it.

    --- Mystic BBS v1.12 A45 2020/02/09 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From g00r00@21:1/108 to Analog on Sun Feb 9 13:01:52 2020
    I just uploaded the first A45 prealphas where this should be fixed!

    g00r00,

    Can confirm A45 fixes the setprompt bug on Linux 64 bit. Thanks!!!

    No problem, thanks for the report!@

    --- Mystic BBS v1.12 A45 2020/02/09 (Linux/64)
    * Origin: Sector 7 (21:1/108)