You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When ion-js reads binary Ion data that includes a local symbol table, it checks to see whether each string being added to the table is already present. If it is, it skips that string. The symbol is not added and the number of entries in the symbol table no longer aligns with the table that was used to encode the data. This behavior is incorrect and causes Errors to be thrown when reading Ion written by libraries other than ion-js.
Ignoring the duplicate symbol means that every starting at SID $11 will map to incorrect text or to no text at all, leading to corrupted data and exceptions like the following:
Error: Symbol $20 greater than maxID.
at BinaryReader.getSymbolString (src/IonBinaryReader.ts:249:23)
at BinaryReader.fieldName (src/IonBinaryReader.ts:128:21)
at _loadStruct (src/dom/index.ts:118:29)
at _loadValue (src/dom/index.ts:108:38)
at Object.load (src/dom/index.ts:68:44)
The text was updated successfully, but these errors were encountered:
zslayton
changed the title
LST discards duplicate symbols on imports, invalidating SIDs
LST discards duplicate symbols in import, invalidating SIDs
Nov 19, 2020
When
ion-js
reads binary Ion data that includes a local symbol table, it checks to see whether each string being added to the table is already present. If it is, it skips that string. The symbol is not added and the number of entries in the symbol table no longer aligns with the table that was used to encode the data. This behavior is incorrect and causes Errors to be thrown when reading Ion written by libraries other thanion-js
.For example, this Ion text:
contains the symbols
files
,name
,format
, andbytes
.A writer encoding that data into binary might (unwisely) choose to add
name
to the symbol table again even though it's already in the system symbol table as SID$4
, creating a new SID$11
.Ignoring the duplicate symbol means that every starting at SID
$11
will map to incorrect text or to no text at all, leading to corrupted data and exceptions like the following:The text was updated successfully, but these errors were encountered: