Dear Maintainer,
I just came across this report and want to note that since ASLR
got quite common the addr2line method is unreliable.

Therefore I want to point to here [1], were another method is
described to find out the source line where a crash happened. 

Attached file contains this exercised for the given output
in the first message.
This would point to [3], folderview.c, line 2339.

The most convenient way I guess is to install a coredump collector,
and inspect that after a crash like in [2] you already mentioned.

Kind regards,
Bernhard


[1] https://wiki.debian.org/InterpretingKernelOutputAtProcessCrash
[2] https://wiki.debian.org/HowToGetABacktrace
[3] https://sources.debian.org/src/claws-mail/3.17.3-2/src/folderview.c/#L2339


dmesg: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972928#5
[Mon Oct 26 10:23:55 2020] claws-mail[1879911]: segfault at 1f ip 
00000000004a35bd sp 00007ffe5872a4e0 error 4 in claws-mail[442000+230000]
[Mon Oct 26 10:23:55 2020] Code: 30 85 c0 0f 84 a4 02 00 00 c7 05 3e f6 2e 00 
00 00 00 00 31 f6 48 89 df e8 c0 fc ff ff 49 8b 84 24 88 00 00 00 48 85 c0 74 
19 <48> 8b 00 31 f6 83 38 04 48 8b 43 50 40 0f 94 c6 48 8b 78 30 e8 5a


https://wiki.debian.org/InterpretingKernelOutputAtProcessCrash

0: no page found
0: read access
1: user-mode access


benutzer@debian:~$ echo -n "find /b ..., ..., 0x" && \
> echo "30 85 c0 0f 84 a4 02 00 00 c7 05 3e f6 2e 00 00 00 00 00 31 f6 48 89 df 
> e8 c0 fc ff ff 49 8b 84 24 88 00 00 00 48 85 c0 74 19 <48> 8b 00 31 f6 83 38 
> 04 48 8b 43 50 40 0f 94 c6 48 8b 78 30 e8 5a" \
>  | sed 's/[<>]//g' | sed 's/ /, 0x/g'
find /b ..., ..., 0x30, 0x85, 0xc0, 0x0f, 0x84, 0xa4, 0x02, 0x00, 0x00, 0xc7, 
0x05, 0x3e, 0xf6, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xf6, 0x48, 0x89, 
0xdf, 0xe8, 0xc0, 0xfc, 0xff, 0xff, 0x49, 0x8b, 0x84, 0x24, 0x88, 0x00, 0x00, 
0x00, 0x48, 0x85, 0xc0, 0x74, 0x19, 0x48, 0x8b, 0x00, 0x31, 0xf6, 0x83, 0x38, 
0x04, 0x48, 0x8b, 0x43, 0x50, 0x40, 0x0f, 0x94, 0xc6, 0x48, 0x8b, 0x78, 0x30, 
0xe8, 0x5a
benutzer@debian:~$




################




# Buster/stable amd64 qemu VM 2020-11-02


apt update
apt dist-ugprade


apt install systemd-coredump gdb claws-mail claws-mail-dbgsym



gdb -q 
set width 0
set pagination off
file /usr/bin/claws-mail
tb main
run

info target

        0x0000000000448cb0 - 0x00000000006715b1 is .text

(gdb) find /b 0x0000000000448cb0, 0x00000000006715b1, 0x30, 0x85, 0xc0, 0x0f, 
0x84, 0xa4, 0x02, 0x00, 0x00, 0xc7, 0x05, 0x3e, 0xf6, 0x2e, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x31, 0xf6, 0x48, 0x89, 0xdf, 0xe8, 0xc0, 0xfc, 0xff, 0xff, 0x49, 
0x8b, 0x84, 0x24, 0x88, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc0, 0x74, 0x19, 0x48, 
0x8b, 0x00, 0x31, 0xf6, 0x83, 0x38, 0x04, 0x48, 0x8b, 0x43, 0x50, 0x40, 0x0f, 
0x94, 0xc6, 0x48, 0x8b, 0x78, 0x30, 0xe8, 0x5a
0x4a3593 <folderview_selected+387>
1 pattern found.

