Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 717374 - "What you type" and "What you get" are swapped
Summary: "What you type" and "What you get" are swapped
Status: RESOLVED WORKSFORME
Alias: None
Product: Websites
Classification: Unclassified
Component: Wiki (show other bugs)
Hardware: All Linux
: Normal trivial (vote)
Assignee: Gentoo Wiki Team
URL: https://i.imgur.com/v1LTiGI.png
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-13 23:11 UTC by inactive
Modified: 2020-04-16 18:11 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
snapshot.png (2020-04-13 19.31.20 wiki.gentoo.org 05cb5c42dd57.png,30.02 KB, image/png)
2020-04-13 23:32 UTC, Brian Evans (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description inactive 2020-04-13 23:11:52 UTC
see the image: https://i.imgur.com/v1LTiGI.png

Reproducible: Always
Comment 1 Brian Evans (RETIRED) gentoo-dev 2020-04-13 23:32:52 UTC
Created attachment 632740 [details]
snapshot.png

Works for me.  See attached PNG
Comment 2 Jonas Stein gentoo-dev 2020-04-14 01:04:49 UTC
works for me too.
Using firefox, was logged into the wiki.
Please try with a different browser, try with LANG=C localization, try without plugins
Please reopen, if you can confirm that this is a bug on our side.
Comment 3 inactive 2020-04-15 06:23:10 UTC
This issue only happens in my locally built firefox. I've been trying to rebuild it with different options/optimizations, different Rust version, clean profile, no vendor.js, no extensions, but the issue still happens, so far.
Doesn't happen with upstream Archlinux Firefox or Chromium, nor in any mozregression builds that I've tested.

Can someone say how those tr/td are being generated? Are they done in javascript on the client browser or is the server generating them before feeding me the page? (possibly based on UserAgent string?)
I'm even trying to find the source code for "What you get" for example, grep-searched in all of these:
$ for i in *; do pushd "$i"; git remote -v; popd; done
/tmp/wiki/bootstrap /tmp/wiki
origin	https://github.com/twbs/bootstrap.git (fetch)
origin	https://github.com/twbs/bootstrap.git (push)
/tmp/wiki
/tmp/wiki/extensions /tmp/wiki
origin	https://anongit.gentoo.org/git/sites/wiki/extensions.git (fetch)
origin	https://anongit.gentoo.org/git/sites/wiki/extensions.git (push)
/tmp/wiki
/tmp/wiki/mediawiki /tmp/wiki
origin	https://github.com/wikimedia/mediawiki.git (fetch)
origin	https://github.com/wikimedia/mediawiki.git (push)
/tmp/wiki
/tmp/wiki/skin-tyrian /tmp/wiki
origin	https://anongit.gentoo.org/git/sites/wiki/skin-tyrian.git (fetch)
origin	https://anongit.gentoo.org/git/sites/wiki/skin-tyrian.git (push)
/tmp/wiki

like:
$ grep -nrFi "What you type"; grep -nrF 'cell-description'; grep -nrIF 'table-discussion'

but got no results!
Where could I even find the code that does have that "What you type" text?

I've noticed that even those "Discussion" rows on the left side(see my screenshot) are in a different order for me, when using my locally built firefox.

For convenience I link to the webpage with the issue: https://wiki.gentoo.org/index.php?title=Talk:Zram&action=edit

The "What you get" and "What you type" headers are in their proper place, but
the `td class cell-result` and `td class cell-syntax` are swapped for each row, only when using my built firefox: https://i.imgur.com/NTCF8WD.png
but not when, for example, using upstream chromium(or firefox): https://i.imgur.com/XezcwYX.png
Comment 4 inactive 2020-04-15 07:40:20 UTC
I got better screenshots(same font and same size):

bad https://i.imgur.com/yNW0Cmq.png

good https://i.imgur.com/lP0ELtH.png

this way I was able to notice that the Link and Image icons are also swapped!
Comment 5 inactive 2020-04-15 08:14:11 UTC
oops I meant this:
good: https://i.imgur.com/e0BSHeN.png
bad: https://i.imgur.com/yNW0Cmq.png

so they're both open on the "Discussion" tab
Comment 6 inactive 2020-04-15 15:44:47 UTC
Found a different swap issue but looks like it is unrelated because I was able to reproduce it with a Firefox that the current issue cannot be reproduced with.
https://bugs.gentoo.org/717596

Just thought I'd mention it.
Comment 7 inactive 2020-04-15 19:17:47 UTC
Oh I found out something else that gets swapped: there are only two requests for which swapping happens; they have a modules= in the query and the module name values inside it get differently-ordered in my bad firefox.

The (incomplete) URL looks something like this:
https://wiki.gentoo.org/load.php?debug=false&lang=en&modules=moment%2Coojs%2Coojs-ui-core%2Coojs-ui-widgets%2Coojs-ui-windows%7Cmediawiki.toolbar%2Cuser%2Cutil%7Cmediaw

^ that's only to give an idea what I meant by modules=

Now, in mitmproxy I can see the Query better like:

For my bad firefox:

Query
debug:   false
lang:    en
modules: moment,oojs,oojs-ui-core,oojs-ui-widgets,oojs-ui-windows|mediawiki.toolbar,user,util|mediawiki.template.regexp|mediawiki.widgets.CategoryMultiselectWidget,DateInputWidget,StashedFileWidget,visibleLengthLimit|mediawiki.widgets.DateInputWidget.styles|oojs-ui.styles.icons-editing-advanced,icons-editing-core,icons-editing-list,icons-editing-styling,icons-media,icons-moderation,icons-movement|user.defaults
skin:    tyrian
version: 0mdsrrx

And for when it works(eg. any other browser, but was a firefox of the same revision via mozregression):

Query
debug:   false
lang:    en
modules: mediawiki.template.regexp|mediawiki.toolbar,user,util|mediawiki.widgets.CategoryMultiselectWidget,DateInputWidget,StashedFileWidget,visibleLengthLimit|mediawiki.widgets.DateInputWidget.styles|moment,oojs,oojs-ui-core,oojs-ui-widgets,oojs-ui-windows|oojs-ui.styles.icons-editing-advanced,icons-editing-core,icons-editing-list,icons-editing-styling,icons-media,icons-moderation,icons-movement|user.defaults
skin:    tyrian
version: 0of4k9j


(that's why that version: string is different, because the modules order is different, still same names, just different order, thus different version hash - just guessing tho)

Here's the other request where only the first two module names are swapped:
In my bad firefox:

Query
debug:   false
lang:    en
modules: ext.gentooPackages|ext.echo.api,init|ext.uls.common,init,interface,preferences,webfonts|jquery.accessKeyLabel,async,checkboxShiftClick,client,cookie,getAttrs,highlightText,lengthLimit,makeCollapsible,mw-jump,suggestions,tabIndex,textSelection|jquery.uls.data|mediawiki.ForeignApi,ForeignStructuredUpload,ForeignUpload,RegExp,String,Title,Upload,Uri,api,cldr,confirmCloseWindow,cookie,icon,jqueryMsg,language,notify,searchSuggest,storage,template|mediawiki.ForeignApi.core|mediawiki.ForeignStructuredUpload.BookletLayout,config|mediawiki.Upload.BookletLayout,Dialog|mediawiki.action.edit|mediawiki.action.edit.collapsibleFooter,editWarning|mediawiki.api.edit,messages,options,upload,user,watch|mediawiki.language.data,init,specialCharacters|mediawiki.libs.jpegmeta,pluralruleparser|mediawiki.page.ready,startup|mediawiki.page.watch.ajax
skin:    tyrian
version: 1tj7msx

In the good firefox:

Query
debug:   false
lang:    en
modules: ext.echo.api,init|ext.gentooPackages|ext.uls.common,init,interface,preferences,webfonts|jquery.accessKeyLabel,async,checkboxShiftClick,client,cookie,getAttrs,highlightText,lengthLimit,makeCollapsible,mw-jump,suggestions,tabIndex,textSelection|jquery.uls.data|mediawiki.ForeignApi,ForeignStructuredUpload,ForeignUpload,RegExp,String,Title,Upload,Uri,api,cldr,confirmCloseWindow,cookie,icon,jqueryMsg,language,notify,searchSuggest,storage,template|mediawiki.ForeignApi.core|mediawiki.ForeignStructuredUpload.BookletLayout,config|mediawiki.Upload.BookletLayout,Dialog|mediawiki.action.edit|mediawiki.action.edit.collapsibleFooter,editWarning|mediawiki.api.edit,messages,options,upload,user,watch|mediawiki.language.data,init,specialCharacters|mediawiki.libs.jpegmeta,pluralruleparser|mediawiki.page.ready,startup|mediawiki.page.watch.ajax
skin:    tyrian
version: 1df261z


Can't wait to find out what's causing this :)
Comment 8 inactive 2020-04-16 09:01:30 UTC
hey I got something, thanks to <graingert> on freenode irc #javascript who told me about this webpage: https://kangax.github.io/compat-table/es6/

now I can see the differences between my bad firefox and the same firefox revision from mozregression aka $ /home/user/.local/bin/mozregression --launch=078326f48100828dc60d2e0ca2819164b8803b7d

and there I have at least "own property order" that's 1/7 instead of 7/7  (haven't yet checked what other things are broken)

