403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/apport/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/apport/__pycache__/report.cpython-314.pyc
+
e��i�6���Rt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt	^RI
t
^RIt^RIt^RI
t
^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RI t^RI!H"t"H#t#^RI$t%^RI&t%^RI't'^RI(H)t)H*t*^RI+H,t,^RI-H.t/]
P`PcRR4t2]2R2t3]2R	2t4R
t5]
P`PcRR4t6R
t7Rt8Rt9Rt:.R*Ot;Rt<RRlt=RRlt>RRlt?RRlt@RtAR+RRlltBRtCRtDRtER R!ltFR,R"R#lltGR$tHR%tI!R&R']J]K]K3,4tL!R(R)]'P�4tNR#)-z;Representation of and data collection for a problem report.N)�Iterable�Iterator)�HookUI�NoninteractiveHookUI)�kill_pkttyagent)�impl�APPORT_DATA_DIRz/usr/share/apportz/general-hooks/z/package-hooks/z/opt�APPORT_IGNORE_FILEz~/.apport-ignore.xmlz/etc/apport/report-ignorez/etc/apport/report-onlyz/etc/apport/blacklist.dz/etc/apport/whitelist.dc���\P!V4\P!T4F'pY!9gKTP	T4\Y!4K)	R# \dR#i;i)z7Recursively add dependencies of package to depends_set.N)�	packaging�get_version�
ValueError�get_dependencies�add�_transitive_dependencies)�package�depends_set�ds&& �//usr/lib/python3/dist-packages/apport/report.pyrrVsZ������g�&��
'�
'��
0�����O�O�A��$�Q�4�1������s�A�A*�)A*c�F�V^8�dQhR\R\\,/#)��	directory�return)�strr)�formats"r�__annotate__rbs��

�

�S�

�X�c�]�

�c#�"�\P!V4P4FgpVPRR7;_uu_4pVF:pVP	4pV'gKVPR4'dK6Vx�K<	RRR4Ki	R# +'giK~;i \dK�i;i \dR#i;i5i)z?Read every file in the directory and return each stripped line.�utf-8��encoding�#N)�pathlib�Path�iterdir�open�strip�
startswith�OSError)r�	list_file�fd�line�strippeds&    r�_read_list_files_in_directoryr-bs����
� ���i�0�8�8�:�I�
��^�^�W�^�5�5�� "��#'�:�:�<��#�8�H�,?�,?��,D�,D�"*�N�!#�6�5�;�5�5�5��
�
��
���
��
�s{�C
�'B;�B)�B�&B�?B�B)�B;�C
�B&� B)�$B;�&B)�)B8�4B;�7B8�8B;�;C
�C
�	C
�
C
c	�V�V^8�dQhR\R\R\R\R,/#)r�entry�	fd_dir_fd�
fdinfo_dir_fdrN�r�int)rs"rrrrs,����#��#��c��c�D�j�rc�na�\P!WR7pTRT2p\TRRT3RlR7;_uu_4pTP	4pRRR4X'd TRTP
R4,,
pT# \dR#i;i +'giLK;i \
dTu#i;i)	z�Read info for a single file descriptor entry.

Return formatted string with the FD's target path and fdinfo
metadata, or None if the FD no longer exists.
��dir_fdN�:�UTF-8�replacec�<�\P!V\P\P,\P,SR7#�r5)�osr%�O_RDONLY�
O_NOFOLLOW�	O_CLOEXEC)�path�moder1s&&�r�<lambda>� _read_fd_entry.<locals>.<lambda>�s+���b�g�g��b�k�k�B�M�M�1�B�L�L�@��'r)r �errors�opener�
)r<�readlink�FileNotFoundErrorr%�readr(�rstrip)r/r0r1�targetr+r*�infos&&f    r�_read_fd_entryrMrs��������U�5���W�A�f�X��D��
�����	
�
���7�7�9�D�
����t�{�{�4�(�(�(���K��)�����
�
�������s?�A?�B$�B�B$�?B�
B�B!	�B$�!B$�$
B4�3B4c�0�V^8�dQhR\R\/#)r�proc_pid_fdr�r3r)rs"rrr�s��'�'��'��'rc��\P!R\P\P,\P,\P
,VR7p\P!R\P\P,\P,\P
,TR7p\P!T4p.pTF&p\YaT4pTfKTPT4K(	RPT4\P!T4\P!T4# \dpR\T4,uRp?#Rp?ii;i \d3p\P!T4R\T4,uRp?#Rp?ii;i \dIpR\T4,uRp?\P!T4\P!T4#Rp?ii;i \P!T4\P!T4i;i)z�Read open file descriptors and their fdinfo from /proc/pid.

Return a formatted string with each FD's target path and fdinfo
metadata, or return a textual error if it failed.
r*r5�Error: N�fdinfo�

)
r<r%r=r>r?�O_DIRECTORYr(r�close�listdirrM�append�join)rOr0�errorr1�entries�partsr/�parts&       r�_read_open_fdsr^�s���&��G�G���K�K�"�-�-�'�"�,�,�6����G��
�	�&������K�K�"�-�-�'�"�,�,�6����G��
�
���*�*�Y�'�����E�!�%�M�B�D������T�"��
�{�{�5�!�	�����
������7�&��3�u�:�%�%��&���&�
������3�u�:�%�%��&���&��3�u�:�%�%�
�����
������	&��	�����
�����ss�A&E�)A&E;�*F;�?%F;�E8�E3�-E8�3E8�;F8�'F3�-F8�3F8�;H�H	�H�H�	H�H�.H?c�<�V^8�dQhR\R\R\/#)rr@r6rr2)rs"rrr�s!��&�&�#�&�s�&�s�&rc��\P!V\P\P,VR7p\P!VR4;_uu_4pVP4P
4PRRR7uuRRR4# +'giR#;i \dpR\T4,uRp?#Rp?ii;i)zPRead file content.

Return its content, or return a textual error if it failed.
r5�rbr8r9�rDNrR)
r<r%r=r?�iorIr&�decoder(r)r@r6�	proc_filer*rZs&&   r�_read_proc_filerf�s���
&��G�G�D�"�+�+����"<�V�L�	�
�W�W�Y��
%�
%���7�7�9�?�?�$�+�+�G�I�+�F�&�
%�
%�
%���&��3�u�:�%�%��&�s<�AB+�/B�
B+�B(	�"B+�(B+�+C�6C
�C�
Cc�a�Rp\RV3RlRR7;_uu_4pVP4P4pRRR4V# +'giT#;i \dpR\	T4,uRp?#Rp?ii;i)z�Read /proc/pid/maps.

Since /proc/$pid/maps may become unreadable unless we are ptracing the
process, detect this, and attempt to attach/detach.
z%Error: unable to read /proc maps file�mapsc�4<�\P!WSR7#r;)r<r%)r@rArOs&&�rrB�_read_maps.<locals>.<lambda>�s���b�g�g�d��&Mrr)rEr NrR)r%rIr&r(r)rOrhr*rZsf   r�
_read_mapsrk�sz���3�D�&�
��M��
�
���7�7�9�?�?�$�D�
��K�
�
��K���&��3�u�:�%�%��&�s9�A�A�A�A	�A�A�B�'A>�8B�>Bc��V^8�dQhR\\,R\\\3,R,R\R\/#)r�command�envN�timeoutr)�listr�dict�float)rs"rrr�s=��#�#�
�#�Y�#�!�#�s�(�^�d�2�#�DI�#��#rc�X�\P!VRRVR\P\PVR7pTP^8XdTP
P4#\RTRTPRTP
P424h \PdxpTP
'd-RTP
P
4P42pMRp\R\TP4RTPR	T24ThR
p?ii;i)z�Run command and capture its output.

Try to execute given command (argv list) and return its stdout, or return
a textual error if it failed.
Fr8r9)�checkr rnrD�stdout�stderrro�: z with no stdoutzError: command z timed out after z secondsNz failed with exit code )
�
subprocess�run�PIPE�STDOUT�TimeoutExpiredrurdrJr(r�cmdro�
returncode)rmrnro�sprZ�outputs&&&   r�_command_outputr��s����^�^�������?�?��$�$��	
��&
�}�}����y�y���!�!�
�
�'��"9�"�-�-��I��I�I�����	!�����$�$���<�<�<��%�,�,�-�-�/�6�6�8�9�:�F�&�F���c�%�)�)�n�-�.��m�m�_�H�V�H�
6�
��	���s�:B�D)�2A2D$�$D)c�:�RVP9dR#VPEF�pVP\PP
P8XgK9VPR8XgKLVPR,PpY09dR#TP4TP4'gK�TP^,P\PP
P8XgK�TP^,PpY,p\T\P4'd#TP!4pTP#R4pM'\T\$4'dTP#R4p\&P(!T4pTP1T4'dEK�R#	VPR,P# \dEK�i;i \&P*\,\.3dEK�i;i)zpCheck if given report matches the given bug pattern XML DOM node.

Return the bug URL on match, otherwise None.
�urlN�re�keyr8)�
attributes�
childNodes�nodeType�xml�dom�Node�ELEMENT_NODE�nodeName�	nodeValue�KeyError�	normalize�
hasChildNodes�	TEXT_NODE�
isinstance�problem_report�CompressedValue�	get_value�encode�bytesr��compilerZ�	TypeErrorr
�search)�report�pattern�cr��regexp�v�re_cs&&     r�_check_bug_patternr�sx��

