Aleph-One-Marathon / alephone

Aleph One is the open source continuation of Bungie’s Marathon 2 game engine.
https://alephone.lhowon.org/
GNU General Public License v3.0
655 stars 99 forks source link

crash after start #125

Open cheese1 opened 6 years ago

cheese1 commented 6 years ago

[cheese@localhost ~]$ alephone-marathon.sh Aleph One Linux 2018-10-06 1.3b2 https://alephone.lhowon.org/

Original code by Bungie Software http://www.bungie.com/ Additional work by Loren Petrich, Chris Pruett, Rhys Hill et al. TCP/IP networking by Woody Zenfell Expat XML library by James Clark SDL port by Christian Bauer Christian.Bauer@uni-mainz.de

This is free software with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. For details, see the file COPYING.

Built with network play enabled.

Built with Lua scripting enabled. while initializing preferences (preferences.cpp:2666) Reading older preferences of version 20170205. Preferences will be upgraded to version 20181006 when saved. (/home/cheese/.alephone/Marathon Preferences) (preferences.cpp:2739) /usr/include/c++/8/bits/stl_vector.h:932: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = unsigned int; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = unsigned int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed. Aborted (core dumped)

compiled for fedora 29

orbea commented 6 years ago

What are the contents of alephone-marathon.sh?

Does it start if you run it with?

alephone /path/to/marathon-1/

Are you able to building alephone yourself with debugging symbols and getting a backtrace with gdb?

cheese1 commented 6 years ago

contents of start-script:

!/bin/bash

set -e if [ ! -d $HOME/.alephone/gamefiles/Marathon ]; then /usr/share/autodl/AutoDL.py /usr/share/AlephOne/marathon.autodlrc RET=$?

0: download OK, user wants to start game

# 2: download OK, user does not want to start game
if [ "$RET" = "0" -o "$RET" = "2" ]; then
    cd $HOME/.alephone/gamefiles/
    unzip -u Marathon-20180930-Data.zip 
    rm -rf Marathon-20180930-Data.zip
fi
if [ "$RET" != "0" ]; then
    exit $RET
fi

fi exec /usr/bin/alephone $HOME/.alephone/gamefiles/Marathon

output from gdb:...warning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentsAleph One Linux 2018-10-06 1.3b2 https://alephone.lhowon.org/ Original code by Bungie Software http://www.bungie.com/Additional work by Loren Petrich, Chris Pruett, Rhys Hill et al.TCP/IP networking by Woody ZenfellExpat XML library by James ClarkSDL port by Christian Bauer Christian.Bauer@uni-mainz.de This is free software with ABSOLUTELY NO WARRANTY.You are welcome to redistribute it under certain conditions.For details, see the file COPYING. Built with network play enabled. Built with Lua scripting enabled.warning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segments

warning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segments[New Thread 0x7fffe48f5700 (LWP 8925)]warning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segmentswarning: Loadable section ".note.gnu.property" outside of ELF segments[New Thread 0x7fffe4040700 (LWP 8926)][New Thread 0x7fffcff4f700 (LWP 8927)]/usr/include/c++/8/bits/stl_vector.h:932: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = unsigned int; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = unsigned int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion 'builtin_expect(n < this->size(), true)' failed. Thread 1 "alephone" received signal SIGABRT, Aborted.0x00007ffff5eb953f in raise () from /lib64/libc.so.6Missing separate debuginfos, use: dnf debuginfo-install SDL2-2.0.9-1.fc29.x86_64 SDL2_image-2.0.4- 1.fc29.x86_64 SDL2_net-2.0.1-7.fc29.x86_64 SDL2_ttf-2.0.14- 7.fc29.x86_64 alsa-lib-1.1.7-2.fc29.x86_64 boost-filesystem-1.66.0- 14.fc29.x86_64 boost-system-1.66.0-14.fc29.x86_64 bzip2-libs-1.0.6- 28.fc29.x86_64 cairo-1.16.0-1.fc29.x86_64 cyrus-sasl-lib-2.1.27- 0.3rc7.fc29.x86_64 dbus-libs-1.12.10-1.fc29.x86_64 expat-2.2.6- 1.fc29.x86_64 ffmpeg-libs-4.0.3-1.fc29.x86_64 flac-libs-1.3.2- 8.fc29.x86_64 fontconfig-2.13.1-3.fc29.x86_64 freetype-2.9.1- 6.fc29.x86_64 fribidi-1.0.5-1.fc29.x86_64 gdk-pixbuf2-2.38.0- 4.fc29.x86_64 glib2-2.58.1-1.fc29.x86_64 gmp-6.1.2-8.fc29.x86_64 gnutls-3.6.4-4.fc29.x86_64 graphite2-1.3.10-6.fc29.x86_64 gsm-1.0.18- 3.fc29.x86_64 jbigkit-libs-2.1-15.fc29.x86_64 keyutils-libs-1.5.10- 8.fc29.x86_64 krb5-libs-1.16.1-21.fc29.x86_64 lame-libs-3.100- 4.fc29.x86_64 libICE-1.0.9-14.fc29.x86_64 libSM-1.2.3-1.fc29.x86_64 libX11-1.6.7-1.fc29.x86_64 libX11-xcb-1.6.7-1.fc29.x86_64 libXScrnSaver-1.2.3-2.fc29.x86_64 libXdamage-1.1.4-15.fc29.x86_64 libXfixes-5.0.3-8.fc29.x86_64 libXinerama-1.1.4-2.fc29.x86_64 libXrandr-1.5.1-8.fc29.x86_64 libXrender-0.9.10-8.fc29.x86_64 libXtst- 1.2.3-8.fc29.x86_64 libaom-1.0.0-5.20180925gitd0076f5.fc29.x86_64 libblkid-2.32.1-1.fc29.x86_64 libbluray-1.0.2-4.fc29.x86_64 libcom_err- 1.44.3-1.fc29.x86_64 libcurl-7.61.1-5.fc29.x86_64 libdatrie-0.2.9- 8.fc29.x86_64 libdrm-2.4.96-1.fc29.x86_64 libffi-3.1-18.fc29.x86_64 libgcc-8.2.1-5.fc29.x86_64 libgcrypt-1.8.3-3.fc29.x86_64 libglvnd- 1.1.0-2.fc29.x86_64 libglvnd-glx-1.1.0-2.fc29.x86_64 libidn2-2.0.5- 2.fc29.x86_64 libjpeg-turbo-2.0.0-1.fc29.x86_64 libmad-0.15.1b- 26.fc29.x86_64 libmfx-1.25-1.fc29.x86_64 libnghttp2-1.34.0- 1.fc29.x86_64 libogg-1.3.3-1.fc29.x86_64 libpng-1.6.34-6.fc29.x86_64 libpsl-0.20.2-5.fc29.x86_64 libselinux-2.8-4.fc29.x86_64 libsndfile- 1.0.28-9.fc29.x86_64 libssh-0.8.5-1.fc29.x86_64 libstdc++-8.2.1- 5.fc29.x86_64 libtheora-1.1.1-22.fc29.x86_64 libtiff-4.0.9- 13.fc29.x86_64 libva-2.3.0-1.fc29.x86_64 libvorbis-1.3.6-3.fc29.x86_64 libwebp-1.0.0-2.fc29.x86_64 libxcb-1.13.1-1.fc29.x86_64 libxcrypt- 4.2.3-1.fc29.x86_64 libxml2-2.9.8-4.fc29.x86_64 mesa-libGL-18.2.4- 2.fc29.x86_64 mesa-libGLU-9.0.0-16.fc29.x86_64 mesa-libglapi-18.2.4- 2.fc29.x86_64 openldap-2.4.46-9.fc29.x86_64 openssl-libs-1.1.1- 3.fc29.x86_64 opus-1.3-1.fc29.x86_64 pcre2-10.32-4.fc29.x86_64 pulseaudio-libs-12.2-1.fc29.x86_64 speex-1.2.0-2.fc29.x86_64 systemd- libs-239-6.git9f3aed1.fc29.x86_64 vo-amrwbenc-0.1.3-8.fc29.x86_64 x264- libs-0.155-2.20180806git0a84d98.fc29.x86_64 x265-libs-2.8-1.fc29.x86_64 zlib-1.2.11-14.fc29.x86_64 zvbi-0.2.35-6.fc29.x86_64 zziplib-0.13.69- 1.fc29.x86_64(gdb) bt#0 0x00007ffff5eb953f in raise () at /lib64/libc.so.6#1 0x00007ffff5ea3895 in abort () at /lib64/libc.so.6#2 0x00005555555e3758 in std::replacement_assert(char const, int, char const, char const*) (file=__file@entry=0x555555951a40 "/usr/include/c++/8/bits/stl_vector.h", erator [with _Tp = unsigned int; _Alloc =edhat- linux/bits/c++config.h:2391#3 0x00005555558a4d24 in std::vector<unsigned int, std::allocator at /usr/include/c++/8/bits/stl_vector.h:930#4 0x00005555558a4d24 in load_collection (strip=false, collection_index=10) at shapes.cpp:804#5 0x00005555558a4d24 in load_collections(bool, bool) (with_progress_bar=with_progress_bar@entry=false, is_opengl=is_opengl@entry=#6 0x00005555558cf438 in create_m1_menu_surfaces() () at images.cpp:1298#7 0x00005555558cf515 in m1_draw_full_screen_pict_resource_from_images (pict_resource_number= 1100) at images.cpp:1376#8 0x00005555558cf515 in draw_full_screen_pict_resource_from_images(int)--Type for more, q to quit, c to continue without paging-- ( pict_resource_number=pict_resource_number@entry=1100) at images.cpp:1391#9 0x00005555557ad74c in display_screen(short) (base_pict_id=) at interface.cpp:2598#10 0x00005555557ad9ba in display_main_menu() () at interface.cpp:1259#11 0x00005555557b1eb5 in idle_game_state(unsigned int) (time=<optimized out>) at interface.cpp:1103#12 0x00005555555cd5c8 in main_event_loop () at shell.cpp:805#13 0x00005555555cd5c8 in main(int, char**) (argc=, argv=) at shell.cpp:346(gdb)