ok I checked, these are "No" and should be "Yes":

Proxy, internal 'get' calls:
 Object.assign
 Object.defineProperties

Proxy, internal 'set' calls:
 Object.assign

Proxy, internal 'defineProperty' calls:
 SetIntegrityLevel

Proxy, internal 'getOwnPropertyDescriptor' calls:
 Object.assign

own property order:
 Object.getOwnPropertyNames
 Object.assign
 JSON.stringify
 JSON.parse
 Reflect.ownKeys, string key order
 Reflect.ownKeys, symbol key order
Comment 9 inactive 2020-04-16 09:16:12 UTC
look at this order dayummm:


Bad ff:
/////////
(9) […]
​
0: "A"
​
1: "B"
​
2: "C"
​
3: "D"
​
4: "1"
​
5: Symbol()
​
6: Symbol()
​
7: Symbol()
​
8: "2"
​
length: 9
​
<prototype>: Array []
/////////

Good ff:
/////////
(9) […]
​
0: "1"
​
1: "2"
​
2: "A"
​
3: "B"
​
4: "C"
​
5: "D"
​
6: Symbol()
​
7: Symbol()
​
8: Symbol()
​
length: 9
​
<prototype>: Array []
/////////


This is code, ran on Console:

var sym1 = Symbol(), sym2 = Symbol(), sym3 = Symbol();
var obj = {
  1: true,
  A: true,
};
obj.B = true;
obj[sym1] = true;
obj[2] = true;
obj[sym2] = true;
Object.defineProperty(obj, 'C', { value: true, enumerable: true });
Object.defineProperty(obj, sym3,{ value: true, enumerable: true });
Object.defineProperty(obj, 'D', { value: true, enumerable: true });

var result = Reflect.ownKeys(obj);
var l = result.length;
console.log(result);

code from that webpage from  "Reflect.ownKeys, symbol key order"
Comment 10 inactive 2020-04-16 13:59:17 UTC
simplest test:

if I paste this in F12 console: 
({c:1, r:1, e:1, d:1, a:1})

I get
Object { a: 1, c: 1, d: 1, e: 1, r: 1 }

but I should get
Object { c: 1, r: 1, e: 1, d: 1, a: 1 }
Comment 11 inactive 2020-04-16 15:01:56 UTC
Found it, I think:

#ifdef JS_MORE_DETERMINISTIC
  
    /*
     * In some cases the enumeration order for an object depends on the
     * execution mode (interpreter vs. JIT), especially for native objects
     * with a class enumerate hook (where resolving a property changes the
     * resulting enumeration order). These aren't really bugs, but the
     * differences can change the generated output and confuse correctness
     * fuzzers, so we sort the ids if such a fuzzer is running.
     *
     * We don't do this in the general case because (a) doing so is slow,
     * and (b) it also breaks the web, which expects enumeration order to
     * follow the order in which properties are added, in certain cases.
     * Since ECMA does not specify an enumeration order for objects, both
     * behaviors are technically correct to do.
     */

I have `ac_add_options --enable-more-deterministic` in `mozconfig`

