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

Compiler using HARP + MPS fails to compile common-dylan-test-suite-app #882

Open
waywardmonkeys opened this Issue Apr 16, 2015 · 11 comments

Comments

Projects
None yet
2 participants
@waywardmonkeys
Member

waywardmonkeys commented Apr 16, 2015

After the addition of FE_INVALID support in #874, the HARP builds using MPS now fail make check as a result of crashing while compiling common-dylan-test-suite-app.

This is actually interesting.

The assertion failure from MPS in the build logs looks like this:

Building common-dylan-test-suite... The MPS detected a problem!
/opt/mps-kit-current/code/lockli.c:139: MPS ASSERTION FAILED: res == 0
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/opt/mps-kit-current/code/lockli.c:143: MPS ASSERTION FAILED: lock->claims == 0
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/opt/mps-kit-current/code/shield.c:222: MPS ASSERTION FAILED: !arena->insideShield
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/opt/mps-kit-current/code/shield.c:224: MPS ASSERTION FAILED: !arena->suspended
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/opt/mps-kit-current/code/lockli.c:139: MPS ASSERTION FAILED: res == 0
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/opt/mps-kit-current/code/lockli.c:143: MPS ASSERTION FAILED: lock->claims == 0
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/opt/mps-kit-current/code/shield.c:222: MPS ASSERTION FAILED: !arena->insideShield
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/opt/mps-kit-current/code/shield.c:224: MPS ASSERTION FAILED: !arena->suspended
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/opt/mps-kit-current/code/seg.c:655: MPS ASSERTION FAILED: SigCheck Seg: seg
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
fdmake: build product /home/jenkins/workspace/opendylan-release-linux-lucid-x86/Bootstrap.3/databases/common-dylan-test-suite.ddb missing
fdmake: build product /home/jenkins/workspace/opendylan-release-linux-lucid-x86/Bootstrap.3/lib/libcommon-dylan-test-suite.so missing
fdmake: compile failed (11), see /home/jenkins/workspace/opendylan-release-linux-lucid-x86/Bootstrap.3/build/logs/compile-common-dylan-test-suite.txt

I installed a clean Ubuntu 14.04 VM and did a build using MPS 1.114.0 and current master of Open Dylan (and gcc 4.8.2).

After the make completed, I ran make check, let it crash, and then ran make check FDMAKE_OPTIONS=--gdb so that it would run the failing build process under gdb.

Then, I set up signal handling in gdb correctly for MPS:

handle SIGSEGV pass nostop noprint

And then I ran and it broke into the debugger here:

Program received signal SIGFPE, Arithmetic exception.
0x401ac7dd in KSVKdMM4I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
(gdb) bt
#0  0x401ac7dd in KSVKdMM4I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#1  0x413a7936 in KCSVdfmc_modelingMM0I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-modeling.so
#2  0x434f5b74 in ?? ()
#3  0x401a13b6 in Khandle_missed_dispatchVKgI ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#4  0x40207c8f in general_engine_node_n ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#5  0x413d2a38 in KCTVdfmc_modeling ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-modeling.so
#6  0xbfffd830 in ?? ()
#7  0x401980c2 in KapplyVKdI ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#8  0x41c1e905 in Kfold_function_callVdfmc_optimizationMM2I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-optimization.so
#9  0x41c1e6c2 in Kmaybe_fold_function_callVdfmc_optimizationI ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-optimization.so
#10 0x41c429f2 in KoptimizeVdfmc_optimizationMM0I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-optimization.so
#11 0x41c42a21 in KoptimizeVdfmc_optimizationMM2I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-optimization.so
#12 0x41c42902 in Kdo_optimizeVdfmc_optimizationI ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-optimization.so
#13 0x41c427de in Krun_optimizationsVdfmc_optimizationMM0I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-optimization.so
#14 0x41c43bf7 in ?? ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-optimization.so
#15 0x41c43427 in ?? ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-optimization.so

We can see here that it was doing a division operator on a float (KSVKdMM4I) and that's where it hit the floating point exception. It did this in the context of attempting to constant fold some function calls during the optimization process.

I cont a couple of times to get through this set of exceptions and then:

Program received signal SIGFPE, Arithmetic exception.
0x4024af92 in TraceStart ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
(gdb) bt
#0  0x4024af92 in TraceStart ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#1  0x402500f7 in TracePoll ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#2  0x402502d4 in ArenaPoll ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#3  0x4025064f in mps_ap_fill ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#4  0x401fbc31 in primitive_alloc_s ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#5  0x415598b0 in KLcode_referencesGZ32ZconstructorVdfmc_back_endMM0I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-back-end.so
#6  0x402076d2 in apply_xep_1 ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#7  0xbfffd9dc in ?? ()
#8  0x4155dfd4 in Klambda_heap_for_sureVdfmc_back_endI ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-back-end.so
#9  0x4155dca0 in Kmaybe_claim_computations_referencesVdfmc_back_endMM0I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-back-end.so
#10 0x41562a81 in Kdrain_pending_elementsVdfmc_back_endI ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-back-end.so
#11 0x415627db in Ktrace_heap_from_rootsVdfmc_back_endMM0I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-back-end.so
#12 0x4155af55 in Kcompute_compilation_record_heapVdfmc_back_endMM0I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-back-end.so
#13 0x41564d1b in Kprecompute_library_heapsVdfmc_back_endMM0I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-back-end.so
#14 0x405116e4 in Kdo_with_profilingYcommon_dylan_internalsVcommon_dylanI ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libcommon-dylan.so
#15 0x40fa3548 in Kdo_timing_compilation_phaseVdfmc_managementI ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdfmc-management.so

I'm not sure why we hit this code path here in the GC (MPS people?), but we did.

I cont from there and:

(gdb) cont
Continuing.
The MPS detected a problem!
/home/bruce/Development/mps-kit-1.114.0/code/lockli.c:139: MPS ASSERTION FAILED: res == 0
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/home/bruce/Development/mps-kit-1.114.0/code/lockli.c:143: MPS ASSERTION FAILED: lock->claims == 0
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/home/bruce/Development/mps-kit-1.114.0/code/shield.c:222: MPS ASSERTION FAILED: !arena->insideShield
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions
The MPS detected a problem!
/home/bruce/Development/mps-kit-1.114.0/code/shield.c:224: MPS ASSERTION FAILED: !arena->suspended
See the "Assertions" section in the reference manual:
http://ravenbrook.com/project/mps/master/manual/html/topic/error.html#assertions

Program received signal SIGFPE, Arithmetic exception.
0x40232ae1 in BufferDetach ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so

At that point, the stack trace looks like:

0x40232ae1 in BufferDetach ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
(gdb) bt
#0  0x40232ae1 in BufferDetach ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#1  0x40233738 in BufferFill ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#2  0x40250701 in mps_ap_fill ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#3  0x401fb9ff in primitive_alloc_s2 ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#4  0x401aa765 in KLarithmetic_domain_errorGZ32ZconstructorVKiMM0I ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#5  0x401ace4f in Kfloat_invalidVKeI ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#6  0xbfffd7f8 in ?? ()
#7  0x402091d8 in dylan_float_invalid_handler ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
#8  0x4031f000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

So, we can see that (as is usual for a lockli.c, res == 0 assertion failure) we've re-entered MPS from the signal handler. We were inside of TraceStart, hit the FP exception, and then in the signal handler, we re-entered MPS to allocate the error object which allocated and caused a re-entry into MPS.

@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
Member

waywardmonkeys commented Apr 16, 2015

@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
@waywardmonkeys

waywardmonkeys Apr 16, 2015

Member

Me either. I was thinking that it might have been one of two things:

  • Is it possible that it was due to touching the memory that contains the bad floating point value rather than the act of carrying out an operation on it?
  • Is there any way that the delivery of a SIGFPE can be delayed?

This is pretty easy to reproduce at least (just takes some time) if you hop on IRC and need help. Otherwise, I'm wondering if I should try to fix the build so that MPS has better debug data / symbols available and see what I see them from the MPS side of things.

I'm not convinced that it is necessarily MPS at fault, just that the symptom lies there (in the asserts).

Member

waywardmonkeys commented Apr 16, 2015

Me either. I was thinking that it might have been one of two things:

  • Is it possible that it was due to touching the memory that contains the bad floating point value rather than the act of carrying out an operation on it?
  • Is there any way that the delivery of a SIGFPE can be delayed?

This is pretty easy to reproduce at least (just takes some time) if you hop on IRC and need help. Otherwise, I'm wondering if I should try to fix the build so that MPS has better debug data / symbols available and see what I see them from the MPS side of things.

I'm not convinced that it is necessarily MPS at fault, just that the symptom lies there (in the asserts).

@gareth-rees

This comment has been minimized.

Show comment
Hide comment
@gareth-rees

gareth-rees Apr 16, 2015

Yes, if you can find out which floating-point operation in TraceStart is invalid, and what the arguments are, that would be very useful.

gareth-rees commented Apr 16, 2015

Yes, if you can find out which floating-point operation in TraceStart is invalid, and what the arguments are, that would be very useful.

@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
@waywardmonkeys

waywardmonkeys Apr 16, 2015

Member

Okay, you asked for it.

I have a new theory: Perhaps with the HARP run-time, we aren't resetting the FPU status correctly after handling an error and that's causing something in MPS using floating point to think it had an error. This is pre-<fenv.h> code, so it is a bit hairy.

