Started by Rollmaterial, February 10, 2020, 09:43:21 PM
0 Members and 1 Guest are viewing this topic.
Quote from: jamespetts on March 04, 2020, 06:44:04 PMYes,. you have correctly understood what I have asked to be tested: thank you for this. However, the error given is rather mystifying: I do not understand how it is possible for a thread barrier to raise an arithmetic exception, and I have not been able to reproduce this myself. I have noticed a thread scheduling problem that seems to be causing thread deadlocks in certain situations, however, so it is possible that these are somehow related.Can I check whether anyone else is experiencing this issue when testing this branch? It might be helpful to run the test multiple times, as thread errors can be non-constant.
Quote from: Matthew on March 09, 2020, 05:38:34 PMI have run the test multiple times and rebuilt from the same commit. I get a crash with exactly the same error message in gdb every time when I run the British and Japanese paksets. It sometimes appears in the terminal as a "floating point exception" rather than an "arithmetic exception". Interestingly, I can run the Swedish pakset, perhaps because it does not appear to have any private cars.I can't respond to your technical points except by wishing you good luck when you feel up to revisiting the branch, James. IIRC you find threading bugs particularly difficult. I appreciate your commitment to making Extended run on a wide variety of systems, from my potato maps up to Rollmaterials' Rolls-Royce games.
Quote from: jamespetts on March 09, 2020, 09:19:26 PMI have realised that there was a change that I had not committed to Github; I am not sure whether this will make any difference, but any re-testing of this would be helpful.
simworld.cc: In member function 'void karte_t::suspend_private_car_threads()':simworld.cc:1941:29: error: could not convert 'karte_t::private_car_route_mutex' from 'pthread_mutex_t' to 'bool' if (private_car_route_mutex) ^simworld.cc:1951:29: error: could not convert 'karte_t::private_car_route_mutex' from 'pthread_mutex_t' to 'bool' if (private_car_route_mutex)
Quote from: jamespetts on March 18, 2020, 07:11:55 PMThank you for checking this. Can I check precisely what you are compiling and in what environment? When I try to compile this on my Linux computer, I get the following error:Code Select Expandsimworld.cc: In member function 'void karte_t::suspend_private_car_threads()':simworld.cc:1941:29: error: could not convert 'karte_t::private_car_route_mutex' from 'pthread_mutex_t' to 'bool' if (private_car_route_mutex) ^simworld.cc:1951:29: error: could not convert 'karte_t::private_car_route_mutex' from 'pthread_mutex_t' to 'bool' if (private_car_route_mutex)
Using built-in specs.COLLECT_GCC=gccCOLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapperOFFLOAD_TARGET_NAMES=nvptx-noneOFFLOAD_TARGET_DEFAULT=1Target: x86_64-linux-gnuConfigured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnuThread model: posixgcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
make: *** [build/default/simworld.o] Error 1make: *** Waiting for unfinished jobs....simtool.cc: In member function 'const char* tool_build_station_t::tool_station_aux(player_t*, koord3d, const building_desc_t*, waytype_t, const char*)':simtool.cc:5187:30: warning: 'cost' may be used uninitialized in this function [-Wmaybe-uninitialized] sint64 adjusted_cost = cost * desc->get_x() * desc->get_y();
descriptor/../display/simgraph.h:130:15: warning: 'zoom_factor' defined but not used [-Wunused-variable] static uint32 zoom_factor = ZOOM_NEUTRAL; ^~~~~~~~~~~common.mk:50: recipe for target 'build/default/simworld.o' failedmake: *** [build/default/simworld.o] Error 1
Thread 1 "simutrans-exten" received signal SIGFPE, Arithmetic exception.__pthread_barrier_wait (barrier=0x555555cf0f80 <karte_t::private_car_barrier>) at pthread_barrier_wait.c:117117 pthread_barrier_wait.c: No such file or directory.(gdb) backtrace#0 __pthread_barrier_wait (barrier=0x555555cf0f80 <karte_t::private_car_barrier>) at pthread_barrier_wait.c:117#1 0x0000555555924bac in karte_t::suspend_private_car_threads() ()#2 0x0000555555947b7f in karte_t::load(char const*) ()#3 0x00005555558dbfbf in simu_main(int, char**) ()#4 0x00005555558f23e2 in sysmain(int, char**) ()#5 0x00007ffff6541b97 in __libc_start_main (main=0x5555555ab1d0 <main>, argc=1, argv=0x7fffffffdf88, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7fffffffdf78) at ../csu/libc-start.c:310#6 0x00005555555ab23a in _start ()
Quote from: jamespetts on March 21, 2020, 03:35:32 PMFurther to the above, I believe that I have now fixed this arithmetic exception error - I should be grateful if people could re-test to confirm that this is now working.Edit: I have also fixed a thread deadlock issue.
Thread 105 "simutrans-exten" received signal SIGSEGV, Segmentation fault.[Switching to Thread 0x7fff9d7fa700 (LWP 16161)]0x0000555555c7d6c0 in vtable for boden_t ()(gdb) bt#0 0x0000555555c7d6c0 in vtable for boden_t ()#1 0x00005555556373a1 in route_t::find_route(karte_t*, koord3d, test_driver_t*, unsigned int, unsigned char, unsigned int, int, unsigned int, unsigned int, bool, route_t::find_route_flags) ()#2 0x0000555555857c19 in stadt_t::check_all_private_car_routes() ()#3 0x000055555591e78a in check_road_connexions_threaded(void*) ()#4 0x00007ffff7bbd6db in start_thread (arg=0x7fff9d7fa700) at pthread_create.c:463#5 0x00007ffff684888f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Quote from: Phystam on March 24, 2020, 05:33:50 AMNot a few seconds — freezes more than a minute, probably eternally.
Quote from: freddyhayward on March 27, 2020, 09:56:33 PMI've attached a save that freezes or crashes almost immediately after being loaded, showing the same output on GDB as on larger saves I've tested with. The save always freezes when run with GDB, but without GDB it occasionally crashes rather than freezing. https://cdn.discordapp.com/attachments/692376966070009877/692923231882969139/unknown.png. I'm on a linux machine and the freeze seems to stem from calling await_private_car_threads(). It's also possible that the internal linux code is the problem.
Quote from: freddyhayward on March 29, 2020, 10:03:05 AMMy previous post seems to have been deleted. Unfortunately the issue persists even under the latest revision.
Quote from: Phystam on March 29, 2020, 09:23:34 PMStill I have the same problem when loading.How to produce:1. Use the attached save data above2. Start a server game with no window binary 3. Access to the server as a client(May stop then)4. Send a nettool force-sync command(May stop then)
Quote from: jamespetts on March 29, 2020, 12:19:08 PMThank you for letting me know Can I check whether you are self compiling or using the pre-compiled binaries from the Bridgewater-Brunel nightly build server?
Quote from: freddyhayward on March 29, 2020, 11:30:06 PMI had previously used a self compiled build as the nightly build had not yet been uploaded. However I have just tried using the latest nightly build and still have the same problem. So far, the freezes have occurred with fast-forward on in--game. I am now testing to see whether this occurs without fast-forward.