I’m currently having two PCs in use: one for working and one for personal use. Both of them have Windows 10 and Mozilla Thunderbird installed.
Since I have various email accounts in use, so I make two instances of Mozilla Thunderbird share the same copy of profile to make my accounts management easier.
Phenomenon
Recently, I found when I first start up my PCs, my Mozilla Thunderbird crashes and Mozilla Thunderbird ‘s crash reporter window shows up.
After I clicked Restart Thunderbird button, Mozilla Thunderbird also crashes.
Trace
The problem needs to be solved, so I use WinDbg to launch Mozilla Thunderbird and simply waiting for Mozilla Thunderbird to crash.
After a while, WinDbg interprets Mozilla Thunderbird‘s execution and notifies that a bug has occurred.
1 2 3 4 5 6 7 8 9 10
(37bc.15c4): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. *** WARNING: Unable to verify checksum for ToastNotification.dll *** ERROR: Symbol file could not be found. Defaulted to export symbols for ToastNotification.dll - eax=132587c8 ebx=00000009ecx=00000000edx=00000000esi=132587c8 edi=00000002 eip=170d1110 esp=00a7bc78 ebp=00a7bc84 iopl=0 nv up ei pl nz na po nc cs=0023ss=002b ds=002b es=002b fs=0053gs=002b efl=00210202 ToastNotification+0x1110: 170d1110 668b02 movax,wordptr [edx] ds:002b:00000000=????
It’s can be seen from the snippet that the bug was caused by ToastNotification.dll and it’s a null pointer dereference bug.
To find out what ToastNotification.dll is, I need to list its detail information.
1 2 3 4 5 6 7 8 9 10
start end module name 170d0000 170ef000 ToastNotification C (export symbols) ToastNotification.dll Loaded symbol image file: ToastNotification.dll Image path: "Profile Path"\extensions\jid1-OoNOA6XBjznvLQ@jetpack\resources\gnotifier\data\ToastNotification.dll Image name: ToastNotification.dll Browse all global symbols functions data Timestamp: Fri May 1522:17:242015 (5555FFF4) CheckSum:00000000 ImageSize: 0001F000 Translations:0000.04b0 0000.04e40409.04b0 0409.04e4
Well, ToastNotification.dll is part of the extension GNotifier
By far, I can draw the conclusion that GNotifier‘s bug causes my Thunderbird to crash.
Further Investigation
Since I knew the source which causes Thunderbird to crash, it’s may be interesting to finding the root problem.
By reading the code below, It’s clear how the bug occurs:
GNotifier uses js-ctypes to register DisplayToastNotification to notify messages in Windows;
For some notifications don’t have an icon, the iconURL parameter will be null;
DisplayToastNotification simply allocate a new ToastNotificationHandler instance and the new object’s Init interface;
The Init interface does not check its parameters and simply passes those parameters to WindowsCreateString even if some of all of them are null pointers;
The whole application crashes.
Another interesting result can also be observed: the DisplayToastNotification‘s prototype already knew, so the message that causes the application to crash can also be found out by simply print out its parameters.
1 2
0:000> du poi(@ebp + 0xC) 0dc56660 "SOGO : Contacts"
1 2
0:000> du poi(@ebp + 0x10) 0dc56680 "No changes."
1 2
0:000> du poi(@ebp + 0x14) 0dc566a0 "Thunderbird"
Well, it’s SOGO: an extension used for accessing online calendars.