Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add crash-type-agnostic optimized thread generators #64

Closed
jfilak opened this issue Mar 27, 2013 · 2 comments
Closed

add crash-type-agnostic optimized thread generators #64

jfilak opened this issue Mar 27, 2013 · 2 comments

Comments

@jfilak
Copy link
Contributor

jfilak commented Mar 27, 2013

The functions should work as sr_gdb_stacktrace_get_optimized_thread() Optimized stacktraces are used by bugzilla reporter when an original backtrace is too big to be added to comment 0.

@jfilak
Copy link
Contributor Author

jfilak commented May 23, 2013

btparser generates an optimized thread in the following format for CCpp:

Thread no. 1 (10 frames)
 #4 gtk_list_store_compare_func at gtkliststore.c:1961
 #5 node_find_closest at gsequence.c:1764
 #6 node_insert_sorted at gsequence.c:2002
 #7 g_sequence_sort_changed_iter at gsequence.c:961
 #8 gtk_list_store_insert_with_valuesv at gtkliststore.c:2327
 #9 ffi_call_unix64 at ../src/x86/unix64.S:75
 #10 ffi_call at ../src/x86/ffi64.c:486
 #11 g_callable_info_invoke at girepository/gicallableinfo.c:610
 #12 g_function_info_invoke at girepository/gifunctioninfo.c:274
 #13 _invoke_callable at pygi-invoke.c:52

And I would expected that it is possible to generate a similar stacktrace for all crash types. It will make bugzilla reports clearer.

Python standard backtrace:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/gnome_abrt/views.py", line 405, in on_tvs_problems_changed
    selection = self._get_selected(selection)
  File "/usr/lib64/python2.7/site-packages/gnome_abrt/views.py", line 401, in _get_selected
    return [model[p][2] for p in rows]
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py", line 1043, in __getitem__
    return self.model.get_value(self.iter, key)
  File "/usr/lib64/python2.7/site-packages/gi/types.py", line 113, in function
    return info.invoke(*args, **kwargs)
ValueError: 2 not in range -2147483648 to 2147483647

Python optimized backtrace:

#0 function at /usr/lib64/python2.7/site-packages/gi/types.py": 113
#1 __getitem__ at /usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py: 1043
#2 _get_selected at /usr/lib64/python2.7/site-packages/gnome_abrt/views.py: 401
#3 on_tvs_problems_changed at /usr/lib64/python2.7/site-packages/gnome_abrt/views.py: 405

mmilata added a commit that referenced this issue May 30, 2013
Type-agnostic API means that we expose several functions that operate on
frames (or threads or stacktraces) regardless of their problem type.
This is accomplished by looking at the type member of each structure
(introduced in previous patch) and using it to look up the right
function for the type.

Furthermore, the implementations of the type-agnostic functions can
themselves work on multiple structure types, which can prevent some code
duplication.

A sr_stacktrace_to_short_text function is provided as an example,
closing #64. Related to #63 and related to #66 as the requested
functionality should be easier to implement now.

Note:

I've fixed an obvious typo in lib/utils.h
- (assert((type > 0) && (type) < SR_REPORT_NUM
+ (assert((type > SR_REPORT_INVALID) && (type) < SR_REPORT_NUM

Jakub Filak

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>
@mmilata
Copy link
Contributor

mmilata commented Jun 4, 2013

Implemented in 7ef55a0

@mmilata mmilata closed this as completed Jun 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants