Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation Fault #4

Open
anshdavid opened this issue Jan 29, 2022 · 9 comments
Open

Segmentation Fault #4

anshdavid opened this issue Jan 29, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@anshdavid
Copy link

Unable to start torcs after copying configurations file to correctly set up torcs for vision

@anshdavid anshdavid reopened this Jan 30, 2022
@anshdavid
Copy link
Author

anshdavid commented Jan 30, 2022

Running the docker container with arguments causes a segmentation fault.

-v $(TORCSPATH)/torcs/configs/config:/usr/local/share/games/torcs/config:ro \
-v $(TORCSPATH)/torcs/configs/drivers/scr_server/scr_server.xml:/usr/local/share/games/torcs/drivers/scr_server/scr_server.xml:ro \
-v $(TORCSPATH)/torcs/configs/drivers/scr_server/0:/usr/local/share/games/torcs/drivers/scr_server/0:ro \
Saving /root/.torcs/config/raceengine.xml to /root/.torcs/config/raceengine.xml.old
Saving /root/.torcs/config/style.xsl to /root/.torcs/config/style.xsl.old
Saving /root/.torcs/config/screen.xml to /root/.torcs/config/screen.xml.old
Saving /root/.torcs/config/graph.xml to /root/.torcs/config/graph.xml.old
Saving /root/.torcs/config/sound.xml to /root/.torcs/config/sound.xml.old
Saving /root/.torcs/config/raceman/champ.xml to /root/.torcs/config/raceman/champ.xml.old
Saving /root/.torcs/config/raceman/dtmrace.xml to /root/.torcs/config/raceman/dtmrace.xml.old
Saving /root/.torcs/config/raceman/endrace.xml to /root/.torcs/config/raceman/endrace.xml.old
Saving /root/.torcs/config/raceman/ncrace.xml to /root/.torcs/config/raceman/ncrace.xml.old
Saving /root/.torcs/config/raceman/practice.xml to /root/.torcs/config/raceman/practice.xml.old
Saving /root/.torcs/config/raceman/quickrace.xml to /root/.torcs/config/raceman/quickrace.xml.old

********** Memory sharing started, attached at 9B320000 **********
 
Visual Properties Report
------------------------
Compatibility mode, properties unknown.
/usr/local/bin/torcs: line 53:    54 Segmentation fault      (core dumped) $LIBDIR/torcs-bin -l $LOCAL_CONF -L $LIBDIR -D $DATADIR $*

@anshdavid
Copy link
Author

I created a fresh build and ran torcs inside a docker container, it is working fine. But when I try to copy/mount ur config and driver settings I get a Segmentation Fault

@anshdavid
Copy link
Author

anshdavid commented Jan 31, 2022

I was able to resolve the error by copying /usr/local/share/games/torcs from your docker image and replacing the files in the configs folder from your repository.

Hope this helps you update your repository and resolve this issue

@gerkone
Copy link
Owner

gerkone commented Jan 31, 2022

Hey, sorry for the slow reply. The seg fault is caused by torcs trying to access a file that does not exist.
I will look into this, I have an idea of why this is happening. I think it's a directory error that went unnoticed on my side.
Thanks

@gerkone gerkone reopened this Jan 31, 2022
@gerkone gerkone added the bug Something isn't working label Jan 31, 2022
gerkone pushed a commit that referenced this issue Jan 31, 2022
@gerkone
Copy link
Owner

gerkone commented Jan 31, 2022

So before the volumes were mounted to the container based on the current working directory (with os.getcwd()). With the last commit I tried to make the volume mount independent from the current directory.

Because I am currently unable to test if everything works as intended I pushed on this branch Could you please check?

@anshdavid
Copy link
Author

Sure, i'll check it and get back to you

@anshdavid
Copy link
Author

Still get the same error the cofigs folder provided in your directory.

Saving /root/.torcs/config/raceengine.xml to /root/.torcs/config/raceengine.xml.old
Saving /root/.torcs/config/style.xsl to /root/.torcs/config/style.xsl.old
Saving /root/.torcs/config/screen.xml to /root/.torcs/config/screen.xml.old
Saving /root/.torcs/config/graph.xml to /root/.torcs/config/graph.xml.old
Saving /root/.torcs/config/sound.xml to /root/.torcs/config/sound.xml.old
Saving /root/.torcs/config/raceman/champ.xml to /root/.torcs/config/raceman/champ.xml.old
Saving /root/.torcs/config/raceman/dtmrace.xml to /root/.torcs/config/raceman/dtmrace.xml.old
Saving /root/.torcs/config/raceman/endrace.xml to /root/.torcs/config/raceman/endrace.xml.old
Saving /root/.torcs/config/raceman/ncrace.xml to /root/.torcs/config/raceman/ncrace.xml.old
Saving /root/.torcs/config/raceman/practice.xml to /root/.torcs/config/raceman/practice.xml.old
Saving /root/.torcs/config/raceman/quickrace.xml to /root/.torcs/config/raceman/quickrace.xml.old

********** Memory sharing started, attached at 735BC000 **********
 
Visual Properties Report
------------------------
Compatibility mode, properties unknown.
/usr/local/bin/torcs: line 53:    57 Segmentation fault      (core dumped) $LIBDIR/torcs-bin -l $LOCAL_CONF -L $LIBDIR -D $DATADIR $*

Running the container with the configs files I copied from your docker image work perfectly.

@gerkone
Copy link
Owner

gerkone commented Feb 1, 2022

Thanks for checking, this is weird though. You said that you run the container with the volumes

-v $(TORCSPATH)/torcs/configs/config:/usr/local/share/games/torcs/config:ro \
-v $(TORCSPATH)/torcs/configs/drivers/scr_server/scr_server.xml:/usr/local/share/games/torcs/drivers/scr_server/scr_server.xml:ro \
-v $(TORCSPATH)/torcs/configs/drivers/scr_server/0:/usr/local/share/games/torcs/drivers/scr_server/0:ro \

Are you sure that $(TORCSPATH) is correctly leading to the torcs directory? Could you also check that the configs you are mounting are correct?

Another thing you could try is see where it is failing (just to be sure it's a missing config, but I am pretty certain that is the cause). Run torcs with the -d flag to run in within gdb. You would need to install gdb on the container to do that though.

I am sorry but as of now I cannot properly support and help this issue, or update and cleanup this repository as I would want.

@anshdavid
Copy link
Author

Yes, its working fine for me after I copied the config folder from inside the docker image and replaced the configs folder present in your repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants