Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6763397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:28:16+00:00 2026-05-26T14:28:16+00:00

We have a Mono application under Linux that does image processing on a bunch

  • 0

We have a Mono application under Linux that does image processing on a bunch of files.

For this we (among other things) use System.Drawing, and for the most part it serves us well. Occasionally however, we encounter an image that crashes the application – it is a crash in a native call, and this is immune to try catch. Simplified, a call like

System.Drawing.Image.FromFile(imagePath);

will cause a crash. The error message looks something like this:

at (wrapper managed-to-native) System.Drawing.GDIPlus.GdipLoadImageFromFile (string,intptr&) <0xffffffff>

This pulls the whole application down instantly.

We have encountered a few instances that this happens – corrupt GIF files, unexpected headers in TIFF files – to name a few. As we don’t have control over the source of the images, we will just have to deal with possible crashes.

The question: I would like to isolate the places where we use GDI+ (through System.Drawing) on untrusted files so that it can happily crash without killing the whole application.

I have attempted this through using separate application domains, but I just can’t stop the crashes. It is probable that I am doing it wrong!


Some detail: openSUSE 11.4 (x86_64), Mono version 2.10.2, libgdiplus0 (package) 2.10-30.2, libtiff3 (package) 3.9.4-3.7.1


Please note that the specific issues we experienced was promptly fixed – see comments below. The question still remains though.

I would have liked to somehow isolate a part of the program so that it does not pull the whole thing down – but I fear the only answer is to call a external process as noted in the answer below. I’ll leave this as is for a while and then accept that answer!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:28:17+00:00Added an answer on May 26, 2026 at 2:28 pm

    Ok, with some measure of naivety here because I don’t know much about Linux… AppDomains (in Windows anyway) reside in the same process. Try separating out the problematic code into another process, using command lines or some communication mechanism like IPC so that if it crashes, it doesn’t bring down the main process, just the child.

    Although I’ve never had an uncatchable exception causing my problems in the past, it sounds like the main process is being killed, which is a layer below the AppDomain idea you said you tried.

    Translate to Linuxese where necessary… sorry I can’t be more specific.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that is programmed in C# 3.5 under Windows. This application
I have recently discovered that I am affected by this bug http://www.mail-archive.com/mono-bugs@lists.ximian.com/msg71515.html Well, at
I'm running an ASP.NET MVC2 application under mod_mono with mono 2.8.1 and currently have
I have written an application (wpf - will Mono translate this for a Mac?)
I have a Mono application that should not show on the dock, but will
I have a Mono application with a plain-old Windows Forms form that has a
I have a long running C# server application running on Linux/mono, and I have
Are there any performance benchmarks for Mono compared to say Java in GNU/Linux? Have
I have a C# command-line application that I need to run in windows and
I have to connect a Qt4 application to a mono Application. The current proof

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.