eLockViolation

eLockViolation

john.uhden
Mentor Mentor
5,190 Views
20 Replies
Message 1 of 21

eLockViolation

john.uhden
Mentor
Mentor

I am setting up my clent's laptop, which he claims "automatically" upgraded itself from Win7 to Win10.  He thought his AutoCAD 2002 would not run, but it does.  That's the good news.

The bad news is that programs that I wrote years ago, that have run flawlessly in Win2K, XP, and Win7 are now experiencing elockviolations ("LWPOLYLINE creation failed ... error:  C#0000005 ...") or something like that on his laptop.

 

I presume that there's something in my code that is causing it, but I have no idea where to look first.  Are there typical situations that cause this error in AutoLisp?  The only thing special is that it's wrapped in a VLX.

 

Wait.  I just checked my code.  The "LWPOLYLINE creation failed" message is built into my program to report an entmake failure.  Might the entmake including a new layer be part of the problem?  It never has before.  Or is 2002 doomed to not work correctly in Win10.

 

The *error* function does contain (command "_.Undo" "_End").  I wonder if converting to some Visual Lisp would circumvent this issue.

John F. Uhden

0 Likes
Accepted solutions (1)
5,191 Views
20 Replies
Replies (20)
Message 2 of 21

wkmvrij
Advocate
Advocate

Don't panic, You will find it eventually.. Smiley Happy

Message 3 of 21

john.uhden
Mentor
Mentor

@wkmvrij wrote, "Don't panic, You will find it eventually.. Smiley Happy"

 

Is that the solution I should accept?

John F. Uhden

0 Likes
Message 4 of 21

ActivistInvestor
Mentor
Mentor

@john.uhden wrote:

I am setting up my clent's laptop, which he claims "automatically" upgraded itself from Win7 to Win10.  He thought his AutoCAD 2002 would not run, but it does.  That's the good news.

The bad news is that programs that I wrote years ago, that have run flawlessly in Win2K, XP, and Win7 are now experiencing elockviolations ("LWPOLYLINE creation failed ... error:  C#0000005 ...") or something like that on his laptop.

 

I presume that there's something in my code that is causing it, but I have no idea where to look first.  Are there typical situations that cause this error in AutoLisp?  The only thing special is that it's wrapped in a VLX.

 

Wait.  I just checked my code.  The "LWPOLYLINE creation failed" message is built into my program to report an entmake failure.  Might the entmake including a new layer be part of the problem?  It never has before.  Or is 2002 doomed to not work correctly in Win10.

 

The *error* function does contain (command "_.Undo" "_End").  I wonder if converting to some Visual Lisp would circumvent this issue.


eLockViolation means that your code is running in the wrong execution context, when the document is locked for exclusive access from another execution context.

 

When AutoCAD starts a command it locks the active document. The lock prevents the document from being accessed by another thread while it is locked, because simultaneous/concurrent access to the document from two different threads could easily become catastrophic. The locking is also what prevents an out-of-process COM client from accessing the ActiveDocument while a command is running (if attempted, it will result in an exception stating that AutoCAD is busy, or some such).

 

Normally, LISP code should not encounter lock violations, unless it runs from a reactor or some other execution context besides a defined C:COMMAND. vlax-add-cmd might also be suspect depending on the flags used.  Avoiding ENTMAKE and using COM is probably a safer route.

Message 5 of 21

john.uhden
Mentor
Mentor

That hasn't as yet solved the issue, but I very much like the answer.  It gives me something for which to look.

Of course it still bothers me that this is happening only with ACAD2002 in Win10, not in Win7 or earlier.

John F. Uhden

0 Likes
Message 6 of 21

wkmvrij
Advocate
Advocate

Have  you tried with another AutCAD version yet? Indeed did you run in a 64bit version? 

A quick google indicates that the error code you mentioned originates in Windows...

 

0 Likes
Message 7 of 21

john.uhden
Mentor
Mentor

Thank you for all your attention, seriously.

No, I have not tried another ACAD release.  The client is well armed with 2002.  It does all that he wants or needs and he can keep installing it on replacement PCs without a galldern activation code.  Yes, he has the same number of licenses as he does workstations.  I would not allow him to go illegal.  If I have to try other techniques like vla-add instead of entmake, then that's okay, so long as there is a solution for what he has.  He knows that he can't keep buying refurbed Win7 machines forever, though it might pay for him to stock up on them while he can.  A new ACAD is a lot more expensive than a new PC, and pretty soon we can expect that a new ACAD won't run on an older Windows.  Despite his volume of business, his material is very costly and his profits are rather small, and he has some very expensive machinery to maintain or replace as needed.

 

The ability to provide him custom routines is crucial.  The typical programs I have made for him draw everything ready for the printer and cutter in about 1 minute (including input) vs. an hour and a half or more without them, and that's only if they're experienced.  Another top draftsman is leaving, so he has to have smart'neasy tools for novices to get the work out of drafting.

John F. Uhden

0 Likes
Message 8 of 21

ActivistInvestor
Mentor
Mentor

@john.uhden wrote:

That hasn't as yet solved the issue, but I very much like the answer.  It gives me something for which to look.

Of course it still bothers me that this is happening only with ACAD2002 in Win10, not in Win7 or earlier.


That suggests it is a compatibility issue with AutoCAD 2002 and Windows 10, which would not surprise me in the least. That's a 15 year-old product developed for Windows XP, and things have changed a bit since then.

 