will test without it!
Comment 12 inactive 2020-04-16 18:11:18 UTC
tl;dr: indeed, issue gone away by recompiling Firefox with --disable-more-deterministic

The above comment (in Comment 11 above) was added by https://hg.mozilla.org/mozilla-central/rev/d87f60b6c99d

changeset:   82357:d87f60b6c99d
user:        Christian Holler
date:        Thu Dec 08 19:28:36 2011 -0800
summary:     Ensure a consistent enumeration order when compiled in deterministic mode, bug 707017. r=luke



The following happens with `ac_add_options --enable-more-deterministic` in `mozconfig` file:

$ time ./mach jstests
[total|regression/fail | timeout | skipped]
[35146|   84|   17| 5506] 100% ======================================>|2106.6s
REGRESSIONS
    non262/BigInt/property-name.js
    non262/Error/prototype-properties.js
    non262/JSON/stringify.js
    non262/JSON/stringify-dropping-elements.js
    non262/JSON/stringify-ignore-noncallable-toJSON.js
    non262/JSON/stringify-replacer.js
    non262/Reflect/ownKeys.js
    non262/Symbol/for-in-order.js
    non262/TypedObject/structtypeenumerate.js
    non262/TypedObject/arrayequiv.js
    non262/TypedObject/structequiv.js
    non262/TypedObject/arraytype.js
    non262/class/superPropDVG.js
    non262/class/newTargetDVG.js
    non262/expressions/optional-chain.js
    non262/extensions/regress-381304.js
    non262/extensions/regress-469625-01.js
    non262/extensions/column-numbers.js
    non262/extensions/decompile-for-of.js
    non262/extensions/regress-353116.js
    non262/extensions/object-toSource-with-symbol-keys.js
    non262/object/15.2.3.7-01.js
    non262/object/assign.js
    non262/object/entries.js
    non262/object/getOwnPropertySymbols-proxy.js
    non262/object/toPrimitive.js
    non262/object/regress-444787.js
    non262/object/values.js
    non262/regress/regress-372364.js
    non262/regress/regress-465013.js
    non262/regress/regress-469758.js
    non262/regress/regress-261887.js
    non262/regress/regress-328664.js
    non262/regress/regress-420919.js
    non262/regress/regress-355556.js
    non262/regress/regress-469625-03.js
    non262/statements/for-inof-loop-const-declaration.js
    non262/template-strings/debugLineNumber.js
    test262/built-ins/JSON/parse/reviver-call-order.js
    test262/built-ins/JSON/stringify/property-order.js
    test262/built-ins/JSON/stringify/replacer-array-number.js
    test262/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-44.js
    test262/built-ins/Object/keys/15.2.3.14-5-11.js
    test262/built-ins/Object/keys/15.2.3.14-6-2.js
    test262/built-ins/Object/keys/15.2.3.14-5-13.js
    test262/built-ins/Proxy/ownKeys/extensible-return-trap-result-absent-not-configurable-keys.js
    test262/built-ins/Proxy/ownKeys/not-extensible-return-keys.js
    test262/built-ins/Proxy/ownKeys/call-parameters-object-keys.js
    test262/built-ins/Proxy/ownKeys/call-parameters-object-getownpropertynames.js
    test262/built-ins/Proxy/ownKeys/extensible-return-trap-result.js
    test262/built-ins/Proxy/ownKeys/trap-is-undefined.js
    test262/built-ins/Reflect/ownKeys/return-on-corresponding-order-large-index.js
    test262/built-ins/Reflect/ownKeys/return-on-corresponding-order.js
    test262/built-ins/Reflect/ownKeys/return-non-enumerable-keys.js
    test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.js
    test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js
    test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-and-symbol-keys-.js
    test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-keys.js
    test262/language/computed-property-names/class/method/number.js
    test262/language/computed-property-names/to-name-side-effects/numbers-class.js
    test262/language/expressions/array/spread-obj-spread-order.js
    test262/language/expressions/assignment/dstr/obj-rest-order.js
    test262/language/expressions/call/spread-obj-spread-order.js
    test262/language/expressions/new/spread-obj-spread-order.js
    test262/language/expressions/super/call-spread-obj-spread-order.js
    test262/language/statements/for-in/order-simple-object.js
    test262/language/statements/for-of/dstr/obj-rest-order.js
