Bug 30704 - problem loading a png from a stream (with test case!)
Summary: problem loading a png from a stream (with test case!)
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Drawing ()
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-06-03 05:25 UTC by smremde
Modified: 2015-06-04 15:49 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 30704 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description smremde 2015-06-03 05:25:06 UTC
$ cat test.cs 

using System.IO;
using System.Net;
using System.Drawing;

class test {
        public static void Main(string[] a) {
                var data = new WebClient().DownloadData("http://upload.wikimedia.org/wikipedia/commons/e/e0/LEM-linedrawing.png");
                Image.FromStream(new MemoryStream(data));

$ mcs /reference:System.Drawing.dll test.cs 

$ ./test.exe 

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Drawing.GDIPlus.GdipLoadImageFromDelegate_linux (System.Drawing.GDIPlus/StreamGetHeaderDelegate,System.Drawing.GDIPlus/StreamGetBytesDelegate,System.Drawing.GDIPlus/StreamPutBytesDelegate,System.Drawing.GDIPlus/StreamSeekDelegate,System.Drawing.GDIPlus/StreamCloseDelegate,System.Drawing.GDIPlus/StreamSizeDelegate,intptr&) <0xffffffff>
  at System.Drawing.Image.InitFromStream (System.IO.Stream) <0x001b3>
  at System.Drawing.Image.LoadFromStream (System.IO.Stream,bool) <0x0002b>
  at System.Drawing.Image.FromStream (System.IO.Stream) <0x00013>
  at test.Main (string[]) <0x0006f>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        /usr/bin/cli() [0x4b73d8]
        /usr/bin/cli() [0x50f13b]
        /usr/bin/cli() [0x423d22]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fece3f58340]
        /usr/lib/libgdiplus.so.0(+0x415ca) [0x7fece07ad5ca]
        /usr/lib/libgdiplus.so.0(GdipLoadImageFromDelegate_linux+0x1ab) [0x7fece07939bb]

Debug info from gdb:

Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.

Aborted (core dumped)
Comment 1 Zoltan Varga 2015-06-04 15:49:59 UTC
-> System.Drawing.