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. Arghhh!

Arghhh!

Scheduled Pinned Locked Moved The Lounge
csharphelpwcfsysadminsecurity
13 Posts 6 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.
  • Sander RosselS Offline
    Sander RosselS Offline
    Sander Rossel
    wrote on last edited by
    #1

    So I build a WCF service for a customer. It was the first WCF service I've ever built and it has given me some headaches... Most notably deadlocks whenever the service made callbacks to the client. It makes use of a library I built. The library basically creates asynchronous queues that handle whatever it is you pass to them (some Interface implementation). This was the first multithreaded library I built. I used Task Parallel Library for it. First service, first multi-threaded library... Sounds good, but wait! What kind of something do I send to my multi-threaded library? Crystal Report documents! Arghhh! First thing I've ever done with Crystal Reports... Overall I think things went pretty well (although it cost me many many many hours to get everything right). But now it's in use at our customer and the thing keeps crashing at the most critical moments... First it seemed there was a memory leak. The service used up 30mb of space when it was started, whenever the customer send some Crystal Reports to be printed or emailed it soon rose to 80mb and around 120mb it crashed. Putting in some Disposes on a SmtpClient and MailMessage seemed to help. Now the service seems to crash for unhandled Exceptions that get thrown on worker threads. Quite annoying and hard to debug as it seldomly occurs, although still a few times to many. This is not unfixable though, and when looking at my code today I already found some possible bottlenecks in my code. Why the error occurs I do not know... But it might have something to do with a C0000005 exception... Some Googling taught me that this is basically my software trying to access memory it may not access! Excuse me? Is .NET not completely managed?! Why do I get memory addresses and C0000005 exceptions? I am certainly not accessing anything I may not! Maybe I should also mention the service was meant to print and email Crystal Report documents and even though our customer has its own IT department the server did not have any printers installed, the ones it had installed had corrupt drivers (which cost me a lot of debugging time, only to find out it wasn't my software that was bugged...), no one knew which user I could run my service on so that my service had access to those printers and was allowed to sent emails (lots of security issues no one could help me with)... Because the server has corrupt printer drivers installed we're currently not even using it for printing. One thing I'm a bit worried about is that the server runs a few other services as well and they're all used

    A D K 3 Replies Last reply
    0
    • Sander RosselS Sander Rossel

      So I build a WCF service for a customer. It was the first WCF service I've ever built and it has given me some headaches... Most notably deadlocks whenever the service made callbacks to the client. It makes use of a library I built. The library basically creates asynchronous queues that handle whatever it is you pass to them (some Interface implementation). This was the first multithreaded library I built. I used Task Parallel Library for it. First service, first multi-threaded library... Sounds good, but wait! What kind of something do I send to my multi-threaded library? Crystal Report documents! Arghhh! First thing I've ever done with Crystal Reports... Overall I think things went pretty well (although it cost me many many many hours to get everything right). But now it's in use at our customer and the thing keeps crashing at the most critical moments... First it seemed there was a memory leak. The service used up 30mb of space when it was started, whenever the customer send some Crystal Reports to be printed or emailed it soon rose to 80mb and around 120mb it crashed. Putting in some Disposes on a SmtpClient and MailMessage seemed to help. Now the service seems to crash for unhandled Exceptions that get thrown on worker threads. Quite annoying and hard to debug as it seldomly occurs, although still a few times to many. This is not unfixable though, and when looking at my code today I already found some possible bottlenecks in my code. Why the error occurs I do not know... But it might have something to do with a C0000005 exception... Some Googling taught me that this is basically my software trying to access memory it may not access! Excuse me? Is .NET not completely managed?! Why do I get memory addresses and C0000005 exceptions? I am certainly not accessing anything I may not! Maybe I should also mention the service was meant to print and email Crystal Report documents and even though our customer has its own IT department the server did not have any printers installed, the ones it had installed had corrupt drivers (which cost me a lot of debugging time, only to find out it wasn't my software that was bugged...), no one knew which user I could run my service on so that my service had access to those printers and was allowed to sent emails (lots of security issues no one could help me with)... Because the server has corrupt printer drivers installed we're currently not even using it for printing. One thing I'm a bit worried about is that the server runs a few other services as well and they're all used

      A Offline
      A Offline
      AspDotNetDev
      wrote on last edited by
      #2

      Naerling wrote:

      Is .NET not completely managed?! Why do I get memory addresses and C0000005 exceptions? I am certainly not accessing anything I may not!

      In .Net, you can use unsafe code and you can call unmanaged code, which I'm guessing Crystal Reports has lots of.

      Thou mewling ill-breeding pignut!

      Sander RosselS 1 Reply Last reply
      0
      • A AspDotNetDev

        Naerling wrote:

        Is .NET not completely managed?! Why do I get memory addresses and C0000005 exceptions? I am certainly not accessing anything I may not!

        In .Net, you can use unsafe code and you can call unmanaged code, which I'm guessing Crystal Reports has lots of.

        Thou mewling ill-breeding pignut!

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

        AspDotNetDev wrote:

        Is .NET not completely managed?!

        Should've said VB.NET. I don't believe there's an Unsafe block in VB :)

        Unsafe
        Dim p As Integer*
        End Unsafe

        Crystal Reports undoubtedly has lots of unmanaged stuff... I'm ok with that, but please don't bother me with it :( Actually, please don't bother me with Crystal Reports at all... :~ Well, I don't really have a choice :sigh:

        It's an OO world.

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

        L 1 Reply Last reply
        0
        • Sander RosselS Sander Rossel

          So I build a WCF service for a customer. It was the first WCF service I've ever built and it has given me some headaches... Most notably deadlocks whenever the service made callbacks to the client. It makes use of a library I built. The library basically creates asynchronous queues that handle whatever it is you pass to them (some Interface implementation). This was the first multithreaded library I built. I used Task Parallel Library for it. First service, first multi-threaded library... Sounds good, but wait! What kind of something do I send to my multi-threaded library? Crystal Report documents! Arghhh! First thing I've ever done with Crystal Reports... Overall I think things went pretty well (although it cost me many many many hours to get everything right). But now it's in use at our customer and the thing keeps crashing at the most critical moments... First it seemed there was a memory leak. The service used up 30mb of space when it was started, whenever the customer send some Crystal Reports to be printed or emailed it soon rose to 80mb and around 120mb it crashed. Putting in some Disposes on a SmtpClient and MailMessage seemed to help. Now the service seems to crash for unhandled Exceptions that get thrown on worker threads. Quite annoying and hard to debug as it seldomly occurs, although still a few times to many. This is not unfixable though, and when looking at my code today I already found some possible bottlenecks in my code. Why the error occurs I do not know... But it might have something to do with a C0000005 exception... Some Googling taught me that this is basically my software trying to access memory it may not access! Excuse me? Is .NET not completely managed?! Why do I get memory addresses and C0000005 exceptions? I am certainly not accessing anything I may not! Maybe I should also mention the service was meant to print and email Crystal Report documents and even though our customer has its own IT department the server did not have any printers installed, the ones it had installed had corrupt drivers (which cost me a lot of debugging time, only to find out it wasn't my software that was bugged...), no one knew which user I could run my service on so that my service had access to those printers and was allowed to sent emails (lots of security issues no one could help me with)... Because the server has corrupt printer drivers installed we're currently not even using it for printing. One thing I'm a bit worried about is that the server runs a few other services as well and they're all used

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You're getting that error probably because you've moved the Crystal Reports junk to a background thread. Crystal Reports does not like threading at all. WCF is actually very nice once you get past the learning curve.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          Sander RosselS 1 Reply Last reply
          0
          • Sander RosselS Sander Rossel

            So I build a WCF service for a customer. It was the first WCF service I've ever built and it has given me some headaches... Most notably deadlocks whenever the service made callbacks to the client. It makes use of a library I built. The library basically creates asynchronous queues that handle whatever it is you pass to them (some Interface implementation). This was the first multithreaded library I built. I used Task Parallel Library for it. First service, first multi-threaded library... Sounds good, but wait! What kind of something do I send to my multi-threaded library? Crystal Report documents! Arghhh! First thing I've ever done with Crystal Reports... Overall I think things went pretty well (although it cost me many many many hours to get everything right). But now it's in use at our customer and the thing keeps crashing at the most critical moments... First it seemed there was a memory leak. The service used up 30mb of space when it was started, whenever the customer send some Crystal Reports to be printed or emailed it soon rose to 80mb and around 120mb it crashed. Putting in some Disposes on a SmtpClient and MailMessage seemed to help. Now the service seems to crash for unhandled Exceptions that get thrown on worker threads. Quite annoying and hard to debug as it seldomly occurs, although still a few times to many. This is not unfixable though, and when looking at my code today I already found some possible bottlenecks in my code. Why the error occurs I do not know... But it might have something to do with a C0000005 exception... Some Googling taught me that this is basically my software trying to access memory it may not access! Excuse me? Is .NET not completely managed?! Why do I get memory addresses and C0000005 exceptions? I am certainly not accessing anything I may not! Maybe I should also mention the service was meant to print and email Crystal Report documents and even though our customer has its own IT department the server did not have any printers installed, the ones it had installed had corrupt drivers (which cost me a lot of debugging time, only to find out it wasn't my software that was bugged...), no one knew which user I could run my service on so that my service had access to those printers and was allowed to sent emails (lots of security issues no one could help me with)... Because the server has corrupt printer drivers installed we're currently not even using it for printing. One thing I'm a bit worried about is that the server runs a few other services as well and they're all used

            K Offline
            K Offline
            kragan
            wrote on last edited by
            #5

            You might try entering a DEP (data execution prevention) exclusion for your service on the server running it. Its something we have to do in our environment for applications that interact with older foxpro stuff to resolve C0000005 exceptions.

            1 Reply Last reply
            0
            • Sander RosselS Sander Rossel

              AspDotNetDev wrote:

              Is .NET not completely managed?!

              Should've said VB.NET. I don't believe there's an Unsafe block in VB :)

              Unsafe
              Dim p As Integer*
              End Unsafe

              Crystal Reports undoubtedly has lots of unmanaged stuff... I'm ok with that, but please don't bother me with it :( Actually, please don't bother me with Crystal Reports at all... :~ Well, I don't really have a choice :sigh:

              It's an OO world.

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

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Naerling wrote:

              I don't believe there's an Unsafe block in VB

              No, no block... Cause the whole language is "Unsafe". I'll get my coat.

              Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

              Sander RosselS 1 Reply Last reply
              0
              • D Dave Kreskowiak

                You're getting that error probably because you've moved the Crystal Reports junk to a background thread. Crystal Reports does not like threading at all. WCF is actually very nice once you get past the learning curve.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak

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

                Dave Kreskowiak wrote:

                Crystal Reports does not like threading at all

                I'm not setting any values once it's on a background thread. I'm treating it as though it's immutable. I wouldn't think that's a problem... :confused:

                Dave Kreskowiak wrote:

                WCF is actually very nice once you get past the learning curve.

                Yeah WCF is nice. Create a new WCF project and you get a running example, looks really easy. But there's a few gotcha's you have to be aware of. I simply called my WCF service like in the example. I then did a callback to my client... That went well sometimes (I think it depended on timing), but most of the times I would get a deadlock (my app was waiting for the WCF call to return and my WCF callback was waiting for my app to become responsive)... Took me days to find the cause of the deadlock (I didn't know it was a deadlock at the time) and call the service async. After you get that kind of stuff it's actually pretty easy compared to some more old school stuff :)

                It's an OO world.

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

                B D 2 Replies Last reply
                0
                • L Lost User

                  Naerling wrote:

                  I don't believe there's an Unsafe block in VB

                  No, no block... Cause the whole language is "Unsafe". I'll get my coat.

                  Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

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

                  Collin Jasnoch wrote:

                  Cause the whole language is "Unsafe".

                  Saying something like that about C# would be unsafe. At least on CP. In VB you don't have to worry about semicolons, case-sensitivity and closing brackets. Once you set Option Strict On on project level there is no safer language in the world ;)

                  It's an OO world.

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

                  1 Reply Last reply
                  0
                  • Sander RosselS Sander Rossel

                    Dave Kreskowiak wrote:

                    Crystal Reports does not like threading at all

                    I'm not setting any values once it's on a background thread. I'm treating it as though it's immutable. I wouldn't think that's a problem... :confused:

                    Dave Kreskowiak wrote:

                    WCF is actually very nice once you get past the learning curve.

                    Yeah WCF is nice. Create a new WCF project and you get a running example, looks really easy. But there's a few gotcha's you have to be aware of. I simply called my WCF service like in the example. I then did a callback to my client... That went well sometimes (I think it depended on timing), but most of the times I would get a deadlock (my app was waiting for the WCF call to return and my WCF callback was waiting for my app to become responsive)... Took me days to find the cause of the deadlock (I didn't know it was a deadlock at the time) and call the service async. After you get that kind of stuff it's actually pretty easy compared to some more old school stuff :)

                    It's an OO world.

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

                    B Offline
                    B Offline
                    Brisingr Aerowing
                    wrote on last edited by
                    #9

                    Naerling wrote:

                    I'm not setting any values once it's on a background thread. I'm treating it as though it's immutable. I wouldn't think that's a problem...

                    Don't forget, it's Crystal Reports, and it is CRApp[^]!

                    All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan

                    Sander RosselS 1 Reply Last reply
                    0
                    • Sander RosselS Sander Rossel

                      Dave Kreskowiak wrote:

                      Crystal Reports does not like threading at all

                      I'm not setting any values once it's on a background thread. I'm treating it as though it's immutable. I wouldn't think that's a problem... :confused:

                      Dave Kreskowiak wrote:

                      WCF is actually very nice once you get past the learning curve.

                      Yeah WCF is nice. Create a new WCF project and you get a running example, looks really easy. But there's a few gotcha's you have to be aware of. I simply called my WCF service like in the example. I then did a callback to my client... That went well sometimes (I think it depended on timing), but most of the times I would get a deadlock (my app was waiting for the WCF call to return and my WCF callback was waiting for my app to become responsive)... Took me days to find the cause of the deadlock (I didn't know it was a deadlock at the time) and call the service async. After you get that kind of stuff it's actually pretty easy compared to some more old school stuff :)

                      It's an OO world.

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

                      D Offline
                      D Offline
                      Dave Kreskowiak
                      wrote on last edited by
                      #10

                      Naerling wrote:

                      I'm not setting any values once it's on a background thread. I'm treating it as though it's immutable. I wouldn't think that's a problem...

                      Yes, it is a problem. You don't have to set anything. It just hates being off of a UI thread for some reason.

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak

                      Sander RosselS 1 Reply Last reply
                      0
                      • B Brisingr Aerowing

                        Naerling wrote:

                        I'm not setting any values once it's on a background thread. I'm treating it as though it's immutable. I wouldn't think that's a problem...

                        Don't forget, it's Crystal Reports, and it is CRApp[^]!

                        All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan

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

                        :laugh:

                        It's an OO world.

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

                        B 1 Reply Last reply
                        0
                        • D Dave Kreskowiak

                          Naerling wrote:

                          I'm not setting any values once it's on a background thread. I'm treating it as though it's immutable. I wouldn't think that's a problem...

                          Yes, it is a problem. You don't have to set anything. It just hates being off of a UI thread for some reason.

                          A guide to posting questions on CodeProject[^]
                          Dave Kreskowiak

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

                          I'll have to watch it then. So far it seems to go allright. Perhaps this issue is (partly?) fixed in the newest version of CR? Although it did throw that C0000005 exception... Thanks for the tip.

                          It's an OO world.

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

                          1 Reply Last reply
                          0
                          • Sander RosselS Sander Rossel

                            :laugh:

                            It's an OO world.

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

                            B Offline
                            B Offline
                            Brisingr Aerowing
                            wrote on last edited by
                            #13

                            :thumbsup: I had several tabs open, this thread was in one, and that one was in another. So I posted a link (because it was related)

                            All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan

                            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