slavapestov/factor — comment on commit c536c84c13686c2329baaca883f6b3a851cd6e74
File:  line 0
By jckarter:

@slavapestov Here's a log of a gdb session from the non-working case:

```text
(gdb) handle SIGQUIT nostop
Signal Stop	Print	Pass to program	Description
SIGQUIT No	Yes	Yes	Quit
(gdb) break 'factor::factor_vm::handle_safepoint()'
Breakpoint 1 at 0x100034dfc: file errors.cpp, line 172.
(gdb) run
Starting program: /Users/joe/Documents/Code/others/factor/factor
Reading symbols for shared libraries ++++++++............................................................................................................................ done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
( scratchpad ) ^\
Program received signal SIGQUIT, Quit.

Breakpoint 1, factor::factor_vm::handle_safepoint (this=0x100835c00) at errors.cpp:172
warning: Source file is more recent than executable.
172	assert(safepoint_signal_number != 0);
(gdb) bt
#0 factor::factor_vm::handle_safepoint (this=0x100835c00) at errors.cpp:172
#1 0x00000001000350b1 in factor::factor_vm::memory_protection_error (this=0x100835c00, addr=4540137472) at errors.cpp:88
#2 0x000000010003530c in factor::factor_vm::memory_signal_handler_impl (this=0x100835c00) at errors.cpp:129
#3 0x0000000100035331 in factor::memory_signal_handler_impl () at errors.cpp:134
#4 0x000000010eb04e50 in ?? ()
#5 0x00007fff85734188 in __CFFileDescriptorPerform ()
#6 0x00007fff856f2b51 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#7 0x00007fff856f23bd in __CFRunLoopDoSources0 ()
#8 0x00007fff857191a9 in __CFRunLoopRun ()
#9 0x00007fff85718ae6 in CFRunLoopRunSpecific ()
#10 0x000000010f305444 in ?? ()
(gdb) call current_vm()->factorbug()
Starting low level debugger...
Basic commands:
q -- continue executing Factor - NOT SAFE
im -- save image to fep.image
x -- exit Factor
Advanced commands:
d -- dump memory
u -- dump object at tagged
. -- print object at tagged
t -- toggle output trimming
s r -- dump data, retain stacks
.s .r .c -- print data, retain, call stacks
e -- dump environment
g -- dump generations
data -- data heap dump
words -- words dump
tuples -- tuples dump
refs -- find data heap references to object
push -- push object on data stack - NOT SAFE
code -- code heap dump
READY
.s .r .c
==== DATA STACK:
READY
==== RETAIN STACK:
READY
==== CALL STACK:
frame: 112e97fc8
executing: ( callback )
scan: f
word/quot addr: 105883c4c
word/quot xt: 10f310790
return address: 10f3107da
frame: 112e97fa8
executing: kernel.private:set-context-object
scan: -1
word/quot addr: 101c42b2c
word/quot xt: 10eb04e50
return address: 10eb04e50
READY
q
(gdb) cont
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00000001000232cd in immediate_p (obj=4334951644) at layouts.hpp:83
83	return TAG(obj) <= F_TYPE;
(gdb) bt
#0 0x00000001000232cd in immediate_p (obj=4334951644) at layouts.hpp:83
#1 0x00000001000254d8 in factor::slot_visitor::visit_pointer (this=0x112e97978, pointer=4334951644) at slot_visitor.hpp:142
#2 0x000000010002557c in factor::slot_visitor::visit_handle (this=0x112e97978, handle=0x106e68340) at slot_visitor.hpp:151
#3 0x00000001000255c8 in factor::slot_visitor::visit_object_array (this=0x112e97978, start=0x106e68348, end=0x106e68360) at slot_visitor.hpp:157
#4 0x0000000100025640 in factor::slot_visitor::visit_slots (this=0x112e97978, ptr=0x106e682c0, payload_start=160) at slot_visitor.hpp:169
#5 0x0000000100028854 in factor::slot_visitor::visit_slots (this=0x112e97978, obj=0x106e682c0) at slot_visitor.hpp:179
#6 0x00000001000288d5 in factor::object_compaction_updater::operator() (this=0x112e97c00, old_address=0x106e682c0, new_address=0x106e682c0, size=160) at compaction.cpp:77
#7 0x00000001000289ec in factor::heap_compactor::operator() (this=0x112e97aa8, block=0x106e682c0, size=160) at free_list_allocator.hpp:169
#8 0x0000000100028aa3 in factor::free_list_allocator::iterate, factor::compaction_fixup> (this=0x10041c740, iter=@0x112e97aa8, fixup={data_forwarding_map = 0x10041ca98, code_forwarding_map = 0x10041cee8, data_finger = 0x112e97ca8, code_finger = 0x112e97ca0}) at free_list_allocator.hpp:201
#9 0x0000000100028b49 in factor::free_list_allocator::compact (this=0x10041c740, iter=@0x112e97c00, finger=0x112e97ca8, fixup={data_forwarding_map = 0x10041ca98, code_forwarding_map = 0x10041cee8, data_finger = 0x112e97ca8, code_finger = 0x112e97ca0}) at free_list_allocator.hpp:182
#10 0x00000001000239cf in factor::factor_vm::collect_compact_impl (this=0x100835c00, trace_contexts_p=true) at compaction.cpp:220
#11 0x0000000100023b60 in factor::factor_vm::collect_compact (this=0x100835c00, trace_contexts_p=true) at compaction.cpp:332
#12 0x000000010003f710 in factor::factor_vm::gc (this=0x100835c00, op=factor::collect_compact_op, requested_size=0, trace_contexts_p=true) at gc.cpp:198
#13 0x000000010003f918 in factor::factor_vm::primitive_compact_gc (this=0x100835c00) at gc.cpp:291
#14 0x0000000100034c97 in factor::factor_vm::general_error (this=0x100835c00, error=factor::ERROR_MEMORY, arg1=160, arg2=1) at errors.cpp:51
#15 0x00000001000352d4 in factor::factor_vm::memory_protection_error (this=0x100835c00, addr=10) at errors.cpp:102
#16 0x000000010003530c in factor::factor_vm::memory_signal_handler_impl (this=0x100835c00) at errors.cpp:129
#17 0x0000000100035331 in factor::memory_signal_handler_impl () at errors.cpp:134
#18 0x000000010e9ea7a0 in ?? ()
(gdb)
```