News:

  • March 27, 2025, 07:03:25 PM

Login with username, password and session length

Author Topic: Import of large UDT crashes DMD  (Read 704 times)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3588
  • Darth Ladder
Import of large UDT crashes DMD
« on: April 09, 2024, 05:03:14 PM »
I try import a 256-byte UDT from a text file (2048 bits) and it crashes DMD on exit from the UDT config dialog.   Dump files too large to attach.   I did edit the UDT txt file externally (in Notepad++), so there might be some problem with the non-printing characters or something.  Take a look when you can and let me know.

Thanks!
« Last Edit: April 10, 2024, 04:16:34 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3731
    • Host Engineering
Re: Import pf large UDT crashes DMD
« Reply #1 on: April 09, 2024, 05:11:29 PM »
I try import a 256-byte UDT from a text file (2048 bits) and it crashes DMD on exit from the UDT config dialog.   Dump files too large to attach.   I did edit the UDT txt file externally (in Notepad++), so there might be some problem with the non-printing characters or something.  Take a look when you can and let me know.

Thanks!

Yeah, you blew the size of the entire SCHEMA TABLE (for ALL UDTs).  Limited memory in the PLC.  We added checks in 2.10 (basically blew the System Configuration serialization).  Your UDT has TONs of fields.

It should have failed on the IMPORT (too many fields).  Good test case  ;)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3588
  • Darth Ladder
Re: Import pf large UDT crashes DMD
« Reply #2 on: April 09, 2024, 05:33:42 PM »
Well, it actually did.   I originally set it at 65 DWORDs, and it complained starting at 64:0, so I deleted DWORD 64, and it didn't complain any more, so I was assuming 64 DWORDs (DW0:63) was the size limit.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3731
    • Host Engineering
Re: Import pf large UDT crashes DMD
« Reply #3 on: April 10, 2024, 10:32:07 AM »
Fixed.  Delusions of grandeur.  I remember purposefully NOT checking the "number of fields" limit so that you could then utilize the built-in UDT editor (vs. tweaking a .txt file).  But then I never added the infrastructure to ensure that AFTER the import that you STILL have to then EDIT that newly imported UDT.  But as you see that can have grave consequences (i.e. SO many fields that it BLOWS OUT the ALLOTTED BUFFER for the Structure Descriptions in the System Configuration!).

I just added a validation check in the import (see attached screenshot).