ó
ˆ5„Oc           @   s²   d  d l  Z  d  d l Z d  d l Z d  d l Z e j j d d ƒ Z e j j	 d e j j
 e d ƒ ƒ d  d l Z d Z d Z d Z d	 Z d
 e  j f d „  ƒ  YZ e  j ƒ  d S(   iÿÿÿÿNt   APPORT_DATA_DIRs   /usr/share/apporti    s   general-hookssú  eax            0xffffffff -1
ecx            0xbfc6af40   -1077498048
edx            0x1  1
ebx            0x26eff4 2551796
esp            0xbfc6af24   0xbfc6af24
ebp            0xbfc6af28   0xbfc6af28
esi            0x826bb60    136756064
edi            0x8083480    134755456
eip            0x808354e    0x808354e <main+14>
eflags         0x200286 [ PF SF IF ID ]
cs             0x73 115
ss             0x7b 123
ds             0x7b 123
es             0x7b 123
fs             0x4  4
gs             0x33 51
s-  rax            0xffffffffffffffff   -1
rbx            0x26eff4 2551796
rcx            0xffffffffffffffff   -1
rdx            0xffffffffff600180   -10485376
rsi            0x0  0
rdi            0x7fffffffe3b0   140737488348080
rbp            0x0  0x0
rsp            0x0000bfc6af24   0x0000bfc6af24
r8             0x0  0
r9             0x0  0
r10            0x7fffffffe140   140737488347456
r11            0x246    582
r12            0x7fffffffe400   140737488348160
r13            0x7fffffffe468   140737488348264
r14            0x1  1
r15            0x7fffffffe460   140737488348256
rip            0x7ffff790be10   0x7ffff790be10 <nanosleep+16>
eflags         0x246    [ PF ZF IF ]
cs             0x33 51
ss             0x2b 43
ds             0x0  0
es             0x0  0
fs             0x0  0
gs             0x0  0
fctrl          0x37f    895
fstat          0x0  0
ftag           0xffff   65535
fiseg          0x0  0
fioff          0x40303a 4206650
foseg          0x0  0
fooff          0x0  0
fop            0x5d8    1496
mxcsr          0x1f80   [ IM DM ZM OM UM PM ]
sà	  00110000-0026c000 r-xp 00000000 08:06 375131     /lib/tls/i686/cmov/libc-2.9.so
0026c000-0026d000 ---p 0015c000 08:06 375131     /lib/tls/i686/cmov/libc-2.9.so
0026d000-0026f000 r--p 0015c000 08:06 375131     /lib/tls/i686/cmov/libc-2.9.so
0026f000-00270000 rw-p 0015e000 08:06 375131     /lib/tls/i686/cmov/libc-2.9.so
00270000-00273000 rw-p 00000000 00:00 0
002c1000-002e5000 r-xp 00000000 08:06 375135     /lib/tls/i686/cmov/libm-2.9.so
002e5000-002e6000 r--p 00023000 08:06 375135     /lib/tls/i686/cmov/libm-2.9.so
002e6000-002e7000 rw-p 00024000 08:06 375135     /lib/tls/i686/cmov/libm-2.9.so
00318000-00334000 r-xp 00000000 08:06 977846     /lib/ld-2.9.so
00334000-00335000 r--p 0001b000 08:06 977846     /lib/ld-2.9.so
00335000-00336000 rw-p 0001c000 08:06 977846     /lib/ld-2.9.so
0056e000-005a1000 r-xp 00000000 08:06 65575      /lib/libncurses.so.5.7
005a1000-005a3000 r--p 00033000 08:06 65575      /lib/libncurses.so.5.7
005a3000-005a4000 rw-p 00035000 08:06 65575      /lib/libncurses.so.5.7
00b67000-00b68000 r-xp 00000000 00:00 0          [vdso]
00bb6000-00bcb000 r-xp 00000000 08:06 375202     /lib/tls/i686/cmov/libpthread-2.9.so
00bcb000-00bcc000 r--p 00014000 08:06 375202     /lib/tls/i686/cmov/libpthread-2.9.so
00bcc000-00bcd000 rw-p 00015000 08:06 375202     /lib/tls/i686/cmov/libpthread-2.9.so
00bcd000-00bcf000 rw-p 00000000 00:00 0
00beb000-00bed000 r-xp 00000000 08:06 375134     /lib/tls/i686/cmov/libdl-2.9.so
00bed000-00bee000 r--p 00001000 08:06 375134     /lib/tls/i686/cmov/libdl-2.9.so
00bee000-00bef000 rw-p 00002000 08:06 375134     /lib/tls/i686/cmov/libdl-2.9.so
00c56000-00c7a000 r-xp 00000000 08:06 1140420    /usr/lib/libexpat.so.1.5.2
00c7a000-00c7c000 r--p 00023000 08:06 1140420    /usr/lib/libexpat.so.1.5.2
00c7c000-00c7d000 rw-p 00025000 08:06 1140420    /usr/lib/libexpat.so.1.5.2
00dce000-00dfa000 r-xp 00000000 08:06 65612      /lib/libreadline.so.5.2
00dfa000-00dfb000 ---p 0002c000 08:06 65612      /lib/libreadline.so.5.2
00dfb000-00dfc000 r--p 0002c000 08:06 65612      /lib/libreadline.so.5.2
00dfc000-00dff000 rw-p 0002d000 08:06 65612      /lib/libreadline.so.5.2
00dff000-00e00000 rw-p 00000000 00:00 0
08048000-0831c000 r-xp 00000000 08:06 1140349    /usr/bin/gdb
0831c000-0831d000 r--p 002d3000 08:06 1140349    /usr/bin/gdb
0831d000-08325000 rw-p 002d4000 08:06 1140349    /usr/bin/gdb
08325000-0833f000 rw-p 00000000 00:00 0
b8077000-b807a000 rw-p 00000000 00:00 0
b8096000-b8098000 rw-p 00000000 00:00 0
bfc57000-bfc6c000 rw-p 00000000 00:00 0          [stack]
sŒ  0x08083540 <main+0>:    lea    0x4(%esp),%ecx
0x08083544 <main+4>:    and    $0xfffffff0,%esp
0x08083547 <main+7>:    pushl  -0x4(%ecx)
0x0808354a <main+10>:   push   %ebp
0x0808354b <main+11>:   mov    %esp,%ebp
0x0808354d <main+13>:   push   %ecx
0x0808354e <main+14>:   sub    $0x14,%esp
0x08083551 <main+17>:   mov    (%ecx),%eax
0x08083553 <main+19>:   mov    0x4(%ecx),%edx
0x08083556 <main+22>:   lea    -0x14(%ebp),%ecx
0x08083559 <main+25>:   movl   $0x0,-0xc(%ebp)
0x08083560 <main+32>:   movl   $0x826bc68,-0x8(%ebp)
0x08083567 <main+39>:   mov    %eax,-0x14(%ebp)
0x0808356a <main+42>:   mov    %edx,-0x10(%ebp)
0x0808356d <main+45>:   mov    %ecx,(%esp)
0x08083570 <main+48>:   call   0x8083580 <gdb_main>
0x08083575 <main+53>:   add    $0x14,%esp
0x08083578 <main+56>:   pop    %ecx
0x08083579 <main+57>:   pop    %ebp
0x0808357a <main+58>:   lea    -0x4(%ecx),%esp
0x0808357d <main+61>:   ret
t   Tc           B   sÂ   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s   Test Segfault Parserc         C   sÑ   d } |  j  t t j | d d ƒ y t j | d d ƒ } Wn5 t k
 rr } |  j d t | ƒ k t | ƒ ƒ n Xd } d } t j | | d ƒ } |  j | j d d | ƒ d | _ |  j  t | j	 d ƒ d S(	   s   Require valid registerss   a 0x10
b !!!
t    s   invalid literal for int()s   a 0x10s.   0x08083540 <main+0>:    lea    0x4(%esp),%ecx
t   ai   N(
   t   assertRaisest
   ValueErrort
   parse_segvt	   ParseSegvt
   assertTruet   strt   assertEqualst   regst   Nonet   parse_disassembly(   t   selfR   t   segvt   et   disasm(    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_invalid_00_registers|   s    &	c         C   s  d } d } |  j  t t j | | d ƒ d } |  j  t t j | | d ƒ d } |  j  t t j | | d ƒ d } |  j  t t j | | d ƒ d } t j | | d ƒ } |  j | j d | j ƒ |  j | j d3 | j ƒ |  j | j d3 | j ƒ |  j | j	 d3 | j	 ƒ d } t j | | d ƒ } |  j | j d	 | j ƒ |  j | j d3 | j ƒ |  j | j d3 | j ƒ |  j | j	 d3 | j	 ƒ d
 } t j | | d ƒ } |  j | j d | j ƒ |  j | j d | j ƒ |  j | j d | j ƒ |  j | j	 d | j	 ƒ d } t j | | d ƒ } |  j | j d | j ƒ |  j | j d | j ƒ |  j | j d | j ƒ |  j | j	 d3 | j	 ƒ d } t j | | d ƒ } |  j | j d | j ƒ |  j | j d | j ƒ |  j | j d | j ƒ |  j | j	 d3 | j	 ƒ d } t j | | d ƒ } |  j | j d | j ƒ |  j | j d | j ƒ |  j | j d | j ƒ |  j | j	 d | j	 ƒ d } t j | | d ƒ } |  j | j d | j ƒ |  j | j d | j ƒ |  j | j d | j ƒ |  j | j	 d | j	 ƒ d } t j | | d ƒ } |  j | j d  | j ƒ |  j | j d! | j ƒ |  j | j d" | j ƒ |  j | j	 d# | j	 ƒ d$ } t j | | d ƒ } |  j | j d% | j ƒ |  j | j d& | j ƒ |  j | j d' | j ƒ |  j | j	 d( | j	 ƒ d) } t j | | d ƒ } |  j | j d | j ƒ |  j | j d | j ƒ |  j | j d | j ƒ |  j | j	 d | j	 ƒ d* } t j | | d ƒ } |  j | j d+ | j ƒ |  j | j d, | j ƒ |  j | j d3 | j ƒ |  j | j	 d3 | j	 ƒ d- } d. } t j | | d ƒ } |  j | j d/ | j ƒ |  j | j d0 | j ƒ |  j | j d | j ƒ |  j | j	 d1 | j	 ƒ d- } d2 } t j | | d ƒ } |  j | j d/ | j ƒ |  j | j d0 | j ƒ |  j | j d | j ƒ |  j | j	 d1 | j	 ƒ d3 S(4   s   Require valid disassemblys   a 0x10R   s   Dump ...s   Dump ...
