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. How to crash VS 2010 in 20 lines of code...

How to crash VS 2010 in 20 lines of code...

Scheduled Pinned Locked Moved The Lounge
visual-studiocombeta-testinghelptutorial
28 Posts 17 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 J Dunlap

    namespace Crash
    {
    public class Foo
    {
    public static void Method(object o)
    {

        }
    }
    
    public class Bar
    {
        public Foo Foo { get; set; }
    
        public static void Method(dynamic d)
        {
            Foo.Method(d); //This crashes VS instantly!
        }
    }
    

    }

    :sigh: Took me a bit to figure out what triggers it because when I encountered it, there was a lot of other code involved. But basically the method being called must be static and must be referenced via the class name (without a namespace). The method making the call must also be static, and the class it belongs to must have a non-static property with the same name as the class whose method is being called. The dynamic value being passed to it can come from anywhere - it doesn't have to be an argument to the calling function. The workaround is to use the namespace as well when referencing the class - e.g. Crash.Foo.Method(d). EDIT: I submitted a bug report here[^].

    S Offline
    S Offline
    SeattleC
    wrote on last edited by
    #18

    Shoot. I don't feel like I've really used a version of visual studio until I've crashed the compiler. I specialize in crashing the C++ compiler. I got an error message from vc++ 6 once saying something like "internal error : contact a graduate student." What's up with that? And it was legal C++ too.

    1 Reply Last reply
    0
    • J J Dunlap

      namespace Crash
      {
      public class Foo
      {
      public static void Method(object o)
      {

          }
      }
      
      public class Bar
      {
          public Foo Foo { get; set; }
      
          public static void Method(dynamic d)
          {
              Foo.Method(d); //This crashes VS instantly!
          }
      }
      

      }

      :sigh: Took me a bit to figure out what triggers it because when I encountered it, there was a lot of other code involved. But basically the method being called must be static and must be referenced via the class name (without a namespace). The method making the call must also be static, and the class it belongs to must have a non-static property with the same name as the class whose method is being called. The dynamic value being passed to it can come from anywhere - it doesn't have to be an argument to the calling function. The workaround is to use the namespace as well when referencing the class - e.g. Crash.Foo.Method(d). EDIT: I submitted a bug report here[^].

      Sander RosselS Offline
      Sander RosselS Offline
      Sander Rossel
      wrote on last edited by
      #19

      Brilliant! :laugh: I had code that crashed VS once too. Don't know what the code was or why it crashed VS. I do know I was in slight panic because it was our entire companies main product that crashed and I couldn't start it up again (I did somehow manage to change the erronous code). Luckily I came back to my senses and simply deleted the code using notepad :laugh:

      It's an OO world.

      public class Naerling : Lazy<Person>{
      public void DoWork(){ throw new NotImplementedException(); }
      }

      J 1 Reply Last reply
      0
      • J J Dunlap

        namespace Crash
        {
        public class Foo
        {
        public static void Method(object o)
        {

            }
        }
        
        public class Bar
        {
            public Foo Foo { get; set; }
        
            public static void Method(dynamic d)
            {
                Foo.Method(d); //This crashes VS instantly!
            }
        }
        

        }

        :sigh: Took me a bit to figure out what triggers it because when I encountered it, there was a lot of other code involved. But basically the method being called must be static and must be referenced via the class name (without a namespace). The method making the call must also be static, and the class it belongs to must have a non-static property with the same name as the class whose method is being called. The dynamic value being passed to it can come from anywhere - it doesn't have to be an argument to the calling function. The workaround is to use the namespace as well when referencing the class - e.g. Crash.Foo.Method(d). EDIT: I submitted a bug report here[^].

        H Offline
        H Offline
        HenryChilvers
        wrote on last edited by
        #20

        Know how to protect yourself from this? Use ReSharper! As soon as you type the "Foo.", ReSharper adds "Crash." in front of it and prevents Visual Studio from having fits! ReSharper, best developer tool, EVER! (possibly even better than Visual Studio! ;) )

        J 1 Reply Last reply
        0
        • J J Dunlap

          namespace Crash
          {
          public class Foo
          {
          public static void Method(object o)
          {

              }
          }
          
          public class Bar
          {
              public Foo Foo { get; set; }
          
              public static void Method(dynamic d)
              {
                  Foo.Method(d); //This crashes VS instantly!
              }
          }
          

          }

          :sigh: Took me a bit to figure out what triggers it because when I encountered it, there was a lot of other code involved. But basically the method being called must be static and must be referenced via the class name (without a namespace). The method making the call must also be static, and the class it belongs to must have a non-static property with the same name as the class whose method is being called. The dynamic value being passed to it can come from anywhere - it doesn't have to be an argument to the calling function. The workaround is to use the namespace as well when referencing the class - e.g. Crash.Foo.Method(d). EDIT: I submitted a bug report here[^].

          A Offline
          A Offline
          Ayobami Adewole
          wrote on last edited by
          #21

          wow, the moment I copied the code to VS 2010, it crashed immediately

          1 Reply Last reply
          0
          • Sander RosselS Sander Rossel

            Brilliant! :laugh: I had code that crashed VS once too. Don't know what the code was or why it crashed VS. I do know I was in slight panic because it was our entire companies main product that crashed and I couldn't start it up again (I did somehow manage to change the erronous code). Luckily I came back to my senses and simply deleted the code using notepad :laugh:

            It's an OO world.

            public class Naerling : Lazy<Person>{
            public void DoWork(){ throw new NotImplementedException(); }
            }

            J Offline
            J Offline
            J Dunlap
            wrote on last edited by
            #22

            Have a 5 vote to counter the uni-voter ;)

            Sander RosselS 1 Reply Last reply
            0
            • H HenryChilvers

              Know how to protect yourself from this? Use ReSharper! As soon as you type the "Foo.", ReSharper adds "Crash." in front of it and prevents Visual Studio from having fits! ReSharper, best developer tool, EVER! (possibly even better than Visual Studio! ;) )

              J Offline
              J Offline
              J Dunlap
              wrote on last edited by
              #23

              I've had a love-hate relationship with Resharper in the past - a lot of useful functionality but it seemed to slow down the IDE. Has this been fixed in the latest versions?

              H 1 Reply Last reply
              0
              • J J Dunlap

                namespace Crash
                {
                public class Foo
                {
                public static void Method(object o)
                {

                    }
                }
                
                public class Bar
                {
                    public Foo Foo { get; set; }
                
                    public static void Method(dynamic d)
                    {
                        Foo.Method(d); //This crashes VS instantly!
                    }
                }
                

                }

                :sigh: Took me a bit to figure out what triggers it because when I encountered it, there was a lot of other code involved. But basically the method being called must be static and must be referenced via the class name (without a namespace). The method making the call must also be static, and the class it belongs to must have a non-static property with the same name as the class whose method is being called. The dynamic value being passed to it can come from anywhere - it doesn't have to be an argument to the calling function. The workaround is to use the namespace as well when referencing the class - e.g. Crash.Foo.Method(d). EDIT: I submitted a bug report here[^].

                S Offline
                S Offline
                Shabana Parveen
                wrote on last edited by
                #24

                Awesome finding... bye the way the only line of code which might caused issue is static void Method(dynamic d)!!!

                1 Reply Last reply
                0
                • J J Dunlap

                  Have a 5 vote to counter the uni-voter ;)

                  Sander RosselS Offline
                  Sander RosselS Offline
                  Sander Rossel
                  wrote on last edited by
                  #25

                  Thanks :) No idea why someone would uni-vote such an innocent post of mine :~

                  It's an OO world.

                  public class Naerling : Lazy<Person>{
                  public void DoWork(){ throw new NotImplementedException(); }
                  }

                  1 Reply Last reply
                  0
                  • J J Dunlap

                    namespace Crash
                    {
                    public class Foo
                    {
                    public static void Method(object o)
                    {

                        }
                    }
                    
                    public class Bar
                    {
                        public Foo Foo { get; set; }
                    
                        public static void Method(dynamic d)
                        {
                            Foo.Method(d); //This crashes VS instantly!
                        }
                    }
                    

                    }

                    :sigh: Took me a bit to figure out what triggers it because when I encountered it, there was a lot of other code involved. But basically the method being called must be static and must be referenced via the class name (without a namespace). The method making the call must also be static, and the class it belongs to must have a non-static property with the same name as the class whose method is being called. The dynamic value being passed to it can come from anywhere - it doesn't have to be an argument to the calling function. The workaround is to use the namespace as well when referencing the class - e.g. Crash.Foo.Method(d). EDIT: I submitted a bug report here[^].

                    U Offline
                    U Offline
                    User 3138470
                    wrote on last edited by
                    #26

                    Lol That's why I would never fly airplane having "Genuine windows" logo attached to it...

                    1 Reply Last reply
                    0
                    • J J Dunlap

                      namespace Crash
                      {
                      public class Foo
                      {
                      public static void Method(object o)
                      {

                          }
                      }
                      
                      public class Bar
                      {
                          public Foo Foo { get; set; }
                      
                          public static void Method(dynamic d)
                          {
                              Foo.Method(d); //This crashes VS instantly!
                          }
                      }
                      

                      }

                      :sigh: Took me a bit to figure out what triggers it because when I encountered it, there was a lot of other code involved. But basically the method being called must be static and must be referenced via the class name (without a namespace). The method making the call must also be static, and the class it belongs to must have a non-static property with the same name as the class whose method is being called. The dynamic value being passed to it can come from anywhere - it doesn't have to be an argument to the calling function. The workaround is to use the namespace as well when referencing the class - e.g. Crash.Foo.Method(d). EDIT: I submitted a bug report here[^].

                      E Offline
                      E Offline
                      edmurphy99
                      wrote on last edited by
                      #27

                      public Foo Foo { get; set; }

                      to

                      public Foo foo { get; set; }

                      seems to work now if you want to reboot your system run this

                      #include
                      int main( void )
                      {
                      for( ;; )
                      {
                      printf( "hung up\t\t\b\b\b\b\b\b" );
                      }
                      return 0;
                      }

                      1 Reply Last reply
                      0
                      • J J Dunlap

                        I've had a love-hate relationship with Resharper in the past - a lot of useful functionality but it seemed to slow down the IDE. Has this been fixed in the latest versions?

                        H Offline
                        H Offline
                        HenryChilvers
                        wrote on last edited by
                        #28

                        It has been improved in the latest few versions (although I haven't upgraded to the latest latest one). Also, running on a quad core, 64-bit Windows 7 box with 8 GBs of RAM doesn't hurt either! :-D

                        1 Reply 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