(gdb) b * (0x4a3593 + 42)
Breakpoint 2 at 0x4a35bd: file folderview.c, line 2339.
(gdb) info b
Num     Type           Disp Enb Address            What
2       breakpoint     keep y   0x00000000004a35bd in folderview_selected at 
folderview.c:2339

(gdb) disassemble /r 0x4a3593, 0x4a3593 + 62
Dump of assembler code from 0x4a3593 to 0x4a35d1:
   0x00000000004a3593 <folderview_selected+387>:        30 85 c0 0f 84 a4       
xor    %al,-0x5b7bf040(%rbp)
   0x00000000004a3599 <folderview_selected+393>:        02 00                   
add    (%rax),%al
   0x00000000004a359b <folderview_selected+395>:        00 c7                   
add    %al,%bh
   0x00000000004a359d <folderview_selected+397>:        05 3e f6 2e 00          
add    $0x2ef63e,%eax
   0x00000000004a35a2 <folderview_selected+402>:        00 00                   
add    %al,(%rax)
   0x00000000004a35a4 <folderview_selected+404>:        00 00                   
add    %al,(%rax)
   0x00000000004a35a6 <folderview_selected+406>:        31 f6                   
xor    %esi,%esi
   0x00000000004a35a8 <folderview_selected+408>:        48 89 df                
mov    %rbx,%rdi
   0x00000000004a35ab <folderview_selected+411>:        e8 c0 fc ff ff          
callq  0x4a3270 <folderview_close_opened>
   0x00000000004a35b0 <folderview_selected+416>:        49 8b 84 24 88 00 00 00 
mov    0x88(%r12),%rax
   0x00000000004a35b8 <folderview_selected+424>:        48 85 c0                
test   %rax,%rax
   0x00000000004a35bb <folderview_selected+427>:        74 19                   
je     0x4a35d6 <folderview_selected+454>
   0x00000000004a35bd <folderview_selected+429>:   >>>  48 8b 00                
mov    (%rax),%rax
   0x00000000004a35c0 <folderview_selected+432>:        31 f6                   
xor    %esi,%esi
   0x00000000004a35c2 <folderview_selected+434>:        83 38 04                
cmpl   $0x4,(%rax)
   0x00000000004a35c5 <folderview_selected+437>:        48 8b 43 50             
mov    0x50(%rbx),%rax
   0x00000000004a35c9 <folderview_selected+441>:        40 0f 94 c6             
sete   %sil
   0x00000000004a35cd <folderview_selected+445>:        48 8b 78 30             
mov    0x30(%rax),%rdi
End of assembler dump.
(gdb) print 0x88
$2 = 136


(gdb) ptype /o FolderView
type = struct _FolderView {
/*    0      |     8 */    GtkWidget *scrolledwin;
/*    8      |     8 */    GtkWidget *ctree;
/*   16      |     8 */    GtkWidget *headerpopupmenu;
/*   24      |     8 */    GHashTable *popups;
/*   32      |     8 */    GtkCMCTreeNode *selected;
/*   40      |     8 */    GtkCMCTreeNode *opened;
/*   48      |     4 */    gboolean open_folder;
/*   52      |    12 */    GdkColor color_new;
/*   64      |    12 */    GdkColor color_op;
/* XXX  4-byte hole */
/*   80      |     8 */    MainWindow *mainwin;
/*   88      |     8 */    SummaryView *summaryview;
/*   96      |     4 */    gint folder_update_callback_id;
/*  100      |     4 */    gint folder_item_update_callback_id;
/*  104      |     8 */    GSList *nodes_to_recollapse;
/*  112      |     4 */    guint drag_timer_id;
/* XXX  4-byte hole */
/*  120      |     8 */    FolderItem *drag_item;
/*  128      |     8 */    GtkCMCTreeNode *drag_node;
/*  136      |     8 */    GtkTargetList *target_list;
/*  144      |    32 */    FolderColumnState col_state[4];
/*  176      |    16 */    gint col_pos[4];
/*  192      |     8 */    Folder *scanning_folder;
/*  200      |     8 */    GtkUIManager *ui_manager;
/*  208      |     8 */    GtkActionGroup *popup_common_action_group;
/*  216      |     8 */    GtkActionGroup *popup_specific_action_group;
/*  224      |     4 */    gint scroll_value;
/*  228      |     4 */    guint deferred_refresh_id;
/*  232      |     4 */    guint scroll_timeout_id;
/*  236      |     4 */    guint postpone_select_id;

                           /* total size (bytes):  240 */
                         }
