Re: [Openocd-development] jtag_add_scan_check Assertion Error

2011-12-22 Thread Mathias K.
Hello,


backtrace from current git repo source.


Regards,

Mathias

---

openocd: core.c:421: jtag_add_scan_check: Assertion `(field-check_value == 
((void *)0)) ||
(field-in_value != ((void *)0))' failed.

Program received signal SIGABRT, Aborted.
0xe424 in __kernel_vsyscall ()
(gdb) bt full
#0  0xe424 in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7e53636 in raise () from /lib/libc.so.6
No symbol table info available.
#2  0xb7e54b6c in abort () from /lib/libc.so.6
No symbol table info available.
#3  0xb7e4c865 in ?? () from /lib/libc.so.6
No symbol table info available.
#4  0xb7e4c91d in __assert_fail () from /lib/libc.so.6
No symbol table info available.
#5  0x0804dc2e in jtag_add_scan_check (active=0x81becf0, jtag_add_scan=0x6, 
in_num_fields=135517632,
in_fields=0xbfffd5c8, state=TAP_IDLE) at core.c:421
field = 0xbfffd5c8
i = optimized out
__PRETTY_FUNCTION__ = jtag_add_scan_check
#6  0x080d97cc in arm_jtag_set_instr_inner (jtag_info=0x81c01f4, new_instr=10, 
no_verify_capture=0x0,
end_state=TAP_IDLE) at arm_jtag.c:48
tap = 0x81becf0
field = {num_bits = 4, out_value = 0xbfffd5dc 
*\320\031\b\370\325\377\277C]\351\267\071,
in_value = 0x0,
  check_value = 0x81bed58 \001, check_mask = 0x81bed68 \017}
t = *\320\031\b
#7  0x080b32aa in arm_jtag_set_instr (new_instr=10, jtag_info=0x81c01f4,
no_verify_capture=optimized out,
end_state=optimized out) at arm_jtag.h:52
tap = optimized out
#8  adi_jtag_dp_scan (dap=0x81c02ac, instr=10 '\n', reg_addr=4 '\004', RnW=1 
'\001',
outvalue=0xbfffd6dc ,
invalue=0x0, ack=0x0) at adi_v5_jtag.c:91
jtag_info = 0x81c01f4
fields = {{num_bits = -1209443005, out_value = 0x6 Address 0x6 out of 
bounds,
in_value = 0x81b5e88 \377\377\377\377XM\034\b\016, check_value = 
0x81a40b0
\350b\033\b\360b\033\b,
check_mask = 0x819d0f8 \030\b\032\bhg\027\b\020}, {num_bits = 
-1073752408,
out_value = 0x8118c8b 1n\020\001\211Ѓ\304,[^_]Ð\215t,
in_value = 0x81a40b0 \350b\033\b\360b\033\b, check_value = 
0x81b62f0
H\312\033\b\b\320\031\b\020,
check_mask = 0x81bca50 0\274\033\bext}}
out_addr_buf = optimized out
retval = 0
#9  0x080b3462 in adi_jtag_dp_scan_u32 (dap=optimized out, instr=optimized 
out,
reg_addr=optimized out,
RnW=1 '\001', outvalue=0, invalue=0x0, ack=0x0) at adi_v5_jtag.c:144
out_value_buf = \000\000\000
retval = optimized out
#10 0x080b34de in adi_jtag_scan_inout_check_u32 (dap=0x81c02ac, 
instr=optimized out,
reg_addr=optimized out,
RnW=1 '\001', outvalue=0, invalue=0x0) at adi_v5_jtag.c:173
---Type return to continue, or q return to quit---
retval = optimized out
#11 0x080d061b in dap_queue_dp_read (data=0x0, dap=0x81c02ac, reg=optimized 
out) at arm_adi_v5.h:260
reg = 4
#12 ahbap_debugport_init (dap=0x81c02ac) at arm_adi_v5.c:1185
ctrlstat = optimized out
cnt = 0
retval = -1073751944
__func__ = ahbap_debugport_init
#13 0x080ea536 in cortex_m3_examine (target=0x81beee8) at cortex_m.c:1894
retval = optimized out
cpuid = 134546344
fpcr = optimized out
i = optimized out
cortex_m3 = 0x81c01f0
swjdp = 0x81c02ac
__func__ = cortex_m3_examine
__FUNCTION__ = cortex_m3_examine
#14 0x08065843 in target_examine_one (target=0x81beee8) at target.c:618
No locals.
#15 target_examine () at target.c:651
retval = 0
target = 0x81beee8
#16 0x0804b6be in handle_init_command (cmd=0xbfffd878) at openocd.c:150
retval = 0
initialized = 1
__func__ = handle_init_command
#17 0x0807b566 in run_command (num_words=1, words=0x81bc960, c=0x81b0318, 
context=optimized out)
at command.c:618
cmd = {ctx = 0x819d008, current = 0x81b0318, name = 0x81b2570 init, 
argc = 0, argv =
0x81bc964}
retval = optimized out
#18 script_command_run (interp=0x819d028, argc=136038600, argv=0xbfffd90c, 
c=0x81b0318,
capture=true) at command.c:218
__FUNCTION__ = script_command_run
nwords = 1
state = 0x81bc8c8
cmd_ctx = optimized out
retval = -1073751796
#19 0x08125804 in Jim_EvalObj (interp=0x819d028, scriptObjPtr=0x81b5eb0) at 
jim.c:10083
argc = 1
j = optimized out
cmd = 0x81a2518
i = 2
script = 0x81b5638
---Type return to continue, or q return to quit---
token = 0x81b6050
retcode = 0
sargv = {0x81bf170, 0x81bc9d8, 0x819d028, 0xbfffd948, 0x811a1f0, 
0x819d028, 0x81bc9d8, 0x2}
argv = 0xbfffd90c
linenr = 1
#20 0x0812788c in Jim_EvalCoreCommand (interp=0x819d028, argc=3, 
argv=0xbfffd9cc) at jim.c:12270
rc = optimized out
#21 0x08125804 in Jim_EvalObj (interp=0x819d028, scriptObjPtr=0x81b2e58) at 
jim.c:10083
argc = 3
j = optimized out
cmd = 0x819e1f8
i = 4
script = 0x81b2f60

Re: [Openocd-development] jtag_add_scan_check Assertion Error

2011-12-22 Thread Øyvind Harboe
 Commenting out this assert everything seems to be OK.

Indeed: http://openocd.zylin.com/297




-- 
Øyvind Harboe - Can Zylin Consulting help on your project?
US toll free 1-866-980-3434
http://www.zylin.com/
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] jtag_add_scan_check Assertion Error

2011-12-22 Thread Drasko DRASKOVIC
On Thu, Dec 22, 2011 at 1:21 PM, Øyvind Harboe oyvind.har...@zylin.com wrote:
 Commenting out this assert everything seems to be OK.

 Indeed: http://openocd.zylin.com/297

Great,
thanks Øyvind for the fix.

BR,
Drasko
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] jtag_add_scan_check Assertion Error

2011-12-21 Thread Drasko DRASKOVIC
Hi all,
with new git repo clone of OpenOCD I have been hitting this assert
during the scan chain init :
openocd: core.c:421: jtag_add_scan_check: Assertion
`(field-check_value == ((void *)0)) || (field-in_value != ((void
*)0))' failed.

Commenting out this assert everything seems to be OK.

I am using libftdi-0.19, and have seen same issue on both ARM946 and
MIPS targets.

BR,
Drasko
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] jtag_add_scan_check Assertion Error

2011-12-21 Thread Øyvind Harboe
Please run this in gdb and do a bt(backtrace).



On Wed, Dec 21, 2011 at 3:52 PM, Drasko DRASKOVIC
drasko.drasko...@gmail.com wrote:
 Hi all,
 with new git repo clone of OpenOCD I have been hitting this assert
 during the scan chain init :
 openocd: core.c:421: jtag_add_scan_check: Assertion
 `(field-check_value == ((void *)0)) || (field-in_value != ((void
 *)0))' failed.

 Commenting out this assert everything seems to be OK.

 I am using libftdi-0.19, and have seen same issue on both ARM946 and
 MIPS targets.

 BR,
 Drasko
 ___
 Openocd-development mailing list
 Openocd-development@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/openocd-development



-- 
Øyvind Harboe - Can Zylin Consulting help on your project?
US toll free 1-866-980-3434
http://www.zylin.com/
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] jtag_add_scan_check Assertion Error

2011-12-21 Thread Øyvind Harboe
 Commenting out this assert everything seems to be OK.

This will eventually cause a crash and must be fixed.

The fix is easy: just provide a storage for in_value when using callbacks or
checking against value/mask.

-- 
Øyvind Harboe - Can Zylin Consulting help on your project?
US toll free 1-866-980-3434
http://www.zylin.com/
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] jtag_add_scan_check Assertion Error

2011-12-21 Thread Drasko DRASKOVIC
On Wed, Dec 21, 2011 at 3:54 PM, Øyvind Harboe oyvind.har...@zylin.com wrote:
 Please run this in gdb and do a bt(backtrace).

Seems to be working fine, at least OpenOCD does not break.

I have in the end of the listing
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
but I guess not related to this problem.

I can see that this was recent commit :

[ddraskovic@lardos:/home/ddraskovic/openocd]git show a30a4f0f
commit a30a4f0fc76b72936a6557e08d6b55b3a46eaafd
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Tue Dec 13 23:44:34 2011 +0100

jtag: make caller always allocate buffer

simplifies the API and there is only one remaining user at this point.

Is the implementation busted where the check does not actually happen
now?

Change-Id: I776a43766f5576a08df320f6fe41a2750d101bde
Signed-off-by: Øyvind Harboe oyvind.har...@zylin.com
Reviewed-on: http://openocd.zylin.com/264
Tested-by: jenkins
Reviewed-by: Spencer Oliver s...@spen-soft.co.uk

diff --git a/src/jtag/core.c b/src/jtag/core.c
index 3090ddd..529e9bc 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -417,12 +417,8 @@ static void jtag_add_scan_check(struct jtag_tap
*active, void (*jtag_add_scan)(s
for (int i = 0; i  in_num_fields; i++)
{
struct scan_field *field = in_fields[i];
-   field-allocated = 0;
-   field-modified = 0;
-   if (field-check_value || field-in_value)
-   continue;
-   interface_jtag_add_scan_check_alloc(field);
-   field-modified = 1;
+   /* caller must provide in_buffer if needed for callback */
+   assert((field-check_value == NULL) || (field-in_value != NULL));
}




Seems to be introducing a bit of regression... Some unchanged files remain ?

BR,
Drasko





 On Wed, Dec 21, 2011 at 3:52 PM, Drasko DRASKOVIC
 drasko.drasko...@gmail.com wrote:
 Hi all,
 with new git repo clone of OpenOCD I have been hitting this assert
 during the scan chain init :
 openocd: core.c:421: jtag_add_scan_check: Assertion
 `(field-check_value == ((void *)0)) || (field-in_value != ((void
 *)0))' failed.

 Commenting out this assert everything seems to be OK.

 I am using libftdi-0.19, and have seen same issue on both ARM946 and
 MIPS targets.

 BR,
 Drasko
 ___
 Openocd-development mailing list
 Openocd-development@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/openocd-development



 --
 Øyvind Harboe - Can Zylin Consulting help on your project?
 US toll free 1-866-980-3434
 http://www.zylin.com/
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development