Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: XE5 DEBUG QUESTION - Access violation in module USER32.dll


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Dec 15, 2014 6:26 AM Last Post By: david hoke
Dan Ambrose

Posts: 87
Registered: 12/11/03
XE5 DEBUG QUESTION - Access violation in module USER32.dll  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2014 2:50 PM
This is a C++ XE5 DEBUG QUESTION

I have an application. My customer is getting the following error.

Access violation at address XXXX in module USER32.dll
Read of address XXXX.

I cant reproduce the problem on my end within the debugger. Assuming this isn't a stack overflow ... Is there some way to reverse engineer the line of code by looking at a map file or something?

When I google USER32.dll I get back suggestions that it might be a call to MessageBox.

I'm an old timer. A long time ago in a land far away I used a DOS extender with BC 5.01. When youd geta GOF you could write the code and data seg to a log file then compare that to a map file. That's how we did 15 years ago. If it wasnt a stack overflow then this would get you to an area in the code within a function. I don't have much experience with XE5. I just recently switched from BC 5.01 released in 1997 to XE5 a year ago. Any clues about extrapolating from this GPF info would be appreciated.

Also, where is the documentation about this ?

Dan - St Louis Missouri
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: XE5 DEBUG QUESTION - Access violation in module USER32.dll  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2014 3:01 PM   in response to: Dan Ambrose in response to: Dan Ambrose
Dan wrote:

Access violation at address XXXX in module USER32.dll Read of address
XXXX.

It would help to see the actual XXXX values. For instance, if the second
XXXX is at/near 0 then you know that a NULL pointer is being accessed.

Assuming this isn't a stack overflow ...

If it were, you would be getting a Stack Overflow error, not an Access Violation
error.

Is there some way to reverse engineer the line of code by looking
at a map file or something?

The first XXXX in the message is the address of the code that crashed. Subtract
the process's base address from that value, and then you can look up the
resulting value in your project's .MAP file (if you have enabled the project
to generate it during compiling) to find out what code it belongs to, then
go look at what that code is doing. Or, if you are running the app in the
debugger, you can "go to address" and look at the CPU disassembly to see
what code is running at the faulting address.

When I google USER32.dll I get back suggestions that it might be a
call to MessageBox.

USER32 has a lot of functions in it. The error could be anything.

--
Remy Lebeau (TeamB)
Dan Ambrose

Posts: 87
Registered: 12/11/03
Re: XE5 DEBUG QUESTION - Access violation in module USER32.dll  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 13, 2014 6:49 AM   in response to: Dan Ambrose in response to: Dan Ambrose
Dan Ambrose wrote:
This is a C++ XE5 DEBUG QUESTION

I have an application. My customer is getting the following error.

Access violation at address XXXX in module USER32.dll
Read of address XXXX.

I cant reproduce the problem on my end within the debugger. Assuming this isn't a stack overflow ... Is there some way to reverse engineer the line of code by looking at a map file or something?

When I google USER32.dll I get back suggestions that it might be a call to MessageBox.

I'm an old timer. A long time ago in a land far away I used a DOS extender with BC 5.01. When youd geta GOF you could write the code and data seg to a log file then compare that to a map file. That's how we did 15 years ago. If it wasnt a stack overflow then this would get you to an area in the code within a function. I don't have much experience with XE5. I just recently switched from BC 5.01 released in 1997 to XE5 a year ago. Any clues about extrapolating from this GPF info would be appreciated.

Also, where is the documentation about this ?

Dan - St Louis Missouri

Thanks for the reply. Ok the exact message / address is ...

Access violation at address 76BB 990B in module USER32.dll Read of address 7265 7355

I cant reproduce the problem on my end. It only happens with this customer of mine. How can I narrow this down ? Read the following and tell me if this is right. I have the program loaded into XE5. I paused it. I opened up VIEW | Debug Windows | Modules I sort by base address. I look for 76BB 990B It comes back USER32.dll There is another windows to the right. Not sure what its called. It has two columns. Entry point and address. I sort it by address. I look for the closest address without going over 76BB 990B It says
DdeQueryStringA: $76BB8D90
DlgDirListA $76BBB27D

Is it correct to assume that my GPF is somewhere within DdeQueryStringA ?

Here is some more information about the program. It is a control program. There is nobody "using it" or typing any information. It has a Form with a TMemo and a derived stream. A class called TTYWindow to display information in a scrolling window. It just runs on a server and controls a bunch of stuff via a Sockets interface. I have two other control programs that use 99% of the same code modules but that control something different. They have run fine a long time. So I know all of the shared code modules are all good. ( years of 24/7 usage )

This particular program worked fine until recently. The most major change was container class usage. I was using USE_OLD_RW_STL Now Im not. I made changes to my StdList wrapper code and removed the USE_OLD_RW_STL. I also made a wrapper function around MessBox that takes variable arguments and sprintf type strings.

I could roll back these changes and see if my customer has any more problems. But it would be interesting to learn how to debug from the error message with the address from the customer. This is a good exercise. Any tips or clues would be appreciated. Is there any documentation of debugging somewhere? I'm used to Borland documentation. Which was always very good. There was always a users guide. A developers guide. And a guide for debugging. For XE5 All I can find is a C++ Builder help window. It loads up Microsoft document explorer. Its very slow. And I'm using a super fast state of the art 6 core processor, 16 gigs of ram and a solid state drive. What is this Microsoft document explorer? Is this reading files local or across the internet? Is there any DOCs available in PDF or HTML format other then Microsoft document explorer which seems slow? Is there any documentation that can be printed out ? I'm talking 3 ring binders that hold 100 pages. Can you buy any actual books ?

Edited by: Dan Ambrose on Dec 13, 2014 9:39 AM

david hoke

Posts: 616
Registered: 2/9/07
Re: XE5 DEBUG QUESTION - Access violation in module USER32.dll [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 15, 2014 6:26 AM   in response to: Dan Ambrose in response to: Dan Ambrose
<Dan Ambrose> wrote in message news:705373 at forums dot embarcadero dot com...
Dan Ambrose wrote:
This is a C++ XE5 DEBUG QUESTION

I have an application. My customer is getting the following error.

Access violation at address XXXX in module USER32.dll
Read of address XXXX.

I cant reproduce the problem on my end within the debugger. Assuming
this isn't a stack overflow ... Is there some way to reverse engineer the
line of code by looking at a map file or something?

You might be interested in this information, which is probably only a
starting point:
http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/

I'm guessing you might be able to add his unit as is (*.pas) to your
project, and maybe get access to the stacktrace at your customer's site, but
I haven't used that code myself.

(I went looking for the page I originally ref'ed trying to use jcldebug
myself from c++, but it doesn't seem to be readily available anymore.)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02