One of the thing's that's changed is that Microsoft dropped all official support for the cooperative fiber mode threading model, which is the threading model that AutoCAD used prior to AutoCAD 2015.

 

I'd also venture to guess that what's happening to your code is most-likely not the problem, but one of myriad symptoms of a much-larger problem (a compatibility issue between AutoCAD 2002 and Windows 10), and you just haven't hit the other symptoms yet.

 

 

0 Likes
Message 9 of 21

john.uhden
Mentor
Mentor

That is of which I was afraid. Smiley Sad

John F. Uhden

0 Likes
Message 10 of 21

wkmvrij
Advocate
Advocate

As this conversation developped, I remember having been in this situation once before. I cannot recall the exact solution for, it but I do remember that the

"Error Code 0xc0000005" is a rather common one, and occurs with any application that wants to access a protected memory section. (not just AutoCad). I then fiddled around with the DEP setting of the computer I was setting up. 

 

For the life of me I could not indicate you the road to get there. My interface is in Dutch, and even to set it up to give it to me English I forgot. It is some seven levels down. My DEP setting is to activate it for Essential Windows programs and services only.

 

After reboot the error went away. I cannot guarantee, that your problem might be over. I came to my settings after a long and  fruitless search on Google on this subject. Complaints are numerous and solutions even more varied.

 

0 Likes
Message 11 of 21

john.uhden
Mentor
Mentor

Sadly, the only DEP I know is the Department of Environmental Protection.  I don't think that preserving wetlands is going to solve this problem.

John F. Uhden

0 Likes
Message 12 of 21

wkmvrij
Advocate
Advocate

The guys at Microsofty get younger and younger. We old farts are to keep up with to much:

 

Here goes: https://www.online-tech-tips.com/windows-xp/disable-turn-off-dep-windows. Guideline.

 

In explorer: This PC->rightclick->Properties->advanced system settings->Tab: advanced->Tab: Performance: button Settings. Then in this window: Data Execution Prevention(DEP). 

 

I do not claim to know what DEP does, other than that it blocks access to certain memory areas. I do not know whether this is the ultimate solution for the problem at hand, I just fooled around with it when fighting the error:  C#0000005, and on some moment the error disappeared.

 

I was not kidding about the number of steps down through the menu structure ...Rediculous!

0 Likes
Message 13 of 21

john.uhden
Mentor
Mentor

WOW!!  Thanks for that information.  I will have to get my client's laptop back and play with those DEP settings.  In the meanwhile I think he can use it (Win10) for his personal matters and run basic AutoCAD.  Whatever I try, I will let you know what happened.

John F. Uhden

0 Likes
Message 14 of 21

ActivistInvestor
Mentor
Mentor

@john.uhden wrote:

Sadly, the only DEP I know is the Department of Environmental Protection.  I don't think that preserving wetlands is going to solve this problem.


In Windows 10, right-click on 'This PC', choose Properties and then click on the Advanced system settings link.

0 Likes
Message 15 of 21

john.uhden
Mentor
Mentor

Thanks, Frank.  I appreciate a second corroberating opinion.

John F. Uhden

0 Likes
Message 16 of 21

Anonymous
Not applicable
Accepted solution

I know that Longbow disables DEP for AutoCAD 2002 we have used their software with success in the past. I think there are more issues with 2002 than just DEP

 

Jason

0 Likes
Message 17 of 21

john.uhden
Mentor
Mentor

Thank you, Jason, very much for that information.  Someone earlier here told me about LongBow, we bought a copy, but I haven't installed it yet.  I have been communicating with a fellow from LongBow named Lex Steel.  He claims their converter deals with DEP and other things.  I will be going to the client's site probably Thursday or Friday.  We will find out then.

Of interest, his Dells bought years ago with XP are gradually all dying, so I found a local guy who sells refurbished Optiplexes with Win7 for only $400.  That buys him some time to deal with the Win10 issues, which he will obviously have to face sometime in the future.

John F. Uhden

0 Likes
Message 18 of 21

dbroad
Mentor
Mentor

Sorry for the late response.  Looks like you have gotten excellent help.  I remember that vla- methods were much flakier on AutoCAD 2002 than in later versions.  You had to be meticulous about releasing your vla-objects.  It wasn't enough to just have them localized.  So writing the error handlers to include releasing the vla-objects was critical.  I would be surprised that entmake is causing the problem. 

 

Even in 2017, some instability continues if an error occurs when using activeselectionset.  Without looking at your code, we're just guessing.  You mght start by running a non-vlx version and use the vlide debugger and see if you can trigger the errors.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 19 of 21

john.uhden
Mentor
Mentor

Thanks for your input, Doug, as always.

The software for my client has been running flawlessly on DOS, Win95, Win98, Win2K, XP, and Win7 actually for decades, first with plain AutoLisp, then Vital Lisp, and then Visual Lisp.  They have never been so touchy that I must release objects except when dealing with apps like Excel.  I recently noticed that my first ones date back to when localized symbols would become global anyway, so they always included an @reset function to set them all to nil.  Oh yeah, and (setq *error* olderr). Smiley Frustrated  I have never used activeselectionset.  I am rather sure it is all due to Win10.

John F. Uhden

0 Likes
Message 20 of 21

wkmvrij
Advocate
Advocate

In case the problem is still active and unsolved, this might give further info:

 

https://compfreakstars.blogspot.pt/2011/11/0xc0000005-error-every-day-many.html.

 

0 Likes