Created attachment 1880 [details] corrupted dirstate file Somehow (probably failed restore from hibernated system) my 'dirstate' file was corrupted: 190kB with only 0x00 bytes in all file. Any 'hg' command causes hg.exe to crash: ======================== Podpis problemu: Nazwa zdarzenia problemu: APPCRASH Nazwa aplikacji: hg.exe Wersja aplikacji: 3.6.1.0 Sygnatura czasowa aplikacji: 4918017b Nazwa modułu z błędem: MSVCR90.dll Wersja modułu z błędem: 9.0.30729.6161 Sygnatura czasowa modułu z błędem: 4dace4e7 Kod wyjątku: c0000005 Przesunięcie wyjątku: 000000000001e51d Wersja systemu operacyjnego: 6.1.7601.2.1.0.256.48 Identyfikator ustawień regionalnych: 1045 Dodatkowe informacje 1: 2ad9 Dodatkowe informacje 2: 2ad922288d1197cb0e39ebfca1c9763d Dodatkowe informacje 3: 5787 Dodatkowe informacje 4: 5787facdad846807ec2517374d75d1a1 ======================== 'hg debugrebuildstate -r tip' also causes appcrash. Only 'hg clone' from outside of repo worked. Cloned repo worked. Deleting 'dirstate' from broken repo - hg commands stopped crashed, but working directory is broken: ======================== λ hg sum parent: -1:000000000000 (no revision checked out) branch: sralgs commit: 2830 unknown (new branch) update: 6227 new changesets (update) phases: 1034 draft ======================== (I understate this is expected) After copied 'dirstate' from cloned repo to broken repo, working directory seems ok: ======================== λ hg sum parent: 6569:0b005c2a028c tip my last commit message branch: sralgs commit: 1 modified update: (current) phases: 1034 draft ======================== λ hg verify -v repository uses revlog format 1 checking changesets checking manifests crosschecking files in changesets and manifests checking files 8843 files, 6570 changesets, 28581 total revisions ========================
Confirmed. parse_dirstate() could read at most 17 bytes beyond the boundary.
Fixed by https://selenic.com/repo/hg/rev/f5e8cb813a4d Yuya Nishihara <yuya@tcha.org> parsers: fix parse_dirstate to check len before unpacking header (issue4979) (please test the fix)
Bug was set to TESTING for 7 days, resolving