Discussion:
[Flightgear-scenery] genapts850 crash with Segmentation fault
Kirill Popov
2014-06-26 21:22:02 UTC
Permalink
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
Peter Sadrozinski
2014-06-26 21:27:17 UTC
Permalink
Kirill Popov
2014-06-26 22:10:30 UTC
Permalink
Thank you for the reply, Peter!
After switching to scenery/ws2.0 I was able to build a working
genapts850 and generate .apt
--
Best regards,
Kirill Popov.

----
Other ways to contact me:
Gtalk: ***@gmail.com
Cell phone: +79052062619
LinkedIn: http://ru.linkedin.com/in/kspopov


On Fri, Jun 27, 2014 at 1:27 AM, Peter Sadrozinski
Sorry - this is my fault. terragear/master has some code for allowing the
tools to add vertex attributes. The vertex attribute code in the simgear
btg writer is not complete.
Please move terragear to scenery/ws2.0 branch and build that - that should
be stable.
Pete
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.
============ 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
============= 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 ===============
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.
----
Cell phone: +79052062619
LinkedIn: http://ru.linkedin.com/in/kspopov
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/flightgear-scenery
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/flightgear-scenery
Geoff McLane
2016-11-03 00:36:51 UTC
Permalink
Hi all,

It has been quite a while since I built the
terragear suite of tools, and used them to
generate scenery tiles...

Have successfully used 'gdalchop' to divide up,
say DEM 3 S18W150.hgt, and used 'terrafit' to
create the equivalent 'fit' files, in the 'SRTM-3'
dir...

And successfully re-generated NTTM.btg.gz... looks
good, and seems equivalent to current terrasync, but ...
need some help...

Where to get the land usage information, and the
roads, rivers, railways, ... data... to reconstruct, in
this case, an island tile...

Any help appreciated...

Regards,
Geoff

unknown
1970-01-01 00:00:00 UTC
Permalink
This is a multi-part message in MIME format.
--------------030708070909020804030508
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Sorry - this is my fault. terragear/master has some code for allowing
the tools to add vertex attributes. The vertex attribute code in the
simgear btg writer is not complete.

Please move terragear to scenery/ws2.0 branch and build that - that
should be stable.

Pete
Post by Kirill Popov
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.
============ 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
============= 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 ===============
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.
----
Cell phone: +79052062619
LinkedIn: http://ru.linkedin.com/in/kspopov
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/flightgear-scenery
--------------030708070909020804030508
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Sorry - this is my fault.&nbsp;
terragear/master has some code for allowing the tools to add
vertex attributes.&nbsp; The vertex attribute code in the simgear btg
writer is not complete.<br>
<br>
Please move terragear to scenery/ws2.0 branch and build that -
that should be stable.<br>
<br>
Pete<br>
<br>
On 06/26/2014 05:22 PM, Kirill Popov wrote:<br>
</div>
<blockquote
cite="mid:CAFEOejM+***@mail.gmail.com"
type="cite">
<pre wrap="">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&lt;unsigned short&gt;
(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&lt;T&gt;(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&lt;unsigned short&gt; (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&lt;T&gt;(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 &amp; SG_VA_INTEGER_1) {
341 write_indice(fp, static_cast&lt;T&gt;(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: <a class="moz-txt-link-abbreviated" href="mailto:***@gmail.com">***@gmail.com</a>
Cell phone: +79052062619
LinkedIn: <a class="moz-txt-link-freetext" href="http://ru.linkedin.com/in/kspopov">http://ru.linkedin.com/in/kspopov</a>
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">------------------------------------------------------------------------------
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
<a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/Bonitasoft">http://p.sf.net/sfu/Bonitasoft</a></pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Flightgear-scenery mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Flightgear-***@lists.sourceforge.net">Flightgear-***@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/flightgear-scenery">https://lists.sourceforge.net/lists/listinfo/flightgear-scenery</a>
</pre>
</blockquote>
<br>
</body>
</html>

--------------030708070909020804030508--
Loading...