0x4024af92 in TraceStart ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
(gdb) disassemble
Dump of assembler code for function TraceStart:
   0x4024ad8d <+0>: push   %ebp
   0x4024ad8e <+1>: push   %edi
   0x4024ad8f <+2>: push   %esi
   0x4024ad90 <+3>: push   %ebx
   0x4024ad91 <+4>: sub    $0x4c,%esp
   0x4024ad94 <+7>: mov    0x60(%esp),%ebp
   0x4024ad98 <+11>:    fldl   0x64(%esp)
   0x4024ad9c <+15>:    fstpl  0x10(%esp)
   0x4024ada0 <+19>:    fldl   0x6c(%esp)
   0x4024ada4 <+23>:    fstpl  0x18(%esp)
   0x4024ada8 <+27>:    mov    %ebp,(%esp)
   0x4024adab <+30>:    call   0x40215afa <TraceCheck>
   0x4024adb0 <+35>:    test   %eax,%eax
   0x4024adb2 <+37>:    jne    0x4024add0 <TraceStart+67>
   0x4024adb4 <+39>:    movl   $0x40262b80,0x8(%esp)
   0x4024adbc <+47>:    movl   $0x658,0x4(%esp)
   0x4024adc4 <+55>:    movl   $0x40259c80,(%esp)
   0x4024adcb <+62>:    call   0x4020aa19 <mps_lib_assert_fail>
   0x4024add0 <+67>:    cmpl   $0x1,0x18(%ebp)
   0x4024add4 <+71>:    je     0x4024adf2 <TraceStart+101>
   0x4024add6 <+73>:    movl   $0x40264d37,0x8(%esp)
   0x4024adde <+81>:    movl   $0x659,0x4(%esp)
   0x4024ade6 <+89>:    movl   $0x40259c80,(%esp)
   0x4024aded <+96>:    call   0x4020aa19 <mps_lib_assert_fail>
   0x4024adf2 <+101>:   fldz   
   0x4024adf4 <+103>:   fldl   0x10(%esp)
   0x4024adf8 <+107>:   fucomip %st(1),%st
   0x4024adfa <+109>:   fstp   %st(0)
   0x4024adfc <+111>:   jae    0x4024ae1a <TraceStart+141>
   0x4024adfe <+113>:   movl   $0x402661db,0x8(%esp)
   0x4024ae06 <+121>:   movl   $0x65a,0x4(%esp)
   0x4024ae0e <+129>:   movl   $0x40259c80,(%esp)
   0x4024ae15 <+136>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024ae1a <+141>:   fld1   
   0x4024ae1c <+143>:   fldl   0x10(%esp)
   0x4024ae20 <+147>:   fxch   %st(1)
   0x4024ae22 <+149>:   fucomip %st(1),%st
   0x4024ae24 <+151>:   fstp   %st(0)
   0x4024ae26 <+153>:   jae    0x4024ae44 <TraceStart+183>
   0x4024ae28 <+155>:   movl   $0x402661ec,0x8(%esp)
   0x4024ae30 <+163>:   movl   $0x65b,0x4(%esp)
   0x4024ae38 <+171>:   movl   $0x40259c80,(%esp)
   0x4024ae3f <+178>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024ae44 <+183>:   fldz   
   0x4024ae46 <+185>:   fldl   0x18(%esp)
   0x4024ae4a <+189>:   fucomip %st(1),%st
   0x4024ae4c <+191>:   fstp   %st(0)
   0x4024ae4e <+193>:   jae    0x4024ae6c <TraceStart+223>
   0x4024ae50 <+195>:   movl   $0x402661fd,0x8(%esp)
   0x4024ae58 <+203>:   movl   $0x65c,0x4(%esp)
   0x4024ae60 <+211>:   movl   $0x40259c80,(%esp)
   0x4024ae67 <+218>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024ae6c <+223>:   mov    0x8(%ebp),%ebx
   0x4024ae6f <+226>:   mov    %ebx,0x4(%esp)
   0x4024ae73 <+230>:   lea    0x30(%esp),%eax
   0x4024ae77 <+234>:   mov    %eax,(%esp)
   0x4024ae7a <+237>:   call   0x4021c5ef <SegFirst>
   0x4024ae7f <+242>:   test   %eax,%eax
   0x4024ae81 <+244>:   je     0x4024af44 <TraceStart+439>
   0x4024ae87 <+250>:   mov    0x30(%esp),%eax
   0x4024ae8b <+254>:   mov    0x14(%eax),%edi
   0x4024ae8e <+257>:   mov    0x8(%eax),%edx
   0x4024ae91 <+260>:   mov    0x8(%edx),%esi
   0x4024ae94 <+263>:   movzbl 0x19(%eax),%edx
   0x4024ae98 <+267>:   and    $0x1,%edx
   0x4024ae9b <+270>:   mov    0x4(%ebp),%eax
   0x4024ae9e <+273>:   bt     %eax,%edx
   0x4024aea1 <+276>:   jae    0x4024aebf <TraceStart+306>
   0x4024aea3 <+278>:   movl   $0x4025c4e4,0x8(%esp)
   0x4024aeab <+286>:   movl   $0x66b,0x4(%esp)
   0x4024aeb3 <+294>:   movl   $0x40259c80,(%esp)
   0x4024aeba <+301>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024aebf <+306>:   mov    0x30(%esp),%eax
   0x4024aec3 <+310>:   testb  $0x78,0x19(%eax)
   0x4024aec7 <+314>:   je     0x4024af24 <TraceStart+407>
   0x4024aec9 <+316>:   sub    %esi,%edi
   0x4024aecb <+318>:   mov    0x10(%ebp),%edx
   0x4024aece <+321>:   test   %edx,0x24(%eax)
   0x4024aed1 <+324>:   je     0x4024aefe <TraceStart+369>
   0x4024aed3 <+326>:   mov    %eax,0x8(%esp)
   0x4024aed7 <+330>:   mov    %ebp,0x4(%esp)
   0x4024aedb <+334>:   mov    0x8(%eax),%eax
   0x4024aede <+337>:   mov    (%eax),%eax
   0x4024aee0 <+339>:   mov    %eax,(%esp)
   0x4024aee3 <+342>:   call   0x40216cef <PoolGrey>
   0x4024aee8 <+347>:   mov    0x30(%esp),%eax
   0x4024aeec <+351>:   movzbl 0x19(%eax),%edx
   0x4024aef0 <+355>:   and    $0x1,%edx
   0x4024aef3 <+358>:   mov    0x4(%ebp),%eax
   0x4024aef6 <+361>:   bt     %eax,%edx
   0x4024aef9 <+364>:   jae    0x4024aefe <TraceStart+369>
   0x4024aefb <+366>:   add    %edi,0x3c(%ebp)
   0x4024aefe <+369>:   mov    0x30(%esp),%eax
   0x4024af02 <+373>:   mov    0x8(%eax),%edx
   0x4024af05 <+376>:   mov    (%edx),%edx
   0x4024af07 <+378>:   mov    0x8(%edx),%edx
   0x4024af0a <+381>:   testb  $0x2,0x1c(%edx)
   0x4024af0e <+385>:   je     0x4024af24 <TraceStart+407>
   0x4024af10 <+387>:   movzbl 0x19(%eax),%edx
   0x4024af14 <+391>:   shr    %dl
   0x4024af16 <+393>:   and    $0x1,%edx
   0x4024af19 <+396>:   mov    0x4(%ebp),%eax
   0x4024af1c <+399>:   bt     %eax,%edx
   0x4024af1f <+402>:   jb     0x4024af24 <TraceStart+407>
   0x4024af21 <+404>:   add    %edi,0x38(%ebp)
   0x4024af24 <+407>:   mov    0x30(%esp),%eax
   0x4024af28 <+411>:   mov    %eax,0x8(%esp)
   0x4024af2c <+415>:   mov    %ebx,0x4(%esp)
   0x4024af30 <+419>:   lea    0x30(%esp),%eax
   0x4024af34 <+423>:   mov    %eax,(%esp)
   0x4024af37 <+426>:   call   0x4021c5c0 <SegNext>
   0x4024af3c <+431>:   test   %eax,%eax
   0x4024af3e <+433>:   jne    0x4024ae87 <TraceStart+250>
   0x4024af44 <+439>:   mov    %ebp,0x8(%esp)
   0x4024af48 <+443>:   movl   $0x4021668b,0x4(%esp)
   0x4024af50 <+451>:   mov    %ebx,(%esp)
   0x4024af53 <+454>:   call   0x4020a32c <RootsIterate>
   0x4024af58 <+459>:   test   %eax,%eax
   0x4024af5a <+461>:   je     0x4024af78 <TraceStart+491>
   0x4024af5c <+463>:   movl   $0x40266315,0x8(%esp)
   0x4024af64 <+471>:   movl   $0x689,0x4(%esp)
   0x4024af6c <+479>:   movl   $0x40259c80,(%esp)
   0x4024af73 <+486>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024af78 <+491>:   mov    0x34(%ebp),%eax
   0x4024af7b <+494>:   mov    $0x0,%edx
   0x4024af80 <+499>:   mov    %eax,0x20(%esp)
   0x4024af84 <+503>:   mov    %edx,0x24(%esp)
   0x4024af88 <+507>:   fildll 0x20(%esp)
   0x4024af8c <+511>:   fld1   
   0x4024af8e <+513>:   fldl   0x10(%esp)
=> 0x4024af92 <+517>:   fsubr  %st(1),%st
   0x4024af94 <+519>:   fmulp  %st,%st(2)
   0x4024af96 <+521>:   fxch   %st(1)
   0x4024af98 <+523>:   fnstcw 0x2e(%esp)
   0x4024af9c <+527>:   movzwl 0x2e(%esp),%eax
   0x4024afa1 <+532>:   mov    $0xc,%ah
   0x4024afa3 <+534>:   mov    %ax,0x2c(%esp)
   0x4024afa8 <+539>:   fldcw  0x2c(%esp)
   0x4024afac <+543>:   fistpll 0x20(%esp)
   0x4024afb0 <+547>:   fldcw  0x2e(%esp)
   0x4024afb4 <+551>:   mov    0x20(%esp),%eax
   0x4024afb8 <+555>:   fldl   0x18(%esp)
   0x4024afbc <+559>:   fmuls  0x402678a8
   0x4024afc2 <+565>:   fxch   %st(1)
   0x4024afc4 <+567>:   fucomip %st(1),%st
   0x4024afc6 <+569>:   ja     0x4024afd8 <TraceStart+587>
   0x4024afc8 <+571>:   fldl   0x402678e8
   0x4024afce <+577>:   fxch   %st(1)
   0x4024afd0 <+579>:   fucomi %st(1),%st
   0x4024afd2 <+581>:   fcmovnb %st(1),%st
   0x4024afd4 <+583>:   fstp   %st(1)
   0x4024afd6 <+585>:   jmp    0x4024afdc <TraceStart+591>
   0x4024afd8 <+587>:   fstp   %st(0)
   0x4024afda <+589>:   fld1   
   0x4024afdc <+591>:   add    0x3c(%ebp),%eax
   0x4024afdf <+594>:   fldcw  0x2c(%esp)
   0x4024afe3 <+598>:   fistpll 0x20(%esp)
   0x4024afe7 <+602>:   fldcw  0x2e(%esp)
   0x4024afeb <+606>:   mov    0x20(%esp),%ecx
   0x4024afef <+610>:   mov    $0x0,%edx
   0x4024aff4 <+615>:   div    %ecx
   0x4024aff6 <+617>:   add    $0x1,%eax
   0x4024aff9 <+620>:   mov    %eax,0x40(%ebp)
   0x4024affc <+623>:   mov    0x403011a8,%eax
   0x4024b001 <+628>:   sub    $0x402fc1a0,%eax
   0x4024b006 <+633>:   cmp    $0x33,%eax
   0x4024b009 <+636>:   ja     0x4024b042 <TraceStart+693>
   0x4024b00b <+638>:   movl   $0x2,(%esp)
   0x4024b012 <+645>:   call   0x4022d788 <EventFlush>
   0x4024b017 <+650>:   mov    0x403011a8,%eax
   0x4024b01c <+655>:   sub    $0x402fc1a0,%eax
   0x4024b021 <+660>:   cmp    $0x33,%eax
   0x4024b024 <+663>:   ja     0x4024b042 <TraceStart+693>
   0x4024b026 <+665>:   movl   $0x4025ee34,0x8(%esp)
   0x4024b02e <+673>:   movl   $0x6a2,0x4(%esp)
   0x4024b036 <+681>:   movl   $0x40259c80,(%esp)
   0x4024b03d <+688>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b042 <+693>:   mov    0x403011a8,%ecx
   0x4024b048 <+699>:   movw   $0x1c,-0x34(%ecx)
   0x4024b04e <+705>:   movw   $0x34,-0x32(%ecx)
   0x4024b054 <+711>:   rdtsc  
   0x4024b056 <+713>:   mov    %eax,-0x30(%ecx)
   0x4024b059 <+716>:   mov    %edx,-0x2c(%ecx)
   0x4024b05c <+719>:   mov    %ebp,-0x28(%ecx)
   0x4024b05f <+722>:   fldl   0x10(%esp)
   0x4024b063 <+726>:   fstpl  -0x24(%ecx)
   0x4024b066 <+729>:   fldl   0x18(%esp)
   0x4024b06a <+733>:   fstpl  -0x1c(%ecx)
   0x4024b06d <+736>:   mov    0x34(%ebp),%eax
   0x4024b070 <+739>:   mov    %eax,-0x14(%ecx)
   0x4024b073 <+742>:   mov    0x38(%ebp),%eax
   0x4024b076 <+745>:   mov    %eax,-0x10(%ecx)
   0x4024b079 <+748>:   mov    0x3c(%ebp),%eax
   0x4024b07c <+751>:   mov    %eax,-0xc(%ecx)
   0x4024b07f <+754>:   mov    0x10(%ebp),%eax
   0x4024b082 <+757>:   mov    %eax,-0x8(%ecx)
   0x4024b085 <+760>:   mov    0x40(%ebp),%eax
   0x4024b088 <+763>:   mov    %eax,-0x4(%ecx)
   0x4024b08b <+766>:   subl   $0x34,0x403011a8
   0x4024b092 <+773>:   movl   $0x2,0x18(%ebp)
   0x4024b099 <+780>:   mov    %ebp,(%esp)
   0x4024b09c <+783>:   call   0x4022c6fb <TracePostStartMessage>
   0x4024b0a1 <+788>:   mov    %ebp,(%esp)
   0x4024b0a4 <+791>:   call   0x40215afa <TraceCheck>
   0x4024b0a9 <+796>:   test   %eax,%eax
   0x4024b0ab <+798>:   jne    0x4024b0c9 <TraceStart+828>
   0x4024b0ad <+800>:   movl   $0x40262b80,0x8(%esp)
   0x4024b0b5 <+808>:   movl   $0x233,0x4(%esp)
   0x4024b0bd <+816>:   movl   $0x40259c80,(%esp)
   0x4024b0c4 <+823>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b0c9 <+828>:   mov    0x4(%ebp),%ecx
   0x4024b0cc <+831>:   mov    $0x1,%eax
   0x4024b0d1 <+836>:   shl    %cl,%eax
   0x4024b0d3 <+838>:   mov    %eax,0x34(%esp)
   0x4024b0d7 <+842>:   mov    0x8(%ebp),%eax
   0x4024b0da <+845>:   mov    %eax,0x18(%esp)
   0x4024b0de <+849>:   mov    %eax,0x38(%esp)
   0x4024b0e2 <+853>:   mov    %eax,(%esp)
   0x4024b0e5 <+856>:   call   0x4024384c <ShieldSuspend>
   0x4024b0ea <+861>:   cmpl   $0x2,0x18(%ebp)
   0x4024b0ee <+865>:   je     0x4024b10c <TraceStart+895>
   0x4024b0f0 <+867>:   movl   $0x4025bd24,0x8(%esp)
   0x4024b0f8 <+875>:   movl   $0x23a,0x4(%esp)
   0x4024b100 <+883>:   movl   $0x40259c80,(%esp)
   0x4024b107 <+890>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b10c <+895>:   mov    0x4(%ebp),%eax
   0x4024b10f <+898>:   mov    0x18(%esp),%ecx
   0x4024b113 <+902>:   mov    0x41c(%ecx),%edx
   0x4024b119 <+908>:   bt     %eax,%edx
   0x4024b11c <+911>:   jae    0x4024b13a <TraceStart+941>
   0x4024b11e <+913>:   movl   $0x4025ee8c,0x8(%esp)
   0x4024b126 <+921>:   movl   $0x23b,0x4(%esp)
   0x4024b12e <+929>:   movl   $0x40259c80,(%esp)
   0x4024b135 <+936>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b13a <+941>:   mov    0x403011a8,%eax
   0x4024b13f <+946>:   sub    $0x402fc1a0,%eax
   0x4024b144 <+951>:   cmp    $0x13,%eax
   0x4024b147 <+954>:   ja     0x4024b180 <TraceStart+1011>
   0x4024b149 <+956>:   movl   $0x2,(%esp)
   0x4024b150 <+963>:   call   0x4022d788 <EventFlush>
   0x4024b155 <+968>:   mov    0x403011a8,%eax
   0x4024b15a <+973>:   sub    $0x402fc1a0,%eax
   0x4024b15f <+978>:   cmp    $0x13,%eax
   0x4024b162 <+981>:   ja     0x4024b180 <TraceStart+1011>
   0x4024b164 <+983>:   movl   $0x4025eebc,0x8(%esp)
   0x4024b16c <+991>:   movl   $0x23d,0x4(%esp)
   0x4024b174 <+999>:   movl   $0x40259c80,(%esp)
   0x4024b17b <+1006>:  call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b180 <+1011>:  mov    0x403011a8,%ecx
   0x4024b186 <+1017>:  movw   $0x20,-0x14(%ecx)
   0x4024b18c <+1023>:  movw   $0x14,-0x12(%ecx)
   0x4024b192 <+1029>:  rdtsc  
   0x4024b194 <+1031>:  mov    %eax,-0x10(%ecx)
   0x4024b197 <+1034>:  mov    %edx,-0xc(%ecx)
   0x4024b19a <+1037>:  mov    %ebp,-0x8(%ecx)
   0x4024b19d <+1040>:  mov    0x18(%esp),%eax
   0x4024b1a1 <+1044>:  mov    %eax,-0x4(%ecx)
   0x4024b1a4 <+1047>:  subl   $0x14,0x403011a8
   0x4024b1ab <+1054>:  mov    0x50(%eax),%esi
   0x4024b1ae <+1057>:  mov    (%esi),%edi
   0x4024b1b0 <+1059>:  add    $0x50,%eax
   0x4024b1b3 <+1062>:  cmp    %eax,%esi
   0x4024b1b5 <+1064>:  je     0x4024b21b <TraceStart+1166>
   0x4024b1b7 <+1066>:  mov    %ebp,0x60(%esp)
   0x4024b1bb <+1070>:  mov    %eax,%ebp
   0x4024b1bd <+1072>:  lea    -0x10(%esi),%eax
   0x4024b1c0 <+1075>:  mov    %eax,(%esp)
   0x4024b1c3 <+1078>:  call   0x40214d34 <PoolCheck>
   0x4024b1c8 <+1083>:  test   %eax,%eax
   0x4024b1ca <+1085>:  jne    0x4024b1e8 <TraceStart+1115>
   0x4024b1cc <+1087>:  movl   $0x40262a05,0x8(%esp)
   0x4024b1d4 <+1095>:  movl   $0x1c0,0x4(%esp)
   0x4024b1dc <+1103>:  movl   $0x40259c80,(%esp)
   0x4024b1e3 <+1110>:  call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b1e8 <+1115>:  mov    0x8(%esi),%eax
   0x4024b1eb <+1118>:  mov    (%eax),%ebx
   0x4024b1ed <+1120>:  add    $0x8,%esi
   0x4024b1f0 <+1123>:  cmp    %esi,%eax
   0x4024b1f2 <+1125>:  je     0x4024b20b <TraceStart+1150>
   0x4024b1f4 <+1127>:  sub    $0x14,%eax
   0x4024b1f7 <+1130>:  mov    %eax,(%esp)
   0x4024b1fa <+1133>:  call   0x4021916f <BufferFlip>
   0x4024b1ff <+1138>:  mov    (%ebx),%edx
   0x4024b201 <+1140>:  cmp    %ebx,%esi
   0x4024b203 <+1142>:  je     0x4024b20b <TraceStart+1150>
   0x4024b205 <+1144>:  mov    %ebx,%eax
   0x4024b207 <+1146>:  mov    %edx,%ebx
   0x4024b209 <+1148>:  jmp    0x4024b1f4 <TraceStart+1127>
   0x4024b20b <+1150>:  mov    (%edi),%eax
   0x4024b20d <+1152>:  cmp    %edi,%ebp
   0x4024b20f <+1154>:  je     0x4024b217 <TraceStart+1162>
   0x4024b211 <+1156>:  mov    %edi,%esi
   0x4024b213 <+1158>:  mov    %eax,%edi
   0x4024b215 <+1160>:  jmp    0x4024b1bd <TraceStart+1072>
   0x4024b217 <+1162>:  mov    0x60(%esp),%ebp
   0x4024b21b <+1166>:  mov    0x14(%ebp),%eax
   0x4024b21e <+1169>:  test   %eax,%eax
   0x4024b220 <+1171>:  je     0x4024b357 <TraceStart+1482>
   0x4024b226 <+1177>:  mov    %eax,0x4(%esp)
   0x4024b22a <+1181>:  mov    0x18(%esp),%eax
   0x4024b22e <+1185>:  mov    %eax,(%esp)
   0x4024b231 <+1188>:  call   0x4021cbae <LDAge>
   0x4024b236 <+1193>:  jmp    0x4024b357 <TraceStart+1482>
   0x4024b23b <+1198>:  mov    0x18(%esp),%eax
   0x4024b23f <+1202>:  lea    0x4e0(%eax),%edi
   0x4024b245 <+1208>:  lea    0x500(%eax),%ecx
   0x4024b24b <+1214>:  mov    %ecx,0x28(%esp)
   0x4024b24f <+1218>:  mov    %eax,%esi
   0x4024b251 <+1220>:  mov    %edi,0x10(%esp)
   0x4024b255 <+1224>:  mov    0x10(%esp),%eax
   0x4024b259 <+1228>:  mov    %eax,%edi
   0x4024b25b <+1230>:  mov    (%eax),%edx
   0x4024b25d <+1232>:  mov    (%edx),%ebx
   0x4024b25f <+1234>:  cmp    %eax,%edx
   0x4024b261 <+1236>:  je     0x4024b29d <TraceStart+1296>
   0x4024b263 <+1238>:  movzbl -0x3(%edx),%eax
   0x4024b267 <+1242>:  and    $0x1,%eax
   0x4024b26a <+1245>:  test   %eax,0x41c(%esi)
   0x4024b270 <+1251>:  jne    0x4024b291 <TraceStart+1284>
   0x4024b272 <+1253>:  mov    0x4(%ebp),%ecx
   0x4024b275 <+1256>:  bt     %ecx,%eax
   0x4024b278 <+1259>:  jae    0x4024b291 <TraceStart+1284>
   0x4024b27a <+1261>:  movl   $0x1,0x8(%esp)
   0x4024b282 <+1269>:  sub    $0x1c,%edx
   0x4024b285 <+1272>:  mov    %edx,0x4(%esp)
   0x4024b289 <+1276>:  mov    %esi,(%esp)
   0x4024b28c <+1279>:  call   0x4024acdb <ShieldRaise>
   0x4024b291 <+1284>:  mov    (%ebx),%eax
   0x4024b293 <+1286>:  cmp    %ebx,%edi
   0x4024b295 <+1288>:  je     0x4024b29d <TraceStart+1296>
   0x4024b297 <+1290>:  mov    %ebx,%edx
   0x4024b299 <+1292>:  mov    %eax,%ebx
   0x4024b29b <+1294>:  jmp    0x4024b263 <TraceStart+1238>
   0x4024b29d <+1296>:  addl   $0x8,0x10(%esp)
   0x4024b2a2 <+1301>:  mov    0x28(%esp),%eax
   0x4024b2a6 <+1305>:  cmp    %eax,0x10(%esp)
   0x4024b2aa <+1309>:  jne    0x4024b255 <TraceStart+1224>
   0x4024b2ac <+1311>:  movl   $0x3,0x18(%ebp)
   0x4024b2b3 <+1318>:  mov    0x4(%ebp),%ecx
   0x4024b2b6 <+1321>:  mov    $0x1,%eax
   0x4024b2bb <+1326>:  shl    %cl,%eax
   0x4024b2bd <+1328>:  mov    0x18(%esp),%ecx
   0x4024b2c1 <+1332>:  or     %eax,0x41c(%ecx)
   0x4024b2c7 <+1338>:  mov    0x403011a8,%eax
   0x4024b2cc <+1343>:  sub    $0x402fc1a0,%eax
   0x4024b2d1 <+1348>:  cmp    $0x13,%eax
   0x4024b2d4 <+1351>:  ja     0x4024b30d <TraceStart+1408>
   0x4024b2d6 <+1353>:  movl   $0x2,(%esp)
   0x4024b2dd <+1360>:  call   0x4022d788 <EventFlush>
   0x4024b2e2 <+1365>:  mov    0x403011a8,%eax
   0x4024b2e7 <+1370>:  sub    $0x402fc1a0,%eax
   0x4024b2ec <+1375>:  cmp    $0x13,%eax
   0x4024b2ef <+1378>:  ja     0x4024b30d <TraceStart+1408>
   0x4024b2f1 <+1380>:  movl   $0x4025ef1c,0x8(%esp)
   0x4024b2f9 <+1388>:  movl   $0x273,0x4(%esp)
   0x4024b301 <+1396>:  movl   $0x40259c80,(%esp)
   0x4024b308 <+1403>:  call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b30d <+1408>:  mov    0x403011a8,%ecx
   0x4024b313 <+1414>:  movw   $0x21,-0x14(%ecx)
   0x4024b319 <+1420>:  movw   $0x14,-0x12(%ecx)
   0x4024b31f <+1426>:  rdtsc  
   0x4024b321 <+1428>:  mov    %eax,-0x10(%ecx)
   0x4024b324 <+1431>:  mov    %edx,-0xc(%ecx)
   0x4024b327 <+1434>:  mov    %ebp,-0x8(%ecx)
   0x4024b32a <+1437>:  mov    0x18(%esp),%eax
   0x4024b32e <+1441>:  mov    %eax,-0x4(%ecx)
   0x4024b331 <+1444>:  subl   $0x14,0x403011a8
   0x4024b338 <+1451>:  mov    %eax,(%esp)
   0x4024b33b <+1454>:  call   0x4021c8aa <ShieldResume>
   0x4024b340 <+1459>:  mov    $0x0,%eax
   0x4024b345 <+1464>:  jmp    0x4024b3ad <TraceStart+1568>
   0x4024b347 <+1466>:  mov    0x18(%esp),%eax
   0x4024b34b <+1470>:  mov    %eax,(%esp)
   0x4024b34e <+1473>:  call   0x4021c8aa <ShieldResume>
   0x4024b353 <+1478>:  mov    %ebx,%eax
   0x4024b355 <+1480>:  jmp    0x4024b3ad <TraceStart+1568>
   0x4024b357 <+1482>:  movl   $0x0,0x3c(%esp)
   0x4024b35f <+1490>:  lea    0x34(%esp),%eax
   0x4024b363 <+1494>:  mov    %eax,0x8(%esp)
   0x4024b367 <+1498>:  movl   $0x402471ad,0x4(%esp)
   0x4024b36f <+1506>:  mov    0x18(%esp),%edi
   0x4024b373 <+1510>:  mov    %edi,(%esp)
   0x4024b376 <+1513>:  call   0x4020a32c <RootsIterate>
   0x4024b37b <+1518>:  mov    %eax,%ebx
   0x4024b37d <+1520>:  test   %eax,%eax
   0x4024b37f <+1522>:  jne    0x4024b347 <TraceStart+1466>
   0x4024b381 <+1524>:  movl   $0x1,0x3c(%esp)
   0x4024b389 <+1532>:  lea    0x34(%esp),%eax
   0x4024b38d <+1536>:  mov    %eax,0x8(%esp)
   0x4024b391 <+1540>:  movl   $0x402471ad,0x4(%esp)
   0x4024b399 <+1548>:  mov    %edi,(%esp)
   0x4024b39c <+1551>:  call   0x4020a32c <RootsIterate>
   0x4024b3a1 <+1556>:  mov    %eax,%ebx
   0x4024b3a3 <+1558>:  test   %eax,%eax
   0x4024b3a5 <+1560>:  je     0x4024b23b <TraceStart+1198>
   0x4024b3ab <+1566>:  jmp    0x4024b347 <TraceStart+1466>
   0x4024b3ad <+1568>:  add    $0x4c,%esp
   0x4024b3b0 <+1571>:  pop    %ebx
   0x4024b3b1 <+1572>:  pop    %esi
   0x4024b3b2 <+1573>:  pop    %edi
   0x4024b3b3 <+1574>:  pop    %ebp
   0x4024b3b4 <+1575>:  ret    
End of assembler dump.
(gdb) info float
  R7: Zero    0x00000000000000000000 +0                         
  R6: Zero    0x00000000000000000000 +0                         
  R5: Zero    0x00000000000000000000 +0                         
  R4: Zero    0x00000000000000000000 +0                         
  R3: Zero    0x00000000000000000000 +0                         
  R2: Zero    0x00000000000000000000 +0                         
  R1: Valid   0x401683d14c0000000000 +8638796                   
=>R0: Valid   0x3fff8000000000000000 +1                         

Status Word:         0x83e1   IE             PE   ES   SF   C0 C1      
                       TOP: 0
Control Word:        0x0362      DM          PM
                       PC: Extended Precision (64-bits)
                       RC: Round to nearest
Tag Word:            0x5550
Instruction Pointer: 0x73:0x4024af8e
Operand Pointer:     0x7b:0xbfffd834
Opcode:              0xdd44
(gdb) 
Member

waywardmonkeys commented Apr 16, 2015

Okay, you asked for it.

I have a new theory: Perhaps with the HARP run-time, we aren't resetting the FPU status correctly after handling an error and that's causing something in MPS using floating point to think it had an error. This is pre-<fenv.h> code, so it is a bit hairy.

0x4024af92 in TraceStart ()
   from /home/bruce/Development/opendylan/Bootstrap.3/bin/../lib/libdylan.so
(gdb) disassemble
Dump of assembler code for function TraceStart:
   0x4024ad8d <+0>: push   %ebp
   0x4024ad8e <+1>: push   %edi
   0x4024ad8f <+2>: push   %esi
   0x4024ad90 <+3>: push   %ebx
   0x4024ad91 <+4>: sub    $0x4c,%esp
   0x4024ad94 <+7>: mov    0x60(%esp),%ebp
   0x4024ad98 <+11>:    fldl   0x64(%esp)
   0x4024ad9c <+15>:    fstpl  0x10(%esp)
   0x4024ada0 <+19>:    fldl   0x6c(%esp)
   0x4024ada4 <+23>:    fstpl  0x18(%esp)
   0x4024ada8 <+27>:    mov    %ebp,(%esp)
   0x4024adab <+30>:    call   0x40215afa <TraceCheck>
   0x4024adb0 <+35>:    test   %eax,%eax
   0x4024adb2 <+37>:    jne    0x4024add0 <TraceStart+67>
   0x4024adb4 <+39>:    movl   $0x40262b80,0x8(%esp)
   0x4024adbc <+47>:    movl   $0x658,0x4(%esp)
   0x4024adc4 <+55>:    movl   $0x40259c80,(%esp)
   0x4024adcb <+62>:    call   0x4020aa19 <mps_lib_assert_fail>
   0x4024add0 <+67>:    cmpl   $0x1,0x18(%ebp)
   0x4024add4 <+71>:    je     0x4024adf2 <TraceStart+101>
   0x4024add6 <+73>:    movl   $0x40264d37,0x8(%esp)
   0x4024adde <+81>:    movl   $0x659,0x4(%esp)
   0x4024ade6 <+89>:    movl   $0x40259c80,(%esp)
   0x4024aded <+96>:    call   0x4020aa19 <mps_lib_assert_fail>
   0x4024adf2 <+101>:   fldz   
   0x4024adf4 <+103>:   fldl   0x10(%esp)
   0x4024adf8 <+107>:   fucomip %st(1),%st
   0x4024adfa <+109>:   fstp   %st(0)
   0x4024adfc <+111>:   jae    0x4024ae1a <TraceStart+141>
   0x4024adfe <+113>:   movl   $0x402661db,0x8(%esp)
   0x4024ae06 <+121>:   movl   $0x65a,0x4(%esp)
   0x4024ae0e <+129>:   movl   $0x40259c80,(%esp)
   0x4024ae15 <+136>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024ae1a <+141>:   fld1   
   0x4024ae1c <+143>:   fldl   0x10(%esp)
   0x4024ae20 <+147>:   fxch   %st(1)
   0x4024ae22 <+149>:   fucomip %st(1),%st
   0x4024ae24 <+151>:   fstp   %st(0)
   0x4024ae26 <+153>:   jae    0x4024ae44 <TraceStart+183>
   0x4024ae28 <+155>:   movl   $0x402661ec,0x8(%esp)
   0x4024ae30 <+163>:   movl   $0x65b,0x4(%esp)
   0x4024ae38 <+171>:   movl   $0x40259c80,(%esp)
   0x4024ae3f <+178>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024ae44 <+183>:   fldz   
   0x4024ae46 <+185>:   fldl   0x18(%esp)
   0x4024ae4a <+189>:   fucomip %st(1),%st
   0x4024ae4c <+191>:   fstp   %st(0)
   0x4024ae4e <+193>:   jae    0x4024ae6c <TraceStart+223>
   0x4024ae50 <+195>:   movl   $0x402661fd,0x8(%esp)
   0x4024ae58 <+203>:   movl   $0x65c,0x4(%esp)
   0x4024ae60 <+211>:   movl   $0x40259c80,(%esp)
   0x4024ae67 <+218>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024ae6c <+223>:   mov    0x8(%ebp),%ebx
   0x4024ae6f <+226>:   mov    %ebx,0x4(%esp)
   0x4024ae73 <+230>:   lea    0x30(%esp),%eax
   0x4024ae77 <+234>:   mov    %eax,(%esp)
   0x4024ae7a <+237>:   call   0x4021c5ef <SegFirst>
   0x4024ae7f <+242>:   test   %eax,%eax
   0x4024ae81 <+244>:   je     0x4024af44 <TraceStart+439>
   0x4024ae87 <+250>:   mov    0x30(%esp),%eax
   0x4024ae8b <+254>:   mov    0x14(%eax),%edi
   0x4024ae8e <+257>:   mov    0x8(%eax),%edx
   0x4024ae91 <+260>:   mov    0x8(%edx),%esi
   0x4024ae94 <+263>:   movzbl 0x19(%eax),%edx
   0x4024ae98 <+267>:   and    $0x1,%edx
   0x4024ae9b <+270>:   mov    0x4(%ebp),%eax
   0x4024ae9e <+273>:   bt     %eax,%edx
   0x4024aea1 <+276>:   jae    0x4024aebf <TraceStart+306>
   0x4024aea3 <+278>:   movl   $0x4025c4e4,0x8(%esp)
   0x4024aeab <+286>:   movl   $0x66b,0x4(%esp)
   0x4024aeb3 <+294>:   movl   $0x40259c80,(%esp)
   0x4024aeba <+301>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024aebf <+306>:   mov    0x30(%esp),%eax
   0x4024aec3 <+310>:   testb  $0x78,0x19(%eax)
   0x4024aec7 <+314>:   je     0x4024af24 <TraceStart+407>
   0x4024aec9 <+316>:   sub    %esi,%edi
   0x4024aecb <+318>:   mov    0x10(%ebp),%edx
   0x4024aece <+321>:   test   %edx,0x24(%eax)
   0x4024aed1 <+324>:   je     0x4024aefe <TraceStart+369>
   0x4024aed3 <+326>:   mov    %eax,0x8(%esp)
   0x4024aed7 <+330>:   mov    %ebp,0x4(%esp)
   0x4024aedb <+334>:   mov    0x8(%eax),%eax
   0x4024aede <+337>:   mov    (%eax),%eax
   0x4024aee0 <+339>:   mov    %eax,(%esp)
   0x4024aee3 <+342>:   call   0x40216cef <PoolGrey>
   0x4024aee8 <+347>:   mov    0x30(%esp),%eax
   0x4024aeec <+351>:   movzbl 0x19(%eax),%edx
   0x4024aef0 <+355>:   and    $0x1,%edx
   0x4024aef3 <+358>:   mov    0x4(%ebp),%eax
   0x4024aef6 <+361>:   bt     %eax,%edx
   0x4024aef9 <+364>:   jae    0x4024aefe <TraceStart+369>
   0x4024aefb <+366>:   add    %edi,0x3c(%ebp)
   0x4024aefe <+369>:   mov    0x30(%esp),%eax
   0x4024af02 <+373>:   mov    0x8(%eax),%edx
   0x4024af05 <+376>:   mov    (%edx),%edx
   0x4024af07 <+378>:   mov    0x8(%edx),%edx
   0x4024af0a <+381>:   testb  $0x2,0x1c(%edx)
   0x4024af0e <+385>:   je     0x4024af24 <TraceStart+407>
   0x4024af10 <+387>:   movzbl 0x19(%eax),%edx
   0x4024af14 <+391>:   shr    %dl
   0x4024af16 <+393>:   and    $0x1,%edx
   0x4024af19 <+396>:   mov    0x4(%ebp),%eax
   0x4024af1c <+399>:   bt     %eax,%edx
   0x4024af1f <+402>:   jb     0x4024af24 <TraceStart+407>
   0x4024af21 <+404>:   add    %edi,0x38(%ebp)
   0x4024af24 <+407>:   mov    0x30(%esp),%eax
   0x4024af28 <+411>:   mov    %eax,0x8(%esp)
   0x4024af2c <+415>:   mov    %ebx,0x4(%esp)
   0x4024af30 <+419>:   lea    0x30(%esp),%eax
   0x4024af34 <+423>:   mov    %eax,(%esp)
   0x4024af37 <+426>:   call   0x4021c5c0 <SegNext>
   0x4024af3c <+431>:   test   %eax,%eax
   0x4024af3e <+433>:   jne    0x4024ae87 <TraceStart+250>
   0x4024af44 <+439>:   mov    %ebp,0x8(%esp)
   0x4024af48 <+443>:   movl   $0x4021668b,0x4(%esp)
   0x4024af50 <+451>:   mov    %ebx,(%esp)
   0x4024af53 <+454>:   call   0x4020a32c <RootsIterate>
   0x4024af58 <+459>:   test   %eax,%eax
   0x4024af5a <+461>:   je     0x4024af78 <TraceStart+491>
   0x4024af5c <+463>:   movl   $0x40266315,0x8(%esp)
   0x4024af64 <+471>:   movl   $0x689,0x4(%esp)
   0x4024af6c <+479>:   movl   $0x40259c80,(%esp)
   0x4024af73 <+486>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024af78 <+491>:   mov    0x34(%ebp),%eax
   0x4024af7b <+494>:   mov    $0x0,%edx
   0x4024af80 <+499>:   mov    %eax,0x20(%esp)
   0x4024af84 <+503>:   mov    %edx,0x24(%esp)
   0x4024af88 <+507>:   fildll 0x20(%esp)
   0x4024af8c <+511>:   fld1   
   0x4024af8e <+513>:   fldl   0x10(%esp)
=> 0x4024af92 <+517>:   fsubr  %st(1),%st
   0x4024af94 <+519>:   fmulp  %st,%st(2)
   0x4024af96 <+521>:   fxch   %st(1)
   0x4024af98 <+523>:   fnstcw 0x2e(%esp)
   0x4024af9c <+527>:   movzwl 0x2e(%esp),%eax
   0x4024afa1 <+532>:   mov    $0xc,%ah
   0x4024afa3 <+534>:   mov    %ax,0x2c(%esp)
   0x4024afa8 <+539>:   fldcw  0x2c(%esp)
   0x4024afac <+543>:   fistpll 0x20(%esp)
   0x4024afb0 <+547>:   fldcw  0x2e(%esp)
   0x4024afb4 <+551>:   mov    0x20(%esp),%eax
   0x4024afb8 <+555>:   fldl   0x18(%esp)
   0x4024afbc <+559>:   fmuls  0x402678a8
   0x4024afc2 <+565>:   fxch   %st(1)
   0x4024afc4 <+567>:   fucomip %st(1),%st
   0x4024afc6 <+569>:   ja     0x4024afd8 <TraceStart+587>
   0x4024afc8 <+571>:   fldl   0x402678e8
   0x4024afce <+577>:   fxch   %st(1)
   0x4024afd0 <+579>:   fucomi %st(1),%st
   0x4024afd2 <+581>:   fcmovnb %st(1),%st
   0x4024afd4 <+583>:   fstp   %st(1)
   0x4024afd6 <+585>:   jmp    0x4024afdc <TraceStart+591>
   0x4024afd8 <+587>:   fstp   %st(0)
   0x4024afda <+589>:   fld1   
   0x4024afdc <+591>:   add    0x3c(%ebp),%eax
   0x4024afdf <+594>:   fldcw  0x2c(%esp)
   0x4024afe3 <+598>:   fistpll 0x20(%esp)
   0x4024afe7 <+602>:   fldcw  0x2e(%esp)
   0x4024afeb <+606>:   mov    0x20(%esp),%ecx
   0x4024afef <+610>:   mov    $0x0,%edx
   0x4024aff4 <+615>:   div    %ecx
   0x4024aff6 <+617>:   add    $0x1,%eax
   0x4024aff9 <+620>:   mov    %eax,0x40(%ebp)
   0x4024affc <+623>:   mov    0x403011a8,%eax
   0x4024b001 <+628>:   sub    $0x402fc1a0,%eax
   0x4024b006 <+633>:   cmp    $0x33,%eax
   0x4024b009 <+636>:   ja     0x4024b042 <TraceStart+693>
   0x4024b00b <+638>:   movl   $0x2,(%esp)
   0x4024b012 <+645>:   call   0x4022d788 <EventFlush>
   0x4024b017 <+650>:   mov    0x403011a8,%eax
   0x4024b01c <+655>:   sub    $0x402fc1a0,%eax
   0x4024b021 <+660>:   cmp    $0x33,%eax
   0x4024b024 <+663>:   ja     0x4024b042 <TraceStart+693>
   0x4024b026 <+665>:   movl   $0x4025ee34,0x8(%esp)
   0x4024b02e <+673>:   movl   $0x6a2,0x4(%esp)
   0x4024b036 <+681>:   movl   $0x40259c80,(%esp)
   0x4024b03d <+688>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b042 <+693>:   mov    0x403011a8,%ecx
   0x4024b048 <+699>:   movw   $0x1c,-0x34(%ecx)
   0x4024b04e <+705>:   movw   $0x34,-0x32(%ecx)
   0x4024b054 <+711>:   rdtsc  
   0x4024b056 <+713>:   mov    %eax,-0x30(%ecx)
   0x4024b059 <+716>:   mov    %edx,-0x2c(%ecx)
   0x4024b05c <+719>:   mov    %ebp,-0x28(%ecx)
   0x4024b05f <+722>:   fldl   0x10(%esp)
   0x4024b063 <+726>:   fstpl  -0x24(%ecx)
   0x4024b066 <+729>:   fldl   0x18(%esp)
   0x4024b06a <+733>:   fstpl  -0x1c(%ecx)
   0x4024b06d <+736>:   mov    0x34(%ebp),%eax
   0x4024b070 <+739>:   mov    %eax,-0x14(%ecx)
   0x4024b073 <+742>:   mov    0x38(%ebp),%eax
   0x4024b076 <+745>:   mov    %eax,-0x10(%ecx)
   0x4024b079 <+748>:   mov    0x3c(%ebp),%eax
   0x4024b07c <+751>:   mov    %eax,-0xc(%ecx)
   0x4024b07f <+754>:   mov    0x10(%ebp),%eax
   0x4024b082 <+757>:   mov    %eax,-0x8(%ecx)
   0x4024b085 <+760>:   mov    0x40(%ebp),%eax
   0x4024b088 <+763>:   mov    %eax,-0x4(%ecx)
   0x4024b08b <+766>:   subl   $0x34,0x403011a8
   0x4024b092 <+773>:   movl   $0x2,0x18(%ebp)
   0x4024b099 <+780>:   mov    %ebp,(%esp)
   0x4024b09c <+783>:   call   0x4022c6fb <TracePostStartMessage>
   0x4024b0a1 <+788>:   mov    %ebp,(%esp)
   0x4024b0a4 <+791>:   call   0x40215afa <TraceCheck>
   0x4024b0a9 <+796>:   test   %eax,%eax
   0x4024b0ab <+798>:   jne    0x4024b0c9 <TraceStart+828>
   0x4024b0ad <+800>:   movl   $0x40262b80,0x8(%esp)
   0x4024b0b5 <+808>:   movl   $0x233,0x4(%esp)
   0x4024b0bd <+816>:   movl   $0x40259c80,(%esp)
   0x4024b0c4 <+823>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b0c9 <+828>:   mov    0x4(%ebp),%ecx
   0x4024b0cc <+831>:   mov    $0x1,%eax
   0x4024b0d1 <+836>:   shl    %cl,%eax
   0x4024b0d3 <+838>:   mov    %eax,0x34(%esp)
   0x4024b0d7 <+842>:   mov    0x8(%ebp),%eax
   0x4024b0da <+845>:   mov    %eax,0x18(%esp)
   0x4024b0de <+849>:   mov    %eax,0x38(%esp)
   0x4024b0e2 <+853>:   mov    %eax,(%esp)
   0x4024b0e5 <+856>:   call   0x4024384c <ShieldSuspend>
   0x4024b0ea <+861>:   cmpl   $0x2,0x18(%ebp)
   0x4024b0ee <+865>:   je     0x4024b10c <TraceStart+895>
   0x4024b0f0 <+867>:   movl   $0x4025bd24,0x8(%esp)
   0x4024b0f8 <+875>:   movl   $0x23a,0x4(%esp)
   0x4024b100 <+883>:   movl   $0x40259c80,(%esp)
   0x4024b107 <+890>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b10c <+895>:   mov    0x4(%ebp),%eax
   0x4024b10f <+898>:   mov    0x18(%esp),%ecx
   0x4024b113 <+902>:   mov    0x41c(%ecx),%edx
   0x4024b119 <+908>:   bt     %eax,%edx
   0x4024b11c <+911>:   jae    0x4024b13a <TraceStart+941>
   0x4024b11e <+913>:   movl   $0x4025ee8c,0x8(%esp)
   0x4024b126 <+921>:   movl   $0x23b,0x4(%esp)
   0x4024b12e <+929>:   movl   $0x40259c80,(%esp)
   0x4024b135 <+936>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b13a <+941>:   mov    0x403011a8,%eax
   0x4024b13f <+946>:   sub    $0x402fc1a0,%eax
   0x4024b144 <+951>:   cmp    $0x13,%eax
   0x4024b147 <+954>:   ja     0x4024b180 <TraceStart+1011>
   0x4024b149 <+956>:   movl   $0x2,(%esp)
   0x4024b150 <+963>:   call   0x4022d788 <EventFlush>
   0x4024b155 <+968>:   mov    0x403011a8,%eax
   0x4024b15a <+973>:   sub    $0x402fc1a0,%eax
   0x4024b15f <+978>:   cmp    $0x13,%eax
   0x4024b162 <+981>:   ja     0x4024b180 <TraceStart+1011>
   0x4024b164 <+983>:   movl   $0x4025eebc,0x8(%esp)
   0x4024b16c <+991>:   movl   $0x23d,0x4(%esp)
   0x4024b174 <+999>:   movl   $0x40259c80,(%esp)
   0x4024b17b <+1006>:  call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b180 <+1011>:  mov    0x403011a8,%ecx
   0x4024b186 <+1017>:  movw   $0x20,-0x14(%ecx)
   0x4024b18c <+1023>:  movw   $0x14,-0x12(%ecx)
   0x4024b192 <+1029>:  rdtsc  
   0x4024b194 <+1031>:  mov    %eax,-0x10(%ecx)
   0x4024b197 <+1034>:  mov    %edx,-0xc(%ecx)
   0x4024b19a <+1037>:  mov    %ebp,-0x8(%ecx)
   0x4024b19d <+1040>:  mov    0x18(%esp),%eax
   0x4024b1a1 <+1044>:  mov    %eax,-0x4(%ecx)
   0x4024b1a4 <+1047>:  subl   $0x14,0x403011a8
   0x4024b1ab <+1054>:  mov    0x50(%eax),%esi
   0x4024b1ae <+1057>:  mov    (%esi),%edi
   0x4024b1b0 <+1059>:  add    $0x50,%eax
   0x4024b1b3 <+1062>:  cmp    %eax,%esi
   0x4024b1b5 <+1064>:  je     0x4024b21b <TraceStart+1166>
   0x4024b1b7 <+1066>:  mov    %ebp,0x60(%esp)
   0x4024b1bb <+1070>:  mov    %eax,%ebp
   0x4024b1bd <+1072>:  lea    -0x10(%esi),%eax
   0x4024b1c0 <+1075>:  mov    %eax,(%esp)
   0x4024b1c3 <+1078>:  call   0x40214d34 <PoolCheck>
   0x4024b1c8 <+1083>:  test   %eax,%eax
   0x4024b1ca <+1085>:  jne    0x4024b1e8 <TraceStart+1115>
   0x4024b1cc <+1087>:  movl   $0x40262a05,0x8(%esp)
   0x4024b1d4 <+1095>:  movl   $0x1c0,0x4(%esp)
   0x4024b1dc <+1103>:  movl   $0x40259c80,(%esp)
   0x4024b1e3 <+1110>:  call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b1e8 <+1115>:  mov    0x8(%esi),%eax
   0x4024b1eb <+1118>:  mov    (%eax),%ebx
   0x4024b1ed <+1120>:  add    $0x8,%esi
   0x4024b1f0 <+1123>:  cmp    %esi,%eax
   0x4024b1f2 <+1125>:  je     0x4024b20b <TraceStart+1150>
   0x4024b1f4 <+1127>:  sub    $0x14,%eax
   0x4024b1f7 <+1130>:  mov    %eax,(%esp)
   0x4024b1fa <+1133>:  call   0x4021916f <BufferFlip>
   0x4024b1ff <+1138>:  mov    (%ebx),%edx
   0x4024b201 <+1140>:  cmp    %ebx,%esi
   0x4024b203 <+1142>:  je     0x4024b20b <TraceStart+1150>
   0x4024b205 <+1144>:  mov    %ebx,%eax
   0x4024b207 <+1146>:  mov    %edx,%ebx
   0x4024b209 <+1148>:  jmp    0x4024b1f4 <TraceStart+1127>
   0x4024b20b <+1150>:  mov    (%edi),%eax
   0x4024b20d <+1152>:  cmp    %edi,%ebp
   0x4024b20f <+1154>:  je     0x4024b217 <TraceStart+1162>
   0x4024b211 <+1156>:  mov    %edi,%esi
   0x4024b213 <+1158>:  mov    %eax,%edi
   0x4024b215 <+1160>:  jmp    0x4024b1bd <TraceStart+1072>
   0x4024b217 <+1162>:  mov    0x60(%esp),%ebp
   0x4024b21b <+1166>:  mov    0x14(%ebp),%eax
   0x4024b21e <+1169>:  test   %eax,%eax
   0x4024b220 <+1171>:  je     0x4024b357 <TraceStart+1482>
   0x4024b226 <+1177>:  mov    %eax,0x4(%esp)
   0x4024b22a <+1181>:  mov    0x18(%esp),%eax
   0x4024b22e <+1185>:  mov    %eax,(%esp)
   0x4024b231 <+1188>:  call   0x4021cbae <LDAge>
   0x4024b236 <+1193>:  jmp    0x4024b357 <TraceStart+1482>
   0x4024b23b <+1198>:  mov    0x18(%esp),%eax
   0x4024b23f <+1202>:  lea    0x4e0(%eax),%edi
   0x4024b245 <+1208>:  lea    0x500(%eax),%ecx
   0x4024b24b <+1214>:  mov    %ecx,0x28(%esp)
   0x4024b24f <+1218>:  mov    %eax,%esi
   0x4024b251 <+1220>:  mov    %edi,0x10(%esp)
   0x4024b255 <+1224>:  mov    0x10(%esp),%eax
   0x4024b259 <+1228>:  mov    %eax,%edi
   0x4024b25b <+1230>:  mov    (%eax),%edx
   0x4024b25d <+1232>:  mov    (%edx),%ebx
   0x4024b25f <+1234>:  cmp    %eax,%edx
   0x4024b261 <+1236>:  je     0x4024b29d <TraceStart+1296>
   0x4024b263 <+1238>:  movzbl -0x3(%edx),%eax
   0x4024b267 <+1242>:  and    $0x1,%eax
   0x4024b26a <+1245>:  test   %eax,0x41c(%esi)
   0x4024b270 <+1251>:  jne    0x4024b291 <TraceStart+1284>
   0x4024b272 <+1253>:  mov    0x4(%ebp),%ecx
   0x4024b275 <+1256>:  bt     %ecx,%eax
   0x4024b278 <+1259>:  jae    0x4024b291 <TraceStart+1284>
   0x4024b27a <+1261>:  movl   $0x1,0x8(%esp)
   0x4024b282 <+1269>:  sub    $0x1c,%edx
   0x4024b285 <+1272>:  mov    %edx,0x4(%esp)
   0x4024b289 <+1276>:  mov    %esi,(%esp)
   0x4024b28c <+1279>:  call   0x4024acdb <ShieldRaise>
   0x4024b291 <+1284>:  mov    (%ebx),%eax
   0x4024b293 <+1286>:  cmp    %ebx,%edi
   0x4024b295 <+1288>:  je     0x4024b29d <TraceStart+1296>
   0x4024b297 <+1290>:  mov    %ebx,%edx
   0x4024b299 <+1292>:  mov    %eax,%ebx
   0x4024b29b <+1294>:  jmp    0x4024b263 <TraceStart+1238>
   0x4024b29d <+1296>:  addl   $0x8,0x10(%esp)
   0x4024b2a2 <+1301>:  mov    0x28(%esp),%eax
   0x4024b2a6 <+1305>:  cmp    %eax,0x10(%esp)
   0x4024b2aa <+1309>:  jne    0x4024b255 <TraceStart+1224>
   0x4024b2ac <+1311>:  movl   $0x3,0x18(%ebp)
   0x4024b2b3 <+1318>:  mov    0x4(%ebp),%ecx
   0x4024b2b6 <+1321>:  mov    $0x1,%eax
   0x4024b2bb <+1326>:  shl    %cl,%eax
   0x4024b2bd <+1328>:  mov    0x18(%esp),%ecx
   0x4024b2c1 <+1332>:  or     %eax,0x41c(%ecx)
   0x4024b2c7 <+1338>:  mov    0x403011a8,%eax
   0x4024b2cc <+1343>:  sub    $0x402fc1a0,%eax
   0x4024b2d1 <+1348>:  cmp    $0x13,%eax
   0x4024b2d4 <+1351>:  ja     0x4024b30d <TraceStart+1408>
   0x4024b2d6 <+1353>:  movl   $0x2,(%esp)
   0x4024b2dd <+1360>:  call   0x4022d788 <EventFlush>
   0x4024b2e2 <+1365>:  mov    0x403011a8,%eax
   0x4024b2e7 <+1370>:  sub    $0x402fc1a0,%eax
   0x4024b2ec <+1375>:  cmp    $0x13,%eax
   0x4024b2ef <+1378>:  ja     0x4024b30d <TraceStart+1408>
   0x4024b2f1 <+1380>:  movl   $0x4025ef1c,0x8(%esp)
   0x4024b2f9 <+1388>:  movl   $0x273,0x4(%esp)
   0x4024b301 <+1396>:  movl   $0x40259c80,(%esp)
   0x4024b308 <+1403>:  call   0x4020aa19 <mps_lib_assert_fail>
   0x4024b30d <+1408>:  mov    0x403011a8,%ecx
   0x4024b313 <+1414>:  movw   $0x21,-0x14(%ecx)
   0x4024b319 <+1420>:  movw   $0x14,-0x12(%ecx)
   0x4024b31f <+1426>:  rdtsc  
   0x4024b321 <+1428>:  mov    %eax,-0x10(%ecx)
   0x4024b324 <+1431>:  mov    %edx,-0xc(%ecx)
   0x4024b327 <+1434>:  mov    %ebp,-0x8(%ecx)
   0x4024b32a <+1437>:  mov    0x18(%esp),%eax
   0x4024b32e <+1441>:  mov    %eax,-0x4(%ecx)
   0x4024b331 <+1444>:  subl   $0x14,0x403011a8
   0x4024b338 <+1451>:  mov    %eax,(%esp)
   0x4024b33b <+1454>:  call   0x4021c8aa <ShieldResume>
   0x4024b340 <+1459>:  mov    $0x0,%eax
   0x4024b345 <+1464>:  jmp    0x4024b3ad <TraceStart+1568>
   0x4024b347 <+1466>:  mov    0x18(%esp),%eax
   0x4024b34b <+1470>:  mov    %eax,(%esp)
   0x4024b34e <+1473>:  call   0x4021c8aa <ShieldResume>
   0x4024b353 <+1478>:  mov    %ebx,%eax
   0x4024b355 <+1480>:  jmp    0x4024b3ad <TraceStart+1568>
   0x4024b357 <+1482>:  movl   $0x0,0x3c(%esp)
   0x4024b35f <+1490>:  lea    0x34(%esp),%eax
   0x4024b363 <+1494>:  mov    %eax,0x8(%esp)
   0x4024b367 <+1498>:  movl   $0x402471ad,0x4(%esp)
   0x4024b36f <+1506>:  mov    0x18(%esp),%edi
   0x4024b373 <+1510>:  mov    %edi,(%esp)
   0x4024b376 <+1513>:  call   0x4020a32c <RootsIterate>
   0x4024b37b <+1518>:  mov    %eax,%ebx
   0x4024b37d <+1520>:  test   %eax,%eax
   0x4024b37f <+1522>:  jne    0x4024b347 <TraceStart+1466>
   0x4024b381 <+1524>:  movl   $0x1,0x3c(%esp)
   0x4024b389 <+1532>:  lea    0x34(%esp),%eax
   0x4024b38d <+1536>:  mov    %eax,0x8(%esp)
   0x4024b391 <+1540>:  movl   $0x402471ad,0x4(%esp)
   0x4024b399 <+1548>:  mov    %edi,(%esp)
   0x4024b39c <+1551>:  call   0x4020a32c <RootsIterate>
   0x4024b3a1 <+1556>:  mov    %eax,%ebx
   0x4024b3a3 <+1558>:  test   %eax,%eax
   0x4024b3a5 <+1560>:  je     0x4024b23b <TraceStart+1198>
   0x4024b3ab <+1566>:  jmp    0x4024b347 <TraceStart+1466>
   0x4024b3ad <+1568>:  add    $0x4c,%esp
   0x4024b3b0 <+1571>:  pop    %ebx
   0x4024b3b1 <+1572>:  pop    %esi
   0x4024b3b2 <+1573>:  pop    %edi
   0x4024b3b3 <+1574>:  pop    %ebp
   0x4024b3b4 <+1575>:  ret    
