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

Lots of defect fixes #1262

Merged
merged 4 commits into from Nov 11, 2015
Merged

Lots of defect fixes #1262

merged 4 commits into from Nov 11, 2015

Conversation

tambry
Copy link
Contributor

@tambry tambry commented Oct 17, 2015

Includes a few memory corruption bugs fixed, added initialization for a couple variables, fixed some flow control problems and added error checks and error logging to a lot of places.

HDD functions now also return a negative version, if they fail seeking. Didn't add any checks for when they're actually used, but if we'd want to be more or less correct, we should check for errors from those functions in the future.

@@ -19,7 +19,7 @@ void vfsHDDManager::CreateEntry(vfsHDD_Entry& entry)
CreateBlock(entry);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have an enum with error code and use it? Would make code easier to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vlj Sounds like it would make sense. I'll also make some return codes for the virtual memory helper functions.

@Ekaseo
Copy link

Ekaseo commented Oct 17, 2015

im not sure, but it looks like this PR will break the arkedo series games (they will reach the menu, but wont go ingame)

@vlj
Copy link
Contributor

vlj commented Oct 18, 2015

Why?

@danilaml
Copy link
Contributor

@Ekaseo is there any new errors in the log? maybe before it was failing silently for some reason.

@tambry tambry mentioned this pull request Oct 28, 2015
@vlj
Copy link
Contributor

vlj commented Oct 28, 2015

Is there any progress on this ?

@tambry
Copy link
Contributor Author

tambry commented Oct 29, 2015

@vlj It's rebased and ready for merge, from my point of view. Though, if there's any problems, I'd be happy to fix them.

@danilaml
Copy link
Contributor

Is it ready for merging, @Nekotekina , or there is still something left?

@Ekaseo
Copy link

Ekaseo commented Oct 31, 2015

its been a while since i tested some builds, but unfortunately, nothing except a few samples work right now... do you ppl even test the stuff before merging it? (its not this PR that broke almost everything, it was something merged before...) for me, only cube samples work right now, everything else has an acess violation. If its only a problem with my pc, i will include some log files.

@tambry
Copy link
Contributor Author

tambry commented Oct 31, 2015

@Ekaseo Same situation here. Almost everything dies with an access violation, except some of the most simple samples.

@Nekotekina
Copy link
Member

What PR caused it?

@tambry
Copy link
Contributor Author

tambry commented Oct 31, 2015

@Nekotekina #1274 seems to have broken almost everything.

So, it's most likely either c025520 or f842c20.

@vlj
Copy link
Contributor

vlj commented Oct 31, 2015

Which backend?
I often test samples like vertex attributes, dice and primitive to test my dx12 pr, I didn't have access violation with them.

@danilaml
Copy link
Contributor

@Ekaseo some men just want to watch the world burn 🔥 : #1245
😄

@danilaml
Copy link
Contributor

@Ekaseo Also, don't forget to provide your settings. For example dx12 crashes if write color/depth buffer is enabled while oGL needs it to display many things correctly.

@tambry
Copy link
Contributor Author

tambry commented Oct 31, 2015

@vlj
After merge of #1274, with the following settings:
http://puu.sh/l4qWH/96a32ba0aa.png and http://puu.sh/l4qZo/aecbecc249.png
ARKEDO SERIES - 02 SWAP! (NPEB00614) doesn't work

But on #1272, with the almost EXACTLY same settings (excluding the frame limiter, oops :P):
http://puu.sh/l4reZ/cfe97e57e1.png and http://puu.sh/l4rfd/208ba8df97.png
ARKEDO SERIES - 02 SWAP! (NPEB00614) works

@Ekaseo
Copy link

Ekaseo commented Oct 31, 2015

i use opengl and i use basic settings. i dont have anything special enabled, not even color/depth buffers. i mostly use the lowest resolution. i have vsynch one + framelimiter on auto. null on audio, have camera disabled, im using the default folder paths. I guess opengl has no support now compared to dx12.

@tambry
Copy link
Contributor Author

tambry commented Oct 31, 2015

@Ekaseo Well, OpenGL does seem to be a bit of a mess. But I encounter the same errors with DX12.

@vlj
Copy link
Contributor

vlj commented Oct 31, 2015

I'm intending to factor code between dx12 and GL very soon so that GL backend benefits from the work puts in dx12.

@vlj
Copy link
Contributor

vlj commented Oct 31, 2015

tambry, I use default configuration in miscalleous parameters.
Per game config is completly broken now.

@tambry
Copy link
Contributor Author

tambry commented Oct 31, 2015

@vlj I wasn't even aware of per game config now existing. Looks cool though. According to settings though, I do use the default configuration. (http://puu.sh/l4vDi/548f759efc.png)

@vlj
Copy link
Contributor

vlj commented Nov 1, 2015

Still no merge ?

@Nekotekina
Copy link
Member

It's conceptually bloating and introduces some errors.

Most of those functions results are assumed to be "OK" and typing so much unique code to "report" an error and increasing complexity returning various error codes... I don't like it. I would use CHECK_ASSERTION macro for them (it's unrelated to assert and always compiled).

@@ -15,27 +16,30 @@ namespace memory_helper
void* reserve_memory(size_t size)
{
#ifdef _WIN32
return VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_NOACCESS);
void* ret = VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_NOACCESS);
CHECK_ASSERTION(ret == NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHECK_ASSERTION accepts "right" condition, in your code it's inverted everywhere.
Plus many return conditions are actually wrong.

@tambry
Copy link
Contributor Author

tambry commented Nov 4, 2015

@Nekotekina Should be fixed now. If there are any other issues, please let me know.

@Nekotekina
Copy link
Member

You compare unsigned values which cannot be < 0

@tambry
Copy link
Contributor Author

tambry commented Nov 8, 2015

@Nekotekina Seems like most of those comparisons were introduced by function return type being unsigned, while the return values were negative. I have fixed those return types in a few places and also added the CHECK_ASSERTION in a few more places.

Are there any issues left?

@Nekotekina
Copy link
Member

Who asked you to change return type?
http://stackoverflow.com/questions/2711522/what-happens-if-i-assign-a-negative-value-to-an-unsigned-variable

CHECK_ASSERTION(x.seek(...) != -1);

Much better and always works.

memcpy(npdrm_key, klicensee_key, 0x10);
// FIXME: Check is always false.
/*if (klicensee_key != NULL)
memcpy(npdrm_key, klicensee_key, 0x10);*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just don't touch it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nekotekina What do you mean? This check is always false, thus I commented it and added a "FIXME" note. If you want me to uncomment me it, I can do that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It better be kept commented (though it could use // comments) with remark. If we keep it the old way everyone will forget about what this check intended to do.
Maybe more elaborate comment would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danilaml Should be better now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tambry how?

{
return -1;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is fixed correctly on my branch.

Also fix some Seek methods return types being unsigned, while returning
negative errors.

Added the CHECK_ASSERTION macro checks in a couple more places.

Simplified CHECK_ASSERTION macro usage.
It can be enabled in options, under C/C++ -> Editor. It's experimental,
but should be faster. It will be introduced in Update 1.
@tambry
Copy link
Contributor Author

tambry commented Nov 11, 2015

@Nekotekina Are there any other issues blocking this from being merged?

Nekotekina added a commit that referenced this pull request Nov 11, 2015
@Nekotekina Nekotekina merged commit 231f322 into RPCS3:master Nov 11, 2015
@tambry tambry deleted the frog branch November 12, 2015 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants