Kirill Popov
2014-06-26 21:22:02 UTC
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: ***@gmail.com
Cell phone: +79052062619
LinkedIn: http://ru.linkedin.com/in/kspopov
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: ***@gmail.com
Cell phone: +79052062619
LinkedIn: http://ru.linkedin.com/in/kspopov