Fop
  1. Fop
  2. FOP-1709

AFP Renderer Truncates TLE Values

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: unqualified
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • External issue ID:
      47941

      Description

      2 of the longer TLE Values in attached XSL-FO File are truncated by AFP Renderer. Apecifically the TLEs with name JES0 and ACC1 are truncated using a recent revision of FOP trunk. I can't see any specific limit for TLE records in the MO:DCA specification.

      1. testcase001.dmp
        19 kB
        Harald G. Henne
      2. testcase001.fo
        4 kB
        Harald G. Henne
      3. truncated_TLEs.fo
        3 kB
        Chris Bowditch

        Activity

        Chris Bowditch created issue -
        Hide
        Venkat Reddy added a comment -

        Hi Chris,

        Can you please attach the XSL-FO file you used for this test case?

        Thanks,
        Venkat.

        (In reply to comment #0)
        > 2 of the longer TLE Values in attached XSL-FO File are truncated by AFP
        > Renderer. Apecifically the TLEs with name JES0 and ACC1 are truncated using a
        > recent revision of FOP trunk. I can't see any specific limit for TLE records in
        > the MO:DCA specification.

        Show
        Venkat Reddy added a comment - Hi Chris, Can you please attach the XSL-FO file you used for this test case? Thanks, Venkat. (In reply to comment #0) > 2 of the longer TLE Values in attached XSL-FO File are truncated by AFP > Renderer. Apecifically the TLEs with name JES0 and ACC1 are truncated using a > recent revision of FOP trunk. I can't see any specific limit for TLE records in > the MO:DCA specification.
        Hide
        Chris Bowditch added a comment -

        Attachment truncated_TLEs.fo has been added with description: XSL-FO to reproduce the problem

        Show
        Chris Bowditch added a comment - Attachment truncated_TLEs.fo has been added with description: XSL-FO to reproduce the problem
        Hide
        Chris Bowditch added a comment -

        Sorry - I seem to be having some problems with Bugzilla and attachments. I did attach the XSL-FO File when I logged the bug but Bugzilla had a problem with the content type and didn't tell me. Grmbl

        Show
        Chris Bowditch added a comment - Sorry - I seem to be having some problems with Bugzilla and attachments. I did attach the XSL-FO File when I logged the bug but Bugzilla had a problem with the content type and didn't tell me. Grmbl
        Hide
        Harald G. Henne added a comment -

        In the world of AFP a TLE is normally written out by the
        two triplets 0x02 and 0x36. The max lenght of any triplet
        is 254 bytes and this limit is the reason for the mentioned truncation.
        On the other side it is quite common to remove any trailing blanks
        of TLE values.

        I checked out the current trunk and the produced afp is not valid.

        my afp dump:

        0xD3A090: TLE Tag Logical Element [322] (Offset 34)
        T02: Fully Qualified Name [6]
        FQNType: 0x0B (Attribute GID)
        FQNFmt: 0x00 (Character string)
        FQName: "JES0"
        T36: Attribute Value [46]
        Reserved: 00 00
        AttVal: "JES00927200 90INITIATION REGULAR "
        (hex D1 C5 E2 F0 F0 F9 F2 F7 F2 F0 F0 40 40 40 40 40
        40 40 F9 F0 C9 D5 C9 E3 C9 C1 E3 C9 D6 D5 40 40
        40 40 40 D9 C5 C7 E4 D3 C1 D9 40 40
        T40: - unknown triplet - [62]
        40 40 40 40 F6 F9 F0 60 F5 F0 F1 40 40 40 F3 F9
        F0 60 40 F1 F2 F7 40 40 40 40 F2 F7 F2 F0 F0 F0
        F2 F1 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40
        T40: - unknown triplet - [62]
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40
        T40: - unknown triplet - [62]
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40
        T40: - unknown triplet - [62]
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40
        T80: Attribute Qualifier [8]
        SeqNum: 0x00000000 (0)
        LevNum: 0x00000001 (1)
        0xD3A090: TLE Tag Logical Element [340] (Offset 365)
        T02: Fully Qualified Name [6]
        FQNType: 0x0B (Attribute GID)
        FQNFmt: 0x00 (Character string)
        FQName: "ACC1"
        T36: Attribute Value [64]
        Reserved: 00 00
        AttVal: "ACC1374316469000000 690-501 EN "
        (hex C1 C3 C3 F1 F3 F7 F4 F3 F1 F6 F4 F6 F9 F0 F0 F0
        F0 F0 F0 40 40 40 40 F6 F9 F0 60 F5 F0 F1 40 40
        40 40 C5 D5 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40
        T40: - unknown triplet - [62]
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 F0 F0 40 40 40 40 40 40 40 40
        T40: - unknown triplet - [62]
        40 40 40 40 40 40 F0 F0 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40
        T40: - unknown triplet - [62]
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40
        T40: - unknown triplet - [62]
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40
        T80: Attribute Qualifier [8]
        SeqNum: 0x00000001 (1)
        LevNum: 0x00000001 (1)
        0xD3A090: TLE Tag Logical Element [124] (Offset 714)
        T02: Fully Qualified Name [6]
        FQNType: 0x0B (Attribute GID)
        FQNFmt: 0x00 (Character string)
        FQName: "ADR1"
        T36: Attribute Value [104]
        Reserved: 00 00
        AttVal: "ADR1MICKEY MOUSE "
        (hex C1 C4 D9 F1 D4 C9 C3 D2 C5 E8 40 D4 D6 E4 E2 C5
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
        40 40 40 40 40 40
        T80: Attribute Qualifier [8]
        SeqNum: 0x00000002 (2)
        LevNum: 0x00000001 (1)
        ...

        Show
        Harald G. Henne added a comment - In the world of AFP a TLE is normally written out by the two triplets 0x02 and 0x36. The max lenght of any triplet is 254 bytes and this limit is the reason for the mentioned truncation. On the other side it is quite common to remove any trailing blanks of TLE values. I checked out the current trunk and the produced afp is not valid. my afp dump: 0xD3A090: TLE Tag Logical Element [322] (Offset 34) T02: Fully Qualified Name [6] FQNType: 0x0B (Attribute GID) FQNFmt: 0x00 (Character string) FQName: "JES0" T36: Attribute Value [46] Reserved: 00 00 AttVal: "JES00927200 90INITIATION REGULAR " (hex D1 C5 E2 F0 F0 F9 F2 F7 F2 F0 F0 40 40 40 40 40 40 40 F9 F0 C9 D5 C9 E3 C9 C1 E3 C9 D6 D5 40 40 40 40 40 D9 C5 C7 E4 D3 C1 D9 40 40 T40: - unknown triplet - [62] 40 40 40 40 F6 F9 F0 60 F5 F0 F1 40 40 40 F3 F9 F0 60 40 F1 F2 F7 40 40 40 40 F2 F7 F2 F0 F0 F0 F2 F1 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 T40: - unknown triplet - [62] 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 T40: - unknown triplet - [62] 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 T40: - unknown triplet - [62] 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 T80: Attribute Qualifier [8] SeqNum: 0x00000000 (0) LevNum: 0x00000001 (1) 0xD3A090: TLE Tag Logical Element [340] (Offset 365) T02: Fully Qualified Name [6] FQNType: 0x0B (Attribute GID) FQNFmt: 0x00 (Character string) FQName: "ACC1" T36: Attribute Value [64] Reserved: 00 00 AttVal: "ACC1374316469000000 690-501 EN " (hex C1 C3 C3 F1 F3 F7 F4 F3 F1 F6 F4 F6 F9 F0 F0 F0 F0 F0 F0 40 40 40 40 F6 F9 F0 60 F5 F0 F1 40 40 40 40 C5 D5 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 T40: - unknown triplet - [62] 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 F0 F0 40 40 40 40 40 40 40 40 T40: - unknown triplet - [62] 40 40 40 40 40 40 F0 F0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 T40: - unknown triplet - [62] 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 T40: - unknown triplet - [62] 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 T80: Attribute Qualifier [8] SeqNum: 0x00000001 (1) LevNum: 0x00000001 (1) 0xD3A090: TLE Tag Logical Element [124] (Offset 714) T02: Fully Qualified Name [6] FQNType: 0x0B (Attribute GID) FQNFmt: 0x00 (Character string) FQName: "ADR1" T36: Attribute Value [104] Reserved: 00 00 AttVal: "ADR1MICKEY MOUSE " (hex C1 C4 D9 F1 D4 C9 C3 D2 C5 E8 40 D4 D6 E4 E2 C5 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 T80: Attribute Qualifier [8] SeqNum: 0x00000002 (2) LevNum: 0x00000001 (1) ...
        Hide
        Harald G. Henne added a comment -

        Attachment testcase001.fo has been added with description: additional sample

        Show
        Harald G. Henne added a comment - Attachment testcase001.fo has been added with description: additional sample
        Hide
        Harald G. Henne added a comment -

        Attachment testcase001.dmp has been added with description: my output for additional sample

        Show
        Harald G. Henne added a comment - Attachment testcase001.dmp has been added with description: my output for additional sample
        Hide
        Harald G. Henne added a comment -

        secondly i tried it with a small testcase holding
        10 TLEs with increasing value length:

        input:
        <afp:tag-logical-element name="name250" value= ..."/>
        <afp:tag-logical-element name="name251" value= ...1"/>
        <afp:tag-logical-element name="name252" value= ...12"/>
        <afp:tag-logical-element name="name253" value= ...123"/>
        <afp:tag-logical-element name="name254" value= ...1234"/>
        <afp:tag-logical-element name="name255" value= ...12345"/>
        <afp:tag-logical-element name="name256" value= ...123456"/>
        <afp:tag-logical-element name="name257" value= ...1234567"/>
        <afp:tag-logical-element name="name258" value= ...12345678"/>
        <afp:tag-logical-element name="name259" value= ...123456789"/>

        the first failure will be for TLE with name "name253" and it just looks like
        a overflow.

        $ grep T36 testcase001.dmp
        T36: Attribute Value [251]
        T36: Attribute Value [252]
        T36: Attribute Value [253]
        T36: Attribute Value [0]
        T36: Attribute Value [0]
        T36: Attribute Value [0]
        T36: Attribute Value [1]
        T36: Attribute Value [2]
        T36: Attribute Value [3]
        T36: Attribute Value [4]

        in my opinion the best will be to split up such problem TLEs and write out several
        TLE structed fields with incremented triplet 0x80 'Sequence Number'.

        Unfortunately i did no java debugging for the last few years i have first to setup
        eclipse or IntelliJ on my computer.

        Show
        Harald G. Henne added a comment - secondly i tried it with a small testcase holding 10 TLEs with increasing value length: input: <afp:tag-logical-element name="name250" value= ..."/> <afp:tag-logical-element name="name251" value= ...1"/> <afp:tag-logical-element name="name252" value= ...12"/> <afp:tag-logical-element name="name253" value= ...123"/> <afp:tag-logical-element name="name254" value= ...1234"/> <afp:tag-logical-element name="name255" value= ...12345"/> <afp:tag-logical-element name="name256" value= ...123456"/> <afp:tag-logical-element name="name257" value= ...1234567"/> <afp:tag-logical-element name="name258" value= ...12345678"/> <afp:tag-logical-element name="name259" value= ...123456789"/> the first failure will be for TLE with name "name253" and it just looks like a overflow. $ grep T36 testcase001.dmp T36: Attribute Value [251] T36: Attribute Value [252] T36: Attribute Value [253] T36: Attribute Value [0] T36: Attribute Value [0] T36: Attribute Value [0] T36: Attribute Value [1] T36: Attribute Value [2] T36: Attribute Value [3] T36: Attribute Value [4] in my opinion the best will be to split up such problem TLEs and write out several TLE structed fields with incremented triplet 0x80 'Sequence Number'. Unfortunately i did no java debugging for the last few years i have first to setup eclipse or IntelliJ on my computer.
        Hide
        Venkat Reddy added a comment -

        It is better to warn the user atleast when used more than 254 bytes for the TLE value, so that he will get an idea about the truncation happened because of lengthy input value.

        (In reply to comment #7)
        > secondly i tried it with a small testcase holding
        > 10 TLEs with increasing value length:
        > input:
        > <afp:tag-logical-element name="name250" value= ..."/>
        > <afp:tag-logical-element name="name251" value= ...1"/>
        > <afp:tag-logical-element name="name252" value= ...12"/>
        > <afp:tag-logical-element name="name253" value= ...123"/>
        > <afp:tag-logical-element name="name254" value= ...1234"/>
        > <afp:tag-logical-element name="name255" value= ...12345"/>
        > <afp:tag-logical-element name="name256" value= ...123456"/>
        > <afp:tag-logical-element name="name257" value= ...1234567"/>
        > <afp:tag-logical-element name="name258" value= ...12345678"/>
        > <afp:tag-logical-element name="name259" value= ...123456789"/>
        > the first failure will be for TLE with name "name253" and it just looks like
        > a overflow.
        > $ grep T36 testcase001.dmp
        > T36: Attribute Value [251]
        > T36: Attribute Value [252]
        > T36: Attribute Value [253]
        > T36: Attribute Value [0]
        > T36: Attribute Value [0]
        > T36: Attribute Value [0]
        > T36: Attribute Value [1]
        > T36: Attribute Value [2]
        > T36: Attribute Value [3]
        > T36: Attribute Value [4]
        > in my opinion the best will be to split up such problem TLEs and write out
        > several
        > TLE structed fields with incremented triplet 0x80 'Sequence Number'.
        > Unfortunately i did no java debugging for the last few years i have first to
        > setup
        > eclipse or IntelliJ on my computer.

        Show
        Venkat Reddy added a comment - It is better to warn the user atleast when used more than 254 bytes for the TLE value, so that he will get an idea about the truncation happened because of lengthy input value. (In reply to comment #7) > secondly i tried it with a small testcase holding > 10 TLEs with increasing value length: > input: > <afp:tag-logical-element name="name250" value= ..."/> > <afp:tag-logical-element name="name251" value= ...1"/> > <afp:tag-logical-element name="name252" value= ...12"/> > <afp:tag-logical-element name="name253" value= ...123"/> > <afp:tag-logical-element name="name254" value= ...1234"/> > <afp:tag-logical-element name="name255" value= ...12345"/> > <afp:tag-logical-element name="name256" value= ...123456"/> > <afp:tag-logical-element name="name257" value= ...1234567"/> > <afp:tag-logical-element name="name258" value= ...12345678"/> > <afp:tag-logical-element name="name259" value= ...123456789"/> > the first failure will be for TLE with name "name253" and it just looks like > a overflow. > $ grep T36 testcase001.dmp > T36: Attribute Value [251] > T36: Attribute Value [252] > T36: Attribute Value [253] > T36: Attribute Value [0] > T36: Attribute Value [0] > T36: Attribute Value [0] > T36: Attribute Value [1] > T36: Attribute Value [2] > T36: Attribute Value [3] > T36: Attribute Value [4] > in my opinion the best will be to split up such problem TLEs and write out > several > TLE structed fields with incremented triplet 0x80 'Sequence Number'. > Unfortunately i did no java debugging for the last few years i have first to > setup > eclipse or IntelliJ on my computer.
        Hide
        Adrian Cumiskey added a comment -

        This bug was originally misdiagnosed. The TLE values were not being truncated as Chris suggested. As I see it, Harald is correct in his description of the issue. Triplets are a maximum of 254 bytes, therefore Attribute Value Triplets can legally hold a maximum of 250 bytes including the header. So the solution as I see it is that the value must be truncated to 250 characters and a warning provided. I have now resolved this in trunk.

        Adrian.

        Show
        Adrian Cumiskey added a comment - This bug was originally misdiagnosed. The TLE values were not being truncated as Chris suggested. As I see it, Harald is correct in his description of the issue. Triplets are a maximum of 254 bytes, therefore Attribute Value Triplets can legally hold a maximum of 250 bytes including the header. So the solution as I see it is that the value must be truncated to 250 characters and a warning provided. I have now resolved this in trunk. Adrian.
        Hide
        Chris Bowditch added a comment -

        Thanks for the fix Adrian. You are correct that my original report wasn't technically accurate but then I didn't have time to look into the details. Still I am happy with the final resolution.

        Show
        Chris Bowditch added a comment - Thanks for the fix Adrian. You are correct that my original report wasn't technically accurate but then I didn't have time to look into the details. Still I am happy with the final resolution.
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          People

          • Assignee:
            fop-dev
            Reporter:
            Chris Bowditch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development