64bits Guardian failure on Squeak 5.3 RC1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

64bits Guardian failure on Squeak 5.3 RC1

Nicolas Cellier
 
Hi Stephane,
this is the worse game for VM developers ;)
No just kidding, very good game for finding our own bugs!

I just ran in debugger, and it crash in b3dDrawSTWRGB
But it seems like the function received an already corrupted texture...

(lldb) p *texture
(B3DTexture) $10 = {
  width = 152691968
  height = 1
  depth = 152842368
  rowLength = 1
  sMask = 152740096
  sShift = 1
  tMask = 152789728
  tShift = 1
  cmSize = 152890496
  colormap = 0x000000010916dd80
  data = 0x0000000109179f60
}

The width, depth and color map size are insane.
(lldb) p/x texture->width
(int) $5 = 0x0919e500
(lldb) p/x texture->depth
(int) $6 = 0x091c3080
(lldb) p/x texture->sMask
(int) $7 = 0x091aa100
(lldb) p/x texture->tMask
(int) $8 = 0x091b62e0
(lldb) p/x texture->cmSize
(int) $9 = 0x091cec80

Now it remains to discover how this got corrupted...
I wish I could run the debugger backward in time...
Maybe it's time to learn a new skill and explore the rr capability on linux as recommended once by Jan Vrany.


Le mer. 26 févr. 2020 à 10:35, Stéphane Rollandin <[hidden email]> a écrit :
> http://files.squeak.org/5.3rc1/Squeak5.3rc1-19414-64bit/
> Please give them a try and report any issues here on the mailing list.
The Guardians game does not run in the 64bit version - it crashes
immediately.

Guardians:
http://www.zogotounga.net/comp/guardians.htm

Code:
http://www.zogotounga.net/comp/squeak/guardians/Guardians-builder-0.94.sar

(to see the crash, just install the above sar and follow the
instructions for starting the game)


Stef

Reply | Threaded
Open this post in threaded view
|

Re: 64bits Guardian failure on Squeak 5.3 RC1

Nicolas Cellier
 


Le mer. 26 févr. 2020 à 21:56, Nicolas Cellier <[hidden email]> a écrit :
Hi Stephane,
this is the worse game for VM developers ;)
Hem, I meant the worst ever, even worse than my globish dialect ;)

No just kidding, very good game for finding our own bugs!

I just ran in debugger, and it crash in b3dDrawSTWRGB
But it seems like the function received an already corrupted texture...

(lldb) p *texture
(B3DTexture) $10 = {
  width = 152691968
  height = 1
  depth = 152842368
  rowLength = 1
  sMask = 152740096
  sShift = 1
  tMask = 152789728
  tShift = 1
  cmSize = 152890496
  colormap = 0x000000010916dd80
  data = 0x0000000109179f60
}

The width, depth and color map size are insane.
(lldb) p/x texture->width
(int) $5 = 0x0919e500
(lldb) p/x texture->depth
(int) $6 = 0x091c3080
(lldb) p/x texture->sMask
(int) $7 = 0x091aa100
(lldb) p/x texture->tMask
(int) $8 = 0x091b62e0
(lldb) p/x texture->cmSize
(int) $9 = 0x091cec80

Now it remains to discover how this got corrupted...
I wish I could run the debugger backward in time...
Maybe it's time to learn a new skill and explore the rr capability on linux as recommended once by Jan Vrany.


Le mer. 26 févr. 2020 à 10:35, Stéphane Rollandin <[hidden email]> a écrit :
> http://files.squeak.org/5.3rc1/Squeak5.3rc1-19414-64bit/
> Please give them a try and report any issues here on the mailing list.
The Guardians game does not run in the 64bit version - it crashes
immediately.

Guardians:
http://www.zogotounga.net/comp/guardians.htm

Code:
http://www.zogotounga.net/comp/squeak/guardians/Guardians-builder-0.94.sar

(to see the crash, just install the above sar and follow the
instructions for starting the game)


Stef

Reply | Threaded
Open this post in threaded view
|

Re: 64bits Guardian failure on Squeak 5.3 RC1

Nicolas Cellier
 
Well, I've tried to install rr and all its dependencies on Ubuntu 16... But...
I have no available machine to run linux natively.

To run rr inside a virtual machine, virtualization of perf counters needs to be enabled...

I'm using parallels, but not the Pro version, because I don't like the annual pricing model, for personal use it's just too much.
Unfortunately, only pro edition supports PMU virtualization

Maybe it's time to change of VM provider, but for now, that's too many hurdles, I give up...

Le mer. 26 févr. 2020 à 22:04, Nicolas Cellier <[hidden email]> a écrit :


Le mer. 26 févr. 2020 à 21:56, Nicolas Cellier <[hidden email]> a écrit :
Hi Stephane,
this is the worse game for VM developers ;)
Hem, I meant the worst ever, even worse than my globish dialect ;)

No just kidding, very good game for finding our own bugs!

I just ran in debugger, and it crash in b3dDrawSTWRGB
But it seems like the function received an already corrupted texture...

(lldb) p *texture
(B3DTexture) $10 = {
  width = 152691968
  height = 1
  depth = 152842368
  rowLength = 1
  sMask = 152740096
  sShift = 1
  tMask = 152789728
  tShift = 1
  cmSize = 152890496
  colormap = 0x000000010916dd80
  data = 0x0000000109179f60
}

The width, depth and color map size are insane.
(lldb) p/x texture->width
(int) $5 = 0x0919e500
(lldb) p/x texture->depth
(int) $6 = 0x091c3080
(lldb) p/x texture->sMask
(int) $7 = 0x091aa100
(lldb) p/x texture->tMask
(int) $8 = 0x091b62e0
(lldb) p/x texture->cmSize
(int) $9 = 0x091cec80

Now it remains to discover how this got corrupted...
I wish I could run the debugger backward in time...
Maybe it's time to learn a new skill and explore the rr capability on linux as recommended once by Jan Vrany.


Le mer. 26 févr. 2020 à 10:35, Stéphane Rollandin <[hidden email]> a écrit :
> http://files.squeak.org/5.3rc1/Squeak5.3rc1-19414-64bit/
> Please give them a try and report any issues here on the mailing list.
The Guardians game does not run in the 64bit version - it crashes
immediately.

Guardians:
http://www.zogotounga.net/comp/guardians.htm

Code:
http://www.zogotounga.net/comp/squeak/guardians/Guardians-builder-0.94.sar

(to see the crash, just install the above sar and follow the
instructions for starting the game)


Stef

Reply | Threaded
Open this post in threaded view
|

Re: 64bits Guardian failure on Squeak 5.3 RC1

Holger Freyther
 
Have you tried reverse execution in GDB and (software) watchpoints? https://www.jayconrod.com/posts/28/tutorial--reverse-debugging-with-gdb-7


> On 27. Feb 2020, at 06:06, Nicolas Cellier <[hidden email]> wrote:
>
> Well, I've tried to install rr and all its dependencies on Ubuntu 16... But...
> I have no available machine to run linux natively.
>
> To run rr inside a virtual machine, virtualization of perf counters needs to be enabled...
> https://github.com/mozilla/rr/wiki/Building-And-Installing
>
> I'm using parallels, but not the Pro version, because I don't like the annual pricing model, for personal use it's just too much.
> Unfortunately, only pro edition supports PMU virtualization
> https://download.parallels.com/desktop/v11/docs/en_US/Parallels%20Desktop%20User%27s%20Guide/37830.htm
>
> Maybe it's time to change of VM provider, but for now, that's too many hurdles, I give up...
>
> Le mer. 26 févr. 2020 à 22:04, Nicolas Cellier <[hidden email]> a écrit :
>
>
> Le mer. 26 févr. 2020 à 21:56, Nicolas Cellier <[hidden email]> a écrit :
> Hi Stephane,
> this is the worse game for VM developers ;)
> Hem, I meant the worst ever, even worse than my globish dialect ;)
>
> No just kidding, very good game for finding our own bugs!
>
> I just ran in debugger, and it crash in b3dDrawSTWRGB
> But it seems like the function received an already corrupted texture...
>
> (lldb) p *texture
> (B3DTexture) $10 = {
>   width = 152691968
>   height = 1
>   depth = 152842368
>   rowLength = 1
>   sMask = 152740096
>   sShift = 1
>   tMask = 152789728
>   tShift = 1
>   cmSize = 152890496
>   colormap = 0x000000010916dd80
>   data = 0x0000000109179f60
> }
>
> The width, depth and color map size are insane.
> (lldb) p/x texture->width
> (int) $5 = 0x0919e500
> (lldb) p/x texture->depth
> (int) $6 = 0x091c3080
> (lldb) p/x texture->sMask
> (int) $7 = 0x091aa100
> (lldb) p/x texture->tMask
> (int) $8 = 0x091b62e0
> (lldb) p/x texture->cmSize
> (int) $9 = 0x091cec80
>
> Now it remains to discover how this got corrupted...
> I wish I could run the debugger backward in time...
> Maybe it's time to learn a new skill and explore the rr capability on linux as recommended once by Jan Vrany.
>
>
> Le mer. 26 févr. 2020 à 10:35, Stéphane Rollandin <[hidden email]> a écrit :
> > http://files.squeak.org/5.3rc1/Squeak5.3rc1-19414-64bit/
> > Please give them a try and report any issues here on the mailing list.
> The Guardians game does not run in the 64bit version - it crashes
> immediately.
>
> Guardians:
> http://www.zogotounga.net/comp/guardians.htm
>
> Code:
> http://www.zogotounga.net/comp/squeak/guardians/Guardians-builder-0.94.sar
>
> (to see the crash, just install the above sar and follow the
> instructions for starting the game)
>
>
> Stef
>

Reply | Threaded
Open this post in threaded view
|

Re: 64bits Guardian failure on Squeak 5.3 RC1

Nicolas Cellier
 
Hi Holger,
good idea!

Thread 1 "squeak" hit Breakpoint 1, b3dStartRasterizer ()
    at /media/psf/Home/Smalltalk/OpenSmalltalk/opensmalltalk-vm/src/plugins/Squeak3D/Squeak3D.c:1687
1687 if (!((methodArgumentCount()) == 3)) {
(gdb) record
(gdb) cont
Continuing.
/build/gdb-9un5Xp/gdb-7.11.1/gdb/nat/x86-linux-dregs.c:146: internal-error: x86_linux_update_debug_registers: Assertion `lwp_is_stopped (lwp)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

/build/gdb-9un5Xp/gdb-7.11.1/gdb/nat/x86-linux-dregs.c:146: internal-error: x86_linux_update_debug_registers: Assertion `lwp_is_stopped (lwp)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Abandon (core dumped)

Nope, one more hurdle...

Le jeu. 27 févr. 2020 à 01:54, Holger Freyther <[hidden email]> a écrit :
 
Have you tried reverse execution in GDB and (software) watchpoints? https://www.jayconrod.com/posts/28/tutorial--reverse-debugging-with-gdb-7


> On 27. Feb 2020, at 06:06, Nicolas Cellier <[hidden email]> wrote:
>
> Well, I've tried to install rr and all its dependencies on Ubuntu 16... But...
> I have no available machine to run linux natively.
>
> To run rr inside a virtual machine, virtualization of perf counters needs to be enabled...
> https://github.com/mozilla/rr/wiki/Building-And-Installing
>
> I'm using parallels, but not the Pro version, because I don't like the annual pricing model, for personal use it's just too much.
> Unfortunately, only pro edition supports PMU virtualization
> https://download.parallels.com/desktop/v11/docs/en_US/Parallels%20Desktop%20User%27s%20Guide/37830.htm
>
> Maybe it's time to change of VM provider, but for now, that's too many hurdles, I give up...
>
> Le mer. 26 févr. 2020 à 22:04, Nicolas Cellier <[hidden email]> a écrit :
>
>
> Le mer. 26 févr. 2020 à 21:56, Nicolas Cellier <[hidden email]> a écrit :
> Hi Stephane,
> this is the worse game for VM developers ;)
> Hem, I meant the worst ever, even worse than my globish dialect ;)
>
> No just kidding, very good game for finding our own bugs!
>
> I just ran in debugger, and it crash in b3dDrawSTWRGB
> But it seems like the function received an already corrupted texture...
>
> (lldb) p *texture
> (B3DTexture) $10 = {
>   width = 152691968
>   height = 1
>   depth = 152842368
>   rowLength = 1
>   sMask = 152740096
>   sShift = 1
>   tMask = 152789728
>   tShift = 1
>   cmSize = 152890496
>   colormap = 0x000000010916dd80
>   data = 0x0000000109179f60
> }
>
> The width, depth and color map size are insane.
> (lldb) p/x texture->width
> (int) $5 = 0x0919e500
> (lldb) p/x texture->depth
> (int) $6 = 0x091c3080
> (lldb) p/x texture->sMask
> (int) $7 = 0x091aa100
> (lldb) p/x texture->tMask
> (int) $8 = 0x091b62e0
> (lldb) p/x texture->cmSize
> (int) $9 = 0x091cec80
>
> Now it remains to discover how this got corrupted...
> I wish I could run the debugger backward in time...
> Maybe it's time to learn a new skill and explore the rr capability on linux as recommended once by Jan Vrany.
>
>
> Le mer. 26 févr. 2020 à 10:35, Stéphane Rollandin <[hidden email]> a écrit :
> > http://files.squeak.org/5.3rc1/Squeak5.3rc1-19414-64bit/
> > Please give them a try and report any issues here on the mailing list.
> The Guardians game does not run in the 64bit version - it crashes
> immediately.
>
> Guardians:
> http://www.zogotounga.net/comp/guardians.htm
>
> Code:
> http://www.zogotounga.net/comp/squeak/guardians/Guardians-builder-0.94.sar
>
> (to see the crash, just install the above sar and follow the
> instructions for starting the game)
>
>
> Stef
>

