Skip to main content

News

Topic: neoSphere 5.9.2 (Read 523103 times) previous topic - next topic

0 Members and 14 Guests are viewing this topic.
  • Rhuan
  • [*][*][*][*]
Re: miniSphere 4.8.4
Reply #1950
Looking at your crash logs, it seems like it's crashing while freeing textures?  And the cause is apparently a use-after-free.  So maybe Allegro is mismanaging something...

Any chance you could send me a project I can use to try and reproduce?
I posted everything I'm working on for trying out purposes here: http://forums.spheredev.org/index.php/topic,1466.msg10043.html#msg10043

Notes
- this is with the Scale2x stuff in (which I think may not be working and may be where the killer graphical anomalies occur), to remove it comment out the body of MEngine.prototype.scale
- MEngine.prototype.loadRMPMap takes far too long to run (partly due to calling the scale function)
- this is without the Dispatch change (hence this is the version that segfaults)
- I've also noticed that there's a missing raw_data.dispose() call on line 209 of MEngine (inside MEngine.prototype.loadRMPMap.


  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 4.8.4
Reply #1951
Sure, I'll look at it tomorrow after I get some sleep.  I have a theory for what's causing the "shimmering" but I'll have to see it in action to know for sure.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 4.8.4
Reply #1952
I don't see any MEngine.prototype.scale() function, are you sure the version you uploaded is the broken version?

Possible bug: You have this.folder set to "@".  It isn't recommended to use a SphereFS prefix by itself like that since it won't be recognized as a directory in all contexts.  You should add a slash to it ("@/") and then open the map file using:

Code: (javascript) [Select]
var raw_data = new FileStream(FS.fullPath(name, this.folder), FileOp.Read);

http://wiki.spheredev.org/index.php/API:FS.fullPath

Which has the added benefit that it always gives you the canonical normalized SphereFS path with no extraneous slashes or relative parts.  That lets you use the string returned by a FS.fullPath() as a key to track state for different maps, for example.
  • Last Edit: August 24, 2017, 10:24:25 am by Fat Cerberus
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Rhuan
  • [*][*][*][*]
Re: miniSphere 4.8.4
Reply #1953
99% sure but I will double check when I get home - as said the only consistent problem is the riples, the worse anomalies and the seg faults only happen 20-30% of the time.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 4.8.4
Reply #1954
One feature I think might be useful is to extend FS.fullPath() to optionally add a file extension if none is provided and the path is not prefixed.  If there's a prefix it would be assumed to already be a full path so no extension would be added.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Rhuan
  • [*][*][*][*]
Re: miniSphere 4.8.4
Reply #1955
I don't see any MEngine.prototype.scale() function, are you sure the version you uploaded is the broken version?
My mistake the scaling function is just called scale, not MEngine.prototype.scale. And I've checked, the version i've uploaded is the one that crashes and/or has massive graphical anomalies (i.e. whole screen black or drawing at 1/8th of the size it should) ~30% of the time. I think it may be that the scale 2x shader programme is just too much for my graphics card sometimes particularly in the context it's used in.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 4.8.4
Reply #1956
Alrighty, I'll do some more testing then to see if I can find the issue.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Rhuan
  • [*][*][*][*]
Re: miniSphere 4.8.4
Reply #1957
The screen shimmering issue has me more worried now, the short answer to the big graphical anomalies problem seems to be: don't run an unnecessary scaling shader programme and/or maybe there's an intermittent error in said shader programme, I can do without it or I can work on tweaking it later.

Whereas the shimmering problem is there whatever I do, the only way I can find to avoid it is to not move around a map, that's a bit more fundamental, vsync helps a little but doesn't make it go away.

I feel bad that it feels like I'm endlessly asking you to help with bugs :(

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 4.8.4
Reply #1958
I feel bad that it feels like I'm endlessly asking you to help with bugs :(

Don't.  Seriously. :)  miniSphere was developed in the first place because I was fed up with all the glitches and crash bugs in Sphere 1.5 (towards the end, when Spectacles was pushing the engine to its limits, I saw a LOT of segfaults).  So if there's any chance there's a bug in the engine that I can fix, I'm more than happy to try to hunt it down.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Rhuan
  • [*][*][*][*]
Re: miniSphere 4.8.4
Reply #1959
I feel bad that it feels like I'm endlessly asking you to help with bugs :(

Don't.  Seriously. :)  miniSphere was developed in the first place because I was fed up with all the glitches and crash bugs in Sphere 1.5 (towards the end, when Spectacles was pushing the engine to its limits, I saw a LOT of segfaults).  So if there's any chance there's a bug in the engine that I can fix, I'm more than happy to try to hunt it down.
Thanks, it's really appreciated.

In other news... I thought I'd build cell which I did, I've been trying to build spectacles to test it but just keep getting a seg fault.

I can't get the fancy looking crash logs I get from miniSphere as this is a command line tool so the best output I can get is this:
Segmenation fault 11 (which apparently means attempt to access unassigned memory)

cell`___lldb_unnamed_symbol123$$cell:
    0x100008a10 <+0>:  pushq  %rbp
    0x100008a11 <+1>:  movq   %rsp, %rbp
    0x100008a14 <+4>:  movq   %rdi, -0x8(%rbp)
    0x100008a18 <+8>:  movq   -0x8(%rbp), %rdi
->  0x100008a1c <+12>: movq   0x10(%rdi), %rax <- EXC_BAD_ACCESS (code =1, address =0x10)
    0x100008a20 <+16>: popq   %rbp
    0x100008a21 <+17>: retq  
    0x100008a22 <+18>: nopw   %cs:(%rax,%rax)

  • Rhuan
  • [*][*][*][*]
Re: miniSphere 4.8.4
Reply #1960
I stuck in a stack of printfs to trace the segfault I'm getting in cell.

From main we get safely through parsing the arguments and into build_new, from there it goes to fs_new, in that function it manages root_path, game_path and app_path but cannot do system_path.

To make the system path the funtion path_rebase is called, the first few lines of this run including the malloc but then the function path_num_hops is called and the seg fault occurs before that function returns.
  • Last Edit: August 24, 2017, 07:05:48 pm by Rhuan

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 4.8.4
Reply #1961
path_num_hops() is very simple:
https://github.com/fatcerberus/minisphere/blob/v4.8.4/src/shared/path.c#L177-L181

The only way that should segfault is if the path pointer passed in is null.  Hmm...
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 4.8.4
Reply #1962
I have a suspicion path_new_self() (returns path to calling executable) is returning a null pointer.  The method to get the path on Linux probably doesn't work in macOS:

https://github.com/fatcerberus/minisphere/blob/v4.8.4/src/shared/path.c#L66-L84
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: miniSphere 4.8.4
Reply #1963
That's not a great method even on Linux, the proc filesystem is not very consistent or portable even between kernel versions.

  • Rhuan
  • [*][*][*][*]
Re: miniSphere 4.8.4
Reply #1964
Ok, resolved that but hit another seg fault later, I'll trace it through myself and post the solution when done.