Subject: bug#18438: 24.4.50; assertion failed in bidi.c

From: Eli Zaretskii <[email-masked]>
Date: Wed, 17 Sep 2014 08:07:34 +0300

> Date: Wed, 17 Sep 2014 10:42:18 +1200
> From: [email-masked]
> Cc: Eli Zaretskii <[email-masked]>
> 
> On Tue, 16 Sep 2014 17:33:09 +0300, Eli Zaretskii wrote:
> > If you don't mind messing with assembler, it would be interesting to
> > disassemble bidi_check_type, see in which register it holds the value
> > when it tests it, and then look at the actual value in that register
> > in the bidi_check_type's call-stack frame.
> 
> Sure, but I'm not very familiar with x86 assembly, so I'll just post 
> the entire disassemble output to start with and someone else will have 
> to identify the register of interest.
> 
> Dump of assembler code for function bidi_check_type:
>     0x00000001005010c3 <+0>:     push   %rbp
>     0x00000001005010c4 <+1>:     mov    %rsp,%rbp
>     0x00000001005010c7 <+4>:     sub    $0x20,%rsp
>     0x00000001005010cb <+8>:     mov    %ecx,0x10(%rbp)
>     0x00000001005010ce <+11>:    mov    0x58ab9b(%rip),%rax        # 
> 0x100a8bc70 <.refptr.suppress_checking>
>     0x00000001005010d5 <+18>:    movzbl (%rax),%eax
>     0x00000001005010d8 <+21>:    xor    $0x1,%eax
>     0x00000001005010db <+24>:    test   %al,%al
>     0x00000001005010dd <+26>:    je     0x1005010ff <bidi_check_type+60>
>     0x00000001005010df <+28>:    cmpl   $0x17,0x10(%rbp)
>     0x00000001005010e3 <+32>:    jbe    0x1005010ff <bidi_check_type+60>
>     0x00000001005010e5 <+34>:    mov    $0x149,%r8d
>     0x00000001005010eb <+40>:    lea    0x5599de(%rip),%rdx        # 
> 0x100a5aad0 <DEFAULT_REHASH_SIZE+56>
>     0x00000001005010f2 <+47>:    lea    0x5599df(%rip),%rcx        # 
> 0x100a5aad8 <DEFAULT_REHASH_SIZE+64>
>     0x00000001005010f9 <+54>:    callq  0x1005b9a15 <die>
> => 0x00000001005010fe <+59>:    nop
>     0x00000001005010ff <+60>:    add    $0x20,%rsp
>     0x0000000100501103 <+64>:    pop    %rbp
>     0x0000000100501104 <+65>:    retq
> End of assembler dump.

My reading of this is:

  . the value being tested is originally in ECX
  . it is stored in a temporary local variable at RBP+0x10
  . then it is compared with 0x17 (decimal 23)

So you have two places to check: the ECX register and the value
pointed to by RBP+0x10.

Thanks.