List Info

Thread: how to trouble shoot access violation




how to trouble shoot access violation
user name
2006-08-30 08:31:39
Does this happen on all computers? Are you certain the error
message is
incorrect when it suggests there is a bad 'spot' in
memory? Note this
could be on the Harddrive(Swap space physical location
literally on the
platter) or a bad 'chip' in memory. I would text the code
on a second
computer and run a full diagnostic on the computer in
question.

Remember Windows can run with a bad memory address and never
even notice
it until something finally writes to that location. You
might try
booting one of the free Knoppix Linux distros. Linux is a
much pickier
about memory then Windows. One other trick might be to copy
the image
file to another directory and test the code there. Don't
move the file,
copy it, this will result in the file being in a different
physical
location and might also help the problem.

John Warner

> Date:    Tue, 29 Aug 2006 09:15:40 -0400
> From:    Stacey Levine <staceylMUSICFORASONG.COM>
> Subject: how to trouble shoot access violation
>
> I have a class that returns an image as a public
property. I
> am occasionally getting an AccessViolationException.  I
am
> not sure why, and I have no idea how to trouble shoot
it.  It
> is a simple property that loads an image from a file. 
The
> error message is:
>
> =20
>
> "Attempted to read or write protected memory.
This is often
> an indication that other memory is corrupt."
>
> =20
>
> This happens in the Return Image.... Line in the
property
> below. The value of _listenImage is "D:\Projects
> .NET\ListeningStation\bin\Application
Customization\Ear.gif"
> ... and the file exists.  Not sure exactly what to do
next
> here. Thanks.
>
> =20
>
>   Public ReadOnly Property ListenImage() As Image
>
>         Get
>
>             If Me._listenImage <> String.Empty
Then
>
>                 Try
>
>                     Return
Image.FromFile(Me._listenImage)
>
>                 Catch ex As AccessViolationException
>
>                     Return Nothing
>
>                 End Try
>
>             Else
>
>                 Return Nothing
>
>             End If
>
>         End Get
>
>     End Property
>
> =20
>
> =20
>
> Stacey Levine
>
> Lead Technical Architect
>
> Value Music Concepts
>
> 825-C Franklin Court
>
> Marietta, GA 30067
>
> 678-229-4255

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )