Closed Bug 1825516 Opened 2 years ago Closed 2 years ago

Perma /worker/checkouts/gecko/accessible/ipc/RemoteAccessibleBase.cpp:702:66: error: 'bool mozilla::a11y::RemoteAccessibleBase<Derived>::ApplyScrollOffset(nsRect&) const [with Derived = mozilla::a11y::RemoteAccessible]' is protected within this context

Categories

(Core :: Disability Access APIs, defect, P5)

defect

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox111 --- unaffected
firefox112 --- unaffected
firefox113 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: nlapre)

References

(Regression)

Details

(Keywords: intermittent-failure, regression)

Attachments

(3 files)

Filed by: csabou [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=410775413&repo=mozilla-central
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/eE3ARJ2mTg6tT98TTqYPEQ/runs/0/artifacts/public/logs/live_backing.log


[task 2023-03-30T09:56:32.202Z] 09:56:32     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/accessible/ipc'
[task 2023-03-30T09:56:32.205Z] 09:56:32     INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/gcc/bin/g++ --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -o Unified_cpp_accessible_ipc0.o -c  -I/builds/worker/workspace/obj-build/dist/stl_wrappers -I/builds/worker/workspace/obj-build/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DOS_POSIX=1 -DOS_LINUX=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/accessible/ipc -I/builds/worker/workspace/obj-build/accessible/ipc -I/builds/worker/checkouts/gecko/accessible/ipc/other -I/builds/worker/checkouts/gecko/accessible/atk -I/builds/worker/checkouts/gecko/accessible/base -I/builds/worker/checkouts/gecko/accessible/generic -I/builds/worker/checkouts/gecko/accessible/xpcom -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-build/mozilla-config.h -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -freorder-blocks -O2 -fno-omit-frame-pointer -funwind-tables -Werror -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wc++2a-compat -Wcomma-subscript -Wvolatile -Wno-error=deprecated -Wno-error=deprecated-enum-enum-conversion -Wduplicated-cond -Wimplicit-fallthrough -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wformat -Wformat-overflow=2 -Wno-psabi -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/Unified_cpp_accessible_ipc0.o.pp   Unified_cpp_accessible_ipc0.cpp
[task 2023-03-30T09:56:32.205Z] 09:56:32     INFO -  In file included from Unified_cpp_accessible_ipc0.cpp:20:
[task 2023-03-30T09:56:32.205Z] 09:56:32     INFO -  /builds/worker/checkouts/gecko/accessible/ipc/RemoteAccessibleBase.cpp: In member function 'mozilla::LayoutDeviceIntRect mozilla::a11y::RemoteAccessibleBase<Derived>::BoundsWithOffset(mozilla::Maybe<nsRect>, bool) const':
[task 2023-03-30T09:56:32.205Z] 09:56:32    ERROR -  /builds/worker/checkouts/gecko/accessible/ipc/RemoteAccessibleBase.cpp:702:66: error: 'bool mozilla::a11y::RemoteAccessibleBase<Derived>::ApplyScrollOffset(nsRect&) const [with Derived = mozilla::a11y::RemoteAccessible]' is protected within this context
[task 2023-03-30T09:56:32.205Z] 09:56:32     INFO -    702 |           const bool hasScrollArea = remoteAcc->ApplyScrollOffset(bounds);
[task 2023-03-30T09:56:32.208Z] 09:56:32     INFO -        |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
[task 2023-03-30T09:56:32.208Z] 09:56:32     INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/RemoteAccessible.h:11,
[task 2023-03-30T09:56:32.209Z] 09:56:32     INFO -                   from /builds/worker/checkouts/gecko/accessible/ipc/DocAccessibleChildBase.cpp:9,
[task 2023-03-30T09:56:32.209Z] 09:56:32     INFO -                   from Unified_cpp_accessible_ipc0.cpp:2:
[task 2023-03-30T09:56:32.209Z] 09:56:32     INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/RemoteAccessibleBase.h:439:8: note: declared protected here
[task 2023-03-30T09:56:32.209Z] 09:56:32     INFO -    439 |   bool ApplyScrollOffset(nsRect& aBounds) const;
[task 2023-03-30T09:56:32.209Z] 09:56:32     INFO -        |        ^~~~~~~~~~~~~~~~~
[task 2023-03-30T09:56:32.209Z] 09:56:32     INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/nsIFrame.h:53,
[task 2023-03-30T09:56:32.209Z] 09:56:32     INFO -                   from /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/HyperTextAccessible.h:13,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/HyperTextAccessibleWrap.h:10,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/DocAccessible.h:11,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/DocAccessibleChildBase.h:10,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from /builds/worker/checkouts/gecko/accessible/ipc/DocAccessibleChildBase.cpp:7,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from Unified_cpp_accessible_ipc0.cpp:2:
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -  /builds/worker/workspace/obj-build/dist/include/FrameProperties.h: In instantiation of 'static mozilla::FrameProperties::PropertyType<T> mozilla::FrameProperties::ReinterpretHelper<T>::FromInternalValue(uint64_t) [with T = mozilla::SmallValueHolder<mozilla::FrameBidiData>; mozilla::FrameProperties::PropertyType<T> = mozilla::FrameBidiData; uint64_t = long unsigned int]':
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -  /builds/worker/workspace/obj-build/dist/include/FrameProperties.h:202:51:   required from 'mozilla::FrameProperties::PropertyType<T> mozilla::FrameProperties::Get(mozilla::FrameProperties::Descriptor<T>, bool*) const [with T = mozilla::SmallValueHolder<mozilla::FrameBidiData>; mozilla::FrameProperties::PropertyType<T> = mozilla::FrameBidiData; mozilla::FrameProperties::Descriptor<T> = const mozilla::FramePropertyDescriptor<mozilla::SmallValueHolder<mozilla::FrameBidiData> >*]'
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -  /builds/worker/workspace/obj-build/dist/include/nsIFrame.h:4155:27:   required from 'mozilla::FrameProperties::PropertyType<T> nsIFrame::GetProperty(mozilla::FrameProperties::Descriptor<T>, bool*) const [with T = mozilla::SmallValueHolder<mozilla::FrameBidiData>; mozilla::FrameProperties::PropertyType<T> = mozilla::FrameBidiData; mozilla::FrameProperties::Descriptor<T> = const mozilla::FramePropertyDescriptor<mozilla::SmallValueHolder<mozilla::FrameBidiData> >*]'
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -  /builds/worker/workspace/obj-build/dist/include/nsIFrame.h:1382:50:   required from here
[task 2023-03-30T09:56:32.210Z] 09:56:32  WARNING -  /builds/worker/workspace/obj-build/dist/include/FrameProperties.h:302:13: warning: 'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'mozilla::FrameProperties::PropertyType<mozilla::SmallValueHolder<mozilla::FrameBidiData> >' {aka 'struct mozilla::FrameBidiData'} from an array of 'uint64_t' {aka 'long unsigned int'} [-Wclass-memaccess]
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -    302 |       memcpy(&value, &aInternalValue, sizeof(value));
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -        |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/HyperTextAccessible.h:13,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/HyperTextAccessibleWrap.h:10,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/DocAccessible.h:11,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from /builds/worker/workspace/obj-build/dist/include/mozilla/a11y/DocAccessibleChildBase.h:10,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from /builds/worker/checkouts/gecko/accessible/ipc/DocAccessibleChildBase.cpp:7,
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -                   from Unified_cpp_accessible_ipc0.cpp:2:
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -  /builds/worker/workspace/obj-build/dist/include/nsIFrame.h:388:8: note: 'mozilla::FrameProperties::PropertyType<mozilla::SmallValueHolder<mozilla::FrameBidiData> >' {aka 'struct mozilla::FrameBidiData'} declared here
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -    388 | struct FrameBidiData {
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -        |        ^~~~~~~~~~~~~
[task 2023-03-30T09:56:32.210Z] 09:56:32    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:670: Unified_cpp_accessible_ipc0.o] Error 1
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/accessible/ipc'
[task 2023-03-30T09:56:32.210Z] 09:56:32     INFO -  gmake[4]: Target 'target-objects' not remade because of errors.
[task 2023-03-30T09:56:32.210Z] 09:56:32    ERROR -  gmake[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:72: accessible/ipc/target-objects] Error 2

Set release status flags based on info from the regressing bug 1819741

:nlapre, since you are the author of the regressor, bug 1819741, could you take a look?

For more information, please visit auto_nag documentation.

I see the same on Solaris.

Assignee: nobody → nlapre
Flags: needinfo?(nlapre)

I'm having trouble reproducing this, though I've tried with compiler explorer's gcc (see here).

I'm confused as to how my patch caused this build failure. I changed the function signature of ApplyScrollOffset, but didn't change the access rules for the member function, nor did I add or remove an invocation of it. The function was protected before my patch; I didn't change that. I'm wondering if it's possible that there's something else going on with the build environment causing this.

Still poking at it, just trying to get it to fail for me locally.

Could anyone point me to the best way to ask Linux to build Firefox with gcc? I can't seem to find the right option for mach configure to switch off of clang as I try to reproduce this.

I am hitting this issue when I try to build C-C thunderbird using GCC version 11 after modifying M-C and C-C in the last several hours.

This is under Debian GNU/Linux.

I think you can define

export CC="/usr/bin/gcc-11"
export CXX="/usr/bin/g++-11"

(or whatever version of gcc you may want to use, simply exporting CC=/usr/bin/gcc and CXX=/usr/bin/g++ should work)

and then in the same shell session that inherits CC, CXX values as exported environment variables
|mach clobber|
|mach configure|
|mach build| or |mach| should build M-C FF.

hope this helps.

Just for completeness's sake, I am quoting my local build failure.
I think it would be very similar to the original poster's.
The warning from " struct FrameBidiData {" can be ignored for now. It is a warning.
This is logged during the build of C-C TB under Debian GNU/Linux using gcc 11 compiler suite.

In file included from Unified_cpp_accessible_ipc0.cpp:20:
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/accessible/ipc/RemoteAccessibleBase.cpp: In member function ‘mozilla::LayoutDeviceIntRect mozilla::a11y::RemoteAccessibleBase<Derived>::BoundsWithOffset(mozilla::Maybe<nsRect>, bool) const’:
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/accessible/ipc/RemoteAccessibleBase.cpp:702:66: error: ‘bool mozilla::a11y::RemoteAccessibleBase<Derived>::ApplyScrollOffset(nsRect&) const [with Derived = mozilla::a11y::RemoteAccessible]’ is protected within this context
  702 |           const bool hasScrollArea = remoteAcc->ApplyScrollOffset(bounds);
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /NEW-SSD/moz-obj-dir/objdir-tb3/dist/include/mozilla/a11y/RemoteAccessible.h:11,
                 from /NEW-SSD/NREF-COMM-CENTRAL/mozilla/accessible/ipc/DocAccessibleChildBase.cpp:9,
                 from Unified_cpp_accessible_ipc0.cpp:2:
/NEW-SSD/moz-obj-dir/objdir-tb3/dist/include/mozilla/a11y/RemoteAccessibleBase.h:439:8: note: declared protected here
  439 |   bool ApplyScrollOffset(nsRect& aBounds) const;
      |        ^~~~~~~~~~~~~~~~~
In file included from /NEW-SSD/moz-obj-dir/objdir-tb3/dist/include/nsIFrame.h:53,
                 from /NEW-SSD/moz-obj-dir/objdir-tb3/dist/include/mozilla/a11y/HyperTextAccessible.h:13,
                 from /NEW-SSD/moz-obj-dir/objdir-tb3/dist/include/mozilla/a11y/HyperTextAccessibleWrap.h:10,
                 from /NEW-SSD/moz-obj-dir/objdir-tb3/dist/include/mozilla/a11y/DocAccessible.h:11,
                 from /NEW-SSD/moz-obj-dir/objdir-tb3/dist/include/mozilla/a11y/DocAccessibleChildBase.h:10,
                 from /NEW-SSD/NREF-COMM-CENTRAL/mozilla/accessible/ipc/DocAccessibleChildBase.cpp:7,
                 from Unified_cpp_accessible_ipc0.cpp:2:

As I mentioned in my previous post,

export CC="/usr/bin/gcc"
export CXX="/usr/bin/g++"
# or specify whatever version of gcc you may want to use,  exporting CC=/usr/bin/gcc-11 and CXX=/usr/bin/g++-11 is what I use, for example

# export ... other variables .. to customize your build here
# cd to proper souce directory and then,
mach clobber
mach configure
mach build

should build M-C/C-C software (in my case it is TB, and it is FF in your case) using the specified GCC compilers.
Switching the compiler to GCC using the environment variables is what I have been doing for years.
Just undefine CC and CXX will revert back to clang.

Attached patch WIP patchSplinter Review

I don't have time to look into the compiler/language issues.
But the attached patch got me going by building C-C TB so that I can fix the pending issues in C-C TB.

Someone needs to sit down and figure out what is going on IMHO.

YMMV

Thanks for the tips on building with gcc! I've got a local reproducer now and I've looked into it. I think this might be a gcc bug. The compiler doesn't like it when we capture the return value of ApplyScrollOffset. For instance, if we instead write Unused << ApplyScrollOffset(bounds);, gcc won't complain. As far as I can tell, we haven't violated any C++ rules with this code (and the majority of compilers agree), so I'm inclined to call this a compiler bug. I've found a workaround which seems effective: wrapping the call in an anonymous lambda:

const bool hasScrollArea = [&]() {
    return remoteAcc->ApplyScrollOffset(bounds);
}();

I don't love it, but this satisfies the compiler. I'm going to post a patch with this change soon. I haven't found an open gcc bug for this issue. If I have some more time I'll try to narrow it down to a minimal reproducer (my efforts in Comment 3 above didn't work).

This revision works around a suspected bug in gcc which was causing
build failures. The compiler would complain that ApplyScrollOffset was
protected, and therefore inaccessible, if we capture the return value
of that function within BoundsWithOffset. I don't think this actually
violates any C++ rules, and other compilers agree. To work around the
problem, this revision wraps the call to ApplyScrollOffset in an
immediately-invoked lambda, which satisfies gcc for some reason.

Maybe we can file a gcc bug without reduced case just to inform of a possible bug to the developer community.

With gcc bug, creating a small reproducible case turns out to be often close to impossible for large mozilla source file.
I tried using automatic reduce tool, but I gave up after running the tool for three days or so and could not come up with valid reduced case.
(Or maybe I was using the tool wrongly. https://embed.cs.utah.edu/creduce/ )

An example of reporting a problem without the reduced test case.
A gcc bug report of mine. I simply attached the preprocessed file.
One of the developers found a reduced case using C-vise.
It is still being addressed(?), but at least the developers are aware of the existence of the bug (at least the database has it.).

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98000

Pushed by nlapre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0e1627afe8a2 Work around suspected gcc bug, r=morgan,eeejay

Here is a preprocessed version of RemoteAccessibleBase.cpp that will show the error alone when compiled with gcc (specifically, 12.2.1 20220819 (Red Hat 12.2.1-2)) like so:

g++ -c -fno-exceptions -Wno-invalid-offsetof -Wno-error=class-memaccess -Wno-deprecated-declarations -Wno-literal-suffix -Wno-narrowing RemoteAccessibleBase.i

I have yet to get the creduce tool to work, but this is a preprocessed file which appears similar to that which you submitted to gcc devs in the past.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch

(In reply to Nathan LaPré from comment #14)

Here is a preprocessed version of RemoteAccessibleBase.cpp that will show the error alone when compiled with gcc (specifically, 12.2.1 20220819 (Red Hat 12.2.1-2)) like so:

g++ -c -fno-exceptions -Wno-invalid-offsetof -Wno-error=class-memaccess -Wno-deprecated-declarations -Wno-literal-suffix -Wno-narrowing RemoteAccessibleBase.i

I have yet to get the creduce tool to work, but this is a preprocessed file which appears similar to that which you submitted to gcc devs in the past.

Thank you again for producing the preprocessed file.

After painful 4 days, I could produce a reduced test case.
This compiles with clang and fails with g++-12 without any options.

struct nsRect { int x; int y; } ;
namespace mozilla {
namespace a11y {
template <class Derived> struct RemoteAccessibleBase {
protected:
        bool ApplyScrollOffset(nsRect & a) const { return a.x > 0 ? true: false; } ;
   void BoundsWithOffset() const;
};
struct RemoteAccessible;
template <class Derived>
void RemoteAccessibleBase<Derived>::BoundsWithOffset() const {
  nsRect bounds = {1,1} ;
  RemoteAccessibleBase<RemoteAccessible> remoteAcc;
  const bool hasScrollArea = remoteAcc.ApplyScrollOffset(bounds);
}
} // namespace a11y
} // namespace mozilla

Here is a console log:

ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ clang --version
clang version 15.0.5 (taskcluster-ETTsfeYjQ76jbYk0xzOrPA)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/ishikawa/.mozbuild/clang/bin
ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ g++-12 --version
g++-12 (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ clang -c target.cpp
ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ g++-12 -c target.cpp
target.cpp: In member function ‘void mozilla::a11y::RemoteAccessibleBase<Derived>::BoundsWithOffset() const’:
target.cpp:14:57: error: ‘bool mozilla::a11y::RemoteAccessibleBase<Derived>::ApplyScrollOffset(nsRect&) const [with Derived = mozilla::a11y::RemoteAccessible]’ is protected within this context
   14 |   const bool hasScrollArea = remoteAcc.ApplyScrollOffset(bounds);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
target.cpp:6:14: note: declared protected here
    6 |         bool ApplyScrollOffset(nsRect & a) const { return a.x > 0 ? true: false; } ;
      |              ^~~~~~~~~~~~~~~~~
ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ 

This is my first serious attempt to use c-vise.
The above example could be fed through cvise once more, but it produces a file that is NOT compilable by clang despite my test checker insists that the produced source be compilable by clang. Something is wrong.

I said "painful 4 days" because for the 1st three days, the g++ specific construct caused the semantic analyzer in c-vise to barf.
( I believe this is due to the appearance of built-in functions specific to g++.)
So c-vise was reduced to very dumb elimination of a bunch of lines at a time in a peephole optimizer fashion.
But the source was, after the reformatting done by c-vise, 160K lines of code. It has to repeat this process MANY times.
After each transformation of source files, in this case, the elimination of a few lines,
c-vise with my check script checks that the produced source preserves the original compilation problem, but not introducing other compilation errors.
So it has to perform the FULL compilation at least once. It took about 12-15 seconds initially (remember the 160K lines of code)
I tried to speed up the process by interrupting the process and did a few different transformation steps of my choice, but to no avail.
The sheer size of the source and g++-specific construct rendered the source analysis impossible.
I even tried to eliminate some of the g++ specific built-in function calls most notably something about args_pack(), but again it was not very effective.

After three days, when this very inefficient process of chipping away a few lines at a time reduced the source file to about 65K lines of code [and with my several steps of invoking a few other internal steps of c-vise by skipping the ordinary flow], suddenly the semantic analyzer within c-vise started to work. I think the routines specific to g++ disappeared by then and also something that caused the clang c++ compiler to barf was eliminated.
It was good news since now c-vise can remove unused functions using the semantic information and invoke other transformation steps based on the semantic information, followed by the repeated elimination of a few lines code at a time in a peephole optimization manner again.
It is a repetitive process.
After the semantic analysis started to work, it took about 14 hours to produce the above shortened code.
I used seven cores of my Ryzen 3700X CPU under Debian GNU/Linux that runs inside VirtualBox running under Windows 10 Pro.

Actually the final code produced by c-vise failed to compile with clang without an option, so I modified it a bit.
I inserted { int x; int y; } for nsRect, and added the code to return true or false based on b.x.

Very educating experience. I believe during the first couple of days, I noticed an intermediate file which caused the clang c++ compiler to encounter an internal compiler error and spew the stack trace. That is when I tried to track the progress of c-vise.
I produced such problematic source code more than half a dozen times.
But I am not going to report these because I can't reduce them in a reasonable time (!) and the source code is unlikely to be produced by a human programmer.
Well, actually, the compiler internal error report may be easier to handle than the problem reported here because the stack trace really pin points at the problem of segfault.

Anyway, I will file an entry to GCC bugzilla citing this mozilla bugzilla entry.

(In reply to ISHIKAWA, Chiaki from comment #17)
...

Anyway, I will file an entry to GCC bugzilla citing this mozilla bugzilla entry.

GCC bugzilla filed.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109480

Wow, that's truly incredible work. Thank you so much for doing this, and thank you for your detailed write-up of the experience. I am following that GCC bug with extreme interest. It looks like the workaround they suggest would work well for us, should we need it. I've shared your work with the Mozilla Accessibility team. Thanks again!

(In reply to Nathan LaPré from comment #19)

Wow, that's truly incredible work. Thank you so much for doing this, and thank you for your detailed write-up of the experience. I am following that GCC bug with extreme interest. It looks like the workaround they suggest would work well for us, should we need it. I've shared your work with the Mozilla Accessibility team. Thanks again!

You are welcome.
Happy hacking :-)

GCC bug 109480 describes an issue we're encountering with calling protected
member functions from within protected member functions. The previous workaround,
removed in this revision, is a bit annoying, and must be repeated when we need
to capture the return value of protected functions. Making specializations of
RemoteAccessibleBase friends of other RemoteAccessibleBase specializations, while
maybe a bit heavy-handed, is a cleaner solution here, particularly since we only
specialize with RemoteAccessible itself. This is a workaround suggested by GCC
devs in the referenced bug.

Pushed by nlapre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/350f8a6d93c3 Replace one workaround with a nicer one r=Jamie
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: