Opened 14 years ago

Closed 14 years ago

Last modified 8 years ago

#456 closed task (fixed)

DllLoader should handle missing files better

Reported by: Philip Taylor Owned by: Evans
Priority: Nice to Have Milestone:
Component: Core engine Keywords: simple
Cc: Patch:

Description

DllLoader is used to load the Atlas and Collada libraries at run-time. In a Debug build, it tries to load AtlasUI_dbg.dll (./libAtlasUI_dbg.so on Linux). In a Release build, it loads AtlasUI.dll (./libAtlasUI.so).

(Ignore the comment in DllLoader saying "it is critical that compiler options are the same between app and SO" - that is untrue, since the libraries are designed to be safely mixed with different compiler options. We just want to use the Debug library with Debug builds in order to help debugging and error-detection.)

Because Atlas is a bit awkward and slow to compile, it's disabled by default on Windows, so AtlasUI_dbg.dll won't be created. But AtlasUI.dll will exist, because we put a pre-compiled binary in SVN (for non-programmers to use). Rather than fail to load Atlas in Debug builds because there's no matching library, it should fall back on AtlasUI.dll and load that one instead.

So in Debug builds on Windows, DllLoader needs to look for the Debug library then the Release library; in all other cases it should just look for the single appropriate library.

In all cases, it shouldn't trigger internal error messages in dlopen: it should check that the file exists before trying to open it, and give a nice friendly error message if it can't find anything. (Or maybe it should try to open it first, and change the Windows emulation of dlopen in wdlfcn.cpp to silently return a failure code that the caller can check.)

Attachments (1)

patch.diff (776 bytes ) - added by Evans 14 years ago.

Download all attachments as: .zip

Change History (7)

by Evans, 14 years ago

Attachment: patch.diff added

comment:1 by Evans, 14 years ago

Owner: set to Evans

comment:2 by Evans, 14 years ago

Keywords: review added
Status: newassigned

comment:3 by philip, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [7783]) Fix #456 (DllLoader should handle missing files better), based on patch from evans

comment:4 by Philip Taylor, 14 years ago

Thanks, I ended up making a few changes (mainly so that it reports the error from the first dlopen call) but it's basically the same. I haven't been able to test this on Windows but hopefully it'll work there...

comment:5 by (none), 14 years ago

Milestone: Unclassified

Milestone Unclassified deleted

comment:6 by sanderd17, 8 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.