�G�&�&�&��
�
�
���:�:������2�2�2�q�z�z�T�7I�
��l�l�5�)�3�3��� ��
�K�K�M���� � �Q�\�\�!�_�%=�%=������AW�AW�%W����a��2�2���K���a��!?�!?�@�@����
�A�#�]�]�7�3�F���5�)�)�#�]�]�7�3�F���:�:�f�-�D��{�{�1�~�~��/ �2���e�$�.�.�.��)�
��
�����)�Z�8����s$�-G"�G5�"G2�1G2�5 H�Hc�$�\PPPV4pTPR4Fp\Y4pT'gKTu#	R# \PP
P\3dR#i;i)Nr�)
r�r��minidom�parseString�parsers�expat�
ExpatError�UnicodeEncodeError�getElementsByTagNamer�)r��patternsr�r�r�s&&   r�_check_bug_patternsr�)sy����g�g�o�o�)�)�(�3���+�+�I�6�� ��1���3��J�7�
��
�K�K���(�(�*<�=����s�)A�/B�Bc�,�VPF�pVP\PPP
8XdCVPP4R8Xd$VP4VPV4Kx\V4K�	R#)z6Recursively remove whitespace from given XML DOM node.�N)r�r�r�r�r�r�r�r&�unlink�removeChild�_dom_remove_space)�noder�s& rr�r�7s]��
�_�_���:�:������/�/�/�A�K�K�4E�4E�4G�2�4M�
�H�H�J����Q���a� �rc�J�V^8�dQhR\R,R\R\/#)r�gdb_sandboxN�	same_archr)r�bool)rs"rrrAs%����s�T�z��d��s�rc�|�V'd"\PPVRR4MRp\RV4pV'g>\	\
P\P!\
P4R4hV'g8\RV4pV'dTpV#\PPR4V#)zDetermine path to GDB.�usr�binN�gdbzgdb not found in retracing envz
gdb-multiarchzWARNING: Please install gdb-multiarch for processing reports from foreign architectures. Results with "gdb" will be very poor.
)r<r@rY�_which_extrapathrH�errno�ENOENT�strerror�sysrv�write)r�r��gdb_sandbox_bin�gdb_path�mas&&   r�
_get_gdb_pathr�As���AL�b�g�g�l�l�;��u�=�RV�O����7�H����L�L�"�+�+�e�l�l�3�5U�
�	
��
�o��
?��
��H��O�
�J�J���'�
�
�Orc�F�V^8�dQhR\R\\,/#)r�ld_sor)rrp)rs"rrrXs"��G�G��G�$�s�)�Grc�j�\P!VR.R\PRR7p\P!RVP
\PR7pVUUu/uFwr4\V^4VbK	ppp\VP44UUu.uFwr4VNK		upp#uuppiuuppi)zAQuery the given ld.so binary for the shared library search paths.z--list-diagnosticsT)rtru�textz.^path\.system_dirs\[(0x[0-9a-f]+)\]="([^"]+)"$)�flags)
rxryrzr��findallru�	MULTILINEr3�sorted�items)r��diagnostics�matches�indexr@�ld_search_pathss&     r�_get_ld_search_pathsr�Xs����.�.�	�$�%�T�*�/�/�PT��K��j�j�9�����l�l��G�
AH�H��}��s�5�!�}�d�*��O�H�&,�_�-B�-B�-D�&E�F�&E�]�e�D�&E�F�F��I��Fs�!B)�
B/c	�d�\PPV4'gR#/p\VRR7;_uu_4p\	\VP
4VR4V4RRR4VR,!W4R# +'giL";i \d;p\T4PR4'dTR,!T4Rp?M	hRp?ii;iR# \dR#\d�\PP\PPT44^,PRR	4p\P !4P#4TR
T,&\$P&P)RT4\P*!4R#i;i)Frr�execN�add_infoz
add_info()T�-�_�
HookError_zhook %s crashed:)r<r@�existsr%r�r�rIr�rr'�
StopIteration�	Exception�splitext�basenamer9�	traceback�
format_excr&�apport�loggingrZ�	print_exc)r��ui�hook�symbr*rZ�hooknames&&&    r�	_run_hookr�gsJ��
�7�7�>�>�$����
�D��
�$��
)�
)�R�������D�&�1�4�8�*�	����V�(� �)*�
)��
�	��5�z�$�$�\�2�2��Z� ��(�(���
	��)���������7�7�#�#�B�G�G�$4�$4�T�$:�;�A�>�F�F�s�C�P��*3�*>�*>�*@�*F�*F�*H��|�h�&�'������/��6������
�s`�C�&B�&C�/B�B	�C�C�/C�
C�C�C�C�F/�,F/�5B6F/�.F/c���RpV'd@\PPV\PP	RR4.4p\
P!WR7#)z.Return path of command, preferring extra_path.N�PATHr�)r@)r<�pathseprY�environ�get�shutil�which)rm�
extra_pathr@s&& rr�r��s?���D���z�z���
�B�J�J�N�N�6�2�,F�G�H���<�<��+�+rc�Xa�]tRtRtoRtV3RlRltV3RlRlt]R4tRt	Vt
R	#)
�_Environmenti�z)Wrapper around an environment dictionary.c�<�V^8�dQhRR/#�rrN�)r�
__classdict__s"�rr�_Environment.__annotate__�s���
/�
/��
/rc��VPR4pVfR#VR8XdVRR#RV9gRV9dRVR&R#RVR&R#)z/Anonymize PATH environment variable if present.r�NzG/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/gamesz/homez/tmpz(custom, user)z(custom, no user)�r�)�selfr@s& r�anonymize_path�_Environment.anonymize_path�sM���x�x�����<���8�
8��V��
��_��$��+�D��L�.�D��Lrc�4<�V^8�dQhRS[S[,RR/#)r�keysrN)rr)rr�s"�rrr��s���$�$�8�C�=�$�T�$rc�0�VFpW 9gKRW&K	R#)z1Anonymize given environment variables if present.z<set>Nr�)r�r�r�s&& r�anonymize_vars�_Environment.anonymize_vars�s���C��{�#��	�rc	��T!VPR4Uu.uFpRV9gKVPR^4NK 	up4#uupi)zzRead environment variables from text representation.

The environment variables are expected to be separated by newlines.
rF�=)�split)�clsr�r/s&& r�from_string�_Environment.from_string�sE���.5�m�m�D�.A�R�.A�U�S�E�\�
 �U�[�[��a�
 �.A�R�
�	
��Rs
�	A�Ar�N)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r�r��classmethodr�__static_attributes__�__classdictcell__�r�s@rr�r��s0����3�
/�
/�$�$��
��
rr�c��a�]tRtRtoRtRiV3RlRllt]V3RlRl4tV3RlR	ltV3R
lRlt	RjV3RlR
llt
RtV3RlRltV3RlRlt
V3RlRltV3RlRltV3RlRlt]V3RlRl4tRkV3RlRlltV3RlRltV3RlR ltV3R!lR"ltRkV3R#lR$lltRjV3R%lR&lltV3R'lR(ltRlV3R)lR*lltR+tRkV3R,lR-lltV3R.lR/ltV3R0lR1lt]R24tV3R3lR4ltV3R5lR6lt V3R7lR8lt!V3R9lR:lt"V3R;lR<lt#V3R=lR>lt$V3R?lR@lt%V3RAlRBlt&V3RClRDlt'V3RElRFlt(V3RGlRHlt)V3RIlRJlt*V3RKlRLlt+V3RMlRNlt,V3ROlRPlt-]V3RQlRRl4t.V3RSlRTlt/V3RUlRVlt0V3RWlRXlt1V3RYlRZlt2RjV3R[lR\llt3V3R]lR^lt4V3R_lR`lt5V3RalRblt6V3RclRdlt7V3RelRflt8]9Rg4t:Rht;Vt<R#)m�Reporti�z�A problem report specific to apport (crash or bug).

This class wraps a standard ProblemReport and adds methods for collecting
standard debugging data.
Nc�8<�V^8�dQhRS[RS[R,RR/#)r�problem_type�dateNr�r)rr�s"�rr�Report.__annotate__�s'���?�?�S�?�#��*�?�PT�?rc�b�\PPWV4RVn.VnR#)aInitialize a fresh problem report.

date is the desired date/time string; if None (default), the current
local time is used.

If the report is attached to a process ID, this should be set in
self.pid, so that e. g. hooks can use it to collect additional data.
N)r��
ProblemReport�__init__�pid�_proc_maps_cache)r�rrs&&&rr�Report.__init__�s)��	�$�$�-�-�d�$�G�#���<>��rc�&<�V^8�dQhRS[RS[/#�rrrr)rr�s"�rrr�s�����C��C�rc�H�Rp\P!V4pV'dVRRPV4R2,
p\P!V4'g7\P!V4pV'dVRVR2,
pV#VR,
pV# \
dT#i;i)z�Return a string suitable for appending to Package/Dependencies.

