Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Dear CPians: Help me out by voting for this

Dear CPians: Help me out by voting for this

Scheduled Pinned Locked Moved The Lounge
helpcsharpdatabasecomdebugging
52 Posts 19 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Judah Gabriel Himango
    wrote on last edited by
    #1

    Dear CPians, Have you ever written a .NET desktop or web application that talks to a SQL database? Uses WinForms controls? Talks to COM objects? Talks to Win32 via P/Invoke? If so, you may have run into the dreaded AccessViolationException: Some managed code called into unmanaged code, and memory was corrupted. Maybe you passed a bad argument to the unmanaged function. Maybe there's a bug in the managed-to-native interop. Whatever the case, when it happens, all you get is an unhelpful message and a useless stack trace, making it near-impossible to debug. Please vote up this MSConnect case[^] so Microsoft gives us more information when these errors occur. If MS gives us more information, devs can fix crashing .NET apps, users will be happier, and the world will be a better place. Thank you.

    Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

    M L H C B 16 Replies Last reply
    0
    • J Judah Gabriel Himango

      Dear CPians, Have you ever written a .NET desktop or web application that talks to a SQL database? Uses WinForms controls? Talks to COM objects? Talks to Win32 via P/Invoke? If so, you may have run into the dreaded AccessViolationException: Some managed code called into unmanaged code, and memory was corrupted. Maybe you passed a bad argument to the unmanaged function. Maybe there's a bug in the managed-to-native interop. Whatever the case, when it happens, all you get is an unhelpful message and a useless stack trace, making it near-impossible to debug. Please vote up this MSConnect case[^] so Microsoft gives us more information when these errors occur. If MS gives us more information, devs can fix crashing .NET apps, users will be happier, and the world will be a better place. Thank you.

      Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

      M Offline
      M Offline
      Marc Clifton
      wrote on last edited by
      #2

      I'd love to vote, but I'm not going to sign up to MS Connect just to vote. I guess that's what you'd call a "disconnect!" Marc

      Will work for food. Interacx

      I'm not overthinking the problem, I just felt like I needed a small, unimportant, uninteresting rant! - Martin Hart Turner

      J 1 Reply Last reply
      0
      • M Marc Clifton

        I'd love to vote, but I'm not going to sign up to MS Connect just to vote. I guess that's what you'd call a "disconnect!" Marc

        Will work for food. Interacx

        I'm not overthinking the problem, I just felt like I needed a small, unimportant, uninteresting rant! - Martin Hart Turner

        J Offline
        J Offline
        Judah Gabriel Himango
        wrote on last edited by
        #3

        I don't think you have to sign-up for MS Connect. All you need is a Hotmail MSN Messenger .NET passport :doh: Windows Live account. If you're on the MSDN forums, run Windows Live Messenger, have a Hotmail account, or have an MSDN subscription, you should be able to vote.

        Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

        1 Reply Last reply
        0
        • J Judah Gabriel Himango

          Dear CPians, Have you ever written a .NET desktop or web application that talks to a SQL database? Uses WinForms controls? Talks to COM objects? Talks to Win32 via P/Invoke? If so, you may have run into the dreaded AccessViolationException: Some managed code called into unmanaged code, and memory was corrupted. Maybe you passed a bad argument to the unmanaged function. Maybe there's a bug in the managed-to-native interop. Whatever the case, when it happens, all you get is an unhelpful message and a useless stack trace, making it near-impossible to debug. Please vote up this MSConnect case[^] so Microsoft gives us more information when these errors occur. If MS gives us more information, devs can fix crashing .NET apps, users will be happier, and the world will be a better place. Thank you.

          Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          done :)

          Luc Pattyn


          Local announcement (Antwerp region): Lange Wapper? Neen!


          J 1 Reply Last reply
          0
          • J Judah Gabriel Himango

            Dear CPians, Have you ever written a .NET desktop or web application that talks to a SQL database? Uses WinForms controls? Talks to COM objects? Talks to Win32 via P/Invoke? If so, you may have run into the dreaded AccessViolationException: Some managed code called into unmanaged code, and memory was corrupted. Maybe you passed a bad argument to the unmanaged function. Maybe there's a bug in the managed-to-native interop. Whatever the case, when it happens, all you get is an unhelpful message and a useless stack trace, making it near-impossible to debug. Please vote up this MSConnect case[^] so Microsoft gives us more information when these errors occur. If MS gives us more information, devs can fix crashing .NET apps, users will be happier, and the world will be a better place. Thank you.

            Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

            H Offline
            H Offline
            Henry Minute
            wrote on last edited by
            #5

            Vote += 1;

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            J 1 Reply Last reply
            0
            • J Judah Gabriel Himango

              Dear CPians, Have you ever written a .NET desktop or web application that talks to a SQL database? Uses WinForms controls? Talks to COM objects? Talks to Win32 via P/Invoke? If so, you may have run into the dreaded AccessViolationException: Some managed code called into unmanaged code, and memory was corrupted. Maybe you passed a bad argument to the unmanaged function. Maybe there's a bug in the managed-to-native interop. Whatever the case, when it happens, all you get is an unhelpful message and a useless stack trace, making it near-impossible to debug. Please vote up this MSConnect case[^] so Microsoft gives us more information when these errors occur. If MS gives us more information, devs can fix crashing .NET apps, users will be happier, and the world will be a better place. Thank you.

              Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              Done (even if I guess isn't easy for them to give more meaningful info). :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              J L 2 Replies Last reply
              0
              • L Luc Pattyn

                done :)

                Luc Pattyn


                Local announcement (Antwerp region): Lange Wapper? Neen!


                J Offline
                J Offline
                Judah Gabriel Himango
                wrote on last edited by
                #7

                Thanks, Luc!

                Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                1 Reply Last reply
                0
                • H Henry Minute

                  Vote += 1;

                  Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                  J Offline
                  J Offline
                  Judah Gabriel Himango
                  wrote on last edited by
                  #8

                  Thanks, Henry, you state-mutating fool! :)

                  Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                  1 Reply Last reply
                  0
                  • C CPallini

                    Done (even if I guess isn't easy for them to give more meaningful info). :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    J Offline
                    J Offline
                    Judah Gabriel Himango
                    wrote on last edited by
                    #9

                    Thanks! I acknowledge it is difficult for them to give us more information. But if they're serious about making .NET apps better, they would invest the time to get this right: search the web or MSConnect for "AccessViolationException" and it's all over the place, and there's virtually no info on how to debug it. Here's to hoping they provide us with something.

                    Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                    1 Reply Last reply
                    0
                    • J Judah Gabriel Himango

                      Dear CPians, Have you ever written a .NET desktop or web application that talks to a SQL database? Uses WinForms controls? Talks to COM objects? Talks to Win32 via P/Invoke? If so, you may have run into the dreaded AccessViolationException: Some managed code called into unmanaged code, and memory was corrupted. Maybe you passed a bad argument to the unmanaged function. Maybe there's a bug in the managed-to-native interop. Whatever the case, when it happens, all you get is an unhelpful message and a useless stack trace, making it near-impossible to debug. Please vote up this MSConnect case[^] so Microsoft gives us more information when these errors occur. If MS gives us more information, devs can fix crashing .NET apps, users will be happier, and the world will be a better place. Thank you.

                      Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                      B Offline
                      B Offline
                      BryanWilkins
                      wrote on last edited by
                      #10

                      Done! :)

                      J 1 Reply Last reply
                      0
                      • C CPallini

                        Done (even if I guess isn't easy for them to give more meaningful info). :)

                        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                        [My articles]

                        L Offline
                        L Offline
                        Luc Pattyn
                        wrote on last edited by
                        #11

                        CPallini wrote:

                        even if I guess isn't easy for them to give more meaningful info

                        it isn't about being easy for them; it is about being less hard for us. We are the customers, remember. :)

                        Luc Pattyn


                        Local announcement (Antwerp region): Lange Wapper? Neen!


                        1 Reply Last reply
                        0
                        • B BryanWilkins

                          Done! :)

                          J Offline
                          J Offline
                          Judah Gabriel Himango
                          wrote on last edited by
                          #12

                          Thank you, Bryan!

                          Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                          1 Reply Last reply
                          0
                          • J Judah Gabriel Himango

                            Dear CPians, Have you ever written a .NET desktop or web application that talks to a SQL database? Uses WinForms controls? Talks to COM objects? Talks to Win32 via P/Invoke? If so, you may have run into the dreaded AccessViolationException: Some managed code called into unmanaged code, and memory was corrupted. Maybe you passed a bad argument to the unmanaged function. Maybe there's a bug in the managed-to-native interop. Whatever the case, when it happens, all you get is an unhelpful message and a useless stack trace, making it near-impossible to debug. Please vote up this MSConnect case[^] so Microsoft gives us more information when these errors occur. If MS gives us more information, devs can fix crashing .NET apps, users will be happier, and the world will be a better place. Thank you.

                            Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                            R Offline
                            R Offline
                            Rama Krishna Vavilala
                            wrote on last edited by
                            #13

                            OK, I don't get it. I do a pretty hefty mixed mode debugging and always am able to narrow down the cause of problem. The trick is to use mixed-mode debugging and stop on unmanaged exceptions. So what am I missing?

                            J 1 Reply Last reply
                            0
                            • J Judah Gabriel Himango

                              Dear CPians, Have you ever written a .NET desktop or web application that talks to a SQL database? Uses WinForms controls? Talks to COM objects? Talks to Win32 via P/Invoke? If so, you may have run into the dreaded AccessViolationException: Some managed code called into unmanaged code, and memory was corrupted. Maybe you passed a bad argument to the unmanaged function. Maybe there's a bug in the managed-to-native interop. Whatever the case, when it happens, all you get is an unhelpful message and a useless stack trace, making it near-impossible to debug. Please vote up this MSConnect case[^] so Microsoft gives us more information when these errors occur. If MS gives us more information, devs can fix crashing .NET apps, users will be happier, and the world will be a better place. Thank you.

                              Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                              M Offline
                              M Offline
                              Mustafa Ismail Mustafa
                              wrote on last edited by
                              #14

                              Vote++;

                              If the post was helpful, please vote, eh! Current activities: Book: Devils by Fyodor Dostoyevsky Project: Hospital Automation, final stage Learning: Image analysis, LINQ Now and forever, defiant to the end. What is Multiple Sclerosis[^]?

                              J 1 Reply Last reply
                              0
                              • R Rama Krishna Vavilala

                                OK, I don't get it. I do a pretty hefty mixed mode debugging and always am able to narrow down the cause of problem. The trick is to use mixed-mode debugging and stop on unmanaged exceptions. So what am I missing?

                                J Offline
                                J Offline
                                Judah Gabriel Himango
                                wrote on last edited by
                                #15

                                The exception almost never occurs on our dev machines, but instead on end user machines where no debugger is installed. The exception reported to us is near useless:

                                System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Stack Trace: at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at MyProgram.Main

                                Is there some secret way to debug such crashing errors? If not, I'm asking for more information in the error message to help us track down the error.

                                Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                                R 1 Reply Last reply
                                0
                                • M Mustafa Ismail Mustafa

                                  Vote++;

                                  If the post was helpful, please vote, eh! Current activities: Book: Devils by Fyodor Dostoyevsky Project: Hospital Automation, final stage Learning: Image analysis, LINQ Now and forever, defiant to the end. What is Multiple Sclerosis[^]?

                                  J Offline
                                  J Offline
                                  Judah Gabriel Himango
                                  wrote on last edited by
                                  #16

                                  Thanks, Mustafa!

                                  Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                                  M 1 Reply Last reply
                                  0
                                  • J Judah Gabriel Himango

                                    Thanks, Mustafa!

                                    Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                                    M Offline
                                    M Offline
                                    Mustafa Ismail Mustafa
                                    wrote on last edited by
                                    #17

                                    No worries :) Besides, I'll get a benefit out of this too! (assuming they actually help out)

                                    If the post was helpful, please vote, eh! Current activities: Book: Devils by Fyodor Dostoyevsky Project: Hospital Automation, final stage Learning: Image analysis, LINQ Now and forever, defiant to the end. What is Multiple Sclerosis[^]?

                                    1 Reply Last reply
                                    0
                                    • J Judah Gabriel Himango

                                      Dear CPians, Have you ever written a .NET desktop or web application that talks to a SQL database? Uses WinForms controls? Talks to COM objects? Talks to Win32 via P/Invoke? If so, you may have run into the dreaded AccessViolationException: Some managed code called into unmanaged code, and memory was corrupted. Maybe you passed a bad argument to the unmanaged function. Maybe there's a bug in the managed-to-native interop. Whatever the case, when it happens, all you get is an unhelpful message and a useless stack trace, making it near-impossible to debug. Please vote up this MSConnect case[^] so Microsoft gives us more information when these errors occur. If MS gives us more information, devs can fix crashing .NET apps, users will be happier, and the world will be a better place. Thank you.

                                      Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                                      R Offline
                                      R Offline
                                      Rajesh R Subramanian
                                      wrote on last edited by
                                      #18

                                      Hi Judah, You have my vote on that.

                                      It is a crappy thing, but it's life -^ Carlo Pallini

                                      J 1 Reply Last reply
                                      0
                                      • R Rajesh R Subramanian

                                        Hi Judah, You have my vote on that.

                                        It is a crappy thing, but it's life -^ Carlo Pallini

                                        J Offline
                                        J Offline
                                        Judah Gabriel Himango
                                        wrote on last edited by
                                        #19

                                        Thanks, Rajesh!

                                        Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                                        1 Reply Last reply
                                        0
                                        • J Judah Gabriel Himango

                                          The exception almost never occurs on our dev machines, but instead on end user machines where no debugger is installed. The exception reported to us is near useless:

                                          System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Stack Trace: at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at MyProgram.Main

                                          Is there some secret way to debug such crashing errors? If not, I'm asking for more information in the error message to help us track down the error.

                                          Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                                          R Offline
                                          R Offline
                                          Rama Krishna Vavilala
                                          wrote on last edited by
                                          #20

                                          Yes there is. Do you want me to post here or as an article? Are programming ansers allowed in Lounge?

                                          J D 2 Replies Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups