Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008813opensim[GRID] Inventory Servicepublic2020-11-18 16:582020-11-19 11:31
Assigned To 
PlatformOperating SystemOperating System Version
Product Version0.9.0 
Target VersionFixed in Version 
Summary0008813: My Suitcase is broken due to invalid folder type specification.
DescriptionAn older Mantis [^]
Goes around in circles and concludes that this is a viewer issue.

It *mostly* is not. For while it manifests as a viewer not working properly, the problem is instigated by a misinformed choice.

The problem is that OpenSim unilaterally chose a value of 100 for the "My Suitcase" folder type. This was chosen presumably to give plenty of room for future viewer expansions, not a bad premise. Sadly they overlooked the fact that a 64-bit mask is applied with each bit mapping to a folder type and thus the behaviour is unpredictable on all platforms.

On the 64-bit intel viewer the code "luckily" generates an appropriate bit test that wraps giving a modulo 64 result of 36. Bit 36 happens to be present in the filter mask and works. Pure luck.

On 32-bit intel viewer, the test evaluates to 0, a technically more correct result as the mask was 64 bits and thus could never be true.

The correct solution is to use a folder that is in range and ensure that all the viewers are aware of this. However, this change was instigated in OpenSim 0.8.2 ( [^])
Steps To ReproduceGet a 32-bit intel viewer, firestorm definitely, Dayturn would appear to according to other posts. Any viewer that has inventory filtering based on LL.

go to a region running OS > 0.8.2 and implementing suitcase. The 32-bit viewer will not show it by default. Switch to 64 bit and it will (probably). In all cases forcing show, all folders in the inventory filters will show it as it bypasses the filter checks.
Additional InformationThe issue occurs on the viewer because folders are expected to in held in an unsigned 64-bit mask.

The viewer checks to see if the folder is eligible for display by a bitwise check.

(1LL << cat_type & mFilterOps.mFilterCategoryTypes) == U64(0))

When cat_type > 64 all bets are off.
TagsNo tags attached.
Git Revision or version number
Run ModeStandalone (1 Region) , Standalone (Multiple Regions) , Grid (1 Region per Sim) , Grid (Multiple Regions per Sim)
Physics EngineBulletSim
Script EngineXEngine
Mono VersionNone
Attached Files

- Relationships
related to 0007868closedaiaustin "My Suitcase" folder missing in OSgrid. (unavailabe) objects are available 

-  Notes
tampa (reporter)
2020-11-18 17:09

What would be a safe value for it?
UbitUmarov (administrator)
2020-11-18 17:18

this issue was introduced with viewers inventory filters.
the direct use of folder type to create a bit mask is code that places limit of 63 to folder types, already at 56 on standard ll, more on tpvs
but we do similar things, so can't complain about ll code
now tpvs that support opensim is other thing
that wiki is there since 0.8.2 release :)

in fact the way that seems to work is fun, vs compiler is real nice doing optimization.
as i shown Beq, the code
(1LL << cat_type & mFilterOps.mFilterCategoryTypes) == U64(0))
corresponds, in 64b release mode to
mov ecx,eax
mov rax,qword ptr [rbx+30h]
bt rax,rcx

the module 64 comes from intel bt spec (bit test) in 64bit mode

in 32bit, most likely a support library is called to do 64bit shifts
and the result happens to hide suitcase
other cpus. Who knows.

seems we face another change of that value adding a lot of correction code..
can't do anything for older versions.
lets see what viewer side can do.
beqjanus (reporter)
2020-11-18 17:27

The viewer filters pre-date this change (according to git the filter in question was added by Richard Linden 9 years ago)

My suggestion for the short term is that I will add an explicit check for folder type 100. I will suggest this to other viewers too. This will resolve the issue of not showing but will force it to always show. To bring the folder type in range of the current filters (say 63) and allow future viewer UI control to optionally toggle it on and off would require additional code in all viewers while they'd still need to maintain legacy support for older regions. Not sure how much value there is in taking that path.

Please keep in mind here, 64-bit viewer "happen" to work, lucky chance, by making it explicit we safeguard builds that might not generate lucky code.
beqjanus (reporter)
2020-11-18 19:03

Fix applied to Firestorm as [^]
UbitUmarov (administrator)
2020-11-18 19:05

thanks for the hack Beq :)
Gavin Hird (reporter)
2020-11-19 06:40
edited on: 2020-11-19 06:45

That's brilliant Beq!

New viewer builds are in the pipeline for later today. THANKS!

(Ubit note: this means Dayturn viewer, for those who don't know Gavin is a dev of it)

Gavin Hird (reporter)
2020-11-19 11:31

New Dayturn Windows builds are available at [^]

Again, thanks to Beq!

- Issue History
Date Modified Username Field Change
2020-11-18 16:58 beqjanus New Issue
2020-11-18 17:09 tampa Note Added: 0037195
2020-11-18 17:18 UbitUmarov Note Added: 0037196
2020-11-18 17:27 beqjanus Note Added: 0037197
2020-11-18 19:03 beqjanus Note Added: 0037198
2020-11-18 19:05 UbitUmarov Note Added: 0037199
2020-11-19 04:33 aiaustin Relationship added related to 0007868
2020-11-19 06:40 Gavin Hird Note Added: 0037204
2020-11-19 06:44 UbitUmarov Note Edited: 0037204 View Revisions
2020-11-19 06:45 UbitUmarov Note Edited: 0037204 View Revisions
2020-11-19 06:45 UbitUmarov Note Edited: 0037204 View Revisions
2020-11-19 11:31 Gavin Hird Note Added: 0037218

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker