Closed Bug 45155 Opened 24 years ago Closed 24 years ago

assertion in nsPSMComponent (jar packaging)

Categories

(Core :: Security: PSM, defect, P3)

All
Other
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: warrensomebody, Assigned: warrensomebody)

References

Details

One of our readers, Dave Price, from Mt View California writes:

        This assertion is happening when they try to get 
chatzilla/content/chatzillaOverlay.xul out of the .jar file.

Here's the stack trace.

Dave

nsDebug::Assertion(const char * 0x100cb564, const char * 0x100cb54c,
const char * 0x100cb518, int 355) line 246 + 13 bytes
nsServiceManagerImpl::GetService(nsServiceManagerImpl * const
0x00b16f68, const nsID & {...}, const nsID & {...}, nsISupports * *
0x02a7fb7c, nsIShutdownListener * 0x00000000) line 355 + 44 bytes
nsServiceManagerImpl::GetService(nsServiceManagerImpl * const
0x00b16f68, const char * 0x033efbfc, const nsID & {...}, nsISupports * *
0x02a7fb7c, nsIShutdownListener * 0x00000000) line 494
nsServiceManager::GetService(const char * 0x033efbfc, const nsID &
{...}, nsISupports * * 0x02a7fb7c, nsIShutdownListener * 0x00000000)
line 607
nsGetServiceByProgID::operator()(const nsID & {...}, void * *
0x02a7fb7c) line 66 + 22 bytes
nsCOMPtr<nsISignatureVerifier>::assign_from_helper(const nsCOMPtr_helper
& {...}, const nsID & {...}) line 856 + 18 bytes
nsCOMPtr<nsISignatureVerifier>::nsCOMPtr<nsISignatureVerifier>(const
nsCOMPtr_helper & {...}) line 553
nsJAR::VerifyEntry(const char * 0x02cca1b0, const char * 0x026804c0,
unsigned int 591) line 708 + 33 bytes
nsJARInputStream::Init(nsJAR * 0x02cca228, const char * 0x02cc9540, int
1) line 89 + 38 bytes
nsJAR::CreateInputStream(const char * 0x02cc9540, int 1, nsIInputStream
* * 0x02cc9f3c) line 362 + 20 bytes
nsJAR::GetInputStream(nsJAR * const 0x02cca228, const char * 0x02cc9540,
nsIInputStream * * 0x02cc9f3c) line 293
nsJARChannel::GetInputStream(nsJARChannel * const 0x02cc9038,
nsIInputStream * * 0x02cc9f3c) line 1000 + 37 bytes
nsFileTransport::Process() line 397 + 71 bytes
nsFileTransport::Run(nsFileTransport * const 0x02cc9eec) line 352
nsThreadPoolRunnable::Run(nsThreadPoolRunnable * const 0x024963b8) line
689 + 12 bytes
nsThread::Main(void * 0x02496738) line 84 + 26 bytes
_PR_NativeRunThread(void * 0x02496780) line 399 + 13 bytes
MSVCRTD! 1020c323()
KERNEL32! 77e92ca8()

nsAppShellService::Run(nsAppShellService * const 0x00e4e7f8) line 387
main1(int 1, char * * 0x00b16b48, nsISupports * 0x00000000) line 913 +
32 bytes
main(int 1, char * * 0x00b16b48) line 1099 + 37 bytes
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 77e87903()


My pithy comeback...

Warren Harris wrote: 

  It looks like there's a circular dependency between nsPref, and 
nsPSMComponent. I don't quite see it, but I'm
  guessing that nsPSMComponent initialization needs prefs, but 
pref_VerifyLockFileSpec needs the
  nsPSMComponent (the nsISignatureVerifier). Doug should probably look at this. 

  Doug: It's only manifest with Dave's jar packaging stuff that he's working on. 

  Dave: Can you send us a simple jar manifest that will allow us to reproduce 
this problem? Also, maybe you could set
  a breakpoint on nsPSMComponent::CreatePSMComponent and pref_VerifyLockFileSpec 
and show us their stack
  traces. 

  Warren


Doug Turner replies...

psm definitely depends on libpref.  In fact, when we are created, we get a whole 
mess of preferences: 
http://lxr.mozilla.org/seamonkey/source/extensions/psm-glue/src/nsPSMComponent.c
pp#539 

But it looks like this code: 
http://lxr.mozilla.org/seamonkey/source/modules/libpref/src/nsPref.cpp#1331 