TIMEOUTS
    non262/object/15.2.3.6-new-definition.js
    test262/built-ins/decodeURI/S15.1.3.1_A1.10_T1.js
    test262/built-ins/decodeURI/S15.1.3.1_A1.12_T2.js
    test262/built-ins/decodeURI/S15.1.3.1_A1.2_T2.js
    test262/built-ins/decodeURI/S15.1.3.1_A1.11_T2.js
    test262/built-ins/decodeURI/S15.1.3.1_A1.12_T1.js
    test262/built-ins/decodeURI/S15.1.3.1_A1.2_T1.js
    test262/built-ins/decodeURI/S15.1.3.1_A1.11_T1.js
    test262/built-ins/decodeURI/S15.1.3.1_A1.12_T3.js
    test262/built-ins/decodeURIComponent/S15.1.3.2_A1.12_T2.js
    test262/built-ins/decodeURIComponent/S15.1.3.2_A1.10_T1.js
    test262/built-ins/decodeURIComponent/S15.1.3.2_A1.2_T2.js
    test262/built-ins/decodeURIComponent/S15.1.3.2_A1.11_T2.js
    test262/built-ins/decodeURIComponent/S15.1.3.2_A1.12_T1.js
    test262/built-ins/decodeURIComponent/S15.1.3.2_A1.2_T1.js
    test262/built-ins/decodeURIComponent/S15.1.3.2_A1.12_T3.js
    test262/built-ins/decodeURIComponent/S15.1.3.2_A1.11_T1.js
FAIL

real	35m31.660s
user	69m5.041s
sys	26m13.900s

(exit code 1)

$ /home/user/build/1packages/4used/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/obj-x86_64-pc-linux-gnu/dist/bin/js --execute='console.log(Reflect.ownKeys(({b:1, a:1})));'
a,b

///////
Confirmed the issue goes away with: `ac_add_options --disable-more-deterministic` in `mozconfig`

$ /home/user/build/1packages/4used/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/obj-x86_64-pc-linux-gnu/dist/bin/js --execute='console.log(Reflect.ownKeys(({b:1, a:1})));'
b,a

  -> Running javascript tests (39mins)
[35230|    0|    0| 5506] 100% ======================================>|1169.5s
PASS

real	19m53.464s
user	34m31.795s
sys	21m24.283s


For posterity, the now-working 'mozconfig' file is this:
. "$topsrcdir/browser/config/mozconfig"
ac_add_options --enable-application=browser
ac_add_options --enable-optimize
ac_add_options --disable-more-deterministic
ac_add_options --disable-debug
ac_add_options --disable-install-strip
ac_add_options --disable-strip
ac_add_options --enable-debug-symbols
ac_add_options --disable-debug-js-modules
ac_add_options --prefix=/usr
export -n MOZ_TELEMETRY_REPORTING
unset MOZ_TELEMETRY_REPORTING
export MOZ_ADDON_SIGNING=1
export MOZ_REQUIRE_SIGNING=0
export -n MOZ_TELEMETRY_ON_BY_DEFAULT
unset MOZ_TELEMETRY_ON_BY_DEFAULT
ac_add_options --without-system-nss
ac_add_options --without-system-nspr
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-png
ac_add_options --with-system-libevent
ac_add_options --with-system-libvpx
ac_add_options --enable-system-ffi
ac_add_options --enable-startup-notification
ac_add_options --disable-crashreporter
ac_add_options --disable-updater
ac_add_options --disable-update-channel
ac_add_options --disable-valgrind
ac_add_options --disable-jprof
ac_add_options --disable-instruments
ac_add_options --disable-callgrind
ac_add_options --disable-cpp-rtti
ac_add_options --enable-gold
ac_add_options --disable-dtrace
ac_add_options --disable-printing
ac_add_options --disable-gconf
ac_add_options --disable-libproxy
ac_add_options --enable-dbus
ac_add_options --disable-accessibility
ac_add_options --disable-webrtc
ac_add_options --disable-raw
ac_add_options --disable-directshow
ac_add_options --disable-wmf
ac_add_options --enable-ffmpeg
ac_add_options --enable-fmp4
ac_add_options --disable-eme
ac_add_options --disable-alsa
ac_add_options --enable-jack
ac_add_options --enable-pulseaudio
ac_add_options --disable-system-extension-dirs
ac_add_options --enable-extensions=default,-skipgnomevfs,-skipgio
ac_add_options --disable-verify-mar
ac_add_options --disable-parental-controls
ac_add_options --enable-sandbox
ac_add_options --enable-zipwriter
ac_add_options --disable-logrefcnt
ac_add_options --disable-dump-painting
ac_add_options --disable-elf-hack
ac_add_options --disable-tasktracer
ac_add_options --disable-stdcxx-compat
ac_add_options --disable-startupcache
ac_add_options --disable-nfc
ac_add_options --disable-webspeech
ac_add_options --disable-synth-speechd
ac_add_options --disable-webspeechtestbackend
ac_add_options --disable-synth-pico
ac_add_options --disable-system-cairo
ac_add_options --disable-system-pixman
ac_add_options --enable-xul
ac_add_options --disable-necko-wifi
ac_add_options --enable-ctypes
ac_add_options --without-system-icu
ac_add_options --with-intl-api
ac_add_options --enable-hardening
ac_add_options --enable-release
ac_add_options --enable-rust-simd
ac_add_options --enable-tests
ac_add_options --enable-js-shell
ac_add_options --disable-lto
ac_add_options --disable-profiling
ac_add_options --disable-vtune
ac_add_options --disable-dmd
mk_add_options AUTOCONF=autoconf-2.13
mk_add_options PYTHON=/usr/bin/python2
export CXXFLAGS="-pipe -march=native -Wno-trigraphs -fno-delete-null-pointer-checks -mtune=native -fomit-frame-pointer -O2 -fPIC -D_FORTIFY_SOURCE=2 -fno-plt"
export CFLAGS="-pipe -march=native -Wno-trigraphs -fno-delete-null-pointer-checks -mtune=native -fomit-frame-pointer -O2 -fPIC -D_FORTIFY_SOURCE=2 -fno-plt"
ac_add_options --with-ccache=/usr/bin/ccache
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
mk_add_options AUTOCLOBBER=1
ac_add_options --disable-artifact-builds


Only 3 things changed from the initial `mozconfig`(which didn't work):

1. I added:
ac_add_options --enable-js-shell
#^ needed by enable-tests below

2. I replaced:
ac_add_options --disable-tests
with:
ac_add_options --enable-tests

3. I replaced:
ac_add_options --enable-more-deterministic
with:
ac_add_options --disable-more-deterministic

Having --enable-tests takes a lot more time to compile so I'll be disabling them, and the js-shell, it was more for debug than anything else.

--enable-more-deterministic was obviously(now) the culprit and why the issue was happening.

Glad I found out (the)whY.

Thanks for putting up with my spam:)