On Mon, 2018-11-19 at 08:16 -0800, orbea wrote:

What are the contents of alephone-marathon.sh?

Are you able to building this yourself with debugging symbols and getting a backtrace with gdb?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c5 5493e4bb","name":"GitHub"},"entity":{"external_key":"github/Aleph- One-Marathon/alephone","title":"Aleph-One- Marathon/alephone","subtitle":"GitHub repository","main_image_url":" https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":" https://github.com/Aleph-One-Marathon/alephone"}},"updates":{"snippets":[{"icon":"PERSON","message":"@orbea in #125: What are the contents of alephone-marathon.sh?\r\n\r\nAre you able to building this yourself with debugging symbols and getting a backtrace with gdb?"}],"action":{"name":"View Issue","url":" https://github.com/Aleph-One-Marathon/alephone/issues/125#issuecomment-439949824 "}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": " https://github.com/Aleph-One-Marathon/alephone/issues/125#issuecomment-439949824 ", "url": " https://github.com/Aleph-One-Marathon/alephone/issues/125#issuecomment-439949824 ", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [Aleph-One-Marathon/alephone] crash after start (#125)", "sections": [ { "text": "", "activityTitle": "orbea", "activityImage": " https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@orbea", "facts": [

] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"Aleph-One- Marathon/alephone\",\n\"issueId\": 125,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"Aleph-One-Marathon/alephone\",\n\"issueId\": 125\n}" }, { "targets": [ { "os": "default", "uri": " https://github.com/Aleph-One-Marathon/alephone/issues/125#issuecomment-439949824 " } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 412972495\n}" } ], "themeColor": "26292E" } ]

orbea commented 6 years ago

Can you please use code tags and newlines for the backtrace? That output is not readable.

If you need help with github markdown please see the Styling with Markdown is supported link below the comments field.

cheese1 commented 6 years ago

gdb.txt attached the output from gdb as file. i could add debugsymbols for additional packages, if needed.

Hopper262 commented 6 years ago

Thanks for the text file, that is more readable.

While I can't replicate this on my FC28 machine, the place where it's crashing creates a zero-length vector and then tries to access the first element of that vector. That's definitely not good. Several places in that function do the same thing, and other functions might also make this mistake.

I'll get a fix checked in soon, and then have you recompile from master to make sure nothing else is wrong. Thanks for the report and the work to get us the info we needed!

cheese1 commented 6 years ago

hi thanks for your patch attached is a new backtrace AFTER applying your patch. i try to start a new game, screen shows the image with "leonardo", turns black and stays black.

cheese1 commented 6 years ago

gdb4.txt

cheese1 commented 5 years ago

any more information needed?

Hopper262 commented 5 years ago

I did manage to replicate the crashes on a machine here. I had to build using:

./configure CXXFLAGS="-D _GLIBCXX_ASSERTIONS"

I'll keep working on the fixes (I've been traveling and haven't had time lately), but in the meantime you might be able to stop crashing by building with:

./configure CXXFLAGS="-U _GLIBCXX_ASSERTIONS"

It's okay to disable these assertions because so far, none of the crash spots would lead to a problem during execution. The assertions fail because Aleph One asks for a pointer that's not safe to use, but Aleph One never uses the pointer it requested. The fixes are just moving checks to before Aleph One asks.

Hopper262 commented 5 years ago

I just completed a short game with the code in current master, so hopefully you will get further too. It's impossible to tell whether all crash locations have been found, so please report any other crashes you see. Thank you!

joepogo commented 5 years ago

Sorry to bump this up, but I wanted to ask a question concerning this here as I think my issue and the OP is related. I recently started working on a port of this and keep running into an error with marathon infinity where you try to open a certain door and it immediately crashes.

After many attempts of failed debugging the crash is coming from a half broken struct "SortedNodes" which is a member of a RenderSortPolyClass (RSPtr). I am guessing that the corruption is taking place somewhere in the creation / update code of the corresponding render objects (linked list), possibly some pointer casting or something.

Has anyone ever had any issues with this happening? Marathon 2 crashes immediately on startup as soon as you spawn and infinity always crashes on the first level when trying to open the same door (I think it is supposed to be jammed) It always locks up there as it crashes when trying to render the ceiling and floor.

Can anyone recommend where in the code I could look for this problematic area? I thought RenderSortPoly.cpp might, maybe the culprit?

Hopper262 commented 5 years ago

@joepogo The OP's crash is due to STL assertions being turned on. What type of crash are you seeing: an STL assertion, a segmentation fault, an infinite loop?

The main render starts with render_view(), in render.cpp:423. The floors and ceilings to draw are managed in RenderVisTree.build_render_tree() (RenderVisTree.cpp:120) and RenderSortPoly.sort_render_tree() (RenderSortPoly.cpp:91). You might start at line 199 of RenderSortPoly.cpp, and see if the polygon index is valid -- it should always be between 0 and 559 for Infinity's first level. Best of luck!

joepogo commented 2 years ago

@Hopper262

Sorry for the necro bump here but i wanted to update on something with this port. I am still trying to trace the crash on my end but i found something extremely odd so far which might help:

When i start marathon 2, it crashes immediately when spawning. If i hit the overhead map though when starting and run straight ahead indoors, it actually will let me play the indoor segments of the map without crashing until it has to render outdoor segments again and then it promptly crashes again.

So it seems when it has to render outdoor segments something is causing it to crash.

Anywhere i can look in the code as to why the outdoor segments are doing this? It really makes no sense at all.....

treellama commented 2 years ago

Are you running with OpenGL on? Have you tried software mode? You might drop by the Discord or IRC for more real time support...instead of an issue tracker :)

