Hello, everyone! Today I've built a fresh simgear/terragear suite from sources (simgear's repo at "next", terragear's one at "master"). Building is done with download_and_compile.sh script (modified for Debug build mode).
When I start genapts850 like "./genapts850 --input=tiny_ULSG.dat
--work=. --threads=1 --airport=ULSG --verbose" I'm getting
Segmentation fault and partial results written into directory. Source
file tiny_ULSG.dat is attached. Compilation and running done in
VirtualBox under Ubuntu Trusty x64.
Here are some details from gdb:
============ Segfault message =================
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe81fa700 (LWP 5177)]
0x00000000005bd200 in write_indices<unsigned short>
(fp=0x7fffe05f3c70, indexMask=27 '\033', vaMask=4294967295,
vertices=..., normals=..., colors=..., texCoords=..., vas=...)
at /root/fgfs/stable/simgear/simgear/io/sg_binobj.cxx:341
341 write_indice(fp, static_cast<T>(vas[1][i]));
========== end of Segfault message ===============
Backtrace is also attached.
If I set a breakpoint at simgear/simgear/io/sg_binobj.cxx:341 I get
the following:
============= Variables at breakpoint ==================
Breakpoint 1, write_indices<unsigned short> (fp=0x7fffe05edab0,
indexMask=27 '\033', vaMask=4294967295, vertices=...,
normals=..., colors=..., texCoords=..., vas=...) at
/root/fgfs/stable/simgear/simgear/io/sg_binobj.cxx:341
341 write_indice(fp, static_cast<T>(vas[1][i]));
(gdb) print i
$1 = 0
(gdb) print vas[1].size()
$4 = 0
(gdb) print vaMask
$1 = 4294967295
================== End of variables at breakpoint ===============
So, the code part actually failing is:
340 if (vaMask & SG_VA_INTEGER_1) {
341 write_indice(fp, static_cast<T>(vas[1][i]));
342 }
At the time crash happens, i == 0 and vaMask == 4294967295 ("1" in all
bits). But if we look at vas[1] size, it will be zero. And as in the
next line we're trying to call write_indice() with non-existing
vas[1][i], we're getting segfault.
this is how I see the situation, correct me if I'm wrong.
Unfortunately, I did not manage to understand the code and fix the
issue myself, so I'm asking for help from SG/TG developers.
Thank you in advance!
--
Best regards,
Kirill Popov.
----
Other ways to contact me:
Gtalk: [email protected]
Cell phone: +79052062619
LinkedIn: http://ru.linkedin.com/in/kspopov
#0 0x00000000005bd200 in write_indices<unsigned short> (fp=0x7fffe05f3c70,
indexMask=27 '\033', vaMask=4294967295,
vertices=..., normals=..., colors=..., texCoords=..., vas=...)
at /root/fgfs/stable/simgear/simgear/io/sg_binobj.cxx:341
#1 0x00000000005b7846 in SGBinObject::write_objects (this=0x7fffe81f88e0,
fp=0x7fffe05f3c70, type=10, verts=...,
normals=..., colors=..., texCoords=..., vertexAttribs=..., materials=...)
at /root/fgfs/stable/simgear/simgear/io/sg_binobj.cxx:899
#2 0x00000000005b8d9c in SGBinObject::write_bin_file (this=0x7fffe81f88e0,
file=...)
at /root/fgfs/stable/simgear/simgear/io/sg_binobj.cxx:1047
#3 0x00000000005b7a91 in SGBinObject::write_bin (this=0x7fffe81f88e0,
base=..., name=..., b=...)
at /root/fgfs/stable/simgear/simgear/io/sg_binobj.cxx:917
#4 0x00000000004b60e1 in Airport::WriteFeatureOutput(std::string const&,
SGBucket const&) ()
#5 0x000000000049c863 in Airport::BuildBtg(std::string const&,
std::vector<std::string, std::allocator<std::string> > const&) ()
#6 0x00000000004f8c9b in Parser::run() ()
#7 0x00000000005d3579 in SGThread::PrivateData::start_routine (data=0x8739c0)
at /root/fgfs/stable/simgear/simgear/threads/SGThread.cxx:204
#8 0x00007ffff77aa182 in start_thread () from
/lib/x86_64-linux-gnu/libpthread.so.0
#9 0x00007ffff544730d in clone () from /lib/x86_64-linux-gnu/libc.so.6
tiny_ULSG.dat
Description: Netscape Proxy Auto Config
------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft
_______________________________________________ Flightgear-scenery mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/flightgear-scenery