If package has only unmodified files, return the empty string. If not,
return ' [modified: ...]' with a list of modified files.
r�z [modified: � �]z
 [origin: z [origin: unknown])r�get_modified_filesrY�is_distro_package�get_package_originr
)r�suffix�mod�origins&   r�_customized_package_suffix�!Report._customized_package_suffix�s������*�*�7�3�����S�X�X�c�]�O�1�5�5�F�		��.�.�w�7�7�"�5�5�g�>����
�6�(�!�4�4�F��
��2�2�F�
�
��	�	���
�		�s#�B�B�8
B�	B�B!� B!c�4<�V^8�dQhRS[RS[R,/#)rrrNr)rr�s"�rrr�s�����3��3��:�rc��\P!V4pTRT;'gRVPV42VR&V# \dRpL6i;i)z�Add Package: field.

Determine the version of the given package (uses "(not installed") for
uninstalled packages) and add Package: field to report.
This also checks for any modified files.

Return determined package version (None for uninstalled).
Nr z(not installed)�Package)rrr
r(�r�r�versions&& r�add_package�Report.add_package�sj��	��+�+�G�4�G�
�i�q��5�5�$5�6��.�.�w�7�8�
:�	
�Y��
����	��G�	�s�?�
A�Ac�&<�V^8�dQhRS[RS[/#rr)rr�s"�rrr�s�����C��C�rc��\4p\W4Rp\V4FIp\P!V4pT'd
TR,
pY4RTTP
T42,
pKK	V# \
dK]i;i)r�rFr )�setrr�rrr
r()r�r�dependencies_set�dependencies�depr�s&&    r�_get_transitive_dependencies�#Report._get_transitive_dependencies�s���%(�U�� ��;����*�+�C�
��)�)�#�.��
���$���e�1�Q�C��(G�(G��(L�'M�N�N�L�,�����
��
�s�A2�2B�Bc�2<�V^8�dQhRS[R,RR/#)rrNrr)rr�s"�rrr	s#���$N�$N��d�
�$N�d�$Nrc���V'gPRV9dVR,R8XdVR,pM&\PPVR,4pV'gR#VPV4pV'gRV9d\P
!V4VR&V'gR#RV9d\P!V4VR&RV9dVPV4VR&R#R# \dLVi;i)	a�Add packaging information.

If package is not given, the report must have ExecutablePath.
This adds:
- Package: package name and installed version
- SourcePackage: source package name (if possible to determine)
- PackageArchitecture: processor architecture this package was built
  for
- Dependencies: package names and versions of all dependencies and
  pre-dependencies; this also checks if the files are unmodified and
  appends a list of all modified files
�ExecutablePath�ProblemType�KernelCrashr,N�
SourcePackage�PackageArchitecture�Dependencies)	r��	fileutils�find_file_packager/r�
get_sourcer
�get_architecturer7r-s&& r�add_package_info�Report.add_package_info	s�����t�+��]�0C�}�0T��y�/�� �*�*�<�<�T�BR�=S�T�����"�"�7�+���o�T�1�
�(1�(<�(<�W�(E��_�%��� ��,�*3�*D�*D�W�*M�D�&�'���%�#'�#D�#D�W�#M�D�� �&���
��
�s�9C�C)�(C)c�R�VPR4RVPR4RVPRR4R2VR&VPR4p\R	R
RV.4VR&\R	R
V.4VR&\R	RRV.4VRV2&^RIp\RVR2RR7;_uu_4pVP	V4pRRR4RX9dVR,p\R	RRV.4VRV2&.pRV9dSVR,FEpVR,V,PR4p	V	'gK,W�9gK4VPV	4KG	VFp
\R	RRV
.4VRV
2&K	VPR4'd#VP
VPR44R#R# +'giL�;i)z�Add info about an installed Snap.

This adds a Snap: field, containing name, version and channel.
It adds a SnapSource: field, if the snap has a Launchpad contact
defined.
�namer r.z (�channel�unknown�)�Snap�snap�changesz
--abs-time�SnapChanges�connections�SnapConnectionsrLz	SnapInfo.Nz/snap/z/current/meta/snap.yamlrr�base�plugszdefault-provider�contact)r�r��yamlr%�	safe_loadrX�add_snap_contact_info)r�rM�snapnamerU�f�	snap_metarR�	providers�plug�dp�providers&&         r�
add_snap_info�Report.add_snap_info/s����x�x��� ��$�(�(�9�"5�!6�����)�Y�/�0��
3�	
�V���8�8�F�#��-�
�Y��h�7�
��]��#2�6�=�(�2S�"T��
��'6�
�V�\�8�4�(
��y��
�
#�$�	�
�F�8�*�$;�<�w�
O�
O�ST����q�)�I�P��Y���V�$�D�'6����t�4�(�D�9�T�F�#�$��	��i��!�'�*�*���w�'��-�1�1�2D�E���2�"�-��$�$�R�(�+�"�H�+:����x�8�,�D�9�X�J�'�(�"�
�8�8�I����&�&�t�x�x�	�':�;��%P�
O�s�#F�F&	c�$<�V^8�dQhRS[RR/#)r�snap_contactrNr)rr�s"�rrrYs���,�,�#�,�$�,rc��Rp\P!V\PP	V44pV'dWVP^4'd@VP^4VR&VP^4'dVP^4VR&Rp\P!V\PP	V44pV'd0VP^4VR&VP^4VR&RVR&R	#R	#)
z�Load report with information about where it should be filed.

Parse project (e.g. 'subiquity') or source package string
(e.g. 'ubuntu/+source/gnome-calculator') from snap 'contact'.
Additionally, extract any tag/tags defined in the contact URL.
ze^https?:\/\/.*launchpad\.net\/(?:distros/)?((?:[^\/]+\/\+source\/)?[^\/]+)(?:.*field\.tags?=([^&]+))?�
SnapSource�SnapTagsz'^https?://.*github\.com/([^/]+)/([^/]+)�SnapGitOwner�SnapGitNamezsnap-github�CrashDBN)r�r��urllib�parse�unquote�group)r�rb�p�ms&&  rrW�Report.add_snap_contact_infoYs���
J�	
�
�I�I�a����-�-�l�;�<���������!"�����D����w�w�q�z�z�#$�7�7�1�:��Z� �
7���I�I�a����-�-�l�;�<���#$�7�7�1�:�D�� �"#�'�'�!�*�D���+�D��O�
rc�<�V^8�dQhRR/#r�r�)rr�s"�rrrss���G�G�T�Grc�&�RV9d+\PP4wrVRV2VR&RV9d8\P!4pV^,RV^,RV^,2VR&RV9d\P
!4VR&R#R#)z�Add operating system information.

This adds:
- DistroRelease: NAME and VERSION from /etc/os-release, or
  'lsb_release -sir' output
- Architecture: system architecture in distro specific notation
- Uname: uname -srm output
�
DistroReleaser �Uname�ArchitectureN)r�r�get_os_versionr<�uname�get_system_architecture)r��osname�	osversion�us&   r�add_os_info�Report.add_os_infoss����$�&� &� 0� 0� ?� ?� A��F�'-�h�a�	�{�$;�D��!��$�����
�A� ��t�f�A�a��d�V�1�Q�q�T�F�3�D��M���%�#,�#D�#D�#F�D�� �&rc�<�V^8�dQhRR/#r�r�)rr�s"�rrr�s���'�'�t�'rc
��\P!\P!44^,p\
PP4p\P!4UUUUu.uFwr4rVY9gKYR8:gKTNK	pppppTP4T'dRPT4TR&R#RTR&R# \dR#i;iuuppppi)zWAdd information about the user.

This adds:
- UserGroups: system groups the user is in
Nr �
UserGroupszN/A)�pwd�getpwuidr<�geteuidr�r�rA�get_sys_gid_max�grp�getgrall�sortrY)r��user�sys_gid_maxrHrm�gid�memb�groupss&       r�
add_user_info�Report.add_user_info�s���	��<�<��
�
��-�a�0�D��&�&�6�6�8��'*�l�l�n�
�&4�"����|�
� #� 2�
�D�&4�	�
�
	���
��!$���&�!1�D���"'�D�����	��	��
s#�0C�*C
�:C
�C
�C�Cc�<�V^8�dQhRR/#r�r�)rr�s"�rrr�s���RV�RV�D�RVrc�a�RV9dR#\PPVR,4o\\	V3Rl\
44'gR#RpVR,P
4F#pVPR^4wr4TR8XgK!TpM	V'gR#VR,PR4p.ROp\V4^8�d�V^,PR	4'd~VPR
4'dbV^,R8XdT\V4^8�dDVPV^,4pV'dVR,VR&WpR&R#R
V^,2VR&R#V^K�\V4^8�d�V^,PR4'd9RV9d2\PPVR,V^,4V^&\P!V^,\P4'd6VR,VR&\PPV^,4VR&RV9d�VS8wd�VF�p\P!W�^,,\P4'gK=W�^,,p	\PP\PPV	44V8XdVR,VR&W�R&M	RV9d_\PPVR,4R8Xd2VR,VR&VP!4p
V
'dW�R&R#RVR&R#R#R# \dEK�i;i)z�Check if process is a script.

Use ExecutablePath, ProcStatus and ProcCmdline to determine if
process is an interpreted script. If so, set InterpreterPath
accordingly.
r;Nc�2<�\P!SV4#�N)�fnmatch)�i�exebasenames&�rrB�+Report._check_interpreted.<locals>.<lambda>�s���G�O�O�K��$Cr�
ProcStatus�	zName:�ProcCmdline�r��pythonz-m�InterpreterPathz'Cannot determine path of python module �UnreportableReason�.�ProcCwd�twistdz&Cannot determine twistd client program)z	/usr/bin/z
/usr/sbin/z/bin/z/sbin/)r<r@r��any�filter�interpreters�
splitlinesrr
�lenr'�_python_module_pathrY�access�R_OK�realpath�_twistd_executable)r�rHr+�kr��cmdargs�bindirsr@rm�argvexe�exer�s&          @r�_check_interpreted�Report._check_interpreted�s�����4�'���g�g�&�&�t�,<�'=�>��
�6�C�\�R�S�S������&�1�1�3�D�
��z�z�$��*����G�|����4����}�%�+�+�D�1��@���'�l�a��G�A�J�$9�$9�#�$>�$>����x�(�(�W�Q�Z�4�-?�C��L�TU�DU��/�/���
�;���.2�3C�.D�D�*�+�-1�)�*�
�B�'�!�*��N��-�.����
��w�<�1���q�z�$�$�S�)�)�i�4�.?��W�W�\�\�$�y�/�7�1�:�F���
��y�y����R�W�W�-�-�*.�/?�*@��&�'�)+���)9�)9�'�!�*�)E��%�&��D�(�T�[�-@����9�9�Q���^�R�W�W�5�5��!�*�n�G��w�w�'�'����(8�(8��(A�B�d�J�26�7G�2H��.�/�18�-�.��
�
��%���� � ��&6�!7�8�H�D�&*�+;�&<�D�"�#��)�)�+�C��),�%�&�-U��)�*�E�
&��c�
��
�s�3M�M�Mc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr�s�����C�$�J�rc��VR,PR4R,pV'EdV^,PR^4pV^,PR4'g=V^,PR4'gV^,PR4'd#\V4^8Xd
V^,#V^,#\V^,4^8�dYV^,^,R8XdDV^,^,R8wd/V^,R	,pR
V9gRV9gRV9d
V^,#VP^4EK!R
#)z5Determine the twistd client program from ProcCmdline.r�r�:rNNrz--filez--pythonz--sourcer�:�NNrY�y�sN)rr'r��pop)r��args�arg�optss&   rr��Report._twistd_executable�s����M�"�(�(��.�r�2���d��q�'�-�-��Q�'�C��A��!�!�(�+�+��q�6�$�$�Z�0�0��q�6�$�$�Z�0�0��s�8�q�=��q�6�M��A�w���3�q�6�{�Q��3�q�6�!�9��#3��A��q�	�S�8H��1�v�b�z���$�;�#��+������7�N��H�H�Q�K�rc�4<�V^8�dQhRS[RS[R,/#)r�modulerNr)rr�s"�rrrs�����C��C�$�J�rc��\PPV4pTfR#TP# \dR#i;i)z&Determine path of given Python module.N)�	importlib�util�	find_spec�ImportErrorr')r��specs& rr��Report._python_module_pathsC��	��>�>�+�+�F�3�D��<���{�{���	�	��	�s�3�A�Ac�j<�V^8�dQhRS[R,RS[R,RS[S[,R,RR/#)rrNrO�extraenvr�r3rr)rr�s"�rrrsJ���F+�F+�
�4�Z�F+��4�Z�F+��3�-�$�&�	F+�

�F+rc��V'g�V'g*VP;'g\P!4pVP'gWn\P!RV2\P\P
,\P,4p\V4VR&\P!RVR7VR&VPWVR	7\R
V4VR&\RV4P!R
4VR&\#V4VR&VP%V4\P&P)VR,4'g\VR,R24hVP+4VP-4VR,P/RR4P/RR4P/R
R4VR&VP1V4R# \dp\R4ThRp?i\d2pTP\P8Xd
\R4ThhRp?ii;i \dELvi;i)a�Add /proc/pid information.

If neither pid nor self.pid are given, it defaults to the process'
current pid and sets self.pid.

This adds the following fields:
- ExecutablePath: /proc/pid/exe contents; if the crashed process is
  interpreted, this contains the script path instead
- InterpreterPath: /proc/pid/exe contents if the crashed process is
  interpreted; otherwise this key does not exist
- ExecutableTimestamp: time stamp of ExecutablePath, for comparing at
  report time
- OpenFds: open file descriptors and their fdinfo metadata
- ProcEnviron: A subset of the process' environment (only some standard
  variables that do not disclose potentially sensitive information,
  plus the ones mentioned in extraenv)
- ProcCmdline: /proc/pid/cmdline contents
- ProcStatus: /proc/pid/status contents
- ProcMaps: /proc/pid/maps contents
- ProcAttrCurrent: /proc/pid/attr/current contents, if not "unconfined"
- CurrentDesktop: Value of $XDG_CURRENT_DESKTOP, if present
�/proc/�not accessibleN�invalid process�OpenFds�cwdr5r�)rrOr��statusr��cmdliner�r��ProcMapsr;z does not exist�\z\\r z\ )rr<�getpidr%r=�O_PATHrU�PermissionErrorr
r(r�r�r^rG�add_proc_environrfrJrk�_add_executable_pathr@r�r��_add_executable_timestampr9�_add_lsm_context)r�rrOr�rZs&&&& r�
add_proc_info�Report.add_proc_infos���8���h�h�-�-�"�)�)�+���8�8�8���	
� �g�g��S�E�N�B�K�K�"�)�)�$;�b�n�n�$L���)��5��Y��	� �k�k�%��D�D��O�	
���#���R�,�X�{�C��\��-�i��E�L�L�T�R��]��%�k�2��Z���!�!�+�.��w�w�~�~�d�#3�4�5�5���%5� 6�7��G�H�H�	
���!��&�&�(�
���
�W�T�6�
"�
�W�S�%�
 �
�W�T�3�
�		
�]��	
���k�*��C#�
>� �!1�2��=���
��;�;�%�,�,�.�$�%6�7�U�B���
���	��	�s=�AG�4H7�H4�)G5�5H4�H4�,H/�/H4�7I�Ic�$<�V^8�dQhRS[RR/#�rrOrN�r3)rr�s"�rrr^s���
�
��
��
rc��RV9d\P!RVR7VR&RFCpVR,PRVR24'gK'VR,\RV24RVR&R#	R# \dp\R4ThRp?i\d2pTP
\
P8Xd
\R4ThhRp?ii;i)r;r�r5r�Nr��/)�rofs�rwfs�	squashmnt�
persistmnt)	r<rGr�r
r(r�r�r'r�)r�rOrZrms&&  rr��Report._add_executable_path^s����4�'�
�)+���U�;�)O��%�&�=�A��$�%�0�0�1�Q�C�q��:�:�)-�.>�)?��a��s�G���)O��%�&��=��
#�
>� �!1�2��=���
��;�;�%�,�,�.�$�%6�7�U�B���
�s)�A/�/C�:B�C�C�,C�Cc�<�V^8�dQhRR/#r�r�)rr�s"�rrrms���B�B�4�Brc��VR,p\P!V4p\\	TP
44TR&R# \dRTR2TR&R#i;i)r;zError: Executable 'z' not found�ExecutableTimestampN)r<�statrHrr3�st_mtime)r��exe_path�exe_stats&  rr�� Report._add_executable_timestampmse���(�)��	��w�w�x�(�H�'*�#�h�.?�.?�*@�&A��
"�#��!�	�,?��z��*U�D�&�'��	�s�A�A�Ac�$<�V^8�dQhRS[RR/#r�r�)rr�s"�rrrvs�����C��D�rc��\P!4^8Xd\RV4pVR8wdW R&R#R#R# \dR#i;i)�zattr/current�
unconfined�ProcAttrCurrentN)r<�getuidrfr()r�rO�vals&& rr��Report._add_lsm_contextvsR��	��y�y�{�a��%�n�k�B���,�&�.1�*�+�'� ���	��	�s�19�A�Ac�j<�V^8�dQhRS[R,RS[S[,R,RS[R,RR/#)rrNr�rOrr�)rr�s"�rrr�sD���-�-�
�4�Z�-��3�-�$�&�-��4�Z�	-�

�-rc��V'gpV'g\P!4p\P!RV2\P\P,\P
,4p\
\PPV44pTPYB4R# \dpRT2TR&Rp?R#Rp?ii;i)alAdd environment information.

If pid is not given, it defaults to the process' current pid.

This adds the following fields:
- ProcEnviron: A subset of the process' environment (only some standard
  variables that do not disclose potentially sensitive information,
  plus the ones mentioned in extraenv)
