News:

Want to praise Simutrans?
Your feedback is important for us ;D.

[9.8 bug] Segmentationfault Linux

Started by Erik, June 14, 2011, 08:39:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Erik

Hi, I like the experimental development.
So I tried to play but the newest version ( 9.8 ) wouldn't work.
I have tried the 64 and the 32-bit for Linux, but the frame wouldn't come visible.
If I start the game with the terminal it ended with a segmentationfault.

QuoteReading low level config data ...
parse_simuconf() at config/simuconf.tab: Reading simuconf.tab successful!
Preparing display ...
Loading font 'font/prop.fnt'
font/prop.fnt successfully loaded as old format prop font!
Init done.
parse_simuconf() at pak128/config/simuconf.tab: Reading simuconf.tab successful!
Loading BDF font 'font/Prop-Latin1.bdf'
Loading BDF font font/Prop-Latin1.bdf with 256 characters
Reading city configuration ...
House-Rule 0: chance -2
...
Road-Rule 27: Pos (3,6) Flag 115
Reading speedbonus configuration ...
Reading private car ownership configuration ...
Reading electricity consumption configuration ...
Reading menu configuration ...
Reading object data from pak128/...
reading addon object data failed (disabling).
Reading menu configuration ...
Midi disabled ...
Calculating textures ...done
Creating cities ...
**Distributing 1 tourist attractions ...
Preparing startup ...
Loading BDF font 'font/Prop-Latin1.bdf'
Loading BDF font font/Prop-Latin1.bdf with 256 characters
Show banner ...
Running world, pause=0, fast forward=0 ...
Segmentatiefout


deMangler

Thanks for the report.
Unfortunately I have no way at present to test graphical clients.
I produced those binaries in the hope that they would work in the absence of anything else available for version 9.8.
If I have any progress on this I will post it here.
:)
dM


sdog

did you try to delete your old settings.xml and/or settings_experimental.xml?

Erik

#3
Sorry no, but just tried and no difference.

Perhaps a friend could help me to use some debug software.
Than we can find the problem some more precisely with that.

Far as I have time now, I go to try with gdb.

EDIT:
Running world, pause=0, fast forward=0 ...
^C
Program received signal SIGINT, Interrupt.
0x00007ffff6f2e380 in nanosleep () from /lib/libc.so.6
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6f0b358 in ?? () from /lib/libc.so.6
(gdb)

gdb Gives some new information.
There seems something going wrong with the communication with libc.so.6.
This start to be a new area for me.


Nathan Samson

Also a (the same?) crash on x64. I have a more complete stacktrace:


Running world, pause=0, fast forward=0 ...

Program received signal SIGSEGV, Segmentation fault.
__memmove_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:2139
2139 lddqu -20(%rsi), %xmm0
(gdb) bt
#0  __memmove_ssse3_back ()
    at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:2139
#1  0x000000000060099e in display_scroll_band(short, short, short) ()
#2  0x00000000005a4be9 in ticker::zeichnen() ()
#3  0x00000000005c0884 in win_display_flush(double) ()
#4  0x0000000000593c04 in intr_refresh_display(bool) ()
#5  0x00000000005cae12 in karte_t::sync_step(long, bool, bool) ()
#6  0x0000000000593ba1 in interrupt_check(char const*) ()
#7  0x0000000000593bbf in interrupt_check() ()
#8  0x00000000005d5f95 in karte_t::interactive(unsigned int) ()
#9  0x0000000000599afa in simu_main(int, char**) ()
#10 0x0000000000605a74 in main ()
(gdb)

Nathan Samson

#5
I've recompiled simutrans experimental myself (using the latest git) for x64 Binary can be found @ http://nathan.dommel.be/simutrans-experimental-x64-nathan

I've had to do some (small) changes to the code to get it compile. Patch attached:

[nathan@psi simutrans-experimental]$ git diff > patch
[nathan@psi simutrans-experimental]$ cat patch
diff --git a/simhalt.cc b/simhalt.cc
index 128c0be..29a392e 100644
--- a/simhalt.cc
+++ b/simhalt.cc
@@ -1375,8 +1375,8 @@ void haltestelle_t::remove_fabriken(fabrik_t *fab)

uint16 haltestelle_t::get_average_waiting_time(halthandle_t halt, uint8 category) const
{
- if(&waiting_times[category].get(halt->get_basis_pos()) != NULL)
- {
+ /*if(&waiting_times[category].get(halt->get_basis_pos()) != NULL)
+ {*/
fixed_list_tpl<uint16, 16> times = waiting_times[category].get(halt->get_basis_pos()).times;
const uint16 count = times.get_count();
if(count > 0 && halt.is_bound())
@@ -1393,7 +1393,7 @@ uint16 haltestelle_t::get_average_waiting_time(halthandle_t halt, uint8 category
return total_times >= 40 ? (uint16)total_times : 40;
}
return 39;
- }
+ //}
return 39;
}

diff --git a/tpl/slist_tpl.h b/tpl/slist_tpl.h
index 8ada146..e4a3dfa 100644
--- a/tpl/slist_tpl.h
+++ b/tpl/slist_tpl.h
@@ -10,6 +10,7 @@

#include <iterator>
#include <typeinfo>
+#include <cstddef>
#include "../dataobj/freelist.h"
#include "../simdebug.h"

diff --git a/vehicle/simvehikel.cc b/vehicle/simvehikel.cc
index 248d1fe..2d2260a 100644
--- a/vehicle/simvehikel.cc
+++ b/vehicle/simvehikel.cc
@@ -1283,8 +1283,8 @@ void vehikel_t::hop()
//{
//pre_corner_direction.add_to_tail(999);
//}
-
- speed_limit = calc_modified_speed_limit(&get_pos(), fahrtrichtung, (alte_fahrtrichtung != fahrtrichtung));
+ koord3d pos = get_pos();
+ speed_limit = calc_modified_speed_limit(&pos, fahrtrichtung, (alte_fahrtrichtung != fahrtrichtung));
if(weg->is_crossing())
{
gr->find<crossing_t>(2)->add_to_crossing(this);


Rationale for the first change (removing if): Taking the address of a temporary is not possible. In this case the check is bogus since .get() on a list will always return a value (possible a default constructed one), and so even if taking the address would work, it will never be NULL.

Rationale for the second change (including extra file): It was needed to find ptrdiff_t

Rationale for the third change (using an extra local var): Taking the address of a temporary is not allowed. Put it in local var so it is not a temporary anymore. Don't know if this wil result in correct behaviour, since calc_modified_speed_limit accepts a pointer (why?) and so thinks it can change the position (don't know if it does). Changing the position there will not have an effect on the vehicle, but this would neither be the case in the original code. This MAY be what is intended, but won't work this way (extra reason is that get_pos() returns a const, so shouldn't be changed in this way).

Erik

With the simutrans-experimentat-x64-nathan, get the messages that glibc 2.4 is missing.
It seems I have still glibc 2.3.

But more or less the same problem I had at first.
Has been posted and solved on this topic:
http://forum.simutrans.com/index.php?topic=7461.0