Reply | Threaded
Open this post in threaded view
|

Re: 64bits Guardian failure on Squeak 5.3 RC1

Stéphane Rollandin
In reply to this post by Nicolas Cellier
 
>     I just ran in debugger, and it crash in b3dDrawSTWRGB
>     But it seems like the function received an already corrupted texture...

If I get rid of the background sky object (the one that is textured), by
setting

        sky := #()

in WonderlandPark>>#makeSky

then the game starts normally, but at some point I still either get a
crash with no dump, or a regular error signalling that primitive
primStartRasterizer:objects:textures: failed...

Stef
Reply | Threaded
Open this post in threaded view
|

Re: 64bits Guardian failure on Squeak 5.3 RC1

Holger Freyther
In reply to this post by Nicolas Cellier
 
too bad. :(

> On 27. Feb 2020, at 16:37, Nicolas Cellier <[hidden email]> wrote:
>
> Hi Holger,
> good idea!
>
> Thread 1 "squeak" hit Breakpoint 1, b3dStartRasterizer ()
>     at /media/psf/Home/Smalltalk/OpenSmalltalk/opensmalltalk-vm/src/plugins/Squeak3D/Squeak3D.c:1687
> 1687 if (!((methodArgumentCount()) == 3)) {
> (gdb) record
> (gdb) cont
> Continuing.
> /build/gdb-9un5Xp/gdb-7.11.1/gdb/nat/x86-linux-dregs.c:146: internal-error: x86_linux_update_debug_registers: Assertion `lwp_is_stopped (lwp)' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.Quit this debugging session? (y or n) y
>
> This is a bug, please report it.  For instructions, see:
> <http://www.gnu.org/software/gdb/bugs/>.
>
> /build/gdb-9un5Xp/gdb-7.11.1/gdb/nat/x86-linux-dregs.c:146: internal-error: x86_linux_update_debug_registers: Assertion `lwp_is_stopped (lwp)' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Create a core file of GDB? (y or n) y
> Abandon (core dumped)
>
> Nope, one more hurdle...
>
> Le jeu. 27 févr. 2020 à 01:54, Holger Freyther <[hidden email]> a écrit :
>  
> Have you tried reverse execution in GDB and (software) watchpoints? https://www.jayconrod.com/posts/28/tutorial--reverse-debugging-with-gdb-7
>
>
> > On 27. Feb 2020, at 06:06, Nicolas Cellier <[hidden email]> wrote:
> >
> > Well, I've tried to install rr and all its dependencies on Ubuntu 16... But...
> > I have no available machine to run linux natively.
> >
> > To run rr inside a virtual machine, virtualization of perf counters needs to be enabled...
> > https://github.com/mozilla/rr/wiki/Building-And-Installing
> >
> > I'm using parallels, but not the Pro version, because I don't like the annual pricing model, for personal use it's just too much.
> > Unfortunately, only pro edition supports PMU virtualization
> > https://download.parallels.com/desktop/v11/docs/en_US/Parallels%20Desktop%20User%27s%20Guide/37830.htm
> >
> > Maybe it's time to change of VM provider, but for now, that's too many hurdles, I give up...
> >
> > Le mer. 26 févr. 2020 à 22:04, Nicolas Cellier <[hidden email]> a écrit :
> >
> >
> > Le mer. 26 févr. 2020 à 21:56, Nicolas Cellier <[hidden email]> a écrit :
> > Hi Stephane,
> > this is the worse game for VM developers ;)
> > Hem, I meant the worst ever, even worse than my globish dialect ;)
> >
> > No just kidding, very good game for finding our own bugs!
> >
> > I just ran in debugger, and it crash in b3dDrawSTWRGB
> > But it seems like the function received an already corrupted texture...
> >
> > (lldb) p *texture
> > (B3DTexture) $10 = {
> >   width = 152691968
> >   height = 1
> >   depth = 152842368
> >   rowLength = 1
> >   sMask = 152740096
> >   sShift = 1
> >   tMask = 152789728
> >   tShift = 1
> >   cmSize = 152890496
> >   colormap = 0x000000010916dd80
> >   data = 0x0000000109179f60
> > }
> >
> > The width, depth and color map size are insane.
> > (lldb) p/x texture->width
> > (int) $5 = 0x0919e500
> > (lldb) p/x texture->depth
> > (int) $6 = 0x091c3080
> > (lldb) p/x texture->sMask
> > (int) $7 = 0x091aa100
> > (lldb) p/x texture->tMask
> > (int) $8 = 0x091b62e0
> > (lldb) p/x texture->cmSize
> > (int) $9 = 0x091cec80
> >
> > Now it remains to discover how this got corrupted...
> > I wish I could run the debugger backward in time...
> > Maybe it's time to learn a new skill and explore the rr capability on linux as recommended once by Jan Vrany.
> >
> >
> > Le mer. 26 févr. 2020 à 10:35, Stéphane Rollandin <[hidden email]> a écrit :
> > > http://files.squeak.org/5.3rc1/Squeak5.3rc1-19414-64bit/
> > > Please give them a try and report any issues here on the mailing list.
> > The Guardians game does not run in the 64bit version - it crashes
> > immediately.
> >
> > Guardians:
> > http://www.zogotounga.net/comp/guardians.htm
> >
> > Code:
> > http://www.zogotounga.net/comp/squeak/guardians/Guardians-builder-0.94.sar
> >
> > (to see the crash, just install the above sar and follow the
> > instructions for starting the game)
> >
> >
> > Stef
> >
>