- CurrentDesktop: Value of $XDG_CURRENT_DESKTOP, if present
r�rR�ProcEnvironN)r<r�r%r=r�rUr�r�rA�get_process_environr(�_add_environ)r�rr�rOr�rZs&&&&  rr��Report.add_proc_environ�s��� ���i�i�k���'�'��������b�i�i� 7�"�.�.� H��K�	�"�6�#3�#3�#G�#G��#T�U�G�	
���'�,���	�$+�E�7�"3�D�����	�s�9(B4�4C�?C
�
Cc�H<�V^8�dQhRS[RS[S[,R,RR/#)rr�r�Nr)r�rr)rr�s"�rrr�s.���&
�&
�#�&
�/7��}�t�/C�&
�	
�&
rc��0RmpV0R	m,pV'dV\V4,pVP4VPV4RV9d
VR,VR&RP\	VP44UUu.uF)wrVWT9gK
VR2VP
RR4,NK+	upp4VR&R#uuppi)
�LD_LIBRARY_PATH�XDG_CURRENT_DESKTOP�CurrentDesktoprFr�\nr�N>�
LD_PRELOADr��XDG_RUNTIME_DIR>�LANGr��TERM�SHELL�LC_NAME�LC_TIME�LOCPATH�LANGUAGE�LC_CTYPE�LC_PAPER�
LC_ADDRESS�
LC_COLLATE�
LC_NUMERIC�LC_MESSAGES�LC_MONETARY�LC_TELEPHONE�LC_MEASUREMENT�LC_IDENTIFICATION)r3r�r�rYr�r�r9)r�r�r�r��	safe_varsr��values&&&    rr��Report._add_environ�s���N��"�&
�
�	�(���X��&�I���� ����~�.� �G�+�%,�-B�%C�D�!�"�"�i�i�#)�����"9�
�"9�J�C��#�7�3�%�q�	�E�M�M�$��6�6�6�"9�
�
��]���
s�
C
� C
c� <�V^8�dQhRS[/#�rr�r�)rr�s"�rrr�s�����t�rc
��RV9dR#\P!RR7;_uu_4p\VR,R4'dVR,PV4MVPVR,4VP	4VR,P4^,pRRV2VP.p\P!VRR	\P\PR
7pTP^8HpT'dTPTR&RRR4T# \d
RRR4R#i;i +'giX#;i)
zGAdd information from kernel crash.

This needs a VmCore in the Report.
�VmCoreF�apport_vmcore_��prefixr�rs�crashz/usr/lib/debug/boot/vmlinux-sbt -a -f
ps
runq
quit
)rt�inputrurvN�
Stacktrace)�tempfile�NamedTemporaryFile�hasattrr��flushrrHrxryrzr{r(r~ru)r��core�kverrmr�rets&     r�add_kernel_crash_info�Report.add_kernel_crash_info�s��
�4���
�
(�
(�0@�
A�
A�T��t�H�~�w�/�/��X��$�$�T�*��
�
�4��>�*��J�J�L���=�&�&�(��+�D��">�t�f� E�t�y�y�Q�G�	
�"�����7�%�?�?�%�,�,����"�"�a�'�C��%*�\�\��\�"�-B�.�
��
�
��%B�
A�"
��#B�
A�.�
�s6�BD6�57D�,D6�D6�D3�'D6�2D3�3D6�6E	c�F<�V^8�dQhRS[R,RS[R,RR/#)r�rootdirNr�rr)rr�s"�rrr�s7���wD�wD��T�z�wD�7:�T�z�wD�	
�wDrc�n�RV9gRV9dR#RRRRRR	R
RRR
RR/pVPW4wrERVR&V.R'O,
p.pVP4F#wrxVPV4VRRRV.,
pK%	VPR4VRR.,
p\WER7p	RV	9gRV	9d�RV	9d:RP	V	P4U
u.uFp
RV
9gKV
NK	up
4pMWRV	9d:RP	V	P4U
u.uFp
RV
9gKV
NK	up
4pMV	P4^,pRVP
4,pW�R&\V4hV	PR^R7^,p
V
PR4'd>\\P\P!\P4R4h\P !R \P"4pVPV	4pVP%^4VF4pVP'R!R"4P
4WP%^4&K6	RV9dR#VR,9d
VR,VR&VRRV9dl\P(!R$VR,4pV'dCVP+^4VR&VR,PR%4'dVR,^R(VR&MVRRV9d2VP-4VP/4pV'dVVR&&R#R#R#uup
iuup
i))a�Add information from gdb.

This requires that the report has a CoreDump and an
ExecutablePath. This adds the following fields:
- Registers: Output of gdb's 'info registers' command
- Disassembly: Output of gdb's 'x/16i $pc' command
- Stacktrace: Output of gdb's 'bt full' command
- ThreadStacktrace: Output of gdb's 'thread apply all bt full' command
- StacktraceTop: simplified stacktrace (topmost 5 functions) for inline
  inclusion into bug reports and easier processing
- AssertionMessage: Value of __abort_msg or __glib_assert_msg
  if present

The optional rootdir can specify a root directory which has the
executable, libraries, and debug symbols. This does not require
chroot() or root privileges, it just instructs gdb to search for the
files there.

Raises a OSError if the core dump is invalid/truncated, or OSError if
calling gdb fails, or FileNotFoundError if gdb or the crashing
executable cannot be found.
�CoreDumpr;N�	Registerszinfo registers�Disassemblyz	x/16i $pcr zbt full�ThreadStacktracezthread apply all bt full�AssertionMessagezprint __abort_msg->msg�GLibAssertionMessagezprint (char*) __glib_assert_msgz/nonexistent�HOME�--exzp -99�	separator)rnz%is truncated: expected core file sizezis not a core dumpzwarning:rFzWarning:zInvalid core dump: r�)�maxsplitzNo such file or directory.z&executable file for coredump not foundz^\$\d+\s*=\s*-99$rTz
.
z"ERROR:z(^\$\d+\s+=\s+0x[0-9a-fA-F]+\s+"(.*)"\s*$r��StacktraceAddressSignature)z--batchr4zset backtrace limit 2000z-iexzset debuginfod enable off���)�gdb_commandr�rXr�rYr�r&r(r�endswithrHr�r�r<r�r�r�r�r�r9�matchrl�_gen_stacktrace_top�crash_signature_addresses)r�r+r��gdb_reports�gdb_cmdr��
value_keysrHr}�outr+�warnings�reason�
first_line�part_rer\r]rn�addr_signatures&&&                r�add_gdb_info�Report.add_gdb_info�s0��6�T�!�%5�T�%A��
�)��;��)�� :�� 8�"�$E�

