Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
45 user(s) are online (33 user(s) are browsing Forums)

Members: 0
Guests: 45

more...

Headlines

 
  Register To Post
« 1 ... 9 10 11 (12)

Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@kas1e

Thank you...seems i missed your answer.


@all


I do have another oddity coming up.

In a very special case (see below) i can make the ASL file requester (called from within scummvm) display random characters in the path section, see here:
Resized Image

I also had
RO[Y:7ðRÖð(sâ Y:6Y:6°|ÕH
and
]Ž(_ð`°d __°}øÈ
in two other tests...so completely random.

I don't know if this is a bug in string.gadget, input.gadget, whatever.gadget, ASL itself or maybe coming from an uninitialized ASL window within the scummvm impolementation?

So if anyone wants to shed some light...especially OS4 betatesters as i remember some similar input.gadget problem which has been fixed in beta (iirc) in the meantime

Here is the rudimentary binary (only the exe with no engines)...simply start it from anywhere and click on "Add Game" to bring up the requester. (Available 21 days from today on)
http://www.fileconvoy.com/dfl.php?id= ... 000436932ae4509a990a2b831

and here one would look if one wants to check out the ASL implementation in scummvm.
https://github.com/scummvm/scummvm/tre ... /backends/dialogs/amigaos

TIA for any pointers

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
Visually it looks like memory trashing or missing null termination, i.e. random memory stuff. Can come from everywhere ..

Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@kas1e

I wouldn't want to go as far as saying it comes from *anywhere*.
It's either ASL or ScummVM and i'm suspecting something.

Take a look at lines 56-58 from https://github.com/scummvm/scummvm/tre ... /backends/dialogs/amigaos
if (ConfMan.hasKey("browser_lastpath")) {
            
strncpy(pathBufferConfMan.get("browser_lastpath").c_str(), sizeof(pathBuffer) - 1);
        }

If i understand that correctly it will *read* the browser_lastpath variable (if found?) and add it as a default path to the ASL path input field in line 68, correct?
strncpy(pathBufferfr->fr_Drawersizeof(pathBuffer));

If that is correct then, in this special scenario, there is no browser_lastpath variable set (because we are missing the scummvm.ini file that normally provides it)

So, it should not find/use that variable...but it seems it still does...or it's not using it, fails to set a default path and still continues to read random memory...maybe because of the pathBuffer not being initialized?

Now to know how to set a default pathBuffer...any ideas?
Is it sufficient to do something like this:
pathBuffer 'SYS:';

in line 53?

Thank you

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@Raziel
Cold you try changing line 57 to this?
It could be that the source value it tries to copy into pathbuffer is broken?

strncpy(pathBuffer, "SYS:",4);

X5000
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@Raziel

strncpy(pathBuffer, fr->fr_Drawer, sizeof(pathBuffer));

maybe change to:

strncpy(pathBuffer, fr->fr_Drawer ? fr->fr_Drawer : "", sizeof(pathBuffer));

in case fr_Drawer is NULL, or maybe fr is NULL.

how is pathBuffer allocated.

https://linux.die.net/man/3/strncpy

if buffer overruns strncpy can result in none terminated string , becareful with this one. I never use it..

i use snprintf(pathBuffer,sizeof(pathBuffer),"%s",fr->fr_Drawer ? fr->fr_Drawer : "");

Or better yet try to predirct the final string size and allocate it, insted of guessing.

you can try filling pathBuffer with 'a' and see what it does, maybe there is a bug in strncpy.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@Antique

Thats what i'm suspecting...i'll try and see if that is the culprit.

Thanks

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@LiveForIt

Thank you, i'll try your suggestions, but i rather not drop the browser_lastpath functionality.

I guess i'll have to try and fix it from where it comes in the code (IF it is the culprit)

Thank you for the suggestions

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@all

Both didn't work unfortunately.

The sys: solution triggers a warning about about cutting off before nullptr was read or something like that and the adapted strncpy line didn't fix it either.

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@Raziel

what if you change:

strncpy(pathBuffer, "SYS:",4);

to:

strncpy(pathBuffer, "SYS:",5);

Can be useful do alot of printf and see whats going on.


Edited by LiveForIt on 2022/6/24 22:54:46
(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@Raziel
char *strncpy(char *dest, const char *src, size_t n)

Have you tried to read out the 2 strings? To see what they contain?
printf("pathBuffer=%s",pathBuffer);

Or just try strcpy(pathBuffer, "SYS:");

X5000
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@Antique
@Liveforit

I'll try, thanks.

Problem is that printf didn't show anything.
Looks like I need to use scummvm's own debug command.

Not at home, so will take some time

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@Raziel

what c lib are you using? newlib, clib, clib2?

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Just popping in
Just popping in


See User information
@Raziel
if it is a missing NULL termination

then there are two solutions maybe
(btw. this seems to be a scummvm implemented function so might
work differently regarding null-termination)

since you are using the .c_str() you should have null
termination automatically but... change the sizeof(pathBuffer) -1; to
sizeof(pathBuffer); since the -1 could remove the the null
termination.

you should probably printout pathBuffer in hexadecimal form so
that any white space is 'visible', you could use good old sprintf()
+ printf() or sprintf() + anything that prints text to the
console

the second solution is to add the null termination with '\0'
if it is C++ or modern C then you just use +'\0';

Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@LiveForIt

newlib all over

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@trgswe

Thank you, I may get back to you once i can test again.

all printf versions doesn't seem to print anything, dunno why yet.

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Just popping in
Just popping in


See User information
@Raziel

instead of using printf() try fprintf(stderr,...) then the system
shouldn't que it (I remember seeing this behavior when doing
something a bit more complicated real-time stuff it held all
output until the process had ended then it spit it out into a
freshly opened console which auto-closed pretty much as soon as
all output and been written) or use DBG().

Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Just popping in
Just popping in


See User information
@Raziel

instead of using printf() try fprintf(stderr,...) then the system
shouldn't que it (I remember seeing this behavior when doing
something a bit more complicated real-time stuff it held all
output until the process had ended then it spit it out into a
freshly opened console which auto-closed pretty much as soon as
all output and been written) or use DBG().

Go to top
Re: ScummVM and AmigaOS4.1 F.E.
Home away from home
Home away from home


See User information
@trgswe

I'll try that too, thank you

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top

  Register To Post
« 1 ... 9 10 11 (12)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project