Angus Leeming wrote: > Georg, > > the attached test case crashes in ExportData::addExternalFile, so > I suspect this is an artefact of your recent changes. > > To trigger the crash: > * fire up lyx > * turn instant previewing on (Edit->Preferences dialog, Graphics > pane). * open crash.lyx > * open the External dialog (right click). > * Turn on previewing (LyX View tab) and select 'preview' as the > display > type. > * press 'Apply' > > BANG! The backtrace is below, but it dies when accessing > 'externalfiles[format]' where 'format' == 'dvi'.
Ok, the crash occurs because runparams.exportdata == 0, so the dereferencing that occurs here is bogus. int InsetExternal::latex(Buffer const & buf, ostream & os, OutputParams const & runparams) const { return external::writeExternal(params_, "LaTeX", buf, os, *(runparams.exportdata), external_in_tmpdir); So, your 'hack' is broken. > void ExportData::addExternalFile(string const & format, > string const & sourceName, > string const & exportName) > { > BOOST_ASSERT(lyx::support::AbsolutePath(sourceName)); > > lyxerr << "format == " << format << std::endl; > // Make sure that we have every file only once, otherwise > copyFile() // would ask several times if it should overwrite > a file. > --> vector<ExportedFile> & files = externalfiles[format]; > > (gdb) bt > #0 0x080cfb1f in std::_Rb_tree<std::string, std::pair<std::string > #const, std::vector<ExportedFile, std::allocator<ExportedFile> > >, > #std::_Select1st<std::pair<std::string const, > #std::vector<ExportedFile, std::allocator<ExportedFile> > > >, > #std::less<std::string>, std::allocator<std::pair<std::string const, > #std::vector<ExportedFile, std::allocator<ExportedFile> > > > > #>::lower_bound(std::string const&) (this=0x0, [EMAIL PROTECTED]) at > #stl_tree.h:1319 > #1 0x080cec19 in std::map<std::string, std::vector<ExportedFile, > #std::allocator<ExportedFile> >, std::less<std::string>, > #std::allocator<std::pair<std::string const, > #std::vector<ExportedFile, std::allocator<ExportedFile> > > > > #>::lower_bound(std::string const&) (this=0x0, [EMAIL PROTECTED]) at > #stl_map.h:508 > #2 0x080ce37a in std::map<std::string, std::vector<ExportedFile, > #std::allocator<ExportedFile> >, std::less<std::string>, > #std::allocator<std::pair<std::string const, > #std::vector<ExportedFile, std::allocator<ExportedFile> > > > > #>::operator[](std::string const&) (this=0x0, [EMAIL PROTECTED]) at > #stl_map.h:316 > #3 0x080cdc1a in ExportData::addExternalFile(std::string const&, > #std::string const&, std::string const&) (this=0x0, > [EMAIL PROTECTED], > [EMAIL PROTECTED], [EMAIL PROTECTED]) at > ../../src/exporter.C:294 > #4 0x080cdce6 in ExportData::addExternalFile(std::string const&, > #std::string const&) (this=0x0, [EMAIL PROTECTED], > [EMAIL PROTECTED]) > at ../../src/exporter.C:304 > #5 0x081f1f81 in lyx::external::(anonymous > #namespace)::updateExternal(InsetExternalParams const&, std::string > #const&, Buffer const&, ExportData&, bool) ( > [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], > [EMAIL PROTECTED], external_in_tmpdir=true) at stl_tree.h:202 > #6 0x081f222f in lyx::external::writeExternal(InsetExternalParams > #const&, std::string const&, Buffer const&, std::ostream&, > #ExportData&, bool) ( > [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], > [EMAIL PROTECTED], [EMAIL PROTECTED], external_in_tmpdir=true) > at ../../../src/insets/ExternalSupport.C:286 > #7 0x081c9b69 in InsetExternal::latex(Buffer const&, std::ostream&, > #OutputParams const&) const (this=0xa4b55b0, [EMAIL PROTECTED], > [EMAIL PROTECTED], > [EMAIL PROTECTED]) at stl_alloc.h:652