Menu

#8 Assertion failures

version 0.4.0
open
encoding (12)
4
2008-01-08
2008-01-08
No

Various assertion failures occur when trying to encode large files:

$ wc /etc/passwd
47 69 2238 /etc/passwd

$ dmtxwrite -fa /etc/passwd
dmtxwrite: dmtxencode.c:173: dmtxEncodeDataMatrix: Assertion `sizeIdx != -1 && sizeIdx != -2' failed.
Aborted

$ dmtxwrite -fa -eb /etc/passwd
dmtxwrite: dmtxencode.c:1013: ChangeEncScheme: Assertion `channel->schemeStart % 12 == 0' failed.
Aborted

$ dmtxwrite -fa -et /etc/passwd
dmtxwrite: dmtxsymbol.c:82: dmtxGetSymbolAttribute: Assertion `sizeIdx >= 0 && sizeIdx < 24 + 6' failed.
Aborted

$ dmtxwrite -fa -e8 /etc/passwd
dmtxwrite: dmtxencode.c:173: dmtxEncodeDataMatrix: Assertion `sizeIdx != -1 && sizeIdx != -2' failed.
Aborted

The error should be more sensible (e.g. "Data must be less than x characters with encoding y.") if it's necessary at all. A far better solution would be to enable structured appends, so that messages that overflow the symbol size can be continued in additional symbols.

Discussion

  • Private Citizen

    Private Citizen - 2008-01-08
    • priority: 5 --> 4
     
  • Mike Laughton

    Mike Laughton - 2008-01-08
    • labels: 1050219 --> encoding
    • milestone: --> version 0.4.0
     
  • Mike Laughton

    Mike Laughton - 2008-01-08

    Logged In: YES
    user_id=1384836
    Originator: NO

    Actually, these look like real, unanticipated errors. The encoder makes heavy use of assertions to keep tabs on the internal workings, while the conditions you described are handled using more traditional tests.

    Do you have a test file that you can post so I can reproduce the errors? Please don't post your /etc/passwd file. :)

     
  • Private Citizen

    Private Citizen - 2008-01-08

    bash shell script for exploring the boundary condition

     
  • Private Citizen

    Private Citizen - 2008-01-08

    Logged In: YES
    user_id=974872
    Originator: YES

    I've done you one better. I've created a bash script that tests the boundary conditions and displays the number of bytes/characters that triggers the assertion failure. See attached.
    File Added: libdmtx-encoding-test.sh

     

Log in to post a comment.

MongoDB Logo MongoDB