monkeyt   monkeys;   0x1111111111: Cannot access memory at address 0x1111111111
I   s   0x2111111111: 
I!   s8   0x8069ff0 <fopen@plt+132220>: cmpb   $0x0,(%eax,%ebx,1)
iðŸt   cmpbs   $0x0s   (%eax,%ebx,1)s-   0xb765bb48 <_XSend+440>:  call   *0x40(%edi)
IH»e·    t   calls   *0x40(%edi)s;   0xb7aae5a0:   call   0xb7a805af <_Unwind_Find_FDE@plt+111>
I åª·    t
   0xb7a805afs)   0x09083540:    mov    0x4(%esp),%es:%ecx
i@5	t   movs	   0x4(%esp)s   %es:%ecxs.   0x08083540 <main+0>:    lea    0x4(%esp),%ecx
i@5t   leas   %ecxsP   0x404127 <exo_mount_hal_device_mount+167>:
    repz cmpsb %es:(%rdi),%ds:(%rsi)
i'A@ s
   repz cmpsbs
   %es:(%rdi)s
   %ds:(%rsi)s1   0xb031765a <hufftab16+570>: add    0x3430433,%eaxIZv1°    t   addt	   0x3430433s   %eaxs7   Dump ...
0x08083540 <main+0>:    lea    0x4(%esp),%ecx
s   0x08083550 <main+0>:    nop
iP5t   nops	   esp 0x444s"   0x08083560 <main+0>:    push %ecx
i`5t   pushs   (%esp)s%   => 0x08083560 <main+0>:    push %ecx
N(
   R   R   R   R   R
   t   pct   insnR   t   srct   dest(   R   R   R   R   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_invalid_01_disassemblyŽ   s²    c         C   sÊ   d } d } d } t  j | | | ƒ } |  j | j d | j ƒ |  j | j d | j ƒ |  j | j d | j ƒ |  j | j d | j ƒ | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ d	 S(
   s   I/O port violationss   rax            0x3  3sO   0x4087f1 <snd_pcm_hw_params_set_channels_near@plt+19345>:
    out    %al,$0xb3
s  00400000-00412000 r-xp 00000000 08:04 10371157                           /usr/sbin/pommed
00611000-00614000 rw-p 00011000 08:04 10371157                           /usr/sbin/pommed
00614000-00635000 rw-p 00614000 00:00 0                                  [heap]
iñ‡@ t   outs   %als   $0xb3s'   disallowed I/O port operation on port 3N(	   R   R   R
   R   R   R   R    t   reportR   (   R   R   R   t   mapsR   t
   understoodt   reasont   details(    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_ioport_operationý   s    c         C   sµ  d } d } d } |  j  t t j | | | ƒ d } t j | | | ƒ } |  j | j d d d | ƒ |  j | j d d d	 | ƒ |  j | j d d
 d | ƒ |  j | j d d d | ƒ |  j | j d d d | ƒ |  j | j d d d | ƒ |  j | j d d
 d | ƒ |  j | j d d d | ƒ |  j | j d d d | ƒ |  j | j d d d | ƒ |  j | j d d
 d | ƒ |  j | j d d d | ƒ d S(   s   Require valid mapss   a 0x10s7   Dump ...
0x08083540 <main+0>:    lea    0x4(%esp),%ecx
t   asdlkfjaadfs¨   005a3000-005a4000 rw-p 00035000 08:06 65575      /lib/libncurses.so.5.7
00b67000-00b68000 r-xp 00000000 00:00 0          [vdso]
00c67000-00c68000 r--p 00000000 00:00 0 i    t   starti 0Z t   endi @Z t   permss   rw-pt   names   /lib/libncurses.so.5.7i   i p¶ i €¶ s   r-xps   [vdso]i   i pÆ i €Æ s   r--pN(   R   R   R   R   R
   R$   R   (   R   R   R   R$   R   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_invalid_02_maps  s$    c         C   s\   d } d } d } t  j d d ƒ t _ t j | | | d t ƒ} |  j | d k	 | ƒ d S(   s   Debug mode workss   a 0x10s7   Dump ...
0x08083540 <main+0>:    lea    0x4(%esp),%ecx
s¨   005a3000-005a4000 rw-p 00035000 08:06 65575      /lib/libncurses.so.5.7
00b67000-00b68000 r-xp 00000000 00:00 0          [vdso]
00c67000-00c68000 r--p 00000000 00:00 0 t   prefixs   parse_segv-stderr-t   debugN(	   t   tempfilet   NamedTemporaryFilet   syst   stderrR   R   t   TrueR   R   (   R   R   R   R$   R   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt
   test_debug-  s    c         C   s¿   d } t  j t | d ƒ } | j d ƒ } |  j | d t | ƒ ƒ | j d ƒ } |  j | d t | ƒ ƒ | j d ƒ } |  j | d t | ƒ ƒ | j d	 ƒ } |  j | d
 t | ƒ ƒ d S(   s   Sub-register parsings&   0x08083540 <main+0>:    mov    $1,%ecxR   s   %rdxl   €À~ÿÿ s   %edxI€`ÿ    s   %dxi€  s   %dli€   N(   R   R   t   regs64t   register_valuet   assertEqualt   hex(   R   R   R   t   val(    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_register_values:  s    c         C   sÛ  d } t  j t | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j | j d ƒ d | j d ƒ |  j | j d ƒ d | j d ƒ |  j | j d ƒ d | j d ƒ |  j | j d	 ƒ d
 | j d ƒ |  j | j d ƒ d d ƒ |  j | j d ƒ d | j d ƒ |  j | j d ƒ d | j d ƒ |  j | j d ƒ d | j d ƒ |  j | j d ƒ d | j d ƒ d } t  j t | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j | j d ƒ d | j d ƒ d S(   s   Handles unknown segfaultss&   0x08083540 <main+0>:    mov    $1,%ecxs   (%ecx)I@¯Æ¿    t   ecxs
   0x10(%ecx)IP¯Æ¿    s   -0x20(%ecx)I ¯Æ¿    s
   %fs:(%ecx)ID¯Æ¿    t	   0x3404403iD@s   *0x40(%edi)iÀ4t   edis   (%edx,%ebx,1)iõï& t   ebxs   (%eax,%ebx,1)ióï& s   0x10(,%ebx,1)ið& s&   0x08083540 <main+0>:    mov    $1,%rcxs   (%rax,%rbx,1)t   rbxN(	   R   R   R   R$   R#   t   assertFalseR9   t   calculate_argR7   (   R   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_unknownI  s$    ########c         C   sÜ   d } t  j t | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d } t  j t | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s   Handles PC in missing VMAs-   0x00083540 <main+0>:    lea    0x4(%esp),%ecxs1   PC (0x00083540) not located in a known VMA regions   executing unknown VMAs   0x00083544:s1   PC (0x00083544) not located in a known VMA regionN(   R   R   R   R$   R#   R   (   R   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_pc_missingd  s    c         C   sp   d } t  j t | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s   Handles PC in NULL VMAs-   0x00000540 <main+0>:    lea    0x4(%esp),%ecxs1   PC (0x00000540) not located in a known VMA regions   executing NULL VMAN(   R   R   R   R$   R#   R   (   R   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_pc_nullu  s    c         C   sp   d } t  j t | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s   Handles PC in writable NX VMAs-   0x005a3000 <main+0>:    lea    0x4(%esp),%ecxs-   PC (0x005a3000) in non-executable VMA region:s-   executing writable VMA /lib/libncurses.so.5.7N(   R   R   R   R$   R#   R   (   R   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_pc_nx_writable  s    c         C   sp   d } t  j t | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s!   Handles PC in non-writable NX VMAs-   0x00dfb000 <main+0>:    lea    0x4(%esp),%ecxs-   PC (0x00dfb000) in non-executable VMA region:s2   executing non-writable VMA /lib/libreadline.so.5.2N(   R   R   R   R$   R#   R   (   R   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_pc_nx_unwritable‰  s    c         C   sæ   t  d } d } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s   Handles source in missing VMAs&   ecx            0x0006af24   0xbfc6af24s)   0x08083547 <main+7>:    pushl  -0x4(%ecx)sB   source "-0x4(%ecx)" (0x0006af20) not located in a known VMA regions   reading unknown VMAs$   0x08083547 <main+7>:    callq  *%ecxs=   source "*%ecx" (0x0006af24) not located in a known VMA regionN(   R   R   R   R$   R#   R   (   R   t   regR   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_src_missing“  s    
c         C   sz   t  d } d } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s   Handles source in NULL VMAs&   ecx            0x00000024   0xbfc6af24s)   0x08083547 <main+7>:    pushl  -0x4(%ecx)sB   source "-0x4(%ecx)" (0x00000020) not located in a known VMA regions   reading NULL VMAN(   R   R   R   R$   R#   R   (   R   RI   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_src_null¨  s    
c         C   s¦   t  d } d } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s"   Handles source not in readable VMAs&   ecx            0x0026c080   0xbfc6af24s)   0x08083547 <main+7>:    pushl  -0x4(%ecx)s<   source "-0x4(%ecx)" (0x0026c07c) in non-readable VMA region:s*   reading VMA /lib/tls/i686/cmov/libc-2.9.sos   Stack memory exhausteds&   Stack pointer not within stack segmentN(   R   R   R   R$   R#   R   RB   (   R   RI   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_src_not_readable´  s    
c         C   sz   t  d } d } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s#   Handles destintation in missing VMAs&   esp            0x0006af24   0xbfc6af24s)   0x08083547 <main+7>:    pushl  -0x4(%ecx)sC   destination "(%esp)" (0x0006af24) not located in a known VMA regions   writing unknown VMAN(   R   R   R   R$   R#   R   (   R   RI   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_dest_missingÁ  s    
c         C   sz   t  d } d } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s    Handles destintation in NULL VMAs&   esp            0x00000024   0xbfc6af24s)   0x08083547 <main+7>:    pushl  -0x4(%ecx)sC   destination "(%esp)" (0x00000024) not located in a known VMA regions   writing NULL VMAN(   R   R   R   R$   R#   R   (   R   RI   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_dest_nullÍ  s    
c         C   sz   t  d } d } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d S(   s'   Handles destination not in writable VMAs&   esp            0x08048080   0xbfc6af24s)   0x08083547 <main+7>:    pushl  -0x4(%ecx)s=   destination "(%esp)" (0x08048080) in non-writable VMA region:s   writing VMA /usr/bin/gdbN(   R   R   R   R$   R#   R   (   R   RI   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_dest_not_writableÙ  s    
c         C   s`   d } t  j t | t ƒ } |  j t | j ƒ d } t  j t | t ƒ } |  j t | j ƒ d S(   s   Rejects insane disassembliess)   0x08083547 <main+7>:    pushl  -0x4(blah)s(   0x08083547 <main+7>:    pushl  -04(%ecx)N(   R   R   R   R$   R   R   R#   (   R   R   R   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_crackful_disasmä  s    c         C   sP  t  d } d } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ t  d } d } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ t  d } d	 } t j | | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d
 | k | ƒ |  j d | k | ƒ d S(   s   Handles walking off the stacks&   esp            0xbfc56ff0   0xbfc56ff0s"   0x08083547 <main+7>:    push  %eaxs]   destination "(%esp)" (0xbfc56ff0) not located in a known VMA region (needed writable region)!s&   esp            0xbfc56fff   0xbfc56fffs)   0x08083547 <main+7>:    callq  0x08083540s]   destination "(%esp)" (0xbfc56fff) not located in a known VMA region (needed writable region)!s   Stack memory exhausteds&   esp            0xdfc56000   0xdfc56000s&   0x08083540 <main+0>:    mov    $1,%rcxsK   SP (0xdfc56000) not located in a known VMA region (needed readable region)!s&   Stack pointer not within stack segmentN(   R   R   R   R$   R#   R   (   R   RI   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_stack_failureï  s(    


c         C   sÆ   d } t  j t | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ |  j d | k | ƒ d } t  j t | t ƒ } | j ƒ  \ } } } |  j | | ƒ |  j d | k | ƒ d S(   s#   Handles unknown segfaults in kernels   0x0056e010: rets-   Reason could not be automatically determined.s%   (Unhandled exception in kernel code?)s%   0x00b67422 <__kernel_vsyscall+2>: retsS   Reason could not be automatically determined. (Unhandled exception in kernel code?)N(   R   R   R   R$   R#   RB   R   (   R   R   R   R%   R&   R'   (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   test_segv_stack_kernel_segfault  s    (   t   __name__t
   __module__t   __doc__R   R!   R(   R.   R6   R<   RD   RE   RF   RG   RH   RJ   RK   RL   RM   RN   RO   RP   RQ   RR   (    (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyR   y   s*   		o							
	
	
								(   t   unittestR1   R3   t   os.patht   ost   environt   gett   datadirt   patht   insertt   joinR   R   R7   R$   R   t   TestCaseR   t   main(    (    (    s.   /usr/share/apport/testsuite/test_parse_segv.pyt   <module>   s   0""&ÿ §