Closed Bug 126269 Opened 23 years ago Closed 16 years ago

Assertion in morkFile.cpp beacuse of missing file

Categories

(MailNews Core :: Database, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: bratell, Assigned: Bienvenu)

Details

Attachments

(1 file)

Every time I open MailNews I get an assertion in mork code because "J:\Documents and Settings\Bratell\Application Data\Mozilla\Users50\default\News\news.mozilla.org.msf" doesn't exist when opened in mork_assertion_signal(const char * 0x04e48bd8) line 57 + 31 bytes morkEnv::NewError(const char * 0x054ba818) line 405 + 19 bytes morkFile::NewFileErrnoError(morkEnv * 0x054ba538) line 267 morkStdioFile::new_stdio_file_fault(morkEnv * 0x054ba538) line 769 --->morkStdioFile::OpenStdio(morkEnv * 0x054ba538, const char * 0x054ba180, const char * 0x04e48f14) line 840 morkStdioFile::morkStdioFile(morkEnv * 0x054ba538, const morkUsage & {...}, nsIMdbHeap * 0x044e0754, nsIMdbHeap * 0x044e0754, const char * 0x054ba180, const char * 0x04e48f14) line 794 morkStdioFile::CreateNewStdioFile(morkEnv * 0x054ba538, nsIMdbHeap * 0x044e0754, const char * 0x054ba180) line 481 + 61 bytes morkFile::CreateNewFile(morkEnv * 0x054ba538, nsIMdbHeap * 0x044e0754, const char * 0x054ba180) line 186 + 17 bytes morkFactory::CreateNewFile(morkFactory * const 0x044e06fc, nsIMdbEnv * 0x054ba564, nsIMdbHeap * 0x044e0754, const char * 0x054ba180, nsIMdbFile * * 0x0012ce40) line 252 + 17 bytes nsMsgDatabase::OpenMDB(const char * 0x054ba180, int 1) line 1009 + 34 bytes nsNewsDatabase::Open(nsNewsDatabase * const 0x054b9ee0, nsIFileSpec * 0x054f8260, int 1, int 0, nsIMsgDatabase * * 0x0112f54c) line 128 + 28 bytes nsMsgDatabase::OpenFolderDB(nsMsgDatabase * const 0x054b9ee0, nsIMsgFolder * 0x0112f4dc, int 1, int 0, nsIMsgDatabase * * 0x0112f54c) line 910 + 33 bytes nsMsgNewsFolder::GetDatabase(nsIMsgWindow * 0x00000000) line 390 + 85 bytes nsMsgNewsFolder::GetDBFolderInfoAndDB(nsMsgNewsFolder * const 0x0112f4dc, nsIDBFolderInfo * * 0x0012d038, nsIMsgDatabase * * 0x0012d030) line 773 + 17 bytes nsMsgFolder::OnFlagChange(nsMsgFolder * const 0x0112f4dc, unsigned int 16) line 1625 + 63 bytes nsMsgFolder::ClearFlag(nsMsgFolder * const 0x0112f4dc, unsigned int 16) line 1603 nsMsgFolderDataSource::DoFolderAssert(nsIMsgFolder * 0x0112f4dc, nsIRDFResource * 0x011e7218, nsIRDFNode * 0x011e72b8) line 2018 + 17 bytes nsMsgFolderDataSource::Assert(nsMsgFolderDataSource * const 0x0535f4c8, nsIRDFResource * 0x0112f4c0, nsIRDFResource * 0x011e7218, nsIRDFNode * 0x011e72b8, int 1) line 487 + 25 bytes nsXULOutlinerBuilder::ToggleOpenState(nsXULOutlinerBuilder * const 0x053351e8, int 8) line 733 + 73 bytes XPTC_InvokeByIndex(nsISupports * 0x053351e8, unsigned int 22, unsigned int 1, nsXPTCVariant * 0x0012d26c) line 106 It's true, I don't have a "J:\Documents and Settings\Bratell\Application Data\Mozilla\Users50\default\News\news.mozilla.org.msf" but I do have a directory "J:\Documents and Settings\Bratell\Application Data\Mozilla\Users50\default\News\news.mozilla.org" with several .msf-files beneath it. One for each news group I'm subscribed to I think. I tried to see where that information came from, but all I could gather was that it came from somewhere high up. Maybe a messed up profile? It's quite old.
this assertion is usually because a parent directory doesn't exist so we failed creating the file - are you sure that the parent directories all exist? Could you look carefully at the paths?
Ah, the path to the file that couldn't be opened was "J:\Documents and Settings\Bratell\Application Data\Mozilla\Users50\default\News\news.mozilla.org.msf\", i.e. there was a trailing backslash and no filename. There is no news.mozilla.org.msf directory and there must be a file name so there are two problems. Do you know what's wrong now?
no, I don't know what's wrong. Something went wrong in the news code, I guess. It sounds like there's a news folder with no name, causing an empty path.
I have this in a debugger and can reproduce it so just tell me where to put my breakpoints and I will try to understand it.
oh, just bop up the stack to nsMsgNewsFolder::GetDatabase, or nsMsgDatabase::OpenFolderDB, rather, and see that when we call folder->GetPath(getter_AddRefs(folderPath));, we're getting back the bogus path. You might look more closely at that news folder object and see what various fields look like in it, especially name fields. Be sure to look at the base classes, nsMsgFolder and nsMsgDBFolder.
folder->GetPath returns "J:\DOCUMENTS AND SETTINGS\BRATELL\APPLICATION DATA\Mozilla\Users50\default\News\news.mozilla.org\" nsMsgFolder.mName = "" so it seems to be an empty name as you guessed. Where from does the name come? Other fields at random: mNewsrcFilePath: "J:\DOCUMENTS AND SETTINGS\BRATELL\APPLICATION DATA\Mozilla\Users50\default\News\news.mozilla.org.rc" nsBaseMessageURI: "news-message://bratell@news.mozilla.org" nsMsgLineBuffer.nsByteArray.m_buffer: "netscape.public.mozilla.dom" m_newsrcInputStream.m_buffer: "netscape.public.mozilla.porkjockeys: 1-4302 netscape.public.mozilla.seamonkey: 1-6984 netscape.public.mozilla.mail-news: 1-20244,20246-20249,20251-20253,20277,20300,20310,20311,20316,20412,20413,20416, 20417,20427,20433,20435,20471 netscape" mASCIIName: ""
This file looks good to me. I know that I have a problem with message counts, but that shouldn't affect this I think?
actually, that all looks ok, and that's what happens when I step through this code myself. aNewsgroupName->GetFileSpec(&newsgroupName); nsNewsSummarySpec summarySpec(newsgroupName); when you look at summarySpec, does it look correct? It should have removed the trailing slash and left you with "...\Users50\default\News\news.mozilla.org.msf" - it's trying to create this file, and it should work fine. Again, you might want to look carefully at the path and also look at the parent directory. I'll try deleting my server .msf file and see if I have this problem too, but I don't expect I will.
It seems to be a thing with nsFileSpec/nsFileSpecWin. We are calling getLeaf to get news.mozilla.org from "...sers50\default\News\news.mozilla.org\". Then we append ".msf" to get "news.mozilla.org.msf" and call replaceLeaf on the filespec. But that code has this: if (trailingSeparator) { // If the original ended in a slash, then the new one should, too. char sepStr[2] = "/"; so the result is "...sers50\default\News\news.mozilla.org.msf\" I don't know whose responsibility it is to strip the trailing '\', but ret = myMDBFactory->CreateNewFile(m_mdbEnv, dbHeap, dbName, &newFile); doesn't like it as long as the name ends with a backslash. Where to go from here?
Daniel: could bug 210683 be related?
Possibly, but I'm not sure.
Product: MailNews → Core
QA Contact: esther → database
I vaguely remember fixing something like this a while ago. I'm going to mark WFM. If anyone else sees a similar assertion, they can re-open this, or file a new bug.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: