Bug 547566 - editing files in hexl-mode corrupts file
Summary: editing files in hexl-mode corrupts file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: emacs
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jonathan Underwood
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-14 23:27 UTC by Charles R. Anderson
Modified: 2010-04-20 13:09 UTC (History)
2 users (show)

Fixed In Version: emacs-23.1-13.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-01-29 03:25:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
emacs-hexl-before.pcap (630 bytes, application/octet-stream)
2009-12-14 23:29 UTC, Charles R. Anderson
no flags Details
emacs-hexl-after.pcap (614 bytes, application/octet-stream)
2009-12-14 23:29 UTC, Charles R. Anderson
no flags Details
emacs-hexl-before.hex (3.08 KB, text/plain)
2009-12-14 23:30 UTC, Charles R. Anderson
no flags Details
emacs-hexl-after.hex (3.01 KB, text/plain)
2009-12-14 23:30 UTC, Charles R. Anderson
no flags Details
emacs-hexl.diff - differences between before/after (3.53 KB, patch)
2009-12-14 23:31 UTC, Charles R. Anderson
no flags Details | Diff

Description Charles R. Anderson 2009-12-14 23:27:43 UTC
Description of problem:

Using emacs hexl-mode to simply overwrite/change a few bytes in a file caused file corruption in the saved file.  A whole line of bytes (16 bytes) went missing from the original file.  The saved file is now 16 bytes shorter than the original.

Version-Release number of selected component (if applicable):
23.1-7.fc11.x86_64

How reproducible:
always

Steps to Reproduce:
1. emacs emacs-hexl-before.pcap
2. M-x hexl-mode
3. Move cursor to byte 0x20 (1st one in 3rd line)
4. Edit byte 0x20 to be 0x64: C-M-x.  In the Hex number: entry, type 64
5. Edit byte 0x21 to be 0x01: C-M-x.  In the Hex number: entry, type 01
6. Move cursor to byte 0x24
7. Edit byte 0x24 to be 0x64: C-M-x.  In the Hex number: entry, type 64
8. Edit byte 0x25 to be 0x01: C-M-x.  In the Hex number: entry, type 01
9. Move cursor to byte 0x38
10. Edit byte 0x38 to be 0x01: C-M-x.  In the Hex number: entry, type 01
11. Edit byte 0x39 to be 0x56: C-M-x.  In the Hex number: entry, type 56
12. Move cursor to byte 0x40
13. Edit byte 0x40 to be 0x79: C-M-x.  In the Hex number: entry, type 79
14. Edit byte 0x41 to be 0x98: C-M-x.  In the Hex number: entry, type 98
15. Move cursor to byte 0x4e
16. Edit byte 0x4e to be 0x01: C-M-x.  In the Hex number: entry, type 01
17. Edit byte 0x4f to be 0x42: C-M-x.  In the Hex number: entry, type 42
18. Edit byte 0x50 to be 0xfb: C-M-x.  In the Hex number: entry, type fb
19. Edit byte 0x51 to be 0x24: C-M-x.  In the Hex number: entry, type 24
20. Save file: C-x C-w emacs-hexl-after.pcap
21. hexdump -C -v emacs-hexl-before.pcap > emacs-hexl-before.hex
22. hexdump -C -v emacs-hexl-after.pcap > emacs-hexl-after.hex
23. diff -ub emacs-hexl-before.hex emacs-hexl-after.hex

Actual results:

Comparing the original file to the edited file, the expected changes have been made however additionally bytes 0x60-0x6f went missing and the original bytes starting from 0x70 have been shifted down to position 0x60.  I.e. 16 bytes from 0x60-0x6f have been deleted and the remainder of the file shifted down.  The saved file is also exactly 16 bytes shorter than the original.  Thus the file has become corrupted.

Expected results:

No truncation/corruption of the file when editing bytes in-place.

Additional info:

Comment 1 Charles R. Anderson 2009-12-14 23:29:14 UTC
Created attachment 378386 [details]
emacs-hexl-before.pcap

Comment 2 Charles R. Anderson 2009-12-14 23:29:44 UTC
Created attachment 378387 [details]
emacs-hexl-after.pcap

Comment 3 Charles R. Anderson 2009-12-14 23:30:10 UTC
Created attachment 378389 [details]
emacs-hexl-before.hex

Comment 4 Charles R. Anderson 2009-12-14 23:30:33 UTC
Created attachment 378390 [details]
emacs-hexl-after.hex

Comment 5 Charles R. Anderson 2009-12-14 23:31:15 UTC
Created attachment 378391 [details]
emacs-hexl.diff - differences between before/after

Comment 6 Jonathan Underwood 2010-01-04 13:44:19 UTC
I've forwarded this report to the upstream bugtracker (i.e. to bug-gnu-emacs), though it's not yet appeared in the bug tracker and mail archive.

Comment 7 Jonathan Underwood 2010-01-05 14:23:42 UTC
Upstream bug filed:

Thank you for filing a new bug report with Emacs.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs

If you wish to submit further information on this problem, please
send it to 5313.org.

Please do not send mail to bug-gnu-emacs unless you wish
to report a problem with the Bug-tracking system.

--
5313: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5313

Comment 8 Fedora Update System 2010-01-14 13:34:07 UTC
emacs-23.1-8.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/emacs-23.1-8.fc11

Comment 9 Fedora Update System 2010-01-14 13:35:02 UTC
emacs-23.1-18.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/emacs-23.1-18.fc12

Comment 10 Fedora Update System 2010-01-15 22:00:05 UTC
emacs-23.1-8.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update emacs'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2010-0551

Comment 11 Fedora Update System 2010-01-15 22:16:21 UTC
emacs-23.1-18.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update emacs'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-0653

Comment 12 Fedora Update System 2010-01-29 03:25:20 UTC
emacs-23.1-18.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2010-01-29 03:29:57 UTC
emacs-23.1-8.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2010-03-30 23:17:41 UTC
emacs-23.1-11.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/emacs-23.1-11.fc11

Comment 15 Fedora Update System 2010-04-01 16:09:56 UTC
emacs-23.1-13.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/emacs-23.1-13.fc11

Comment 16 Fedora Update System 2010-04-20 13:08:35 UTC
emacs-23.1-13.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.