joepogo commented 2 years ago

Hey @treellama!. Thank you for the response! Can you direct me as to where i can go to try to speak with someone? :)

treellama commented 2 years ago

https://discord.gg/c7rEVgY or #alephone on Libera.chat (although the latter is very empty)

joepogo commented 2 years ago

Thanks @treellama for the responses! Instead of clogging up the issues tracker i did have one last question for you on this thread. I think i am getting somewhere with my troubleshooting, but am having a hard time locating the skybox rendering code, i think this is where the port is having it's issues,

I want to run a test where i run the game with the sxybox rendering disabled, do you know where that code in particular is?

Thanks again and i'll look to the IRC chat here shortly after i test this out.

treellama commented 2 years ago

There is no skybox in Marathon. Landscapes are rendered as wall or ceiling textures.

joepogo commented 2 years ago

Apologies and thank you for the clarification! I guess that would explain why i cannot find it. :P

Please excuse my noobness as I'm still learning as i go with all of this.

The crashing seems to be related to that particular area when being rendered. It seems to not mind indoors at all though which is odd. Which is why i want to test there first.

So if i wanted to disable the sky (outdoor areas)to run my test i would need to disable ceiling textures i presume?

And thanks again for responding here, i am at work and cannot hop on any chat at the moment. :P

joepogo commented 2 years ago

@treellama I meant to mention you to the above post just in case you didn't see it.