Opened 13 years ago

Closed 13 years ago

#1961 closed defect (fixed)

MgServer crashes by previewing a layer from a Raster data connection without CS specified

Reported by: wuma Owned by: wuma
Priority: high Milestone: 2.4
Component: Server Version: 2.1.0
Severity: major Keywords:
Cc: mars.wu@… External ID: 1451912

Description

It's reported by Autodesk QA: steps:

  1. Copy some raster data e.g. ECW, PNG, JPG, tif to linux OS, you can also use attached one.
  2. Create alias in site administrator.
  3. In studio, connect to the linux server.
  4. New data connection, select Raster provider, add the file attached, save the data connection.

Note: test connection is correct.

  1. Right click the data connection and choose New Layer function.
  2. CLick Refresh button to preview the layer.

Result: If the connected raster file is in format: ecw, png, jpg, tif, server will crash. If the format is bmp or cal, exception may happen, but server is not down. Haven't tried other formats yet. Preview layers generated through Load Procedure works well for all formats.

Expectation: Preview layers which are based on new connection correctly.

Regression: Y, fine in Reeses, but not sure in Jedi Workaround: Y, load procedure

Attachments (1)

segmentation_fault_linux.patch (745 bytes ) - added by wuma 13 years ago.

Download all attachments as: .zip

Change History (5)

by wuma, 13 years ago

comment:1 by wuma, 13 years ago

Following line is executed in StylizeLayers() function:

STRING layerWkt = layerCs->ToString();

layerCs will be NULL if there is no CS or CS override specified for the feature source. Then NULL pointer exception will happen in above line. On Windows, there is a macro MG_CATCH_AND_RELEASE() to catch this exception and simply continue the logic.

#define MG_CATCH_AND_RELEASE() \
} \
catch (MgException* e) \
{ \
mgException = e; \
} \
catch (...) \
{ \
}

However, on Linux, NULL pointer will lead to Segmentation Fault, which cannot be caught by catch (...) and will crash the application directly. So the pointer has to be verified before calling any methods of the pointer to avoid Segmentation Fault crash on Linux

comment:2 by wuma, 13 years ago

r6535 for adsk/2.4j r6536 for trunk

comment:3 by zspitzer, 13 years ago

can we close?

comment:4 by jng, 13 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.