Closed GoogleCodeExporter closed 9 years ago
Hmmmm, so this is actually more interesting than it looks, because the error
message is that NoneType has no attribute path in the line
os.path.exists(os.path.abspath(value)). So the problem isn't anything to do
with the value. Here's what happens (for those that are interested):
The plugins all get imported when required, and the fileparam config handler is
a plugin (seemed reasonable at the time). The fileparam config entry just
takes whatever it's been given and turns it into a location parameter (and only
overrides the location if it's not already set).
During the import the config option gets added, which I think causes a parse of
the options handed in. During this first run it detects the file doesn't exist
and returns an "ERROR : volatility.plugins.fileparam: The requested file
doesn't exist", which is exactly what we wanted it to do. Then it exits (as
errors are supposed to do), but that's actually caught by the plugin importer!
It shows us the failure (*** Failed to import volatility.plugins.fileparam
(SystemExit: 1)) and then *doesn't save* the module it loaded, and carries on
with the next plugin. Already disaster is lurking...
Then another parse of the command line is requested somehow (actually there's
several iterations of this, as can be seen by changing the error to a warning).
The callback function (which was loaded and copied into the config objects by
the add_config call) gets called, but because the module it came from wasn't
saved, all the imports are gone, so at this point os really is None! Since
we're no longer in the plugin importer's safety net of try/except, we get that
big backtrace at the end.
Worse, this is one of the only cases where asking for a frame's module (as the
debugger does to generate the right location) also returns None, so even adding
an import os right in the function doesn't solve all the problems.
My chosen solution is to catch only Exceptions not BaseExceptions, which should
allow system-exiting exceptions (such as SystemExit and KeyboardInterrupt, and
possibly very bad ones like SystemError and MemoryError), through, which now
means you don't have to Ctrl+C several times to get out of the plugin loading
process either. 5:)
Original comment by mike.auty@gmail.com
on 19 Jan 2011 at 11:52
This issue was closed by revision r600.
Original comment by mike.auty@gmail.com
on 19 Jan 2011 at 11:53
Original issue reported on code.google.com by
michael.hale@gmail.com
on 19 Jan 2011 at 3:03