ó Â>Sc@s²ddlZddlZddlZddlZejjddƒZejj dejj edƒƒddl Z dZ dZ dZd Zd ejfd „ƒYZejƒdS( iÿÿÿÿNtAPPORT_DATA_DIRs/usr/share/apportis 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 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 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 : lea 0x4(%esp),%ecx 0x08083544 : and $0xfffffff0,%esp 0x08083547 : pushl -0x4(%ecx) 0x0808354a : push %ebp 0x0808354b : mov %esp,%ebp 0x0808354d : push %ecx 0x0808354e : sub $0x14,%esp 0x08083551 : mov (%ecx),%eax 0x08083553 : mov 0x4(%ecx),%edx 0x08083556 : lea -0x14(%ebp),%ecx 0x08083559 : movl $0x0,-0xc(%ebp) 0x08083560 : movl $0x826bc68,-0x8(%ebp) 0x08083567 : mov %eax,-0x14(%ebp) 0x0808356a : mov %edx,-0x10(%ebp) 0x0808356d : mov %ecx,(%esp) 0x08083570 : call 0x8083580 0x08083575 : add $0x14,%esp 0x08083578 : pop %ecx 0x08083579 : pop %ebp 0x0808357a : lea -0x4(%ecx),%esp 0x0808357d : ret tTcBsÂeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(sTest Segfault ParsercCsÑd}|jttj|ddƒytj|ddƒ}Wn5tk rr}|jdt|ƒkt|ƒƒnXd}d}tj||dƒ}|j|jdd|ƒd|_|jt|j dƒdS( sRequire valid registerss a 0x10 b !!! tsinvalid literal for int()sa 0x10s.0x08083540 : lea 0x4(%esp),%ecx taiN( t assertRaisest ValueErrort parse_segvt ParseSegvt assertTruetstrt assertEqualtregstNonetparse_disassembly(tselfR tsegvtetdisasm((s./usr/share/apport/testsuite/test_parse_segv.pyttest_invalid_00_registers}s& cCsd}d}|jttj||dƒd}|jttj||dƒd}|jttj||dƒd}|jttj||dƒd}tj||dƒ}|j|jd|jƒ|j|jd3|jƒ|j|jd3|jƒ|j|j d3|j ƒd}tj||dƒ}|j|jd |jƒ|j|jd3|jƒ|j|jd3|jƒ|j|j d3|j ƒd }tj||dƒ}|j|jd |jƒ|j|jd |jƒ|j|jd |jƒ|j|j d|j ƒd}tj||dƒ}|j|jd|jƒ|j|jd|jƒ|j|jd|jƒ|j|j d3|j ƒd}tj||dƒ}|j|jd|jƒ|j|jd|jƒ|j|jd|jƒ|j|j d3|j ƒd}tj||dƒ}|j|jd|jƒ|j|jd|jƒ|j|jd|jƒ|j|j d|j ƒd}tj||dƒ}|j|jd|jƒ|j|jd|jƒ|j|jd|jƒ|j|j d|j ƒd}tj||dƒ}|j|jd |jƒ|j|jd!|jƒ|j|jd"|jƒ|j|j d#|j ƒd$}tj||dƒ}|j|jd%|jƒ|j|jd&|jƒ|j|jd'|jƒ|j|j d(|j ƒd)}tj||dƒ}|j|jd|jƒ|j|jd|jƒ|j|jd|jƒ|j|j d|j ƒd*}tj||dƒ}|j|jd+|jƒ|j|jd,|jƒ|j|jd3|jƒ|j|j d3|j ƒd-}d.}tj||dƒ}|j|jd/|jƒ|j|jd0|jƒ|j|jd|jƒ|j|j d1|j ƒd-}d2}tj||dƒ}|j|jd/|jƒ|j|jd0|jƒ|j|jd|jƒ|j|j d1|j ƒd3S(4sRequire valid disassemblysa 0x10RsDump ...sDump ... monkeytmonkeys;0x1111111111: Cannot access memory at address 0x1111111111 Is0x2111111111: I!s80x8069ff0 : cmpb $0x0,(%eax,%ebx,1) iðŸtcmpbs$0x0s (%eax,%ebx,1)s-0xb765bb48 <_XSend+440>: call *0x40(%edi) IH»e·tcalls *0x40(%edi)s;0xb7aae5a0: call 0xb7a805af <_Unwind_Find_FDE@plt+111> I åª·t 0xb7a805afs)0x09083540: mov 0x4(%esp),%es:%ecx i@5 tmovs 0x4(%esp)s%es:%ecxs.0x08083540 : lea 0x4(%esp),%ecx i@5tleas%ecxsP0x404127 : repz cmpsb %es:(%rdi),%ds:(%rsi) i'A@s repz cmpsbs %es:(%rdi)s %ds:(%rsi)s10xb031765a : add 0x3430433,%eaxIZv1°taddt 0x3430433s%eaxs7Dump ... 0x08083540 : lea 0x4(%esp),%ecx s0x08083550 : nop iP5tnops esp 0x444s"0x08083560 : push %ecx i`5tpushs(%esp)s%=> 0x08083560 : push %ecx N( RRRRR tpctinsnR tsrctdest(RR RR((s./usr/share/apport/testsuite/test_parse_segv.pyttest_invalid_01_disassemblys²cCsÊd}d}d}tj|||ƒ}|j|jd|jƒ|j|jd|jƒ|j|jd|jƒ|j|jd|jƒ|jƒ\}}}|j||ƒ|jd|k|ƒd S( sI/O port violationssrax 0x3 3sO0x4087f1 : out %al,$0xb3 s00400000-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ñ‡@touts%als$0xb3s'disallowed I/O port operation on port 3N( RRR RRRR treportR(RR RtmapsRt understoodtreasontdetails((s./usr/share/apport/testsuite/test_parse_segv.pyttest_ioport_operationþscCsµd}d}d}|jttj|||ƒd}tj|||ƒ}|j|jddd|ƒ|j|jddd |ƒ|j|jdd d |ƒ|j|jdd d |ƒ|j|jddd|ƒ|j|jddd|ƒ|j|jdd d|ƒ|j|jdd d|ƒ|j|jddd|ƒ|j|jddd|ƒ|j|jdd d|ƒ|j|jdd d|ƒdS(sRequire valid mapssa 0x10s7Dump ... 0x08083540 : 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 itstarti0Ztendi@Ztpermssrw-ptnames/lib/libncurses.so.5.7iip¶i€¶sr-xps[vdso]iipÆi€Æsr--pN(RRRRR R$R (RR RR$R((s./usr/share/apport/testsuite/test_parse_segv.pyttest_invalid_02_mapss$cCs\d}d}d}tjddƒt_tj|||dtƒ}|j|dk |ƒdS(sDebug mode workssa 0x10s7Dump ... 0x08083540 : 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 tprefixsparse_segv-stderr-tdebugN( ttempfiletNamedTemporaryFiletsyststderrRRtTrueRR (RR RR$R((s./usr/share/apport/testsuite/test_parse_segv.pyt test_debug.s cCs¿d}tjt|dƒ}|jdƒ}|j|dt|ƒƒ|jdƒ}|j|dt|ƒƒ|jdƒ}|j|dt|ƒƒ|jd ƒ}|j|d t|ƒƒd S( sSub-register parsings&0x08083540 : mov $1,%ecxRs%rdxl€À~ÿÿs%edxI€`ÿs%dxi€s%dli€N(RRtregs64tregister_valueR thex(RRRtval((s./usr/share/apport/testsuite/test_parse_segv.pyttest_register_values;scCsÛd}tjt|tƒ}|jƒ\}}}|j||ƒ|j|jdƒd|jdƒ|j|jdƒd|jdƒ|j|jdƒd|jdƒ|j|jd ƒd |jdƒ|j|jd ƒd d ƒ|j|jd ƒd|jdƒ|j|jdƒd|jdƒ|j|jdƒd|jdƒ|j|jdƒd|jdƒd}tjt|tƒ}|jƒ\}}}|j||ƒ|j|jdƒd|jdƒdS(sHandles unknown segfaultss&0x08083540 : mov $1,%ecxs(%ecx)I@¯Æ¿tecxs 0x10(%ecx)IP¯Æ¿s -0x20(%ecx)I ¯Æ¿s %fs:(%ecx)ID¯Æ¿t 0x3404403iD@s *0x40(%edi)iÀ4tedis (%edx,%ebx,1)iõï&tebxs (%eax,%ebx,1)ióï&s 0x10(,%ebx,1)ið&s&0x08083540 : mov $1,%rcxs (%rax,%rbx,1)trbxN( RRR R$R#t assertFalseR t calculate_argR7(RRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_unknownJs$########cCsÜd}tjt|tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒd}tjt|tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒdS(sHandles PC in missing VMAs-0x00083540 : lea 0x4(%esp),%ecxs1PC (0x00083540) not located in a known VMA regionsexecuting unknown VMAs 0x00083544:s1PC (0x00083544) not located in a known VMA regionN(RRR R$R#R(RRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_pc_missingescCspd}tjt|tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒdS(sHandles PC in NULL VMAs-0x00000540 : lea 0x4(%esp),%ecxs1PC (0x00000540) not located in a known VMA regionsexecuting NULL VMAN(RRR R$R#R(RRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_pc_nullvs cCspd}tjt|tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒdS(sHandles PC in writable NX VMAs-0x005a3000 : lea 0x4(%esp),%ecxs-PC (0x005a3000) in non-executable VMA region:s-executing writable VMA /lib/libncurses.so.5.7N(RRR R$R#R(RRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_pc_nx_writable€s cCspd}tjt|tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒdS(s!Handles PC in non-writable NX VMAs-0x00dfb000 : lea 0x4(%esp),%ecxs-PC (0x00dfb000) in non-executable VMA region:s2executing non-writable VMA /lib/libreadline.so.5.2N(RRR R$R#R(RRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_pc_nx_unwritableŠs cCsætd}d}tj||tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒd}tj||tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒdS(sHandles source in missing VMAs&ecx 0x0006af24 0xbfc6af24s)0x08083547 : pushl -0x4(%ecx)sBsource "-0x4(%ecx)" (0x0006af20) not located in a known VMA regionsreading unknown VMAs$0x08083547 : callq *%ecxs=source "*%ecx" (0x0006af24) not located in a known VMA regionN(R RRR$R#R(RtregRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_src_missing”s cCsztd}d}tj||tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒdS(sHandles source in NULL VMAs&ecx 0x00000024 0xbfc6af24s)0x08083547 : pushl -0x4(%ecx)sBsource "-0x4(%ecx)" (0x00000020) not located in a known VMA regionsreading NULL VMAN(R RRR$R#R(RRHRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_src_null©s cCs¦td}d}tj||tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒ|jd|k|ƒ|jd|k|ƒdS(s"Handles source not in readable VMAs&ecx 0x0026c080 0xbfc6af24s)0x08083547 : pushl -0x4(%ecx)s<source "-0x4(%ecx)" (0x0026c07c) in non-readable VMA region:s*reading VMA /lib/tls/i686/cmov/libc-2.9.sosStack memory exhausteds&Stack pointer not within stack segmentN(R RRR$R#RRA(RRHRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_src_not_readableµs cCsztd}d}tj||tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒdS(s#Handles destintation in missing VMAs&esp 0x0006af24 0xbfc6af24s)0x08083547 : pushl -0x4(%ecx)sCdestination "(%esp)" (0x0006af24) not located in a known VMA regionswriting unknown VMAN(R RRR$R#R(RRHRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_dest_missingÂs cCsztd}d}tj||tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒdS(s Handles destintation in NULL VMAs&esp 0x00000024 0xbfc6af24s)0x08083547 : pushl -0x4(%ecx)sCdestination "(%esp)" (0x00000024) not located in a known VMA regionswriting NULL VMAN(R RRR$R#R(RRHRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_dest_nullÎs cCsztd}d}tj||tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒdS(s'Handles destination not in writable VMAs&esp 0x08048080 0xbfc6af24s)0x08083547 : pushl -0x4(%ecx)s=destination "(%esp)" (0x08048080) in non-writable VMA region:swriting VMA /usr/bin/gdbN(R RRR$R#R(RRHRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_dest_not_writableÚs cCs`d}tjt|tƒ}|jt|jƒd}tjt|tƒ}|jt|jƒdS(sRejects insane disassembliess)0x08083547 : pushl -0x4(blah)s(0x08083547 : pushl -04(%ecx)N(RRR R$RRR#(RRR((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_crackful_disasmås cCsPtd}d}tj||tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒtd}d}tj||tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒtd}d }tj||tƒ}|jƒ\}}}|j||ƒ|jd |k|ƒ|jd |k|ƒd S( sHandles walking off the stacks&esp 0xbfc56ff0 0xbfc56ff0s"0x08083547 : push %eaxs]destination "(%esp)" (0xbfc56ff0) not located in a known VMA region (needed writable region)!s&esp 0xbfc56fff 0xbfc56fffs)0x08083547 : callq 0x08083540s]destination "(%esp)" (0xbfc56fff) not located in a known VMA region (needed writable region)!sStack memory exhausteds&esp 0xdfc56000 0xdfc56000s&0x08083540 : mov $1,%rcxsKSP (0xdfc56000) not located in a known VMA region (needed readable region)!s&Stack pointer not within stack segmentN(R RRR$R#R(RRHRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_stack_failureðs(   cCsÆd}tjt|tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒ|jd|k|ƒd}tjt|tƒ}|jƒ\}}}|j||ƒ|jd|k|ƒdS(s#Handles unknown segfaults in kernels0x0056e010: rets-Reason could not be automatically determined.s%(Unhandled exception in kernel code?)s%0x00b67422 <__kernel_vsyscall+2>: retsSReason could not be automatically determined. (Unhandled exception in kernel code?)N(RRR R$R#RAR(RRRR%R&R'((s./usr/share/apport/testsuite/test_parse_segv.pyttest_segv_stack_kernel_segfault s(t__name__t __module__t__doc__RR!R(R.R6R;RCRDRERFRGRIRJRKRLRMRNRORPRQ(((s./usr/share/apport/testsuite/test_parse_segv.pyRzs*  o       (tunittestR1R3tos.pathtostenvirontgettdatadirtpathtinserttjoinRR R7R$RtTestCaseRtmain(((s./usr/share/apport/testsuite/test_parse_segv.pyts0" "&ÿ§