Reply | Threaded
Open this post in threaded view
|

Re: 64bits Guardian failure on Squeak 5.3 RC1

Paul DeBruicker
In reply to this post by Nicolas Cellier
 
libvirt & qemu are supported on macos (https://libvirt.org/platforms.html) &
can use PMU
(https://stackoverflow.com/questions/46490857/how-to-enable-pmu-in-kvm-guest)

You can use homebrew to install libvirt & qemu

  brew install libvirt qemu

virt-manager & virt-viewer (https://virt-manager.org/) are GUI tools
create/manage/view KVM virtual machines. Macos support and install
instructions are here:

https://github.com/jeffreywildman/homebrew-virt-manager

Or instead of virt-manager you can just use the command line and then
install VNC on the vm:

https://linuxconfig.org/how-to-create-and-manage-kvm-virtual-machines-from-cli#h9-create-the-new-virtual-machine



Nicolas Cellier wrote

> Well, I've tried to install rr and all its dependencies on Ubuntu 16...
> But...
> I have no available machine to run linux natively.
>
> To run rr inside a virtual machine, virtualization of perf counters needs
> to be enabled...
> https://github.com/mozilla/rr/wiki/Building-And-Installing
>
> I'm using parallels, but not the Pro version, because I don't like the
> annual pricing model, for personal use it's just too much.
> Unfortunately, only pro edition supports PMU virtualization
> https://download.parallels.com/desktop/v11/docs/en_US/Parallels%20Desktop%20User%27s%20Guide/37830.htm
>
> Maybe it's time to change of VM provider, but for now, that's too many
> hurdles, I give up...
>
> Le mer. 26 févr. 2020 à 22:04, Nicolas Cellier <

> nicolas.cellier.aka.nice@

>> a écrit :
>
>>
>>
>> Le mer. 26 févr. 2020 à 21:56, Nicolas Cellier <
>>

> nicolas.cellier.aka.nice@

>> a écrit :
>>
>>> Hi Stephane,
>>> this is the worse game for VM developers ;)
>>>
>> Hem, I meant the worst ever, even worse than my globish dialect ;)
>>
>> No just kidding, very good game for finding our own bugs!
>>>
>>> I just ran in debugger, and it crash in b3dDrawSTWRGB
>>> But it seems like the function received an already corrupted texture...
>>>
>>> (lldb) p *texture
>>> (B3DTexture) $10 = {
>>>   width = 152691968
>>>   height = 1
>>>   depth = 152842368
>>>   rowLength = 1
>>>   sMask = 152740096
>>>   sShift = 1
>>>   tMask = 152789728
>>>   tShift = 1
>>>   cmSize = 152890496
>>>   colormap = 0x000000010916dd80
>>>   data = 0x0000000109179f60
>>> }
>>>
>>> The width, depth and color map size are insane.
>>> (lldb) p/x texture->width
>>> (int) $5 = 0x0919e500
>>> (lldb) p/x texture->depth
>>> (int) $6 = 0x091c3080
>>> (lldb) p/x texture->sMask
>>> (int) $7 = 0x091aa100
>>> (lldb) p/x texture->tMask
>>> (int) $8 = 0x091b62e0
>>> (lldb) p/x texture->cmSize
>>> (int) $9 = 0x091cec80
>>>
>>> Now it remains to discover how this got corrupted...
>>> I wish I could run the debugger backward in time...
>>> Maybe it's time to learn a new skill and explore the rr capability on
>>> linux as recommended once by Jan Vrany.
>>>
>>>
>>> Le mer. 26 févr. 2020 à 10:35, Stéphane Rollandin &lt;

> lecteur@

> &gt;
>>> a écrit :
>>>
>>>> > http://files.squeak.org/5.3rc1/Squeak5.3rc1-19414-64bit/
>>>> > Please give them a try and report any issues here on the mailing
>>>> list.
>>>> The Guardians game does not run in the 64bit version - it crashes
>>>> immediately.
>>>>
>>>> Guardians:
>>>> http://www.zogotounga.net/comp/guardians.htm
>>>>
>>>> Code:
>>>>
>>>> http://www.zogotounga.net/comp/squeak/guardians/Guardians-builder-0.94.sar
>>>>
>>>> (to see the crash, just install the above sar and follow the
>>>> instructions for starting the game)
>>>>
>>>>
>>>> Stef
>>>>
>>>>





--
Sent from: http://forum.world.st/Squeak-VM-f104410.html
Reply | Threaded
Open this post in threaded view
|

Re: 64bits Guardian failure on Squeak 5.3 RC1

Nicolas Cellier
 
Ah yes, thanks, I tried QEMU via homebrew, but couldn't have it installing ubuntu, nor starting my already initialized images... Maybe 4.2.0 is too recent? I give up for now.

Since we do not have to wait long for crash, I just used traditional trial and restart with hardware watchpoints.

What happens is that loadObjectsFrom: is overwriting the textures...
(lldb) p state
(B3DRasterizerState) $12 = {
  faceAlloc = 0x0000000108fbb6c8
  edgeAlloc = 0x0000000108fdb6d8
  attrAlloc = 0x0000000108feb6e8
  aet = 0x0000000108fef6f8
  addedEdges = 0x0000000108ff3708
  fillList = 0x0000000108ff7710
  nObjects = 1111
  objects = 0x000000010920af98
  nTextures = 1
  textures = 0x000000010920c100
  spanSize = 2048
  spanBuffer = 0x0000000108ff7998
  spanDrawer = 0x0000000100479960 (Squeak`copyBitsFromtoat at BitBltPlugin.c:1359)
}

There is just  4456 bytes offset between objects and textures addresses...
But we pretend we are going to store 1111 pointers to B3DPrimitiveObject into this objects field...
Obviously, that ain't gonna work on a 64bits VM.

Let's take a look at B3DPrimitiveRasterizerData>>initObjects: nObjects
objects _ B3DPrimitiveRasterizerData new: nObjects

B3DPrimitiveRasterizerData is variableWordSubclass: so it needs to allocate twice more words on a 64 bits VM...
With a bit of luck, we can fix it at image side...


Le jeu. 27 févr. 2020 à 19:44, Paul DeBruicker <[hidden email]> a écrit :
 
libvirt & qemu are supported on macos (https://libvirt.org/platforms.html) &
can use PMU
(https://stackoverflow.com/questions/46490857/how-to-enable-pmu-in-kvm-guest)

You can use homebrew to install libvirt & qemu

  brew install libvirt qemu

virt-manager & virt-viewer (https://virt-manager.org/) are GUI tools
create/manage/view KVM virtual machines. Macos support and install
instructions are here:

https://github.com/jeffreywildman/homebrew-virt-manager

Or instead of virt-manager you can just use the command line and then
install VNC on the vm:

https://linuxconfig.org/how-to-create-and-manage-kvm-virtual-machines-from-cli#h9-create-the-new-virtual-machine



Nicolas Cellier wrote
> Well, I've tried to install rr and all its dependencies on Ubuntu 16...
> But...
> I have no available machine to run linux natively.
>
> To run rr inside a virtual machine, virtualization of perf counters needs
> to be enabled...
> https://github.com/mozilla/rr/wiki/Building-And-Installing
>
> I'm using parallels, but not the Pro version, because I don't like the
> annual pricing model, for personal use it's just too much.
> Unfortunately, only pro edition supports PMU virtualization
> https://download.parallels.com/desktop/v11/docs/en_US/Parallels%20Desktop%20User%27s%20Guide/37830.htm
>
> Maybe it's time to change of VM provider, but for now, that's too many
> hurdles, I give up...
>
> Le mer. 26 févr. 2020 à 22:04, Nicolas Cellier <

> nicolas.cellier.aka.nice@

>> a écrit :
>
>>
>>
>> Le mer. 26 févr. 2020 à 21:56, Nicolas Cellier <
>>

> nicolas.cellier.aka.nice@

>> a écrit :
>>
>>> Hi Stephane,
>>> this is the worse game for VM developers ;)
>>>
>> Hem, I meant the worst ever, even worse than my globish dialect ;)
>>
>> No just kidding, very good game for finding our own bugs!
>>>
>>> I just ran in debugger, and it crash in b3dDrawSTWRGB
>>> But it seems like the function received an already corrupted texture...
>>>
>>> (lldb) p *texture
>>> (B3DTexture) $10 = {
>>>   width = 152691968
>>>   height = 1
>>>   depth = 152842368
>>>   rowLength = 1
>>>   sMask = 152740096
>>>   sShift = 1
>>>   tMask = 152789728
>>>   tShift = 1
>>>   cmSize = 152890496
>>>   colormap = 0x000000010916dd80
>>>   data = 0x0000000109179f60
>>> }
>>>
>>> The width, depth and color map size are insane.
>>> (lldb) p/x texture->width
>>> (int) $5 = 0x0919e500
>>> (lldb) p/x texture->depth
>>> (int) $6 = 0x091c3080
>>> (lldb) p/x texture->sMask
>>> (int) $7 = 0x091aa100
>>> (lldb) p/x texture->tMask
>>> (int) $8 = 0x091b62e0
>>> (lldb) p/x texture->cmSize
>>> (int) $9 = 0x091cec80
>>>
>>> Now it remains to discover how this got corrupted...
>>> I wish I could run the debugger backward in time...
>>> Maybe it's time to learn a new skill and explore the rr capability on
>>> linux as recommended once by Jan Vrany.
>>>
>>>
>>> Le mer. 26 févr. 2020 à 10:35, Stéphane Rollandin &lt;

> lecteur@

> &gt;
>>> a écrit :
>>>
>>>> > http://files.squeak.org/5.3rc1/Squeak5.3rc1-19414-64bit/
>>>> > Please give them a try and report any issues here on the mailing
>>>> list.
>>>> The Guardians game does not run in the 64bit version - it crashes
>>>> immediately.
>>>>
>>>> Guardians:
>>>> http://www.zogotounga.net/comp/guardians.htm
>>>>
>>>> Code:
>>>>
>>>> http://www.zogotounga.net/comp/squeak/guardians/Guardians-builder-0.94.sar
>>>>
>>>> (to see the crash, just install the above sar and follow the
>>>> instructions for starting the game)
>>>>
>>>>
>>>> Stef
>>>>
>>>>





--
Sent from: http://forum.world.st/Squeak-VM-f104410.html
Reply | Threaded
Open this post in threaded view
|

Re: 64bits Guardian failure on Squeak 5.3 RC1

Nicolas Cellier
 


Le jeu. 27 févr. 2020 à 20:08, Nicolas Cellier <[hidden email]> a écrit :
Ah yes, thanks, I tried QEMU via homebrew, but couldn't have it installing ubuntu, nor starting my already initialized images... Maybe 4.2.0 is too recent? I give up for now.

Since we do not have to wait long for crash, I just used traditional trial and restart with hardware watchpoints.

What happens is that loadObjectsFrom: is overwriting the textures...
(lldb) p state
(B3DRasterizerState) $12 = {
  faceAlloc = 0x0000000108fbb6c8
  edgeAlloc = 0x0000000108fdb6d8
  attrAlloc = 0x0000000108feb6e8
  aet = 0x0000000108fef6f8
  addedEdges = 0x0000000108ff3708
  fillList = 0x0000000108ff7710
  nObjects = 1111
  objects = 0x000000010920af98
  nTextures = 1
  textures = 0x000000010920c100
  spanSize = 2048
  spanBuffer = 0x0000000108ff7998
  spanDrawer = 0x0000000100479960 (Squeak`copyBitsFromtoat at BitBltPlugin.c:1359)
}

There is just  4456 bytes offset between objects and textures addresses...
But we pretend we are going to store 1111 pointers to B3DPrimitiveObject into this objects field...
Obviously, that ain't gonna work on a 64bits VM.

Let's take a look at B3DPrimitiveRasterizerData>>initObjects: nObjects
objects _ B3DPrimitiveRasterizerData new: nObjects

B3DPrimitiveRasterizerData is variableWordSubclass: so it needs to allocate twice more words on a 64 bits VM...
With a bit of luck, we can fix it at image side...

Nah, bad luck, there are a few slotSizeOf: that should be transformed into byteSizeOf:/sizeof(void*) in the Squeak3D plugin...

So patching image like this is not enough:
B3DPrimitiveRasterizerData>>initObjects: nObjects
objects := B3DPrimitiveRasterizerData new: nObjects * (Smalltalk wordSize / 4)


Le jeu. 27 févr. 2020 à 19:44, Paul DeBruicker <[hidden email]> a écrit :
 
libvirt & qemu are supported on macos (https://libvirt.org/platforms.html) &
can use PMU
(https://stackoverflow.com/questions/46490857/how-to-enable-pmu-in-kvm-guest)

You can use homebrew to install libvirt & qemu

  brew install libvirt qemu

virt-manager & virt-viewer (https://virt-manager.org/) are GUI tools
create/manage/view KVM virtual machines. Macos support and install
instructions are here:

https://github.com/jeffreywildman/homebrew-virt-manager

Or instead of virt-manager you can just use the command line and then
install VNC on the vm:

https://linuxconfig.org/how-to-create-and-manage-kvm-virtual-machines-from-cli#h9-create-the-new-virtual-machine



Nicolas Cellier wrote
> Well, I've tried to install rr and all its dependencies on Ubuntu 16...
> But...
> I have no available machine to run linux natively.
>
> To run rr inside a virtual machine, virtualization of perf counters needs
> to be enabled...
> https://github.com/mozilla/rr/wiki/Building-And-Installing
>
> I'm using parallels, but not the Pro version, because I don't like the
> annual pricing model, for personal use it's just too much.
> Unfortunately, only pro edition supports PMU virtualization
> https://download.parallels.com/desktop/v11/docs/en_US/Parallels%20Desktop%20User%27s%20Guide/37830.htm
>
> Maybe it's time to change of VM provider, but for now, that's too many
> hurdles, I give up...
>
> Le mer. 26 févr. 2020 à 22:04, Nicolas Cellier <

> nicolas.cellier.aka.nice@

>> a écrit :
>
>>
>>
>> Le mer. 26 févr. 2020 à 21:56, Nicolas Cellier <
>>

> nicolas.cellier.aka.nice@

>> a écrit :
>>
>>> Hi Stephane,
>>> this is the worse game for VM developers ;)
>>>
>> Hem, I meant the worst ever, even worse than my globish dialect ;)
>>
>> No just kidding, very good game for finding our own bugs!
>>>
>>> I just ran in debugger, and it crash in b3dDrawSTWRGB
>>> But it seems like the function received an already corrupted texture...
>>>
>>> (lldb) p *texture
>>> (B3DTexture) $10 = {
>>>   width = 152691968
>>>   height = 1
>>>   depth = 152842368
>>>   rowLength = 1
>>>   sMask = 152740096
>>>   sShift = 1
>>>   tMask = 152789728
>>>   tShift = 1
>>>   cmSize = 152890496
>>>   colormap = 0x000000010916dd80
>>>   data = 0x0000000109179f60
>>> }
>>>
>>> The width, depth and color map size are insane.
>>> (lldb) p/x texture->width
>>> (int) $5 = 0x0919e500
>>> (lldb) p/x texture->depth
>>> (int) $6 = 0x091c3080
>>> (lldb) p/x texture->sMask
>>> (int) $7 = 0x091aa100
>>> (lldb) p/x texture->tMask
>>> (int) $8 = 0x091b62e0
>>> (lldb) p/x texture->cmSize
>>> (int) $9 = 0x091cec80
>>>
>>> Now it remains to discover how this got corrupted...
>>> I wish I could run the debugger backward in time...
>>> Maybe it's time to learn a new skill and explore the rr capability on
>>> linux as recommended once by Jan Vrany.
>>>
>>>
>>> Le mer. 26 févr. 2020 à 10:35, Stéphane Rollandin &lt;

> lecteur@

> &gt;
>>> a écrit :
>>>
>>>> > http://files.squeak.org/5.3rc1/Squeak5.3rc1-19414-64bit/
>>>> > Please give them a try and report any issues here on the mailing
>>>> list.
>>>> The Guardians game does not run in the 64bit version - it crashes
>>>> immediately.
>>>>
>>>> Guardians:
>>>> http://www.zogotounga.net/comp/guardians.htm
>>>>
>>>> Code:
>>>>
>>>> http://www.zogotounga.net/comp/squeak/guardians/Guardians-builder-0.94.sar
>>>>
>>>> (to see the crash, just install the above sar and follow the
>>>> instructions for starting the game)
>>>>
>>>>
>>>> Stef
>>>>
>>>>





--
Sent from: http://forum.world.st/Squeak-VM-f104410.html