(gdb) ptype /o MainWindow
type = struct _MainWindow {
/*    0      |     8 */    GtkWidget *hpaned;
/*    8      |     8 */    GtkWidget *vpaned;
/*   16      |     8 */    GtkWidget *window;
/*   24      |     8 */    GtkWidget *vbox;
/*   32      |     8 */    GtkWidget *menubar;
/*   40      |     8 */    GtkWidget *handlebox;
/*   48      |     8 */    Toolbar *toolbar;
/*   56      |     8 */    GtkWidget *vbox_body;
/*   64      |     8 */    GtkWidget *hbox_stat;
/*   72      |     8 */    GtkWidget *statusbar;
/*   80      |     8 */    GtkWidget *progressbar;
/*   88      |     8 */    GtkWidget *statuslabel;
/*   96      |     8 */    GtkWidget *ac_button;
/*  104      |     8 */    GtkWidget *ac_label;
/*  112      |     8 */    GtkWidget *ac_menu;
/*  120      |     8 */    GtkWidget *online_switch;
/*  128      |     8 */    GtkWidget *offline_switch;
/*  136      |     8 */    GtkWidget *online_pixmap;
/*  144      |     8 */    GtkWidget *offline_pixmap;
/*  152      |     4 */    gint mainwin_cid;
/*  156      |     4 */    gint folderview_cid;
/*  160      |     4 */    gint summaryview_cid;
/*  164      |     4 */    gint messageview_cid;
/*  168      |     4 */    ToolbarStyle toolbar_style;
/*  172      |     4 */    guint lock_count;
/*  176      |     4 */    guint menu_lock_count;
/*  180      |     4 */    guint cursor_count;
/*  184      |     8 */    FolderView *folderview;
/*  192      |     8 */    SummaryView *summaryview;
/*  200      |     8 */    MessageView *messageview;
/*  208      |     8 */    LogWindow *logwin;
/*  216      |     8 */    LogWindow *filtering_debugwin;
/*  224      |     4 */    gint progressindicator_hook;
/* XXX  4-byte hole */
/*  232      |     8 */    GtkWidget *colorlabel_menu;
/*  240      |     8 */    GtkWidget *warning_btn;
/*  248      |     8 */    GtkWidget *tags_menu;
/*  256      |     4 */    gboolean in_folder;
/* XXX  4-byte hole */
/*  264      |     8 */    GtkActionGroup *action_group;
/*  272      |     8 */    GtkUIManager *ui_manager;
/*  280      |     8 */    gpointer smc_conn;

                           /* total size (bytes):  288 */
                         }



https://sources.debian.org/src/claws-mail/3.17.3-2/src/folderview.c/#L2339

https://git.claws-mail.org/?p=claws.git;a=blob;f=src/folderview.c;h=263d3d8d7e0da309b7394bcfdb359c39787d1419;hb=HEAD#l2308

https://thewildbeast.co.uk/claws-mail/bugzilla/buglist.cgi?bug_status=__all__&content=folderview_selected&no_redirect=0&query_format=specific&order=bug_id%20DESC&query_based_on=

Reply via email to