is only called when we are messing around with a lock file: 
http://lxr.mozilla.org/seamonkey/source/modules/libpref/src/nsPref.cpp#428 

Also, it seams very wrong that this returns success when the 
nsISignatureVerifier does not exists. 
  

Dave, when you have reduce this to a test case, let me know.
Blocks: 18433
Keywords: nsbeta2
There must be another thread doing something.  I do not see any reentrant calls 
to the service manager in these stacks.  
I've emailed the test case to Doug.  If it works without any problems, I'll post 
it in the bug as well.

Dave
To reproduce this defect:

- make certain you have the latest verions of the following:
        mozilla/config/make-jars.pl
        mozilla/config/rules.mak
        mozilla/netwerk/base/src/nsIOService.cpp
- rebuild mozilla/netwerk
- check out mozilla/extensions/irc/jar.mn
- go to mozilla/extensions/irc and run nmake -f makefile.win xinstall
- delete *.rdf in mozilla/dist/WIN32_D.OBJ/bin/chrome/
- make certain that installed_chrome.txt is in 
mozilla/dist/WIN32_D.OBJ/bin/chrome/ and the contents match the sample at the 
end of this comment
- remove the directory
mozilla/dist/WIN32_D.OBJ/bin/chrome/packages/chatzilla/ 
- run mozilla

If you have problems, just let me know.
Dave

<<begin installed_chrome.txt>>
content,install,url,resource:/chrome/packages/widget-toolkit/ 
content,install,url,resource:/chrome/packages/core/ 
locale,install,url,resource:/chrome/locales/en-US/ 
content,install,url,jar:resource:/chrome/packages/chatzilla.jar!/ 
locale,install,url,jar:resource:/chrome/packages/chatzilla.jar!/ 
skin,install,url,jar:resource:/chrome/packages/chatzilla.jar!/ 
skin,install,url,resource:/chrome/skins/modern/ 
skin,install,url,resource:/chrome/skins/classic/ 
locale,install,url,resource:/chrome/locales/en-GB/ 
content,install,url,resource:/chrome/packages/messenger/ 
<<end installed_chrome.txt>>
running nmake -f makefile.win xinstall does not work.

There are files that are not checked in that are listing in the jar.mn file.  
also I had to manually enter the perl command because xinstall (name sucks) does 
not work:

+++ make: packaging jars from jar.mn
+++ jaring ..\..\dist\WIN32_D.OBJ\bin\chrome/packages\chatzilla.jar
The name specified is not recognized as an
internal or external command, operable program or batch file.
--> mstoltz.

mstoltz I think that this is yours
Assignee: dougt → mstoltz
Putting on [nsbeta2-] radar. Not critical to beta2. 
Whiteboard: [nsbeta2-]
PDT: Removing [nsbeta2-] because this bug is blocking the jar file packaging bug 
18433.
Whiteboard: [nsbeta2-]
This looks like it has something to do with Neeti's code at 
http://lxr.mozilla.org/seamonkey/source/modules/libpref/src/nsPref.cpp#1331 .
She calls nsISignatureVerifier(which is another interface to nsPSMComponent) in 
order to calculate an MD5 hash. It would be much more convenient if we could put 
an MD5 function into Mozilla rather than have to call over to PSM to do it.
I'll pull the changes and test in my tree.
I pulled a new tree this evening and I am still seeing the assert.  

to reproduce:
pull and build a new tree
go to mozilla/extenions/irc and run nmake -f makefile.win xinstall
edit mozilla/dist/WIN32_D.OBJ/bin/chrome/installed_chrome.txt as mentioned above
run mozilla
Putting on [nsbeta2+] radar for beta2 fix, but only to prevent the blocking of 
bug 18433.
Whiteboard: [nsbeta2+]
Could someone (warren?) give me instructions for reproducing this bug? I'll take 
a look at it.
I fixed this.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updating QA Contact.
Component: Browser-General → Installer: XPI Packages
QA Contact: doronr → gbush
Keywords: verifyme
at gbush's request, I've verified that this is fixed.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
Component: Installer: XPI Packages → Installer
QA Contact: agracebush → general
mozilla/extensions/psm-glue/src/nsCrypto.cpp 	1.10
mozilla/extensions/psm-glue/src/Attic/nsCrypto.cpp 	1.10
Assignee: security-bugs → warrensomebody
Keywords: verifyme
Whiteboard: [nsbeta2+]
Component: Installer → Security: PSM
Product: SeaMonkey → Core
QA Contact: general → psm
You need to log in before you can comment on or make changes to this bug.