This project has moved. For the latest updates, please go here.

.Write() crashes application

Dec 20, 2014 at 3:32 PM
Edited Dec 20, 2014 at 3:34 PM
Dirk,

Is there something in the .Write() method which saves the image to a file that might not be multithread safe?

My app was crashing few times a day at random and I was thinking it is probably due to any of the filters it uses, however by luck i discovered it is because of the .Write() method. I needed to stop saving images to hdd for few days and noticed since then my app didn't crash even once. When i reenable saving to disk, it starts crashing again at random..

There's no exception or something thrown, directly those windows error reporting messages "this program has stopped working".. and some crash stuff in Magick.net.dll

Since it happens randomly, i don't think it is because of particular image, so i don't think this can be replicated with particular image..

All i am doing in a multithreading environment is generating a random filename string and then using .Write() to save the image

I will appreciate if you have time to look at that part of the code..
Coordinator
Dec 20, 2014 at 9:53 PM
Can you get me a crash dump? This could help me track down the problem. What is your output image format?
Dec 21, 2014 at 8:01 AM
dlemstra wrote:
Can you get me a crash dump? This could help me track down the problem. What is your output image format?
Is a crash dump file automatically generated somewhere or I need to enable it somehow?

I am working only with jpg,png,bmp,gif formats, and at this point I am not able to tell if it crashes at particular format, as the application receives a mix of all these format. I will now try to see if particular format causes the crash by enabling saving only for 1 format and will leave the app running 24 hours and see if it will crash, then will switch to next format and so on.. This way I think i will see if the format matters at all. Will let you know about this within few days

Thanks!
Coordinator
Dec 21, 2014 at 1:12 PM
Edited Dec 21, 2014 at 1:12 PM
You can find some more information about collecting a crash dump here: http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx
Dec 23, 2014 at 5:16 AM
dlemstra wrote:
You can find some more information about collecting a crash dump here: http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx
Thanks for the crash dump link, however i can't make such file as it is required VS to be installed on the servers where I run the application..

The image format doesn't matter about the crashes as i tested separately with each of the four formats and the app crashes with all.

For sure there's some issue in the .Write(), as since yesterday i switched to a
Using bm As Bitmap = Img.Tobitmap
bm.save("file....")
End Using
and so far there's not and a single crash and this alternative suits me

Sorry, that I can't generate a crash file and help you out with the issue..
Coordinator
Dec 23, 2014 at 8:00 AM
Edited Dec 23, 2014 at 8:12 AM
kratuna wrote:
Thanks for the crash dump link, however i can't make such file as it is required VS to be installed on the servers where I run the application..
Can you not reproduce the issue on your local machine? Getting a crash dump will help to really fix the problem. It would also help if you can provide me with a really small sample application that I can use to reproduce the problem.
Dec 24, 2014 at 2:55 PM
dlemstra wrote:
kratuna wrote:
Thanks for the crash dump link, however i can't make such file as it is required VS to be installed on the servers where I run the application..
Can you not reproduce the issue on your local machine? Getting a crash dump will help to really fix the problem. It would also help if you can provide me with a really small sample application that I can use to reproduce the problem.
No, i am not able to reproduce it on my pc as on it i just develop the application and work with 1 thread only - i manually pass an image. The app is used in real environment on my servers where the images are received in the multithreaded environment.

I will try and see if i can get VS installed on one of my servers, i think it had a trial for 90 days.. and there will run in debug mode to try to get a crash dump file..

Will let you know within some days
Dec 26, 2014 at 2:46 PM
Edited Dec 26, 2014 at 2:47 PM
dlemstra wrote:
Can you not reproduce the issue on your local machine? Getting a crash dump will help to really fix the problem. It would also help if you can provide me with a really small sample application that I can use to reproduce the problem.
Please check your email when you have time, I sent you more info about the issue and crash files as well