pspdev / psp-packages

https://pspdev.github.io/psp-packages/
The Unlicense
23 stars 13 forks source link

Jsoncpp Crashes on linking #51

Closed KorigamiK closed 1 year ago

KorigamiK commented 1 year ago

The jsoncpp library make the application crash on load. The application builds but doesn't run. I'm not able to find debug messages either.

What could be the fix?

sharkwouter commented 1 year ago

Thanks for reporting. Is this on real hardware or on PPSSPP? I have seen crashes on the latter.

KorigamiK commented 1 year ago

Thanks for reporting. Is this on real hardware or on PPSSPP? I have seen crashes on the latter.

This was PPSSPP. I'll get back to you as I check on the actual actual hardware.

KorigamiK commented 1 year ago

So I checked the app on my psp and the same issue is present. The app instantly crashes on start. There's not even any exception shown in psplink.

sharkwouter commented 1 year ago

Thanks for testing, I'll look into it.

sharkwouter commented 1 year ago

I am able to reproduce this.

KorigamiK commented 1 year ago

I am able to reproduce this.

Thanks for confirming. I was afraid I built the libraries wrongly. Please update if you are able to pinpoint the error.

sharkwouter commented 1 year ago

I'm having a bit of a hard time figuring this one out. I'm trying to debug it, but gdb is giving me a strange error. I don't know if this means gdb is broken or that this is showing the actual problem:

wouterwijsman@XPS13:~/Sources/hello-json-cpp$ psp-gdb ./hello_world
GNU gdb (GDB) 11.0.50.20210718-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=psp".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./hello_world...
(gdb) target remote :10001
Remote debugging using :10001
_start (args=0, argp=0x0) at crt0_prx.c:102
102    crt0_prx.c: No such file or directory.
(gdb) bt
#0  _start (args=0, argp=0x0) at crt0_prx.c:102

I'm using this project for testing: https://github.com/sharkwouter/hello-json-cpp

KorigamiK commented 1 year ago

Just to confirm, you're running this over in psplink right?

sharkwouter commented 1 year ago

Yes, you run debug ./hello_world.prx in pspsh and then I do the above.

sharkwouter commented 1 year ago

Is this still the case? I saw you use jsoncpp in one of your projects. Did you do anything specific to get it working?

KorigamiK commented 1 year ago

I believe this is still the case.

The compilation finishes with no issues, but the app crashes if there's any call to the Json namespace, so I don't define any usage of this library when building for the PSP.

I would like to test this with an older SDK version since the package you created must have worked at that specific time. This might be worth investigating.

sharkwouter commented 1 year ago

Last time I tested this, this was not always the case. I'm not sure what makes it so at all. Perhaps the coming newlib changes would improve this.

bucanero commented 1 year ago

A bit unrelated, but for JSON parsing, on PS4 homebrews I've been using this cJSON library: https://github.com/DaveGamble/cJSON

I can try to port this simple ANSI C library to pspsdk, at least to offer a working alternative to JSON parsing while we fix this Jsoncpp. (also useful for anyone who doesn't want to use C++)

sharkwouter commented 1 year ago

Actually, this was fixed. Cjson should work as well, though. Would be cool to have a port of it.