Assertion in morkFile.cpp beacuse of missing file



17 years ago
11 years ago


(Reporter: bratell, Assigned: Bienvenu)


Windows 2000

Firefox Tracking Flags

(Not tracked)



(1 attachment)



17 years ago
Every time I open MailNews I get an assertion in mork code because "J:\Documents 
and Settings\Bratell\Application 

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 
nsMsgFolder::OnFlagChange(nsMsgFolder * const 0x0112f4dc, unsigned int 16) line 
1625 + 63 bytes
nsMsgFolder::ClearFlag(nsMsgFolder * const 0x0112f4dc, unsigned int 16) line 
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\" but I do have a 
directory "J:\Documents and Settings\Bratell\Application 
Data\Mozilla\Users50\default\News\" 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.

Comment 1

17 years ago
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?

Comment 2

17 years ago
Ah, the path to the file that couldn't be opened was "J:\Documents 
and Settings\Bratell\Application 
Data\Mozilla\Users50\default\News\\", i.e. there was a 
trailing backslash and no filename. There is no directory 
and there must be a file name so there are two problems. Do you know what's 
wrong now?

Comment 3

17 years ago
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.

Comment 4

17 years ago
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.

Comment 5

17 years ago
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.


Comment 6

17 years ago

nsMsgFolder.mName = "" so it seems to be an empty name as you guessed. Where 
from does the name come?

Other fields at random:


nsBaseMessageURI:	"news-message://"

nsMsgLineBuffer.nsByteArray.m_buffer: "netscape.public.mozilla.dom"

  "netscape.public.mozilla.porkjockeys: 1-4302
   netscape.public.mozilla.seamonkey: 1-6984

mASCIIName:  ""


Comment 7

17 years ago
Created attachment 70233 [details]
the file

This file looks good to me. I know that I have a problem with message counts,
but that shouldn't affect this I think?

Comment 8

17 years ago
actually, that all looks ok, and that's what happens when I step through this
code myself. 

  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\"
- 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.

Comment 9

17 years ago
It seems to be a thing with nsFileSpec/nsFileSpecWin.

We are calling getLeaf to get from 
"...sers50\default\News\\". Then we append ".msf" to get 
"" and call replaceLeaf on the filespec. But that code has 

    if (trailingSeparator)
        // If the original ended in a slash, then the new one should, too.
        char sepStr[2] = "/";

so the result is 

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?

Comment 10

16 years ago
Daniel: could bug 210683 be related?

Comment 11

16 years ago
Possibly, but I'm not sure.
Product: MailNews → Core
QA Contact: esther → database

Comment 12

11 years ago
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.
Last Resolved: 11 years ago
Resolution: --- → WORKSFORME
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.