Summary
z3.egg eof handling bug
Metadata
- Id: 1345c7f7985abc2c88a92bdfa6c3e3270d6da387
- Trac id: 79
- Type: defect
- Reporter: tonysidaway
- Owner: tonysidaway
- Cc:
- Status: closed
- Component: extensions
- Estimated difficulty:
- Resolution: fixed
- Priority: major
- Milestone:
- Version: 4.1.x
- Changetime: 2009-10-22 17:59:55 UTC
- Created: 2009-10-09 06:05:41 UTC
- Keywords: z3 egg eof
Attachments
- 1345c7f7985abc2c88a92bdfa6c3e3270d6da387/attachments/diff
Description
This refers to revision 16161, z3.egg as of 9 October, 2009.
If an attempt is made to read from a compressed input file port (z3:open-compressed-input-file) after the eof is reached, it throws an error like this:
Error: (z3:read-decoded) can not read encoded data - Invalid or incomplete multibyte or wide character
This is because it is attempting to fetch data that isn't there.
Suggested fix: bind an eof flag with a value of #f in the let* clause inside z3:open-compressed-input-file. In read-next, set the flag to #t on encountering an end of file condition, and check the flag on each call to read-next prior to attempting to read further characters from the input file, simply returning #!eof if it is set.
Changes and comments
[2009-10-10 16:07:59 UTC] tonysidaway attached diff (description=svn diff for suggested fix (patches z3.scm))
[2009-10-13 12:15:47 UTC] felix changed status from new to assigned
[2009-10-13 12:15:47 UTC] felix set owner to felix
[2009-10-22 17:42:08 UTC] tonysidaway changed status from assigned to accepted
[2009-10-22 17:42:08 UTC] tonysidaway changed owner from felix to tonysidaway
[2009-10-22 17:59:55 UTC] tonysidaway changed status from accepted to closed
[2009-10-22 17:59:55 UTC] tonysidaway set resolution to fixed
[2009-10-22 17:59:55 UTC] tonysidaway wrote:
Applied patch helpfully provided by ticket creator. :)