[jcifs] Exception: Invalid access to memory location

Tapperson Kevin Kevin.Tapperson at eHC.com
Mon Oct 18 13:08:30 GMT 2004


The short answer/suggestion is to try upgrading to jcifs-1.1.0.

Here is the long description (at least from my experience):

I have seen this error before while I was working with the NtlmHttpFilter
class to create a customized version for our environment.  From your stack
trace, it appears that you are creating a customized version as well
(WlbNtlmHttpFilter).  In my case, this error was created by the following
scenario:

1) type 1 request received
2) generate a challenge from domain controller A
3) save this challenge in the HttpSession
4) send this challenge to client browser in type 2 response
5) type 3 request received
6) retrieve the saved challenge from the HttpSession
7) submit the challenge (from the HttpSession generated in step 2) along
with the LM and NT responses received in step 5 to domain controller B for
verification

The issue here is that domain controller B did not generate the challenge;
it was generated by domain controller A and, therefore the hashes must be
verified by domain controller A.  My guess is that the 8 byte challenge
value itself is somehow tied to a memory location on the domain controller
that generated it.

If you replace the steps listed above with the following, it should go away:
3) save the address of the domain controller used in step 2 in the
HttpSession
6) retrieve the saved address of the domain controller from the HttpSession
7) submit the challenge (can be re-acquired with
SmbSession.getChallenge(dc)) along with the LM and NT responses received in
step 5 to domain controller A (which was saved in the HttpSession)

If you are using a NetBIOS 0x1C name lookup for the domain name, the
scenario outlined above where the domain controller used in step 2 and the
one used in step 7 are different is possible.  As you decrease the value for
jcifs.netbios.cachePolicy, the probability of that situation increases.
This is probably why you are seeing this problem show up intermittently.
The domain controller address is cached for a while (based on
jcifs.netbios.cachePolicy), and subsequent calls to lookup the address will
return the same domain controller.  When the cache expires, however, a
different domain controller could be returned.

Kevin Tapperson
kevin.tapperson at ehc.com

-----Original Message-----
From: Richard Attermeyer [mailto:richard.attermeyer at web.de]
Sent: Monday, October 18, 2004 3:24 AM
To: jcifs at lists.samba.org
Subject: [jcifs] Exception: Invalid access to memory location


We are encountering from time to time an exception (see below) with JCifs 
since we upgraded to Windows XP clients.
We are using jcifs-0.9.7.
Does anyone know what the problem is or what we look for?

jcifs.smb.SmbAuthException: Invalid access to memory location.
	at jcifs.smb.SmbComSessionSetupAndX.<init>
(SmbComSessionSetupAndX.java:46)
	at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:246)
	at jcifs.smb.SmbSession.send(SmbSession.java:219)
	at jcifs.smb.SmbTree.treeConnect(SmbTree.java:134)
	at jcifs.smb.SmbSession.logon(SmbSession.java:155)
	at jcifs.smb.SmbSession.logon(SmbSession.java:150)
	at de.westlb_systems.sso.filter.WlbNtlmHttpFilter.doFilter
(WlbNtlmHttpFilter.java:188)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:213)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at westlb.gsf.servlet.LoginFilter.doFilter(LoginFilter.java:94)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:213)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at de.westlb_systems.sso.filter.WlbNtlmHttpFilter.doFilter
(WlbNtlmHttpFilter.java:220)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:213)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNe
xt(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNe
xt(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2415)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNe
xt(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNe
xt(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:172)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNe
xt(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:995)
	at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNe
xt(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service
(CoyoteAdapter.java:223)
	at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:432)
	at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
cti
on(Http11Protocol.java:386)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:534)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:530)
	at java.lang.Thread.run(Thread.java:536)



More information about the jcifs mailing list