�� �+�+�G�A���(�����
�	
���
�$�*�*�,�I�D����d�#������5�5�G�-�	���+�&��F�G�$�$���g�3��
4�s�:�#�s�*��S� ��9�9�&)�n�n�&6�M�&6�d�*��:L�T�T�&6�M����s�"��9�9�&)�n�n�&6�M�&6�d�*��:L�T�T�&6�M����>�>�+�A�.��*�X�^�^�-=�=�F�)/�%�&��&�/�!��Y�Y�t�a�Y�0��3�
����;�<�<�#�������E�L�L�)�8��
��*�*�1�2�<�<�@���
�
�c�"��
�	�	�!���D�&*�l�l�6�7�&C�&I�&I�&K�D����"�#��
"�T�)��D�!7�8�8�+/�0F�+G��'�(��+�,���%����;�T�BT�=U��A��+,�7�7�1�:��'�(��*�+�4�4�U�;�;�/3�4F�/G��"�/M�D�+�,���+�,��4���$�$�&�!�;�;�=�N��5C��1�2�� ��aN��Ns�	L-�#L-�	L2�#L2c�~�\.RO4pR.^,p^pRpRpRp\P!R4p\P!R4p\P!R4p	VR,P4EF�p
VP	V
4pV'gVP	V
4pV'gK8V'd	V'd�VP^4'd>VP^4P
4^,P
R4^,pMR	pV'd+V'dVPR
4'gVR9dK�RpVP^4'gW�9d4Rp^pR.^,pVP^4'dRpVR8XdRpEK RpVP^4;'gVP^4p
V
P
4^,pV\V48gEKvV	P	V4'dEK�W�V&V^,
pEK�	RPV4P4VR
&R	#)z�Build field StacktraceTop as the top five functions of Stacktrace.

Signal handler invocations and related functions are skipped since they
are generally not useful for triaging and duplicate detection.
�_XErrorr�FzD^#(\d+)\s+(?:0x(?:\w+)\s+in\s+\*?(.*)|(<signal handler called>)\s*)$z0^#(\d+)\s+(?:(.*)|(<signal handler called>)\s*)$z,^(__.*_s?sse\d+(?:_\w+)?|__kernel_vsyscall)$r �(N�_XTrF�
StacktraceTop)�g_logv�g_log�	IA__g_log�
IA__g_logv�g_assert_warning�IA__g_assert_warning�
__GI_abortrJ>�XWindowEvent�handle_error�handle_response)r3r�r�r�r;rlrr'r�rYr&)r��unwind_functions�toptrace�depth�unwound�	unwinding�unwinding_xerror�bt_fn_re�bt_fn_noaddr_re�ignore_functions_rer+rn�fn�frame�functions&              rr<�Report._gen_stacktrace_topds����	
�
���4�!�8�������	� ���:�:�S�
���*�*�?�
��!�j�j�;�
����&�1�1�3�D����t�$�A��#�)�)�$�/�����i��7�7�1�:�:������)�)�+�A�.�4�4�S�9�!�<�B��B�$���M�M�$�/�/��!T�T� �',�$��7�7�1�:�:��!7� $�I��E� "�t�a�x�H��w�w�q�z�z�#'���Y��+/�(��!�	��G�G�A�J�,�,�!�'�'�!�*�E��{�{�}�Q�'�H��s�8�}�$�-@�-F�-F�x�-P�-P�"'�����
��U4�V!%�	�	�(� 3� 9� 9� ;��_�rc�\<�V^8�dQhRS[R,RS[R,RS[R,RS[/#)rr�Nr�
srcpackager�rrr�)rr�s"�rrr�s?������T�M���t����$�J�	�

�rc�~�Vf\4pVPWV4pVPRR4\4V#)asRun hook script for collecting package specific data.

A hook script needs to be in PACKAGE_HOOK_DIR/<Package>.py or in
GENERAL_HOOK_DIR/*.py and has to contain a function 'add_info(report,
ui)' that takes and modifies a Report, and gets an UserInterface
reference for interactivity.

return True if the hook requested to stop the report filing process,
False otherwise.
N�	_HooksRun)r�_add_hooks_infor�r)r�r�rrfr's&&&& r�add_hooks_info�Report.add_hooks_info�s<�� �:�%�'�B��"�"�2�
�;������d�#����
rc�N<�V^8�dQhRS[RS[R,RS[R,RS[/#)rr�rNrfrrg)rr�s"�rrr�s;���B�B��B�#&��:�B�;>��:�B�	
�Brc��V'gVPR4pV'd)VP4^,pRV9dRV2VR&R#V'gVPR4pV'd)VP4^,pRV9dRV2VR&R#\.pRp\PPVPRR	44pVP
\4'dTpMvV'do\PPV4FIpVP
\4'gK \PPV4'gKGTpM	V'dp\V4\\48�dSVP\PPVR
RR44\PP!V4pKo\#\$P$!\&R
,44Fp\)WV4'gKR#	V'dCVF<p	\)W\PPW�R,44'gK;R#	V'dAVF:p	\)W\PPV	RVR244'gK9R#	R# \dEL_i;i)r,r�zinvalid Package: r�Fr>zinvalid SourcePackage: Nr;r��sharer�z
package-hooksz/*.pyTz.py�source_)r�r�PACKAGE_HOOK_DIRr<r@r�r'�_OPT_DIRr�r�	get_files�isfiler
r�rXrY�dirnamer��glob�GENERAL_HOOK_DIRr�)
r�r�rrf�	hook_dirs�opt_path�	exec_pathrYr��hook_dirs
&&&&      rrj�Report._add_hooks_info�s����h�h�y�)�G���m�m�o�a�(�G��g�~�/@��	�-J��)�*������/�2�J��#�)�)�+�A�.�J��j� �/F�z�l�-S��)�*��%�&�	����G�G�$�$�T�X�X�.>��%C�D�	�����)�)� �H�
�
��)�)�3�3�G�<�A��|�|�H�-�-�"�'�'�.�.��2C�2C�#$���=���h�-�3�x�=�0�� � ��G�G�L�L��7�H�o�N���7�7�?�?�8�4���4�9�9�%5��%?�@�A�D���4�(�(��B�
�%���T�r�w�w�|�|�H��o�'N�O�O��&�
�%����b�g�g�l�l�8�w�z�l�#�5N�O��� �	&���=�
��
�s$�2:J0�1"J0�J0�J0�0J?�>J?c�B<�V^8�dQhRS[R,RS[R,/#)rr�Nrr)rr�s"�rrrs#���)�)�s�T�z�)�c�D�j�)rc�D�V'gR#\PPV4;_uu_4pVP4P	RRR7pRRR4RX9dR#\
Y4pT'dT#R# +'giL0;i \
dR#i;i)a�Check bug patterns loaded from the specified url.

Return bug URL on match, or None otherwise.

The url must refer to a valid XML document with the following syntax:
root element := <patterns>
patterns := <pattern url="http://bug.url"> *
pattern := <re key="report_key">regular expression*</re> +

For example:
<?xml version="1.0"?>
<patterns>
    <pattern url="http://bugtracker.net/bugs/1">
        <re key="Foo">ba.*r</re>
    </pattern>
    <pattern url="http://bugtracker.net/bugs/2">
        <re key="Package">^\\S* 1-2$</re>
        <!-- test for a particular version -->
        <re key="Foo">write_(hello|goodbye)</re>
    </pattern>
</patterns>
Nr8r9rbz<title>404 Not Found)ri�request�urlopenrIrdr(r�)r�r�rr�s&&  r�search_bug_patterns�Report.search_bug_patternss���0��	����'�'��,�,��"�<�<�>�0�0���0�K��-�"�X�-��!�$�1����J��-�,���	��	�s.�'B�"A=�B�=B
	�B�
B�B�Bc��\P!\P!44^,p\PRV4pRpRpRp\P!V\P\P,4p\P!V4p\P!VP4'd)\P!VR4pVPR4pTeTP!4MTe\P !T4TR8Xd1\"P$P'4P)RRR4pM*\"P$P*P-T4pTP8P;4\=TP84T# \dL�i;i TeTP!4iTe\P !T4ii;i \"P.P0P2d$p\5\R\7T424ThRp?ii;i)z�Read ignore list XML file and return a DOM tree.

Return an empty DOM tree if file does not exist.

Raises ValueError if the file exists but is invalid XML.
�~r�N�riP�r�z has invalid format: )r�r�r<r��_ignore_filer9r%r>r=�fstatr��S_ISREG�st_mode�fdopenrIr(rVr�r��getDOMImplementation�createDocumentr�r�r�r�r�r
r�documentElementr�r�)�homedir�ifpath�contentsr*rY�str�rZs        r�_get_ignore_dom�Report._get_ignore_dom9s����,�,�r�z�z�|�,�Q�/���%�%�c�7�3����
����
	�����������!<�=�B����"��B��|�|�B�J�J�'�'��I�I�b�#�&���6�6�%�=���}����	���������r�>��'�'�.�.�0�?�?��h�PT�U�C�
��g�g�o�o�1�1�(�;��	���%�%�'��#�-�-�.��
��1�	��	���}����	�������� ���;�;�$�$�/�/�
� �#�n�$9�#�e�*��F�����
�s=�BF-�)G3�-F;�8F>�:F;�;F>�>2G0�3)H?�H:�:H?c� <�V^8�dQhRS[/#rr)rr�s"�rrrjs���-�-�#�-rc���\VR,4pVPR4pV'dV#\P!V4P# \
d	RT2u#i;i)�Signal�
SignalNamezsignal )r3r��signal�SignalsrHr
)r��
signal_number�signal_names&  r�_get_signal_name�Report._get_signal_namejs]���D��N�+�
��h�h�|�,�����	-��>�>�-�0�5�5�5���	-��]�O�,�,�	-�s�A�A"�!A"c� <�V^8�dQhRS[/#rr)rr�s"�rrrvs���5�5�t�5rc�J�RV9gQhVR,\\49gVR,\\49dR#\\\44pV\\\
44,pV'dVR,V9dR#VP
4p\\P !TR,4P"4pTP'R4FDpTP)R4TR,8XgK"\+TP)R44T8�gKCR#	R# \\3d9\PPR4\P!4R#i;i \$dR#i;i \\3dR#i;i)aCheck if current report should not be presented.

Reports can be suppressed by per-user denylisting in
~/.apport-ignore.xml (in the real UID's home) and
/etc/apport/report-ignore/. For environments where you are only
interested in crashes of some programs, you can also create an
allowlist in /etc/apport/report-only/, everything which does not
match gets ignored then.

This requires the ExecutablePath attribute. Throws a ValueError if the
file has an invalid format.

Privileges may need to be dropped before calling this.
r;TzCould not get ignore file:F�ignore�program�mtime)r-�
_DENYLIST_DIR�_LEGACY_DENYLIST_DIRr3�_ALLOWLIST_DIR�_LEGACY_ALLOWLIST_DIRr�r
r�r�r�rZr�r�r3r<r�r�r(r��getAttributerr)r��	allowlistr��	cur_mtimer�s&    r�
check_ignored�Report.check_ignoredvsv�� �4�'�'�'�� �!�%B��&
�
�
�"�
#�'D� �(
�
���5�n�E�F�	��S�6�7L�M�N�N�	���.�/�y�@��	��&�&�(�C�	��B�G�G�D�)9�$:�;�D�D�E�I�	��2�2�8�<���&�&�y�1�T�:J�5K�K��V�0�0��9�:�i�G�#�=���)�H�%�	��N�N� � �!=�>����!��	���	��	���H�%�	���	�sI�D/�#0E;�.F
�F
�(F
�+F
�/AE8�7E8�;F
�	F
�
F"�!F"c�<�V^8�dQhRR/#r�r�)rr�s"�rrr�s���+�+�T�+rc��RV9gQhVP4p\\\P!VR,4P
44pTPR4F4pTPR4TR,8XgK"TPRT4MY	TPR4pTPRTR,4TPRT4TPPT4\P !\P"!44^,p\$P'RT4p\)TRRR	7;_uu_4pTP+TR
RR7RRR4TP-4R# \d,pTP\P8XdRp?R#hRp?ii;i +'giL[;i)
aFIgnore future crashes of this executable.

Add a ignore list entry for this report to ~/.apport-ignore.xml, so
that future reports for this ExecutablePath are not presented to the
user any more.

Throws a ValueError if the file already exists and has an invalid
format.

Privileges may need to be dropped before calling this.
r;Nr�r�r�r��wrrz  rF)�	addindent�newl)r�rr3r<r�r�r(r�r�r�r��setAttribute�
createElementr��appendChildr�r�r�r�r9r%�writexmlr�)	r�r�r�rZr��er��ignore_file_pathr*s	&        r�mark_ignore�Report.mark_ignore�sg�� �4�'�'�'��"�"�$��	���B�G�G�D�)9�$:�;�D�D�E�F�E��.�.�x�8�F��"�"�9�-��6F�1G�G��#�#�G�U�3��9��!�!�(�+�A�
�N�N�9�d�+;�&<�=�
�N�N�7�E�*����+�+�A�.��,�,�r�z�z�|�,�Q�/��'�/�/��W�=��
�"�C�'�
:�
:�b��L�L��t�$�L�7�;�	�
�
���5�	��{�{�e�l�l�*����		��.;�
:�s)�9E?�F8�?F5�
F0�/F0�0F5�8G	c� <�V^8�dQhRS[/#rr)rr�s"�rrr�s���?�?�t�?rc�6�VPR4'gR#VR,P4Uu.uFqPR4NK	pp\V4^8dVP	R4^8H#VP	R4\V4R,8*#uupi)z�Check whether StackTrace can be considered 'useful'.

The current heuristic is to consider it useless if it either is shorter
than three lines and has any unknown function, or for longer traces, a
minority of known functions.
rMF�??Tg@)r�r�r'r��count)r�rY�
unknown_fns&  r�has_useful_stacktrace�Report.has_useful_stacktrace�s����x�x��(�(��26��2G�2R�2R�2T�U�2T�Q�l�l�4�(�2T�
�U��z�?�Q���#�#�D�)�Q�.�.�����%��Z��3�)>�>�>��Vs�Bc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr�s������t��rc��VPRR4P4F4pVPR4^,P4pVR8wgK2Vu#	R#)z)Return topmost function in StacktraceTop.rMr�rKr�N)r�r�rr&)r�r+�fnames&  r�stacktrace_top_function�Report.stacktrace_top_function�sL���H�H�_�b�1�<�<�>�D��J�J�s�O�A�&�,�,�.�E���}���?�
rc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr�s���-�-�S�4�Z�-rc�x�VR,P4p\V4^8dR#\V4^8d3\PP	VR,4RV^,2#\
P!R4p\V4^,
pRpV^8�dNVPW,4pV'd$VP^4pVP^4pMV^,pKT\PP	VR,4pVR,pVPR4^,p	\
P!R\
P!V	4R2V4pV'dVP^4p
MRp
VR	8XdXVR,8XdR
pMTpMVR2pVRV	RV2pV
'd
VR
V
2,
pV#)�	TracebackNr;� crashed with z^\s*File\s*"(\S+)".* in (.+)$rJr7�^z: (.+)$�<module>�__main__�()� in rw���)r�r�r<r@r�r�r�r;rlr�escape)
r��trace�trace_rer�rcrn�module_pathr@�	last_line�	exception�message�context�titles
&            r�_get_python_exception_title�"Report._get_python_exception_title�s����[�!�,�,�.���u�:��>���u�:��>��7�7�#�#�D�)9�$:�;�<� ��q��
�,�
�
�:�:�>�?����J��N�����1�f����u�x�(�A���g�g�a�j���7�7�1�:���
��F�A��w�w����%5� 6�7���"�I�	��O�O�C�(��+�	��H�H�q����9�-�.�g�6�	�B����g�g�a�j�G��G��z�!��d�#3�4�4�$��&��!�
�"�o�G��&��y�k��g�Y�?����r�'��^�#�E��rc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr#s���
�
��t��
rc�>�VP4pV'dRVR2pMRpRpRV9d8RV9d1VR,VR,8wdVR,R8wdRVR,R2p\PPVR,4R	VP	4VV2#)
r�r�r�rtr?�allz
 [non-native z	 package]r;r�)r�r<r@r�r�)r�ra�
arch_mismatchs&  r�_get_signal_crash_title�Report._get_signal_crash_title#s���
�
)�
)�
+��
���t�2��B��B��
��d�"�%��-��^�$��-B�(C�C��*�+�u�4�+�D�1F�,G�+H�	�R�M��w�w����%5� 6�7�8��T�2�2�4�5�b�T�-��
J�	
rc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr9s���9�9��d�
�9rc��VPR4R8XdARV9d:RV9d3\PPVR,4RVR,2#RV9dRV9dRV9dVP	4#RV9dRV9dVP4#VPR4R	8XdZR	V9dSR
VR	,R2pVPR4'd-VR
VR,P
4R,,,
pV#VPR4R8Xd^RV9dWVR,pVPR4'dVPR^4^,pV#VPR^4^,pV#VPR4R8XduRV9dnRpRV9dVRVR,,R,,
pWR,R,,
pRV9dVRVR,,R,,
pVR,
pV#R#)a*Create an appropriate title for a crash database entry.

This contains the topmost function name from the stack trace and the
signal (for signal crashes) or the Python exception (for unhandled
Python exceptions).

Return None if the report is not a crash or a default title could not
be generated.
r��6r;r1z assert failure: rMr�r<r,zpackage z failed to install/upgrade�ErrorMessagerw�
KernelOops�OopsTextz$------------[ cut here ]------------rF�Failurer��MachineType�[z] z failure�NonfreeKernelModulesz [non-free: r!Nr�)	r�r<r@r�r�r�r�r'r)r�r��oopss&  r�standard_title�Report.standard_title9s���
�H�H�X��#�%� �D�(�"�d�*��7�7�#�#�D�)9�$:�;�<�=��+�,�-�/�
�
�t�� 0�D� 8�_�PT�=T��/�/�1�1��$��#3�t�#;��3�3�5�5��8�8�M�"�i�/�I��4E��t�I��/�/I�J�E��x�x��'�'����^� 4� ?� ?� A�"� E�E�E���L��8�8�M�"�l�2�z�T�7I��
�#�D����E�F�F��
�
�4��+�A�.���L��
�
�4��+�A�.���L��8�8�M�"�l�2�y�D�7H��E���$���t�M�2�2�T�9�9���)�_�z�1�1�E�%��-���$�/E�*F�F��L�L���T�M�E��L�rc�0<�V^8�dQhRS[S[,/#r)rpr)rr�s"�rrrts�����4��9�rc��.pVPRR4R,VPRR4,P4FpV'gK
VP4R,wr4\P!V4pVfKBVR8wgKKVfKQ\P
!WE4^8gKnVP
V4K�	V#)z=Return list of obsolete packages in Package and Dependencies.r,r�rFr@:NrN�None)r�r�rr�get_available_version�compare_versionsrX)r��obsoleter+�pkg�ver�avails&     r�obsolete_packages�Report.obsolete_packagests������H�H�Y��#�d�*�T�X�X�n�b�-I�I�
�*�,��D����z�z�|�B�'�H�C��3�3�C�8�E����6�M��%��.�.�s�:�Q�>�����$���rc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr�s���4�4��t��4rc�>�RV9dVR,R9dR#RV9dVR,R8XdVP4#VPR4R8Xd>R	V9d7VR,R
,VR	,,p\P!RRV4#R
V9dRV9dVP	4#RV9dVP4#VR,R8Xd4RV9d-RVR,9gRVR,9dVP
4#RV9dVP4#R#)aPGet a signature string for a crash.

This is suitable for identifying duplicates.

For signal crashes this the concatenation of ExecutablePath, Signal
number, and StacktraceTop function names, separated by a colon. If
StacktraceTop has unknown functions or the report lacks any of those
fields, return None. In this case, you can use
crash_signature_addresses() to get a less precise duplicate signature
based on addresses instead of symbol names.

For assertion failures, it is the concatenation of ExecutablePath
and assertion message, separated by colons.

For Python crashes, this concatenates the ExecutablePath, exception
name, and Traceback function names, again separated by a colon.

For suspend/resume failures, this concatenates whether it was a suspend
or resume failure with the hardware identifier and the BIOS version, if
it exists.
r;r<r=r�Nr r�r�r1r7z0x[0-9a-f]{6,}�ADDRrMr�r��suspend�resumer�>r�r=)�_crash_signature_kernel_crashr�r��sub�_crash_signature_signal_crash�!_crash_signature_python_traceback�'_crash_signature_suspend_resume_failure�_crash_signature_kernel_oops�r��sigs& r�crash_signature�Report.crash_signature�s��,�4�'��M�"�*G�G���4��D��$7�=�$H��5�5�7�7��8�8�H���$�);�t�)C��'�(�3�.��6H�1I�I�C��6�6�+�V�S�9�9��d�"�x�4�'7��5�5�7�7��$���9�9�;�;��
��,�.�9��3D��D��O�+�x�4�	�?�/J��C�C�E�E�����4�4�6�6�rc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr�s�����s�T�z�rc���Rp\P!R4pVR,P4F=pVPV4pV'gKVRVP	^4,,
pK?	V#)�kernelz^\s*\#\d+\s\[\w+\]\s(\w+)r r7)r�r�r�r;rl)r�r�regexr+rns&    rr��$Report._crash_signature_kernel_crash�s_�����
�
�7�8����&�1�1�3�D����D�!�A��q��s�a�g�g�a�j�)�)��4��
rc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr�s�����c�D�j�rc��Rp.pVR,PR4EF"pVPR4'dT\P!RV4pV'd5VP	^4pV'gQRV24hVPV4VPR4'd/VP
V4pV'dVPV4K�K�VPR4'dRpK�V'gK�R	pV'd?V^,R
8Xd1VP
V4pV'dVPV4EKEK RpEK%	V'dRPV4#R	#)Fr�rFzBUG: unable to handlez^BUG: unable to handle (.*) at z,could not parse expected problem type line: zIP: zCall Trace:TNr r7)rr'r�r�rlrX�_extract_function_and_addressrY)r��
in_trace_bodyr\r+�parsedr;s&     rr�#Report._crash_signature_kernel_oops�s���
�����$�*�*�4�0�D����6�7�7����#D�d�K���"�L�L��O�E� �W�$P�QU�PV�"W�W�5��L�L��'����v�&�&��:�:�4�@����L�L��'������/�/� $�
������D��G�s�N� �>�>�t�D�E�����U�+��%*�M�/1�0��8�8�E�?�"�rc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr�s���"=�"=�3��:�"=rc��VR,P4pRp\V4^8XdO\P!RV^,4pV'gR#VR,R,VP	^4,#\V4^8dR#\P
!R4pVF�pVPV4pV'gKVP	^4R8wd"VRVP	^4,,
pKUVP	^4p\PPV4'd \PPV4pVRVRVP	^42,
pK�	VR,PR4^,pVR	VR
,R2,
pVR,R,V,V,# \dL+i;i)
r�r�z(\w+): Nr;r7z)^\s+File "([^"]+).*line (\d+).*\sin (.*)$r��@rK�_PythonExceptionQualifierrKr�)r�r�r�r;rlr�r<r@�islinkr�rr�)r�r�rrn�loc_rer+rY�exc_names&       rr�(Report._crash_signature_python_traceback�s~���[�!�,�,�.�����u�:��?�����U�1�X�.�A����(�)�C�/�!�'�'�!�*�<�<��u�:��>�����H�I���D����T�"�A��q��7�7�1�:��+��3������+�+�C�����
�A��w�w�~�~�a�(�(��G�G�,�,�Q�/���Q�q�c��1�7�7�1�:�,�/�/�C����9�?�?�3�'��*��	��!�D�!<�=�>�a�@�@�H��$�%��+�h�6��<�<���	��	�s�G�G�
Gc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrrs�����s�T�z�rc�h�VR,RVR,2p\P!R4pVR,P4p\V4^8dR#VFWpVP	V4pV'd;TRVP^4;'gVP^4,,
pKVR#	V#)r;r7r�z.^(?:([\w:~]+).*|(<signal handler called>)\s*)$rMN)r�r�r�r�r;rl)r�rr^�linesr+rns&     rr��$Report._crash_signature_signal_crashs����&�'�(��$�x�.�)9�:���:�:�O�P���_�%�0�0�2���u�:��>���D����t�$�A���s�a�g�g�a�j�6�6�A�G�G�A�J�7�7���
��
rc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrrs������t��rc��VR,pVPR4'dVRVR,2,
pVPR4'dVRVR,2,
pV#)r�r�r7zdmi.bios.versionr�rs& rr�.Report._crash_signature_suspend_resume_failures^���9�o���8�8�M�"�"��Q�t�M�*�+�,�,�C��8�8�&�'�'��Q�t�.�/�0�1�1�C��
rc�4<�V^8�dQhRS[RS[R,/#)rr+rNr)rr�s"�rrr%s�����C��C�$�J�rc��\P!RV4pV'd4VP^4pV'gQRV24hV^,R8wdV#R#)z\[.*\] (.*)$z*could not parse expected call trace line: �?N)r�r�rl)r+rr;s&  rr�$Report._extract_function_and_address$sJ�����?�D�1����L�L��O�E��M�F�t�f�M�M�5��Q�x�3����rc�.<�V^8�dQhRS[R,/#r�r)rr�s"�rrr.s���:N�:N�3��:�:Nrc��RV9gRV9gRV9dR#VR,PR4'dR#.p^pVR,P4F�pVPR4'd�VP4^,pVPR4'gKJ\V^4pVR8dK_VP	V4pV'd#VPVP
R	R
44M	V^,
p\V4^8�gK�M	V^8�d\V4V,^8dR#V^8Xd\V4^8gV^8�d\V4^8dR#VR,R	VR,R	R	PV42#)a*Compute heuristic duplicate signature for a signal crash.

This should be used if crash_signature() fails, i. e. Stacktrace does
not have enough symbols.

This approach only uses addresses in the stack trace and does not rely
on symbol resolution. As we can't unwind these stack traces, we cannot
limit them to the top five frames and thus will end up with several or
many different signatures for a particular crash. But these can be
computed and synchronously checked with a crash database at the client
side, which avoids having to upload and process the full report. So on
the server-side crash database we will only have to deal with all the
equivalence classes (i. e. same crash producing a number of possible
signatures) instead of every single report.

Return None when signature cannot be determined.
r�r r�NrRr!�0xir7z..r;)	r'r�rr3�_address_to_offsetrXr9r�rY)r��stack�failedr+�addr�offsets&     rr=� Report.crash_signature_addresses.sR��$�T�!�\��%=��QU�AU���
��&�&�y�1�1��������&�1�1�3�D����s�#�#��z�z�|�A������t�,�,���4��}���&�=���0�0��6����L�L�����T�!:�;��a�K�F�
�5�z�R���-4�4�A�:�#�e�*�v�-��1��
�a�K�C��J��N���
�s�5�z�A�~���'�(�)��4��>�*:�!�C�H�H�U�O�;L�M�Mrc�<�V^8�dQhRR/#r�r�)rr�s"�rrrls���7=�7=�4�7=rc
��.p\P!4^8�EdM\P!\P!44p\V^,4^8�dGVP
\P!R\P!V^,4R24R34VP
\P!R\P!V^,4R24R34V^,PR4FdpVP4p\V4^8�gK%VP
\P!R\P!V4R24R34Kf	\P!4^,p\V4^8�d@VP
\P!R\P!V4R24R34VRVF�pVPR	4;'dVR9pV'gR
V9g
VR9gK9\W,R4'gKSVFwwrx\!W,\"4'd=VP%W�V,P'RR
R74P)R4W&K]VP%W�V,4W&Ky	K�	R# \dL�i;i)z�Remove user identifying strings from the report.

This particularly removes the user name, host name, and IPs
from attributes which contain data read from the environment, and
removes the ProcCwd attribute completely.
z\b�usernamez/home/username�,z(\b|\s)z\1User Name�hostnamer��Procr �isspacer8r9rbN)�ProcCpuinfor�r��ProcInterrupts�ProcModules>�Titler��
PythonArgs�
JournalErrors)r<r�r�r�r�r�rXr�r�r�rr&rvr�r'r#r�r�r�rdr�)	r��replacementsrmr�r2r��
is_proc_fieldr��repls	&        r�	anonymize�Report.anonymizels$����
�9�9�;��?����R�Z�Z�\�*�A��1�Q�4�y�A�~��#�#�R�Z�Z�2�b�i�i��!��o�5F�b�0I�%J�J�$W�X�������r�"�)�)�A�a�D�/�!2�"�5�6�8H�I�
��q�T�Z�Z��_���G�G�I���q�6�A�:� �'�'����w�r�y�y��|�n�B�$?�@�.�Q��%��8�8�:�a�=���x�=�A��������r�"�)�)�H�2E�1F�b�,I�!J�J� W�X�	��Y���A��L�L��0���Q�?�6�M���1�$��M�M��t�w�	�2�2��%1�M�G�!�$�'�5�1�1�")�+�+� �q�'�.�.���.�"K�#� �&��/���#*�+�+�d��G�"<���
&2����	��	�s�J1�1J?�>J?c� <�V^8�dQhRS[/#rr)rr�s"�rrr�s�����S�rc���VR,p\V\4'dQh\V\4'dm\P!RR7wr#\
P!\PV4\P!W!4\P!V4V#\V\P4'd�\P!RR7wr#\
P!\PV4\P!V4\VR4;_uu_4pVPV4RRR4V#V^,pV# +'giT#;i)r-�apport_core_r�wbN)r�rr�r!�mkstemp�atexit�registerr<r�r�rVr�r�r%)r��coredumpr*r%rYs&    r�#_provide_uncompressed_coredump_file�*Report._provide_uncompressed_coredump_file�s����
�#���h��,�,�,�,��h��&�&��'�'�~�>�H�B��O�O�B�I�I�t�,��H�H�R�"��H�H�R�L�����.�"@�"@�
A�
A��'�'�~�>�H�B��O�O�B�I�I�t�,��H�H�R�L��d�D�!�!�Q����q�!�"�
���A�;�D���"�!�
��s�,E�E$	c�.<�V^8�dQhRS[R,/#r�r�)rr�s"�rrr�s�����#��*�rc�X�\VR,4# \\3dR#i;i)z-Get ExecutableTimestamp if present and valid.r�N)r3r�r
)r�s&r�get_executable_timestamp�Report.get_executable_timestamp�s/��	��t�1�2�3�3���*�%�	��	�s��)�)c
�<�V^8�dQhRS[R,RS[R,RS[S[S[,S[S[S[3,3,/#)r�sandboxNr�r)r�tuplerprq)rr�s"�rrr�sH���H �H ��T�z�H �03�d�
�H �	�t�C�y�$�s�C�x�.�(�	)�H rc��RV9gQhVPRVR,4pRpRV9d$VR,\P!48XdRp\W$4.p/pV'Ed5\	R4pVUu.uFq�V2NK
	p	pVRRVR	2RR
V,RRV,RRR
PV	42.,
pV'dTVUu.uFq�V2NK
	p
pR
PV
4pVR2pVRVRVRVRVR2/,pR.VR&VRRVR2.,
p\PPW,4'gSVPR4'd<\PPWR,,4'd
VR,pW,pVRRVR2.,
pRV9d#VP4p
VRRV
,.,
pWV3#uupiuupi)a�Build gdb command for this report.

This builds a gdb command for processing the given report, by setting
the file to the ExecutablePath/InterpreterPath, unpacking the core dump
and pointing "core-file" to it (if the report has a core dump), and
setting up the paths when calling gdb in a package sandbox.

When available, this calls "gdb-multiarch" instead of "gdb", for
processing crash reports from foreign architectures.

Return argv list for gdb and any environment variables.
r;r�FrtTz*/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2r4zset debug-file-directory z/usr/lib/debugzset solib-absolute-prefix zadd-auto-load-safe-path zset solib-search-path r7z/usrr�r��
PYTHONHOME�
GCONV_PATHz/usr/lib/x86_64-linux-gnu/gconvzld-linux-x86-64.so.2:Nr�Nzset data-directory z/usr/share/gdb:�NNzfile "�"r-z
core-file )r�rrwr�r�rYr<r@r�r'rH)r�rOr��
executabler�rmr��host_library_pathsr@�sandbox_library_paths�gdb_sandbox_library_paths�ld_lib_path�pyhomer%s&&&           rr9�Report.gdb_command�s%�� �4�'�'�'��X�X�/��6F�1G�H�
��	��d�"��^�$�	�(I�(I�(K�K��I� ��8�9��"$���7�!5�<�"��EW�$W�DV�D�y���%7�DV�!�$W���+�G�9�N�C��,�w�6��*�W�4��(����2G�)H�(I�J�
�

�G��7I�-�7I�t�m�D�6�*�7I�*�-�"�h�h�'@�A��'�=��-���%�{��K� �&� �[�M�1P�"Q�	��� 6�6�����F�&9�+��n�$U�V�V���7�7�>�>�'�"6�7�7��(�(��0�0��w�w�~�~�g�2��&>�?�?�%/��^�
� �-�J��F�f�Z�L��2�3�3������;�;�=�D����t� 3�4�4�G�����Q%X��-s�5G�Gc�4<�V^8�dQhRS[RS[R,/#)rr+rNrP)rr�s"�rrr	s�����s��s�T�z�rc�~�VP4F(wr#pY!u;8:d
V8:gKMKVRW,
R
2u#	R#)aResolve a memory address to an ELF name and offset.

This can be used for building duplicate signatures from non-symbolic
stack traces. These often do not have enough symbols available to
resolve function names, but taking the raw addresses also is not
suitable due to ASLR. But the offsets within a library should be
constant between crashes (assuming the same version of all libraries).

This needs and uses the "ProcMaps" field to resolve addresses.

Return 'path+offset' when found, or None if address is not in any
mapped range.
�+�xN)�_build_proc_maps_cache)r�r+�start�end�elfs&&   rr(�Report._address_to_offset	sD�� $�:�:�<�O�E���#��#�#���a���Q�/�0�0� =�rc�J<�V^8�dQhRS[S[S[S[S[3,,/#r)rprPr3r)rr�s"�rrrs$��� %� %��U�3��S�=�-A�(B� %rc	��VP'd
VP#RV9gQh.Vn\P!R4p\P!R4pVR,P4F�pVP	4'gKVPV4pV'g0VPV4'dKMV'gQRV,4hVPP
\VP^4^4\VP^4^4VP^434K�	VP#)zOGenerate self._proc_maps_cache from ProcMaps field.

This only gets done once.
r�z-^([0-9a-fA-F]+)-([0-9a-fA-F]+).*\s{2,}(\S.*$)z ^([0-9a-fA-F]+)-([0-9a-fA-F]+)\szcannot parse ProcMaps line: )	rr�r�r�r&r;rXr3rl)r��fmt�fmt_unknownr+rns&    rra�Report._build_proc_maps_caches��
� � � ��(�(�(��T�!�!�!� "����j�j�I�J���j�j�!D�E����$�/�/�1�D��:�:�<�<���	�	�$��A���$�$�T�*�*���?�8�4�?�?�q��!�!�(�(��Q�W�W�Q�Z��$�c�!�'�'�!�*�b�&9�1�7�7�1�:�F�
�2��$�$�$rc�F<�V^8�dQhRS[S[S[3,RS[RS[RR/#)rrG�coredump_keyr�rN�rqr�object)rr�s"�rrr?s6���#�#��S�&�[�)�#�9<�#�CF�#�	
�#rc�|�VPV4p\V\4'gQhVP4W&R#r�)r�r�rrJ)r�rGrlr�rs&&&& r�_add_str_from_coredump�Report._add_str_from_coredump?s2�����\�*���%��%�%�%�%��L�L�N��	rc�:<�V^8�dQhRS[S[S[3,RR/#�rrGrNrm)rr�s"�rrrFs(���D�D�$�s�F�{�2C�D��Drc���VPR4pVfR#\V\4'gQh\P!V\
PR7p\P!V^R7VR&R#)�COREDUMP_PACKAGE_JSONN)�object_pairs_hook)�indent�CoredumpPackageJson)r�r�r�json�loads�collections�OrderedDict�dumps)r�rGr�decodeds&&  r�_add_elf_package_metadata� Report._add_elf_package_metadataFsZ�����4�5���=���%��%�%�%�%��*�*�U�k�6M�6M�N��&*�j�j���&C��
"�#rc�:<�V^8�dQhRS[S[S[3,RR/#rsrm)rr�s"�rrrPs%�����D��f��<M��RV�rc��VPR4pV'd\V\4'gQhW R&R#VPR4pV'd5\V\4'gQh\P
!V4VR&R#R# \d/\P!\4PRT4R#i;i)�COREDUMPr-N�COREDUMP_FILENAMEz:Ignoring COREDUMP_FILENAME '%s' because it does not exist.)r�r�r�rr��CompressedFilerHr��	getLoggerr�warning)r�rG�dump�filenames&&  r�#_add_coredump_from_systemd_coredump�*Report._add_coredump_from_systemd_coredumpPs����|�|�J�'����d�E�*�*�*�*�#�����<�<� 3�4����h��,�,�,�,�
�#1�#@�#@��#J��Z� ���%�
��!�!�(�+�3�3�P���
�s�*B�5C�?Cc���VPR4p\V\P4'gQhV!\P!VP44R7pVPR4p\V\4'gQhWCnVPR4p\V\4'gQh\V4VR&VPVRR4VPVRR	4VPVR
R4VPVRR
4VPVRR4VPVRR4VPVRR4VPV4VPR4p\V\4'gQhVP\PV44VP4VPR4R8wdVPV4V#)acConvert the givin systemd coredump into a problem report.

The following keys are not used:
 * COREDUMP_CGROUP (str)
 * COREDUMP_COMM (str)
 * COREDUMP_CONTAINER_CMDLINE (str)
 * COREDUMP_GID (int)
 * COREDUMP_HOSTNAME (str)
 * COREDUMP_OWNER_UID (str)
 * COREDUMP_PACKAGE_NAME
 * COREDUMP_PACKAGE_VERSION
 * COREDUMP_PROC_AUXV (bytes)
 * COREDUMP_PROC_CGROUP (str)
 * COREDUMP_PROC_LIMITS (str)
 * COREDUMP_PROC_MOUNTINFO (str)
 * COREDUMP_RLIMIT (str)
 * COREDUMP_ROOT (str)
 * COREDUMP_SESSION
 * COREDUMP_SLICE (str)
 * COREDUMP_UID (int)
 * COREDUMP_UNIT (str)
 * COREDUMP_USER_UNIT (str)
 * MESSAGE (str)
�COREDUMP_TIMESTAMP)r�COREDUMP_PID�COREDUMP_SIGNALr��COREDUMP_SIGNAL_NAMEr��COREDUMP_CMDLINEr��COREDUMP_EXEr;�COREDUMP_CWDr��COREDUMP_OPEN_FDSr��COREDUMP_PROC_MAPSr��COREDUMP_PROC_STATUSr��COREDUMP_ENVIRON�COREDUMP_TRUNCATED�1)r�r��datetime�time�asctime�	timetupler3rrrprr�r�rr�r�)rrGrr�rr�r�s&&     r�from_systemd_coredump�Report.from_systemd_coredumpbs���4�|�|�0�1���$�� 1� 1�2�2�2�2��$�,�,�t�~�~�'7�8�9���l�l�>�*���#�s�#�#�#�#��
� ���%6�7�
��-��-�-�-�-��}�-��x���%�%�h�0F��U��%�%�h�0B�M�R��%�%�h��@P�Q��%�%�h��	�J��%�%�h�0C�Y�O��%�%�h�0D�j�Q��%�%�h�0F��U��(�(��2��,�,�1�2���'�3�'�'�'�'����L�4�4�W�=�>��(�(�*��:�:�*�+�s�2��6�6�x�@��
r)rr)�CrashNr�)NNN)NN)=rrr	r
rr�staticmethodr(r/r7rEr_rWr{r�r�r�r�r�r�r�r�r�r�r(rGr<rkrjr�r�r�r�r�r�r�r�r�r�r�rr�rrr�rrr=r>rHrLr9r(rarprr�rr�r
rrs@rrr�si�����?�?�����.��*��&$N�$N�L(<�T,�,�4G�G�$'�'�4RV�RV�h��0����F+�F+�P
�
�B�B���-�-�<&
�&
�P��@wD�wD�vM<�^��.B�B�H)�)�V�.��.�`-�-�5�5�n+�+�Z?�?�"��-�-�^
�
�,9�9�v��(4�4�l����@"=�"=�H��"������:N�:N�|7=�7=�r��&��H �H �T��( %� %�D#�#�D�D���$�6��6rr)�sh�bash�dash�csh�tcshzpython*zruby*�phpzperl*zmono*�awk)Ni)zld.so)OrrEr{r�r�r�rvr��importlib.utilr�rcryr�r<r"r�r�r�r�r�rxr�r!r�r��urllib.errorri�urllib.parse�urllib.request�xml.domr��xml.dom.minidom�xml.parsers.expat�collections.abcrr�apport.fileutilsr��apport.loggingr��apport.hook_uirr�apport.hookutilsr�apport.packaging_implrrr�r��	_data_dirrwrqrrr�r�r�r�r�r�rr-rMr^rfrkr�r�r�r�r�r�r�r�rqrr�rrr�rr�<module>r�sU��A�������
��	���	��
�	�
�
���
����������.����7�,�3��J�J�N�N�,�.A�B�	��[��0���[��0�����z�z�~�~�2�4J�K��,�
�*��0��1����&	5�

� �>'�T&��(#�P!/�H�!��.G��:,� 
�4��S��>� 
�Pd�^�
)�
)�dr

Youez - 2016 - github.com/yon3zu
LinuXploit