RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    ES crashing on launch - "terminate called after throwing an instance of 'std::out_of_range'"

    Scheduled Pinned Locked Moved Help and Support
    es crashed
    8 Posts 4 Posters 2.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      New2pi
      last edited by

      Luckily I had SSH enabled so I can boot to terminal. I did that then disabled auto launch of ES and also try to troubleshoot.

      That said I can't figure out the root cause yet. I'm new to PI and Linux for the matter.

      Here is the full error message immediately following the starting of ES from the terminal. The ES logo screen does come up and stays for about 5 seconds.

      pi@retropie:~/RetroPie-Setup $ emulationstation
      terminate called after throwing an instance of 'std::out_of_range'
      what(): basic_string::substr: __pos (which is 30) > this->size() (which is 11)
      Aborted

      What I've tried:
      -I do utilize a USB drive but have disabled that for now thinking it may be the issue but the error remains the same.

      • I have tried fully uninstalling all core packages and reinstalling from binary.
      • I also removed all the extra drivers like control block.
      • I ran the take roms ownership script
      • I probably did a a dozen other things that were variations from the above and generally went hunting around for additional options.

      Where do I find more logs on the crash or how to look at any ES config files to see if there's some UI option that's bad? Anyone have any thoughts or ideas in general?

      N 1 Reply Last reply Reply Quote 0
      • N
        New2pi @New2pi
        last edited by

        Sorry — Just found this post. I will try this once I research where that config option is from the terminal and report back.

        I was messing with UI options for collections so this seems like a plausible cause and being a setting I tripped over and tinkered with without remembering that I did it.

        UI GAMELIST OPTION

        1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator
          last edited by

          Looks like a bad gamelist file and not a configuration file problem. Please fill in the information requested in https://retropie.org.uk/forum/topic/3/read-this-first.

          1 Reply Last reply Reply Quote 0
          • N
            New2pi
            last edited by

            Thank you @mitu

            It was in fact the ParseGamelistOnly option that caused the problem, similar to the post I linked to above.

            I was able to SSH into the terminal and then went to the hidden .emulationstation folder. There I edited the es_settings.cfg and changed the parsegamelistonly option back to false, then did a reboot.

            What is the best way to rebuild gamelist files? Is there any command?

            Pi Model or other hardware: B+
            Power Supply used: 2.5A part of the following case Miuzei Raspberry Pi 3B+ Case with Fan and Heat Sinks, 5V 2.5A Power Supply, Compatible with Raspberry 3 Model B+, Pi 3 Model B
            RetroPie Version Used: 4.4.2
            Built From: retropie-4.4-rpi2_rpi3.img.gz
            Error messages received:
            terminate called after throwing an instance of 'std::out_of_range'
            what(): basic_string::substr: __pos (which is 30) > this->size() (which is 11)
            Aborted

            How to replicate the problem:
            turn on parsegameslistonly then did a scrape from terminal

            KN4THXK mituM 2 Replies Last reply Reply Quote 0
            • KN4THXK
              KN4THX @New2pi
              last edited by

              @new2pi I don't know any fancy way but you can re-scrape all systems and it builds the gamelist pretty quickly since all of the files are already downloaded.

              "If you're gonna play the Game Boy, You gotta learn to play it right" - https://www.youtube.com/watch?v=FYLGl92ETNQ

              1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @New2pi
                last edited by mitu

                @new2pi said in ES crashing on launch - "terminate called after throwing an instance of 'std::out_of_range'":

                What is the best way to rebuild gamelist files? Is there any command?

                That's easy, remove/rename the gamelist.xml files. ES will rebuild it, but any scraped information will be lost. Or you can find out which gamelist is at fault (look in ~/.emulationstation/es_log.txt and try to guess which gamelist is read when the crash occurs) and then find out what's causing this. My guess is that there's a corrupted .xml file somewhere.

                The problem is one of your gamelists, not the option you turned off. I can't replicate the problem with a 4.4 installation.

                N 1 Reply Last reply Reply Quote 0
                • W
                  wiggy808
                  last edited by

                  @New2pi couple of thoughts. The scraping is done by the internal scraper on ES which references thegamesdb for all of its information gathering when its looking at your roms. If you're looking for an alternative / external scraper, you can use somethign like "Skraper" which is one I'm becoming quickly fond of but thats a 3rd party tool and you'll have to learn that one on your own.

                  As far as gamelist.xml issues, I just had an issue with scraping and gamelist files just this week and it all boils down to the gamelist.xml and how it was created and if it is done correctly. Your version of RetroPie has two locations for gamelist.xml files:

                  /home/pi/.emulationstation/gamelists/<console>
                  and
                  /home/pi/RetroPie/roms/<console>

                  The one in .emulationstation is read first I believe, so if you have two of them, check that one first and make sure the paths are correct for your roms, images, videos, etc.

                  1 Reply Last reply Reply Quote 0
                  • N
                    New2pi @mitu
                    last edited by

                    @mitu Thank you, that was correct, es_log.txt showed me where the issues were and so I could target the rescrape better.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                    Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.