OS: GNU/Linux
Kernel-release: 4.10.9-gnu-1
Hi guys! When I launch OpenRCT2 on linux I get these two errors:
WARNING(/usr/local/games/OpenRCT2/src/openrct2/platform/posix.c:807 (platform_get_locale_date_format)]: Function platform_get_locale_date_format at /usr/local/games/OpenRCT2/src/openrct2/platform/posix.c:807 is a stub.
openrct2: /usr/local/games/OpenRCT2/src/openrct2/util/util.c.314: safe_strcpy: Assertion `source != NULL' failed.
Aborted (core dumped)
I looked into the /usr/local/games/OpenRCT2/src/openrct2/platform/posix.c file and I saw this code for the platform_get_locale_date_format function
unit8 platform_get_locale_date_format ()
{
STUB();
return DATE_FORMAT_DAY_MONTH_YEAR;
}
What is this STUB function? And is there a way I can fix this from the editing the code in the /usr/local/games/OpenRCT2/src/openrct2/platform/posix.c file or should I do something with the locale on my linux box?
For the second error I also looked into the code of the file located at /usr/local/games/OpenRCT2/src/openrct2/util/util.c. What is the source? I noticed I do not get this error when I don't specify a game_path in the ~/.config/OpenRCT2/config.ini file. Maybe I am setting up that wrong.
Thanks!
STUB() is our custom macro to label some implementation as incomplete. You're welcome to provide real implementation. See https://github.com/OpenRCT2/OpenRCT2/pull/5349
The assertion you hit is a bug, though. Please compile a debug version (cmake ../ -DCMAKE_BUILD_TYPE=debug), launch it in a debugger (gdb ./openrct2) and when it crashes, provide full stack trace (bt full).
Not everyone can compile openrct2 themselves. Maybe provide an hyperlink to a page with more specific instructions? You can't just throw someone in a pit with some water and expect them to manage to climb out of it, if you know what I mean. (The more difficult and incomplete your instructions are, the less likely people will follow these instructions and help you developers). You can't expect people to know how to rebase an issue or compiling the game themselves.
@mrtnptrs Why don't you do us all a favour and stop sticking your nose into everything? You hardly contribute anything except commenting and up/downvoting.
This guy has been looking into the source and knows about kernel versions. It's not a stretch to think he can compile.
@Gymnasiast I know what you mean and I get it. I won't comment anymore unless it's really usefull for the issue itself (Not that I make many comments :P). (and maybe the comment from an hour ago sounded a bit harsh. Wasn't meant to sound that way.)
@janisozaur I compiled a debug build like you said and I used gdb on the new debug openrct2 file. Using "bt full" returned "No stack."
Here is some extra information on the original bug post that I didn't think migth have mattered. Originally I compiled it with DCMAKE_BUILD_TYPE=RELWITHDEBINFO
In gdb, have you actually started it? With run
@janisozaur Yeah that was my result in gdb. I did some reasrch and ended up finding out how to open the latest code dump in gdb with coredumpctl. I made a log file called openrct2coredump.txt with this command
coredumpctl gdb |& tee openrct2coredump.txt
Inside gdb I used bt full. Here is the output of that:
Reading symbols from /usr/local/games/OpenRCT2/debugbuild/openrct2...done.
[New LWP 10930]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/usr/local/games/OpenRCT2/debugbuild/openrct2'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007fe3531d9a10 in raise () from /usr/lib/libc.so.6
(gdb) bt full
#0 0x00007fe3531d9a10 in raise () from /usr/lib/libc.so.6
No symbol table info available.
#1 0x00007fe3531db13a in abort () from /usr/lib/libc.so.6
No symbol table info available.
#2 0x00007fe3531d2607 in __assert_fail_base () from /usr/lib/libc.so.6
No symbol table info available.
#3 0x00007fe3531d26b2 in __assert_fail () from /usr/lib/libc.so.6
No symbol table info available.
#4 0x000000000086847b in safe_strcpy (destination=0xdc2ec9 <CurrencyDescriptors+457> "Ctm",
source=0x0, size=8) at /usr/local/games/OpenRCT2/src/openrct2/util/util.c:314
__PRETTY_FUNCTION__ = "safe_strcpy"
result = 0x7ffed9e15be0 ""
truncated = false
sourceLimit = 0x7ffed9e15bf0 "/home/arthur/.config/OpenRCT2/config.ini"
ch = 0x28 <error: Cannot access memory at address 0x28>
codepoint = 0
__func__ = "safe_strcpy"
#5 0x000000000053ceb1 in currency_load_custom_currency_config ()
at /usr/local/games/OpenRCT2/src/openrct2/localisation/currency.c:46
No locals.
#6 0x000000000090f180 in config_open_default ()
at /usr/local/games/OpenRCT2/src/openrct2/config/Config.cpp:656
path =
"/home/arthur/.config/OpenRCT2/config.ini\000\024\251\002\000\000\000\000`\\\341\331\376\177\000\000\020\"Q\000\000\000\000\000\320c\341\331\376\177", '\000' <repeats 18 times>, "\227\217\221\000\000\000\000\000`\\\341\331\376\177\000\000\320\024\251\002\000\000\000\000\200\\\341\331\376\177\000\000\206\024\221\000\000\000\000\000\320\024\251\002\000\000\000\000\320\\\341\331\376\177\000\000\300\\\341\331\376\177\000\000\275\017\221\000\000\000\000\000height_b\320\\\341\331\376\177\000\000\300\\\341\331\376\177\000\000\320\\\341\331\376\177\000\000\320\024\251\002\000\000\000\000"...
#7 0x00000000008f96eb in OpenRCT2::SetupEnvironment ()
at /usr/local/games/OpenRCT2/src/openrct2/OpenRCT2.cpp:376
userPath = "/home/arthur/.config/OpenRCT2/\000\000\001", '\000' <repeats 15 times>, "\060KTS\343\177\000\000\360P,V\343\177\000\000\060KTS\343\177\000\000\020\033\334\000\000\000\000\000\020\"Q\000\000\000\000\000\320c\341\331\376\177", '\000' <repeats 18 times>, "\240a\341\331\376\177\000\000\250`\341\331\376\177\000\000\363F\261\000\000\000\000\000\000\000\000\000\001\000\000\000\001\b\000\000\000\000\000\000\020\200\002T\343\177\000\000`a\341\331\376\177\000\000\317l\vV\343\177", '\000' <repeats 11 times>, "\377\000\000\000\000\000\000\377\377\377\377\377\377\377\377"...
path = "\324^\341\331\000\000\000\000\240_\341\331\376\177\000\000(\024*V", '\000' <repeats 12 times>, "\070u\003T\000\000\000\000HT,V\343\177\000\000 `\341\331\376\177\000\000\000\000\000\000\000\000\000\000\001", '\000' <repeats 15 times>, "H`\341\331\376\177\000\000\341\254\nV\343\177\000\000\r", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001\000\000\000\000\000\000\000\360P,V\343\177\000\000\001", '\000' <repeats 23 times>, "HT,V\343\177\000\000\220_\341\331\376\177\000\000.\000\000\000\001\000\000\000\360P,V\343\177\000\000"...
basePaths = {"",
"EVP_MD_CTX_create\000EVP_PKEY_set1_RSA\000libcrypto.so.1.0.0\000EVP_PKEY_keygen\000PEM_write_bio_RSAPrivateKey\000PEM_write_bio_RSAPublicKey\000RSA_check_key\000EVP_DigestVerifyFinal\000EVP_PKEY_get1_RSA\000EVP_DigestVerifyInit"..., <error: Cannot access memory at address 0x2139c58>, ""}
env = 0x512210 <_start>
#8 0x00000000008f8faf in openrct2_initialise ()
at /usr/local/games/OpenRCT2/src/openrct2/OpenRCT2.cpp:123
__func__ = "openrct2_initialise"
objRepo = 0xe7241bc1c465ba00
tdRepo = 0x1
scenarioRepo = 0x0
#9 0x00000000008f91f2 in openrct2_launch () at /usr/local/games/OpenRCT2/src/openrct2/OpenRCT2.cpp:206
No locals.
#10 0x0000000000578da6 in main (argc=1, argv=0x7ffed9e163d8)
at /usr/local/games/OpenRCT2/src/openrct2/platform/posix.c:60
run_game = 1
I also found the process ID of that core dump and used coredumpctl to output the info on it.
PID: 10930 (openrct2)
Signal: 6 (ABRT)
Timestamp: Fri 2017-04-21 19:38:16 GMT (1h 9min ago)
Command Line: /usr/local/games/OpenRCT2/debugbuild/openrct2
Stack trace of thread 10930:
#0 0x00007fe3531d9a10 raise (libc.so.6)
#1 0x00007fe3531db13a abort (libc.so.6)
#2 0x00007fe3531d2607 __assert_fail_base (libc.so.6)
#3 0x00007fe3531d26b2 __assert_fail (libc.so.6)
#4 0x000000000086847b safe_strcpy (openrct2)
#5 0x000000000053ceb1 currency_load_custom_currency_config (openrct2)
#6 0x000000000090f180 config_open_default (openrct2)
#7 0x00000000008f96eb _ZN8OpenRCT216SetupEnvironmentEv (openrct2)
#8 0x00000000008f8faf openrct2_initialise (openrct2)
#9 0x00000000008f91f2 openrct2_launch (openrct2)
#10 0x0000000000578da6 main (openrct2)
#11 0x00007fe3531c6511 __libc_start_main (libc.so.6)
#12 0x000000000051223a _start (openrct2)
I hope these logs would be helpful to anyone. I'll try to read them too but I'm kind of new to doing this sort of thing so I might not get very far.
OK, this should be good enough, I'll fix it later on.
@drjb4n4n4z can you post your ~/.config/OpenRCT2/config.ini?
and output of your locale as well
@janisozaur The output of locale is:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_INDENTIFICATION="en_US.UTF-8"
LC_ALL=
@janisozaur I don't really know how to do the config.ini file (I want to learn how to do it though). This is what that file ~/.config/OpenRCT2/config.ini looks like:
game_path=/usr/local/games/RCT2OriginalFiles/app
/usr/local/games/RCT2OriginalFiles is the location where I keep the original RCT2 files I extracted with innoextract from the setup_rollercoaster_tycoon2_2.0.0.6.exe file I got from gog. I pointed the game_path to the app directory because that is where the Data, ObjData, and Scenario directories are located. If I made the path the parent directory, would OpenRCT2 search the subdirectories for the files? Thanks for your help!
You shouldn't have to create config.ini manually, we have hooks to zenity and kdialog to ask for the path, but other than that, all the parts in the config file should be populated automatically.
The path sounds correct according to your description.
@drjb4n4n4z this should be fixed now.