Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Thunderbird segfault after extension reads preferences.

18 views
Skip to first unread message

dmr...@gmail.com

unread,
Oct 3, 2006, 11:01:55 AM10/3/06
to
While developing an extension for Thunderbird I found that after my
extension reads any preference, thunderbird is not able to show the
contents of any folder any more, and eventually segfaults. If I try
the same extension in firebird or xulrunner, everything seems to work
ok.
Of course, I blamed my extension, so I downloaded Mozillazine's
helloworld-tb, added a button to hello.xull that calls a javascript
function to report the value of some preference. After that
thunderbird behaves as with my extension.
I've been able to reproduce this problem on all the versions I tried
(1.07, 1.5.x, night-builds, 3.0a1), on several linux distros (debian
unstable, fedora core 3, sles9) on x86 and amd64.
The Segmentation Fault happens after some javascript exceptions:

************************************************************
* Call to xpconnect wrapped JSObject produced this error: *
[Exception... "Component returned failure code: 0xc1f30001
(NS_ERROR_NOT_INITIALIZED) [nsIPrefBranch.getBoolPref]" nsresult:
"0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame ::
chrome://messenger/content/msgMail3PaneWindow.js ::
ScrollToMessageAfterFolderLoad :: line 87" data: no]
************************************************************
...

Error loading with many headers to download: [Exception... "Component
returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED)
[nsIMsgFolder.updateFolder]" nsresult: "0x8000ffff
(NS_ERROR_UNEXPECTED)" location: "JS frame ::
chrome://messenger/content/commandglue.js :: ChangeFolderByURI :: line
221" data: no]

...

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1220860224 (LWP 27190)]
0xb4d0b761 in nsMsgDBView::Open (this=0x8c35a00, folder=0x89ed160,
sortType=18, sortOrder=1, viewFlags=0,
pCount=0xbfa999dc) at nsMsgDBView.cpp:1832
1832 mIsNews = !strcmp("nntp",type.get());
(gdb)


Here's the function that I added to helloworld, and seems to have left
thunderbird in such a bad state:

function colgate()
{
var m_prefs =
Components.classes["@mozilla.org/preferences-service;1"].createInstance(Components.interfaces.nsIPrefService);

var m_branch = m_prefs.getBranch( "mail.accountmanager." );
var sieve_server = m_branch.getCharPref( "accounts" );
var sieve_port = m_branch.getCharPref( "defaultaccount" );

alert( "Server: " + sieve_server );
alert( "Port: " + sieve_port );

return null;
}


Am I missing something? Is this a bug?


Thanks,
Diego.

Neil

unread,
Oct 3, 2006, 11:24:37 AM10/3/06
to
dmr...@gmail.com wrote:

>var m_prefs =
>Components.classes["@mozilla.org/preferences-service;1"].createInstance(Components.interfaces.nsIPrefService);
>
>

Have you never heard of getService?

--
Warning: May contain traces of nuts.

dmr...@gmail.com

unread,
Oct 3, 2006, 1:33:28 PM10/3/06
to


Thanks a lot, that was it.

Diego

0 new messages