I'm trying to recover some lost data from an raw drive image (created wit dd_rescue).
Photorec always segfaults after 900-1000 files. I tried with several disk images, all containing FAT12 to FAT32 partitions. I tried with the pre-compiled 6.14-1 version from my ArchLinux repo, and with the self-compiled 7.0-WIP and with the current git... same result.
The segfault is at:
"file_reg.c:79 if(memcmp(block,"RGDB",4)!=0)" (__memcmp_sse4_1 () from /usr/lib/libc.so.6)
Code: Select all
#0 0x00007ffff6c15444 in __memcmp_sse4_1 () from /usr/lib/libc.so.6
No symbol table info available.
#1 0x00000000004428b9 in header_check_reg_9x (buffer=0x7ffff7f7e800 "CREG", buffer_size=65536, safe_header_only=0, file_recovery=0x7fffffffd590, file_recovery_new=0x7fffffffccd0)
at file_reg.c:79
header = 0x7ffff7f7e800
block = 0x7ffff801ec00
#2 0x00000000004224af in photorec_aux (params=0x7fffffffe270, options=0x7fffffffe2d0, list_search_space=0x698a00 <list_search_space.6939>) at psearchn.c:195
file_check = 0x7f47d0
tmp = 0x7f47d0
pos = 0x87f000
tmpl = 0x882000
file_recovery_new = {
filename = "\000kLFT3\000k\000\212i\000\000\000\000\000\320\342\377\377\377\177\000\000p\342\377\377\377\177\000\000\000XT3\000kNXT4\000kNXT5\000kNXT6\000kNXT7\000kPRV3\000kPRV4\000kPRV5\000kPRV6\000kPRV7\000kRIT3\000kRIT4\000kRIT5\000kRIT6\000kRIT7\000kUP\000kUP3\000kUP4\000kUP5\000kUP6\000kUP7\000ka2\000kb1\000kb3\000kc2", '\000' <repeats 11 times>, "p\323\377\377\377\177\000\000`\323\377\377\377\177\000\000\f\232\261\366\377\177\000\000"..., location = {list = {next = 0x7fffffffd4d0, prev = 0x7fffffffd4d0}, start = 417644032, end = 0,
data = 0}, loc = 0xf00690, file_stat = 0x0, handle = 0x0, time = 0, file_size = 0, file_size_on_disk = 0, extension = 0x47a660 "exe", min_filesize = 0, offset_ok = 0,
offset_error = 0, extra = 0, calculated_file_size = 0, data_check = 0x0, file_check = 0x0, file_rename = 0x0, checkpoint_offset = 0, checkpoint_status = 0, blocksize = 1024,
flags = 0}
file_recovered = 0
old_offset = 419126784
offset = 419126784
buffer_start = 0x7ffff7f65000 ""
buffer_olddata = 0x7ffff7f7e400 "\313\211]\374t\vS\377u\b\350\322n\001"
buffer = 0x7ffff7f7e800 "CREG"
start_time = 1381474354
previous_time = 1381474355
next_checkpoint = 1381474654
ind_stop = PSTATUS_OK
buffer_size = 525312
blocksize = 1024
read_size = 65536
offset_before_back = 417644032
back = 0
current_search_space = 0xf00690
file_recovery = {
filename = "/data/data2/rec/recup_dir.7/f0815711.exe\000\064\000kNXT5\000kNXT6\000kNXT7\000kPRV3\000kPRV4\000kPRV5\000kPRV6\000kPRV7\000kRIT3\000kRIT4\000kRIT5\000kRIT6\000kRIT7\000kUP\000kUP3\000kUP4\000kUP5\000kUP6\000kUP7\000ka2\000kb1\000kb3\000kc2", '\000' <repeats 11 times>, "p\323\377\377\377\177\000\000`\323\377\377\377\177\000\000\f\232\261\366\377\177\000\000"..., location = {list = {next = 0x7fffffffdd90, prev = 0x7fffffffdd90}, start = 417644032, end = 0, data = 0}, loc = 0xf00690, file_stat = 0x7fe4a0, handle = 0xf006d0, time = 0,
file_size = 1482752, file_size_on_disk = 1482752, extension = 0x47a660 "exe", min_filesize = 0, offset_ok = 0, offset_error = 0, extra = 0, calculated_file_size = 0,
data_check = 0x0, file_check = 0x0, file_rename = 0x0, checkpoint_offset = 0, checkpoint_status = 0, blocksize = 1024, flags = 0}
#3 0x000000000041f591 in photorec (params=0x7fffffffe270, options=0x7fffffffe2d0, list_search_space=0x698a00 <list_search_space.6939>) at phrecn.c:457
old_file_nbr = 0
ind_stop = PSTATUS_OK
blocksize_is_known = 0
#4 0x0000000000421b88 in menu_photorec (params=0x7fffffffe270, options=0x7fffffffe2d0, list_search_space=0x698a00 <list_search_space.6939>) at ppartsel.c:409
element = 0x0
i = 2
list_part = 0x79dcd0
current_element = 0x79dcd0
current_element_num = 0
user_blocksize = 0
done = 0
mode_init_space = INIT_SPACE_WHOLE
command = 83
offset = 0
menu = 0
menuMain = {{key = 83, name = 0x477bef "Search", desc = 0x477bf6 "Start file recovery"}, {key = 79, name = 0x477c0a "Options", desc = 0x477c12 "Modify options"}, {key = 70,
name = 0x477c21 "File Opt", desc = 0x477c2a "Modify file options"}, {key = 71, name = 0x477c3e "Geometry", desc = 0x477c47 "Change disk geometry"}, {key = 81,
name = 0x477c5c "Quit", desc = 0x477c61 "Return to disk selection"}, {key = 0, name = 0x0, desc = 0x0}}
#5 0x000000000041b315 in photorec_disk_selection_ncurses (params=0x7fffffffe270, options=0x7fffffffe2d0, list_disk=0x6c1270, list_search_space=0x698a00 <list_search_space.6939>)
at pdisksel.c:283
disk = 0x79d740
hpa_dco = 0
menu_options = 0x4765c9 "OQ"
i = 1
command = 79
real_key = 13
menu = 2
offset = 0
pos_num = 0
use_sudo = 0
element_disk = 0x0
current_disk = 0x6c1270
menuMain = {{key = 80, name = 0x4765fa "Previous", desc = 0x476603 ""}, {key = 78, name = 0x476604 "Next", desc = 0x476603 ""}, {key = 79, name = 0x476609 "Proceed",
desc = 0x476603 ""}, {key = 83, name = 0x476611 "Sudo", desc = 0x476618 "Use the sudo command to restart as root"}, {key = 81, name = 0x476640 "Quit",
desc = 0x476645 "Quit program"}, {key = 0, name = 0x0, desc = 0x0}}
#6 0x000000000041b473 in do_curses_photorec (params=0x7fffffffe270, options=0x7fffffffe2d0, list_disk=0x6c1270) at pdisksel.c:331
list_search_space = {list = {next = 0x7c7e60, prev = 0xf00690}, start = 0, end = 0, file_stat = 0x0, data = 0}
#7 0x0000000000404db3 in main (argc=2, argv=0x7fffffffe468) at phmain.c:365
i = 2
use_sudo = 0
help = 0
version = 0
create_log = 0
run_setlocale = 1
testdisk_mode = 8
list_disk = 0x6c1270
element_disk = 0x0
logfile = 0x471c64 "photorec.log"
log_handle = 0x0
log_errno = 0
options = {paranoid = 1, keep_corrupted_file = 0, mode_ext2 = 0, expert = 0, lowmem = 0, verbose = 0, list_file_format = 0x69baa0 <list_file_enable>}
params = {cmd_device = 0x0, cmd_run = 0x0, disk = 0x79d740, partition = 0x79db60, carve_free_space_only = 0, blocksize = 1024, pass = 1, status = STATUS_EXT2_OFF,
real_start_time = 1381474354, recup_dir = 0x800fa0 "/data/data2/rec/recup_dir", dir_num = 7, file_nbr = 3060, file_stats = 0x7fe000, offset = 112467456}
(gdb) up
#1 0x00000000004428b9 in header_check_reg_9x (buffer=0x7ffff7f7e800 "CREG", buffer_size=65536, safe_header_only=0, file_recovery=0x7fffffffd590, file_recovery_new=0x7fffffffccd0)
at file_reg.c:79
79 if(memcmp(block,"RGDB",4)!=0)
(gdb)
Code: Select all
Using locale 'C'.
Fri Oct 11 09:01:20 2013
Command line: PhotoRec /log /debug XP6
PhotoRec 7.0-WIP, Data Recovery Utility, August 2013
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
OS: Linux, kernel 3.10.15 (#1 SMP PREEMPT Tue Oct 8 10:24:42 CEST 2013) x86_64
Compiler: GCC 4.8
Compilation date: 2013-10-11T08:37:53
ext2fs lib: 1.42.8, ntfs lib: libntfs-3g, ewf lib: none, libjpeg: libjpeg-turbo-1.3.0
Hard disk list
Disk XP6 - 2111 MB / 2014 MiB - CHS 257 255 63 (RO), sector size=512
Partition table type (auto): Intel
Geometry from i386 MBR: head=64 sector=63
FAT32 at 0/1/1
Info: size boot_sector 4120640, partition 4120641
FAT1 : 38-4054
FAT2 : 4055-8071
start_rootdir : 8072 root cluster : 2
Data : 8072-4120639
sectors : 4120640
cluster_size : 8
no_of_cluster : 514071 (2 - 514072)
fat_length 4017 calculated 4017
heads/cylinder 64 (FAT) != 255 (HD)
get_geometry_from_list_part_aux head=255 nbr=1
get_geometry_from_list_part_aux head=8 nbr=2
get_geometry_from_list_part_aux head=16 nbr=2
get_geometry_from_list_part_aux head=32 nbr=2
get_geometry_from_list_part_aux head=64 nbr=2
get_geometry_from_list_part_aux head=128 nbr=2
get_geometry_from_list_part_aux head=240 nbr=1
get_geometry_from_list_part_aux head=255 nbr=1
No partition 0 0 1 256 191 63 4124736 [Whole disk]
1 * FAT32 0 1 1 256 127 63 4120641 [IRIS]
FAT32, blocksize=4096, 2109 MB / 2012 MiB
602 first-level signatures enabled
Analyse
No partition 0 0 1 256 191 63 4124736 [Whole disk]
Pass 0 (blocksize=512) STATUS_FIND_OFFSET
* 0-4124735: (null)
4124736 sectors contains unknown data, 0 invalid files found and rejected.
Elapsed time 0h00m00s
Pass 1 (blocksize=1024) STATUS_EXT2_OFF
* 1-62: (null)
63-68: fat
69-8414: fat
8415-8422: fat
8423-8518: fat
8519-8526: cab
8527-8702: cab
8703-8862: cab
8863-9126: cab
9127-11814: cab
11815-4124735: lnk
4124735 sectors contains unknown data, 10 invalid files found and rejected.
Sector 8415
37 drwxr-xr-x 0 0 0 16-Sep-2004 14:43 .
0 drwxr-xr-x 0 0 0 16-Sep-2004 14:43 ..
38 drwxr-xr-x 0 0 0 16-Sep-2004 15:03 TEMP
1285 drwxr-xr-x 0 0 0 16-Sep-2004 15:03 ARCHIVE
1800 drwxr-xr-x 0 0 0 16-Sep-2004 15:03 LOGS
2315 drwxr-xr-x 0 0 0 16-Sep-2004 15:03 SFP
2316 drwxr-xr-x 0 0 0 16-Sep-2004 15:03 EXTRACT
188479 -rwxr-xr-x 0 0 52 26-Oct-2004 12:04 DSINFO.DAT
2318 -rwxr-xr-x 0 0 62374 16-Sep-2004 15:03 VxDMon.dat
2334 -rwxr-xr-x 0 0 1 16-Sep-2004 15:03 SRDISKID.DAT
2335 -rwxr-xr-x 0 0 104 16-Sep-2004 15:03 DISKCFG.DAT
9 -rwxr-xr-x 0 0 28 26-Oct-2004 12:04 VxDMon.cfg
[...]
/data/data2/rec/recup_dir.7/f0812119.fat 812119-812120
Sector 812127
100501 drwxr-xr-x 0 0 0 16-Sep-2004 14:35 .
100500 drwxr-xr-x 0 0 0 16-Sep-2004 14:35 ..
100502 -rwxr-xr-x 0 0 2059 8-Jun-2000 19:00 CHART.JS
100503 -rwxr-xr-x 0 0 3212 8-Jun-2000 19:00 EXCEL.JS
100504 -rwxr-xr-x 0 0 3919 8-Jun-2000 19:00 NETWORK.JS
100505 -rwxr-xr-x 0 0 2586 8-Jun-2000 19:00 REGISTRY.JS
100506 -rwxr-xr-x 0 0 2281 8-Jun-2000 19:00 SHORTCUT.JS
100507 -rwxr-xr-x 0 0 1845 8-Jun-2000 19:00 CHART.VBS
100508 -rwxr-xr-x 0 0 3076 8-Jun-2000 19:00 EXCEL.VBS
100509 -rwxr-xr-x 0 0 5378 8-Jun-2000 19:00 NETWORK.VBS
100511 -rwxr-xr-x 0 0 2347 8-Jun-2000 19:00 REGISTRY.VBS
100512 -rwxr-xr-x 0 0 2126 8-Jun-2000 19:00 SHORTCUT.VBS
100513 -rwxr-xr-x 0 0 1941 8-Jun-2000 19:00 SHOWVAR.VBS
/data/data2/rec/recup_dir.7/f0812127.fat 812127-812128
/data/data2/rec/recup_dir.7/f0812135.txt 812135-812140
/data/data2/rec/recup_dir.7/f0812143.txt 812143-812150
/data/data2/rec/recup_dir.7/f0812151.txt 812151-812158
/data/data2/rec/recup_dir.7/f0812159.txt 812159-812164
/data/data2/rec/recup_dir.7/f0812167.txt 812167-812172
/data/data2/rec/recup_dir.7/f0812175.txt 812175-812178
/data/data2/rec/recup_dir.7/f0812183.txt 812183-812188
/data/data2/rec/recup_dir.7/f0812191.txt 812191-812202
/data/data2/rec/recup_dir.7/f0812207.txt 812207-812212
/data/data2/rec/recup_dir.7/f0812215.txt 812215-812220
/data/data2/rec/recup_dir.7/f08122
My system: Linux 3.10.15 PREEMPT x86_64