End of assembler dump.
(gdb) info float
  R7: Zero    0x00000000000000000000 +0                         
  R6: Zero    0x00000000000000000000 +0                         
  R5: Zero    0x00000000000000000000 +0                         
  R4: Zero    0x00000000000000000000 +0                         
  R3: Zero    0x00000000000000000000 +0                         
  R2: Zero    0x00000000000000000000 +0                         
  R1: Valid   0x401683d14c0000000000 +8638796                   
=>R0: Valid   0x3fff8000000000000000 +1                         

Status Word:         0x83e1   IE             PE   ES   SF   C0 C1      
                       TOP: 0
Control Word:        0x0362      DM          PM
                       PC: Extended Precision (64-bits)
                       RC: Round to nearest
Tag Word:            0x5550
Instruction Pointer: 0x73:0x4024af8e
Operand Pointer:     0x7b:0xbfffd834
Opcode:              0xdd44
(gdb) 
@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
@waywardmonkeys

waywardmonkeys Apr 16, 2015

Member

When in doubt, disassemble (not dissemble!).

(gdb) disassemble 
Dump of assembler code for function dylan_float_invalid_handler:
=> 0x402091ca <+0>: push   %ebp
   0x402091cb <+1>: mov    %esp,%ebp
   0x402091cd <+3>: pushf  
   0x402091ce <+4>: push   %ebx
   0x402091cf <+5>: push   %esi
   0x402091d0 <+6>: push   %edi
   0x402091d1 <+7>: fnclex 
   0x402091d3 <+9>: call   0x401ace33 <Kfloat_invalidVKeI>
   0x402091d8 <+14>:    lea    -0x10(%ebp),%esp
   0x402091db <+17>:    pop    %edi
   0x402091dc <+18>:    pop    %esi
   0x402091dd <+19>:    pop    %ebx
   0x402091de <+20>:    popf   
   0x402091df <+21>:    pop    %ebp
   0x402091e0 <+22>:    ret    
End of assembler dump.

And indeed, we can set a breakpoint on Kfloat_invalidVKeI and when we're in there, we can see that the FPU got reset:

(gdb) info float
  R7: Zero    0x00000000000000000000 +0                         
  R6: Zero    0x00000000000000000000 +0                         
  R5: Zero    0x00000000000000000000 +0                         
  R4: Zero    0x00000000000000000000 +0                         
=>R3: Zero    0x00000000000000000000 +0                         
  R2: Empty   0x401887e0bc0000000000
  R1: Empty   0x00000000000000000000
  R0: Empty   0x00000000000000000000

Status Word:         0x1900                                 C0         
                       TOP: 3
Control Word:        0x0362      DM          PM
                       PC: Extended Precision (64-bits)
                       RC: Round to nearest
Tag Word:            0x557f
Instruction Pointer: 0x73:0x401ac80b
Operand Pointer:     0x7b:0xbfffd80c
Opcode:              0xd875
Member

waywardmonkeys commented Apr 16, 2015

When in doubt, disassemble (not dissemble!).

(gdb) disassemble 
Dump of assembler code for function dylan_float_invalid_handler:
=> 0x402091ca <+0>: push   %ebp
   0x402091cb <+1>: mov    %esp,%ebp
   0x402091cd <+3>: pushf  
   0x402091ce <+4>: push   %ebx
   0x402091cf <+5>: push   %esi
   0x402091d0 <+6>: push   %edi
   0x402091d1 <+7>: fnclex 
   0x402091d3 <+9>: call   0x401ace33 <Kfloat_invalidVKeI>
   0x402091d8 <+14>:    lea    -0x10(%ebp),%esp
   0x402091db <+17>:    pop    %edi
   0x402091dc <+18>:    pop    %esi
   0x402091dd <+19>:    pop    %ebx
   0x402091de <+20>:    popf   
   0x402091df <+21>:    pop    %ebp
   0x402091e0 <+22>:    ret    
End of assembler dump.

And indeed, we can set a breakpoint on Kfloat_invalidVKeI and when we're in there, we can see that the FPU got reset:

(gdb) info float
  R7: Zero    0x00000000000000000000 +0                         
  R6: Zero    0x00000000000000000000 +0                         
  R5: Zero    0x00000000000000000000 +0                         
  R4: Zero    0x00000000000000000000 +0                         
=>R3: Zero    0x00000000000000000000 +0                         
  R2: Empty   0x401887e0bc0000000000
  R1: Empty   0x00000000000000000000
  R0: Empty   0x00000000000000000000

