-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error on Ubuntu 18.04 #24
Comments
Here is the complete build.log. |
After I worked on the "novel" above last several hours. I find that may be my |
Summary: The `VLOG(8)` is not enabled anywhere (it looks like this was mainly for debugging purposes during development) and this adds a non-trivial amount of generated code. Each instantiation is distinct since the logging string is dependent on the NTTP. The VLOG macro itself generates a decent amount of code to check whether or not the logging level is enabled. Additionally, downgrade the `CHECK` to a `DCHECK` -- we don't ever expect this to be hit; the state machine implementations always use an unqualified access to `Transition` (i.e. nobody ever explicitly writes `EventHandlerBase<SM, SomeOtherState, SomeOtherEvent>::Transition`, which means that the correct state is guaranteed. This also eliminates the runtime check overhead. Prior to this diff: ``` 0000000000034ac4 <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE>: 34ac4: d10103ff sub sp, sp, #0x40 34ac8: a90257fe stp x30, x21, [sp, #32] 34acc: a9034ff4 stp x20, x19, [sp, #48] 34ad0: d53bd054 mrs x20, tpidr_el0 34ad4: 52800035 mov w21, #0x1 // #1 34ad8: f0fffea2 adrp x2, b000 <note_end+0xad30> 34adc: 911ea042 add x2, x2, #0x7a8 34ae0: f9401688 ldr x8, [x20, #40] 34ae4: 910003e1 mov x1, sp 34ae8: aa0003f3 mov x19, x0 34aec: f9000fe8 str x8, [sp, #24] 34af0: b90003f5 str w21, [sp] 34af4: 94003d92 bl 4413c <_ZN6google12Check_EQImplIN4fizz6client9StateEnumES3_EEPNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKT_RKT0_PKc> 34af8: f9000be0 str x0, [sp, #16] 34afc: b5000140 cbnz x0, 34b24 <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE+0x60> 34b00: b9000275 str w21, [x19] 34b04: f9401688 ldr x8, [x20, #40] 34b08: f9400fe9 ldr x9, [sp, #24] 34b0c: eb09011f cmp x8, x9 34b10: 540001c1 b.ne 34b48 <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE+0x84> // b.any 34b14: a9434ff4 ldp x20, x19, [sp, #48] 34b18: a94257fe ldp x30, x21, [sp, #32] 34b1c: 910103ff add sp, sp, #0x40 34b20: d65f03c0 ret 34b24: f0fffea1 adrp x1, b000 <note_end+0xad30> 34b28: 9114e821 add x1, x1, #0x53a 34b2c: 910003e0 mov x0, sp 34b30: 910043e3 add x3, sp, #0x10 34b34: 52800502 mov w2, #0x28 // #40 34b38: 940084bb bl 55e24 <_ZN6google15LogMessageFatalC1EPKciRKNS_13CheckOpStringE> 34b3c: 910003e0 mov x0, sp 34b40: 940080a1 bl 54dc4 <_ZN6google10LogMessage6streamEv> 34b44: 14000002 b 34b4c <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE+0x88> 34b48: 94008c82 bl 57d50 <__stack_chk_fail@plt> 34b4c: 910003e0 mov x0, sp 34b50: 940084b6 bl 55e28 <_ZN6google15LogMessageFatalD1Ev> ``` After this diff: ``` 00000000000347e8 <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE>: 347e8: 52800028 mov w8, #0x1 // #1 347ec: b9000008 str w8, [x0] 347f0: d65f03c0 ret ``` Reviewed By: abakiaydin Differential Revision: D58162021 fbshipit-source-id: e223ac9902b3c6817ee4e5962292b20bd95c40f7
…rence Summary: Prior to this diff, the `EarlyAppWrite` was taken in by value, which meant that there were 6 unique event handlers that needed to perform the allocate stack/move/call/cleanup/exception handling for each call to `handleAppWrite` or `ignoreEarlyAppWrite`. This diff changes the signature to take the parameter by reference. This means that w.r.t the caller, there are no locally scoped variables with non-trivial destructors, so that the EventHandlers can simply tail call into the function. Before: ``` 0000000000039774 <_ZN4fizz2sm12EventHandlerINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE16EE6handleERKNS2_5StateERNS_5ParamE>: 39774: d10143ff sub sp, sp, #0x50 39778: f9001bfe str x30, [sp, #48] 3977c: a9044ff4 stp x20, x19, [sp, #64] 39780: d53bd053 mrs x19, tpidr_el0 39784: 910003f4 mov x20, sp 39788: f9401669 ldr x9, [x19, #40] 3978c: f90017e9 str x9, [sp, #40] 39790: b9412029 ldr w9, [x1, #288] 39794: 71004d3f cmp w9, #0x13 39798: 9a9f0029 csel x9, x1, xzr, eq // eq = none 3979c: 3dc00120 ldr q0, [x9] 397a0: f900053f str xzr, [x9, #8] 397a4: f940092a ldr x10, [x9, #16] 397a8: b9401929 ldr w9, [x9, #24] 397ac: 3d8003e0 str q0, [sp] 397b0: f9000bea str x10, [sp, #16] 397b4: b9001be9 str w9, [sp, #24] 397b8: 910003e1 mov x1, sp 397bc: 94000011 bl 39800 <_ZN4fizz2smL19handleEarlyAppWriteERKNS_6client5StateENS_13EarlyAppWriteE> 397c0: b27d0280 orr x0, x20, #0x8 397c4: 97ffb75a bl 2752c <_ZNSt6__ndk110unique_ptrIN5folly5IOBufENS_14default_deleteIS2_EEED2Ev> 397c8: f9401668 ldr x8, [x19, #40] 397cc: f94017e9 ldr x9, [sp, #40] 397d0: eb09011f cmp x8, x9 397d4: 540000a1 b.ne 397e8 <_ZN4fizz2sm12EventHandlerINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE16EE6handleERKNS2_5StateERNS_5ParamE+0x74> // b.any 397d8: a9444ff4 ldp x20, x19, [sp, #64] 397dc: f9401bfe ldr x30, [sp, #48] 397e0: 910143ff add sp, sp, #0x50 397e4: d65f03c0 ret 397e8: 9400770e bl 57420 <__stack_chk_fail@plt> 397ec: aa0003f3 mov x19, x0 397f0: b27d0280 orr x0, x20, #0x8 397f4: 97ffb74e bl 2752c <_ZNSt6__ndk110unique_ptrIN5folly5IOBufENS_14default_deleteIS2_EEED2Ev> 397f8: aa1303e0 mov x0, x19 397fc: 940078d1 bl 57b40 <__wrap__Unwind_Resume@plt> ``` After: ``` 0000000000039714 <_ZN4fizz2sm12EventHandlerINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE16EE6handleERKNS2_5StateERNS_5ParamE>: 39714: 14000001 b 39718 <_ZN4fizz2smL19handleEarlyAppWriteERKNS_6client5StateERNS_5ParamE> ``` Reviewed By: zalecodez Differential Revision: D58164235 fbshipit-source-id: 9d06f5bf7f1a2c931131597f53ef6c3cd734fe46
Environment:
gcc
7.3.0Boost
1.65 (actually, I also try the latest version 1.70, however, I forget to record the error messages)fizz
v2019.04.15.00 (actually, I also try the latest source code, just the same)Log of CMake in generate time:
folly
v2019.04.15.00Then we can see the compiler write a novel in the screen:
How can I do with it? Thanks very much!
Hope you have a good day.
The text was updated successfully, but these errors were encountered: