Apologies in advance.. Before I further compound recent blunders, I could use some feedback;
Until the build and install of capstone source 3.0.5-rc2, I could (using my distro toolchain, and unpatched capstone) make any CHDK trunk/ target I wanted; tools worked properly. Eg, dumpchk -fix did not core dump, capstone could read inside the dumps. The CHDK's that I built booted and ran in the cams.
Since the build and install of capstone source 3.0.5-rc2, I can't build dumpchk or capdis correctly. Compiler spits warnings, (perhaps relevant) but makes the files. dumpchk core dumps. Getting this on ubuntu 16.04 and 17.04, both x86_64.
Does not seem to matter now if I use distro toolchain for gcc-arm-none-eabi or not. Does not seem to matter if source capstone or distro capstone is used.. any clue helps, thanks.
Compiler err
:~/code/new_trunk/tools$ make OPT_USE_GCC_EABI=1 extras
rawconvert.c -> rawconvert.o
rawconvert.o -> rawconvert
yuvconvert.c -> yuvconvert.o
yuvconvert.c: In function 'main':
yuvconvert.c:212:9: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
p_yuv = in_data;
^
yuvconvert.o -> yuvconvert
find_levent.c -> find_levent.o
dumputil.c -> dumputil.o
find_levent.o dumputil.o -> find_levent
find_eventproc.c -> find_eventproc.o
find_eventproc.c: In function 'find_event_proc':
find_eventproc.c:23:32: warning: pointer targets in passing argument 2 of 'find_word_aligned' differ in signedness [-Wpointer-sign]
while(find_word_aligned(dump,&i,str_addr)) {
^
In file included from find_eventproc.c:7:0:
dumputil.h:16:5: note: expected 'unsigned int *' but argument is of type 'int *'
int find_word_aligned(dump_t *dump, unsigned *index, uint32_t word);
^~~~~~~~~~~~~~~~~
find_eventproc.o dumputil.o -> find_eventproc
dumpchk.c -> dumpchk.o
dumpchk.c: In function 'main':
dumpchk.c:111:3: warning: ignoring return value of 'fread', declared with attribute warn_unused_result [-Wunused-result]
fread(buf, 1, size, dumpfile);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dumpchk.o -> dumpchk
extract_error_table.c -> extract_error_table.o
extract_error_table.o dumputil.o -> extract_error_table
capdis.c -> capdis.o
capdis.c: In function 'do_dis_range':
capdis.c:866:17: warning: format not a string literal and no format arguments [-Wformat-security]
printf(comment_start);
^~~~~~
capdis.c:905:25: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
printf("%04x ",*(unsigned short *)is->insn->bytes);
^~~~~~
capdis.c:907:25: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
printf("%04x %04x",*(unsigned short *)is->insn->bytes,*(unsigned short *)(is->insn->bytes+2));
^~~~~~
stubs_load.c -> stubs_load.o
firmware_load_ng.c -> firmware_load_ng.o
firmware_load_ng.c: In function 'firmware_load':
firmware_load_ng.c:1608:5: warning: ignoring return value of 'fread', declared with attribute warn_unused_result [-Wunused-result]
fread(fw->buf8, 1, fw->size8, f);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
capdis.o stubs_load.o firmware_load_ng.o -> capdis
and informing about the core dump
:~/code/new_trunk/tools$ ./dumpchk -fix ../../chdk_trunk/tools/PRIMARY.BIN.M10
../../chdk_trunk/tools/PRIMARY.BIN.M10 0x2000000 (33554432) bytes no sig found
*** Error in `./dumpchk': double free or corruption (!prev): 0x000055cdc3d6d010 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7908b)[0x7f5f5457a08b]
/lib/x86_64-linux-gnu/libc.so.6(+0x826fa)[0x7f5f545836fa]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f5f5458712c]
/lib/x86_64-linux-gnu/libc.so.6(fclose+0x132)[0x7f5f5456f522]
./dumpchk(+0xc23)[0x55cdc30b1c23]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f5f545213f1]
./dumpchk(+0xeaa)[0x55cdc30b1eaa]
======= Memory map: ========
55cdc30b1000-55cdc30b3000 r-xp 00000000 08:04 336693 /home/ajm/code/new_trunk/tools/dumpchk
55cdc32b2000-55cdc32b3000 r--p 00001000 08:04 336693 /home/ajm/code/new_trunk/tools/dumpchk
55cdc32b3000-55cdc32b4000 rw-p 00002000 08:04 336693 /home/ajm/code/new_trunk/tools/dumpchk
55cdc3d6d000-55cdc3d8e000 rw-p 00000000 00:00 0 [heap]
7f5f50000000-7f5f50021000 rw-p 00000000 00:00 0
7f5f50021000-7f5f54000000 ---p 00000000 00:00 0
7f5f542ea000-7f5f54300000 r-xp 00000000 08:04 5247577 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f5f54300000-7f5f544ff000 ---p 00016000 08:04 5247577 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f5f544ff000-7f5f54500000 r--p 00015000 08:04 5247577 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f5f54500000-7f5f54501000 rw-p 00016000 08:04 5247577 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f5f54501000-7f5f546be000 r-xp 00000000 08:04 5247537 /lib/x86_64-linux-gnu/libc-2.24.so
7f5f546be000-7f5f548be000 ---p 001bd000 08:04 5247537 /lib/x86_64-linux-gnu/libc-2.24.so
7f5f548be000-7f5f548c2000 r--p 001bd000 08:04 5247537 /lib/x86_64-linux-gnu/libc-2.24.so
7f5f548c2000-7f5f548c4000 rw-p 001c1000 08:04 5247537 /lib/x86_64-linux-gnu/libc-2.24.so
7f5f548c4000-7f5f548c8000 rw-p 00000000 00:00 0
7f5f548c8000-7f5f548ed000 r-xp 00000000 08:04 5247509 /lib/x86_64-linux-gnu/ld-2.24.so
7f5f54acb000-7f5f54acd000 rw-p 00000000 00:00 0
7f5f54ae9000-7f5f54aed000 rw-p 00000000 00:00 0
7f5f54aed000-7f5f54aee000 r--p 00025000 08:04 5247509 /lib/x86_64-linux-gnu/ld-2.24.so
7f5f54aee000-7f5f54aef000 rw-p 00026000 08:04 5247509 /lib/x86_64-linux-gnu/ld-2.24.so
7f5f54aef000-7f5f54af0000 rw-p 00000000 00:00 0
7fff23597000-7fff235b8000 rw-p 00000000 00:00 0 [stack]
7fff235b8000-7fff235ba000 r--p 00000000 00:00 0 [vvar]
7fff235ba000-7fff235bc000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)