Status Word:         0x1900                                 C0         
                       TOP: 3
Control Word:        0x0362      DM          PM
                       PC: Extended Precision (64-bits)
                       RC: Round to nearest
Tag Word:            0x557f
Instruction Pointer: 0x73:0x401ac80b
Operand Pointer:     0x7b:0xbfffd80c
Opcode:              0xd875
@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
@waywardmonkeys

waywardmonkeys Apr 16, 2015

Member

I wonder if the difference between fclex and fnclex might be important here: http://x86.renejeschke.de/html/file_module_x86_id_85.html

Member

waywardmonkeys commented Apr 16, 2015

I wonder if the difference between fclex and fnclex might be important here: http://x86.renejeschke.de/html/file_module_x86_id_85.html

@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
@waywardmonkeys

waywardmonkeys Apr 16, 2015

Member

So, let's look at the MPS code in more detail ... I wish I had debug info for it! (I'm not sure why it gets lost).

   0x4024af53 <+454>:   call   0x4020a32c <RootsIterate>
   0x4024af58 <+459>:   test   %eax,%eax
   0x4024af5a <+461>:   je     0x4024af78 <TraceStart+491>
   0x4024af5c <+463>:   movl   $0x40266315,0x8(%esp)
   0x4024af64 <+471>:   movl   $0x689,0x4(%esp)
   0x4024af6c <+479>:   movl   $0x40259c80,(%esp)
   0x4024af73 <+486>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024af78 <+491>:   mov    0x34(%ebp),%eax
   0x4024af7b <+494>:   mov    $0x0,%edx
   0x4024af80 <+499>:   mov    %eax,0x20(%esp)
   0x4024af84 <+503>:   mov    %edx,0x24(%esp)
   0x4024af88 <+507>:   fildll 0x20(%esp)
   0x4024af8c <+511>:   fld1   
   0x4024af8e <+513>:   fldl   0x10(%esp)
=> 0x4024af92 <+517>:   fsubr  %st(1),%st
   0x4024af94 <+519>:   fmulp  %st,%st(2)
   0x4024af96 <+521>:   fxch   %st(1)
   0x4024af98 <+523>:   fnstcw 0x2e(%esp)
   0x4024af9c <+527>:   movzwl 0x2e(%esp),%eax
   0x4024afa1 <+532>:   mov    $0xc,%ah
   0x4024afa3 <+534>:   mov    %ax,0x2c(%esp)
   0x4024afa8 <+539>:   fldcw  0x2c(%esp)
   0x4024afac <+543>:   fistpll 0x20(%esp)
   0x4024afb0 <+547>:   fldcw  0x2e(%esp)
   0x4024afb4 <+551>:   mov    0x20(%esp),%eax
   0x4024afb8 <+555>:   fldl   0x18(%esp)
   0x4024afbc <+559>:   fmuls  0x402678a8
   0x4024afc2 <+565>:   fxch   %st(1)
   0x4024afc4 <+567>:   fucomip %st(1),%st
   0x4024afc6 <+569>:   ja     0x4024afd8 <TraceStart+587>

So, we can see that this is something that happens after a call to RootsIterate and after a check ... and that it does a subtraction and then a multiplication and it is the fsubr %st(1),%st that failed.

If we look in the C code, we see this in TraceStart:

  res = RootsIterate(ArenaGlobals(arena), rootGrey, (void *)trace);
  AVER(res == ResOK);

  STATISTIC_STAT(EVENT2(ArenaWriteFaults, arena, arena->writeBarrierHitCount));

  /* Calculate the rate of scanning. */
  {
    Size sSurvivors = (Size)(trace->condemned * (1.0 - mortality));
    double nPolls = finishingTime / ArenaPollALLOCTIME;

So .. I think it failed on 1.0 - mortality and, if we look at the floating point stack, we see:

  R1: Valid   0x401683d14c0000000000 +8638796                   
=>R0: Valid   0x3fff8000000000000000 +1                         

So, should fsubr %st(1),%st have failed here?

Member

waywardmonkeys commented Apr 16, 2015

So, let's look at the MPS code in more detail ... I wish I had debug info for it! (I'm not sure why it gets lost).

   0x4024af53 <+454>:   call   0x4020a32c <RootsIterate>
   0x4024af58 <+459>:   test   %eax,%eax
   0x4024af5a <+461>:   je     0x4024af78 <TraceStart+491>
   0x4024af5c <+463>:   movl   $0x40266315,0x8(%esp)
   0x4024af64 <+471>:   movl   $0x689,0x4(%esp)
   0x4024af6c <+479>:   movl   $0x40259c80,(%esp)
   0x4024af73 <+486>:   call   0x4020aa19 <mps_lib_assert_fail>
   0x4024af78 <+491>:   mov    0x34(%ebp),%eax
   0x4024af7b <+494>:   mov    $0x0,%edx
   0x4024af80 <+499>:   mov    %eax,0x20(%esp)
   0x4024af84 <+503>:   mov    %edx,0x24(%esp)
   0x4024af88 <+507>:   fildll 0x20(%esp)
   0x4024af8c <+511>:   fld1   
   0x4024af8e <+513>:   fldl   0x10(%esp)
=> 0x4024af92 <+517>:   fsubr  %st(1),%st
   0x4024af94 <+519>:   fmulp  %st,%st(2)
   0x4024af96 <+521>:   fxch   %st(1)
   0x4024af98 <+523>:   fnstcw 0x2e(%esp)
   0x4024af9c <+527>:   movzwl 0x2e(%esp),%eax
   0x4024afa1 <+532>:   mov    $0xc,%ah
   0x4024afa3 <+534>:   mov    %ax,0x2c(%esp)
   0x4024afa8 <+539>:   fldcw  0x2c(%esp)
   0x4024afac <+543>:   fistpll 0x20(%esp)
   0x4024afb0 <+547>:   fldcw  0x2e(%esp)
   0x4024afb4 <+551>:   mov    0x20(%esp),%eax
   0x4024afb8 <+555>:   fldl   0x18(%esp)
   0x4024afbc <+559>:   fmuls  0x402678a8
   0x4024afc2 <+565>:   fxch   %st(1)
   0x4024afc4 <+567>:   fucomip %st(1),%st
   0x4024afc6 <+569>:   ja     0x4024afd8 <TraceStart+587>

So, we can see that this is something that happens after a call to RootsIterate and after a check ... and that it does a subtraction and then a multiplication and it is the fsubr %st(1),%st that failed.

If we look in the C code, we see this in TraceStart:

  res = RootsIterate(ArenaGlobals(arena), rootGrey, (void *)trace);
  AVER(res == ResOK);

  STATISTIC_STAT(EVENT2(ArenaWriteFaults, arena, arena->writeBarrierHitCount));

  /* Calculate the rate of scanning. */
  {
    Size sSurvivors = (Size)(trace->condemned * (1.0 - mortality));
    double nPolls = finishingTime / ArenaPollALLOCTIME;

So .. I think it failed on 1.0 - mortality and, if we look at the floating point stack, we see:

  R1: Valid   0x401683d14c0000000000 +8638796                   
=>R0: Valid   0x3fff8000000000000000 +1                         

So, should fsubr %st(1),%st have failed here?

@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
@waywardmonkeys

waywardmonkeys Apr 16, 2015

Member

Okay. If we look at an info float in the first FP exception, we see that the status is:

Status Word:         0xb9a1   IE             PE   ES        C0         
                       TOP: 7

When we get into the MPS failure, it is:

Status Word:         0x83e1   IE             PE   ES   SF   C0 C1      
                       TOP: 0

Differences: SF is set, as well as C1.

From http://x86.renejeschke.de/html/file_module_x86_id_122.html, fsubr will set C1 when:

C1 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. C0, C2, C3 Undefined.

Member

waywardmonkeys commented Apr 16, 2015

Okay. If we look at an info float in the first FP exception, we see that the status is:

Status Word:         0xb9a1   IE             PE   ES        C0         
                       TOP: 7

When we get into the MPS failure, it is:

Status Word:         0x83e1   IE             PE   ES   SF   C0 C1      
                       TOP: 0

Differences: SF is set, as well as C1.

From http://x86.renejeschke.de/html/file_module_x86_id_122.html, fsubr will set C1 when:

C1 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. C0, C2, C3 Undefined.

@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
@waywardmonkeys

waywardmonkeys Apr 16, 2015

Member

So, each time we hit our SIGFPE handler, we're losing an FPU stack slot ... so this is on our side.

Member

waywardmonkeys commented Apr 16, 2015

So, each time we hit our SIGFPE handler, we're losing an FPU stack slot ... so this is on our side.

@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
@waywardmonkeys

waywardmonkeys Apr 16, 2015

Member

We need to more aggressively reset FPU state. I'm pretty sure this issue will impact the FPU exception handling in both the HARP and LLVM back-ends / run-times.

I'll probably convert HARP over to using <fenv.h> like LLVM is ...

Member

waywardmonkeys commented Apr 16, 2015

We need to more aggressively reset FPU state. I'm pretty sure this issue will impact the FPU exception handling in both the HARP and LLVM back-ends / run-times.

I'll probably convert HARP over to using <fenv.h> like LLVM is ...

@waywardmonkeys

This comment has been minimized.

Show comment
Hide comment
@waywardmonkeys

waywardmonkeys Apr 16, 2015

Member

I've been digging into this more and have been talking to some people including stassats and pkhuong from SBCL. (Earlier, I talked with nsz from MUSL libc.)

What is happening here is that FE_INVALID, on x86 and against what IEEE specifies, is what gets reported when there is an x87 stack fault. We may be able to ignore this and let things carry on. That requires some investigation. If so, we'll want to be looking at bit 6 of the FPU status word and if that's set, it is a stack fault. stassats pasted something that indicates that while SF is always set for a stack fault, it might also have stuck around and show up set when we're handling a real invalid FPE.

Of course, if we're using the SSE instructions and ignoring the x87 FPU, all is well and this isn't a concern.

Member

waywardmonkeys commented Apr 16, 2015

I've been digging into this more and have been talking to some people including stassats and pkhuong from SBCL. (Earlier, I talked with nsz from MUSL libc.)

What is happening here is that FE_INVALID, on x86 and against what IEEE specifies, is what gets reported when there is an x87 stack fault. We may be able to ignore this and let things carry on. That requires some investigation. If so, we'll want to be looking at bit 6 of the FPU status word and if that's set, it is a stack fault. stassats pasted something that indicates that while SF is always set for a stack fault, it might also have stuck around and show up set when we're handling a real invalid FPE.

Of course, if we're using the SSE instructions and ignoring the x87 FPU, all is well and this isn't a concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment