Created
December 9, 2015 04:01
-
-
Save frsyuki/4bb6a9a3533b03a986f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fiddle/import' | |
module PtrToValueSegv | |
extend Fiddle::Importer | |
dlload "libc.dylib" | |
extern('int gettimeofday(void *, void *)') | |
Timeval = struct(["long tv_sec", "long tv_usec"]) | |
end | |
timeval = PtrToValueSegv::Timeval.malloc | |
e = PtrToValueSegv.gettimeofday(timeval, nil) | |
timeval.to_ptr.to_value.to_s | |
__END__ | |
[frsyuki@xcore ~]$ ruby represent.rb | |
represent.rb:13: [BUG] Segmentation fault at 0x00000000000000 | |
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14] | |
-- Crash Report log information -------------------------------------------- | |
See Crash Report log file under the one of following: | |
* ~/Library/Logs/CrashReporter | |
* /Library/Logs/CrashReporter | |
* ~/Library/Logs/DiagnosticReports | |
* /Library/Logs/DiagnosticReports | |
for more details. | |
-- Control frame information ----------------------------------------------- | |
c:0002 p:0067 s:0007 E:002640 EVAL represent.rb:13 [FINISH] | |
c:0001 p:0000 s:0002 E:000160 TOP [FINISH] | |
-- Ruby level backtrace information ---------------------------------------- | |
represent.rb:13:in `<main>' | |
-- Machine register context ------------------------------------------------ | |
rax: 0x0000000000000327 rbx: 0x00007faa8b94e540 rcx: 0x0000000000000fc3 | |
rdx: 0x00007faa8b94e580 rdi: 0x0000000000000085 rsi: 0x0000000000000ca1 | |
rbp: 0x00007fff50744d60 rsp: 0x00007fff50744c20 r8: 0x0000000000001055 | |
r9: 0x00007faa8a8ed600 r10: 0x000000010f78b030 r11: 0x000000010f88af60 | |
r12: 0x00007faa8b94d5b8 r13: 0x00007faa8a4091e0 r14: 0x000000010f88af60 | |
r15: 0x200007fa00097c34 rip: 0x000000010f63753b rfl: 0x0000000000010246 | |
-- C level backtrace information ------------------------------------------- | |
0 ruby 0x000000010f654ecb rb_vm_bugreport + 155 | |
1 ruby 0x000000010f4f8ca0 rb_bug_context + 480 | |
2 ruby 0x000000010f5d1713 sigsegv + 83 | |
3 libsystem_platform.dylib 0x00007fff95ac7f1a _sigtramp + 26 | |
4 ruby 0x000000010f63753b vm_exec_core + 12811 | |
5 ??? 0x00007fff50744d10 0x0 + 140734543187216 | |
-- Other runtime information ----------------------------------------------- | |
* Loaded script: represent.rb | |
* Loaded features: | |
0 enumerator.so | |
1 rational.so | |
2 complex.so | |
3 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/x86_64-darwin14/enc/encdb.bundle | |
4 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/x86_64-darwin14/enc/trans/transdb.bundle | |
5 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/unicode_normalize.rb | |
6 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/x86_64-darwin14/rbconfig.rb | |
7 thread.rb | |
8 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/x86_64-darwin14/thread.bundle | |
9 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/compatibility.rb | |
10 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/defaults.rb | |
11 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/deprecate.rb | |
12 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/errors.rb | |
13 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/version.rb | |
14 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/requirement.rb | |
15 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/platform.rb | |
16 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/basic_specification.rb | |
17 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/stub_specification.rb | |
18 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/util/stringio.rb | |
19 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/specification.rb | |
20 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/exceptions.rb | |
21 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb | |
22 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/monitor.rb | |
23 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb | |
24 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems.rb | |
25 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/x86_64-darwin14/fiddle.bundle | |
26 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fiddle/function.rb | |
27 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fiddle/closure.rb | |
28 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fiddle.rb | |
29 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fiddle/value.rb | |
30 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fiddle/pack.rb | |
31 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fiddle/struct.rb | |
32 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fiddle/cparser.rb | |
33 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fiddle/import.rb | |
34 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/x86_64-darwin14/socket.bundle | |
35 /Users/frsyuki/.rbenv/versions/2.2.3/lib/ruby/2.2.0/socket.rb | |
[NOTE] | |
You may have encountered a bug in the Ruby interpreter or extension libraries. | |
Bug reports are welcome. | |
Don't forget to include the above Crash Report log file. | |
For details: http://www.ruby-lang.org/bugreport.html | |
Abort trap: 6 | |
[frsyuki@xcore ~]$ cat Library/Logs/DiagnosticReports/ruby_2015-12-09-125812_xcore.crash | |
Process: ruby [17381] | |
Path: /Users/USER/*/ruby | |
Identifier: ruby | |
Version: 0 | |
Code Type: X86-64 (Native) | |
Parent Process: bash [15915] | |
Responsible: iTerm [234] | |
User ID: 502 | |
Date/Time: 2015-12-09 12:58:12.622 +0900 | |
OS Version: Mac OS X 10.10.4 (14E46) | |
Report Version: 11 | |
Anonymous UUID: 9F574E1D-CEA1-E5A7-733C-CA511A7FD71B | |
Sleep/Wake UUID: 776AD7FF-6696-4671-8D07-D7CB8C0FEDC3 | |
Time Awake Since Boot: 73000 seconds | |
Time Since Wake: 10000 seconds | |
Crashed Thread: 0 Dispatch queue: com.apple.main-thread | |
Exception Type: EXC_BAD_ACCESS (SIGABRT) | |
Exception Codes: EXC_I386_GPFLT | |
Application Specific Information: | |
abort() called | |
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread | |
0 libsystem_kernel.dylib 0x00007fff9586c286 __pthread_kill + 10 | |
1 libsystem_c.dylib 0x00007fff8eb21b53 abort + 129 | |
2 ruby 0x000000010f4f8ab9 die + 9 | |
3 ruby 0x000000010f4f8cee rb_bug_context + 558 | |
4 ruby 0x000000010f5d1713 sigsegv + 83 | |
5 libsystem_platform.dylib 0x00007fff95ac7f1a _sigtramp + 26 | |
6 ??? 000000000000000000 0 + 0 | |
7 ruby 0x000000010f6468e6 vm_exec + 134 | |
8 ruby 0x000000010f647408 rb_iseq_eval_main + 504 | |
9 ruby 0x000000010f501aa4 ruby_exec_internal + 148 | |
10 ruby 0x000000010f5019ce ruby_run_node + 78 | |
11 ruby 0x000000010f4bacbf main + 79 | |
12 libdyld.dylib 0x00007fff92c415c9 start + 1 | |
Thread 1:: ruby-timer-thr | |
0 libsystem_kernel.dylib 0x00007fff9586d5c2 poll + 10 | |
1 libsystem_pthread.dylib 0x00007fff992af268 _pthread_body + 131 | |
2 libsystem_pthread.dylib 0x00007fff992af1e5 _pthread_start + 176 | |
3 libsystem_pthread.dylib 0x00007fff992ad41d thread_start + 13 | |
Thread 0 crashed with X86 Thread State (64-bit): | |
rax: 0x0000000000000000 rbx: 0x0000000000000006 rcx: 0x00007faa8a8ecdf8 rdx: 0x0000000000000000 | |
rdi: 0x000000000000074f rsi: 0x0000000000000006 rbp: 0x00007faa8a8ece20 rsp: 0x00007faa8a8ecdf8 | |
r8: 0x00007faa8a8ecdd0 r9: 0x00007fff7c232300 r10: 0x0000000008000000 r11: 0x0000000000000206 | |
r12: 0x00007faa8a8ecf50 r13: 0x0000000000000011 r14: 0x00007fff7c232300 r15: 0x000000010f676f24 | |
rip: 0x00007fff9586c286 rfl: 0x0000000000000206 cr2: 0x00007fff7aab1fd8 | |
Logical CPU: 0 | |
Error Code: 0x02000148 | |
Trap Number: 133 | |
Binary Images: | |
0x10f4ba000 - 0x10f6e1ff7 +ruby (0) <863BE105-F93F-3774-BFB4-8200A3A6A5DE> /Users/USER/*/ruby | |
0x10f769000 - 0x10f786fff libJapaneseConverter.dylib (64) <12325659-06A4-37C9-8A9C-DA7A3F8DB8A2> /System/Library/CoreServices/Encodings/libJapaneseConverter.dylib | |
0x10f893000 - 0x10f894ff7 +encdb.bundle (0) <14824012-1A62-363E-A0DA-BC98893DE32E> /Users/USER/*/encdb.bundle | |
0x10f897000 - 0x10f898ff7 +transdb.bundle (0) <327102B9-BC28-3009-99F8-F0BCDD4E6550> /Users/USER/*/transdb.bundle | |
0x10f89b000 - 0x10f89dfff +thread.bundle (0) <0A27567F-6287-33CB-85DE-B5F1E34B99F0> /Users/USER/*/thread.bundle | |
0x10f8a1000 - 0x10f8a5fff +fiddle.bundle (0) <F77275E2-BEDE-3BC7-BBFC-B9769CE70B5D> /Users/USER/*/fiddle.bundle | |
0x10f8aa000 - 0x10f8c8fff +socket.bundle (0) <6C658DAC-1C1E-3152-8304-2ACED078B273> /Users/USER/*/socket.bundle | |
0x7fff63bf9000 - 0x7fff63c2f837 dyld (353.2.1) <72A99D0F-0B56-3938-ABC5-67A0F33757C4> /usr/lib/dyld | |
0x7fff8bc64000 - 0x7fff8bc9cfff libsystem_network.dylib (412.20.3) <6105C134-6722-3C0A-A4CE-5E1261E2E1CC> /usr/lib/system/libsystem_network.dylib | |
0x7fff8c575000 - 0x7fff8c576fff libDiagnosticMessagesClient.dylib (100) <2EE8E436-5CDC-34C5-9959-5BA218D507FB> /usr/lib/libDiagnosticMessagesClient.dylib | |
0x7fff8c591000 - 0x7fff8c5a2ff3 libsystem_coretls.dylib (35.30.2) <0F7BAD0C-FC28-3E4B-8D21-06B426599043> /usr/lib/system/libsystem_coretls.dylib | |
0x7fff8c5dd000 - 0x7fff8c5dffff libsystem_sandbox.dylib (358.20.5) <3F5E973F-C702-31AC-97BC-05F5C195683C> /usr/lib/system/libsystem_sandbox.dylib | |
0x7fff8c7d6000 - 0x7fff8c7d8fff libquarantine.dylib (76.20.1) <7AF90041-2768-378A-925A-D83161863642> /usr/lib/system/libquarantine.dylib | |
0x7fff8c907000 - 0x7fff8c907ff7 libkeymgr.dylib (28) <77845842-DE70-3CC5-BD01-C3D14227CED5> /usr/lib/system/libkeymgr.dylib | |
0x7fff8ddd7000 - 0x7fff8ddd8ff3 libSystem.B.dylib (1213) <AD223AEB-237D-35A3-825E-EECF95916838> /usr/lib/libSystem.B.dylib | |
0x7fff8dddd000 - 0x7fff8dde5fff libsystem_dnssd.dylib (576.30.4) <4EA2DEC3-77EE-3941-A703-DE6DC2056B15> /usr/lib/system/libsystem_dnssd.dylib | |
0x7fff8e53e000 - 0x7fff8e54fff7 libz.1.dylib (55) <88C7C7DE-04B8-316F-8B74-ACD9F3DE1AA1> /usr/lib/libz.1.dylib | |
0x7fff8e602000 - 0x7fff8e99aff7 com.apple.CoreFoundation (6.9 - 1153.18) <5C0892B8-9691-341F-9279-CA3A74D59AA0> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation | |
0x7fff8ea1e000 - 0x7fff8ea46fff libsystem_info.dylib (459.20.1) <AEB3FE62-4763-3050-8352-D6F9AF961AE6> /usr/lib/system/libsystem_info.dylib | |
0x7fff8ea47000 - 0x7fff8ea48fff libffi.dylib (18.1) <0F6C6A4D-1210-3585-8DA1-B8A94B9924A5> /usr/lib/libffi.dylib | |
0x7fff8eac2000 - 0x7fff8eac3ff7 libsystem_blocks.dylib (65) <9615D10A-FCA7-3BE4-AA1A-1B195DACE1A1> /usr/lib/system/libsystem_blocks.dylib | |
0x7fff8eac4000 - 0x7fff8eb50ff7 libsystem_c.dylib (1044.10.1) <86FBED7A-F2C8-3591-AD6F-486DD57E6B6A> /usr/lib/system/libsystem_c.dylib | |
0x7fff8eb5a000 - 0x7fff8ebaefff libc++.1.dylib (120) <1B9530FD-989B-3174-BB1C-BDC159501710> /usr/lib/libc++.1.dylib | |
0x7fff8ece2000 - 0x7fff8ecfeff7 libsystem_malloc.dylib (53.30.1) <DDA8928B-CC0D-3255-BD8A-3FEA0982B890> /usr/lib/system/libsystem_malloc.dylib | |
0x7fff8eeea000 - 0x7fff8eeefff7 libunwind.dylib (35.3) <BE7E51A0-B6EA-3A54-9CCA-9D88F683A6D6> /usr/lib/system/libunwind.dylib | |
0x7fff8f2a8000 - 0x7fff8f2aeff7 libsystem_networkextension.dylib (167.30.1) <3E99FF35-DCBB-3A4C-8853-F1F39A792D29> /usr/lib/system/libsystem_networkextension.dylib | |
0x7fff8f330000 - 0x7fff8f332fff libsystem_configuration.dylib (699.30.1) <B124CC64-59B9-354F-A693-B3431ADB87AC> /usr/lib/system/libsystem_configuration.dylib | |
0x7fff8f415000 - 0x7fff8f5faff7 libicucore.A.dylib (531.48) <3CD34752-B1F9-31D2-865D-B5B0F0BE3111> /usr/lib/libicucore.A.dylib | |
0x7fff8ff26000 - 0x7fff8ff51fff libc++abi.dylib (125) <88A22A0F-87C6-3002-BFBA-AC0F2808B8B9> /usr/lib/libc++abi.dylib | |
0x7fff8ff52000 - 0x7fff8ff5affb libcopyfile.dylib (118.1.2) <0C68D3A6-ACDD-3EF3-991A-CC82C32AB836> /usr/lib/system/libcopyfile.dylib | |
0x7fff90195000 - 0x7fff901c5fff libsystem_m.dylib (3086.1) <1E12AB45-6D96-36D0-A226-F24D9FB0D9D6> /usr/lib/system/libsystem_m.dylib | |
0x7fff9128a000 - 0x7fff91290fff libsystem_trace.dylib (72.20.1) <840F5301-B55A-3078-90B9-FEFFD6CD741A> /usr/lib/system/libsystem_trace.dylib | |
0x7fff91519000 - 0x7fff9151afff libsystem_secinit.dylib (18) <581DAD0F-6B63-3A48-B63B-917AF799ABAA> /usr/lib/system/libsystem_secinit.dylib | |
0x7fff91526000 - 0x7fff9172046f libobjc.A.dylib (647) <759E155D-BC42-3D4E-869B-6F57D477177C> /usr/lib/libobjc.A.dylib | |
0x7fff92c3e000 - 0x7fff92c41ff7 libdyld.dylib (353.2.1) <78E8F33D-0C86-3DB6-A93D-B67A25BA3522> /usr/lib/system/libdyld.dylib | |
0x7fff92fc9000 - 0x7fff92fc9ff7 liblaunch.dylib (559.30.1) <B1301610-D60C-3301-B254-11F066BD48A7> /usr/lib/system/liblaunch.dylib | |
0x7fff93ed6000 - 0x7fff93edfff7 libsystem_notify.dylib (133.1.1) <61147800-F320-3DAA-850C-BADF33855F29> /usr/lib/system/libsystem_notify.dylib | |
0x7fff93f22000 - 0x7fff93f29ff7 libcompiler_rt.dylib (35) <BF8FC133-EE10-3DA6-9B90-92039E28678F> /usr/lib/system/libcompiler_rt.dylib | |
0x7fff94222000 - 0x7fff94224ff7 libsystem_coreservices.dylib (9) <41B7C578-5A53-31C8-A96F-C73E030B0938> /usr/lib/system/libsystem_coreservices.dylib | |
0x7fff94fa8000 - 0x7fff94fd2ff7 libdispatch.dylib (442.1.4) <502CF32B-669B-3709-8862-08188225E4F0> /usr/lib/system/libdispatch.dylib | |
0x7fff95094000 - 0x7fff95099ff7 libmacho.dylib (862) <126CA2ED-DE91-308F-8881-B9DAEC3C63B6> /usr/lib/system/libmacho.dylib | |
0x7fff9509a000 - 0x7fff950e0ff7 libauto.dylib (186) <A260789B-D4D8-316A-9490-254767B8A5F1> /usr/lib/libauto.dylib | |
0x7fff95745000 - 0x7fff95749fff libcache.dylib (69) <45E9A2E7-99C4-36B2-BEE3-0C4E11614AD1> /usr/lib/system/libcache.dylib | |
0x7fff95856000 - 0x7fff95873fff libsystem_kernel.dylib (2782.30.5) <101D28C0-AF07-3B81-87BE-CA27ADED33AB> /usr/lib/system/libsystem_kernel.dylib | |
0x7fff95ac3000 - 0x7fff95acbfff libsystem_platform.dylib (63) <64E34079-D712-3D66-9CE2-418624A5C040> /usr/lib/system/libsystem_platform.dylib | |
0x7fff95de5000 - 0x7fff95e0dfff libxpc.dylib (559.30.1) <80D68997-17B9-32B6-A5FA-A218216415E5> /usr/lib/system/libxpc.dylib | |
0x7fff95e9f000 - 0x7fff95eaafff libcommonCrypto.dylib (60061.30.1) <E789748D-F9A7-3CFF-B317-90DF348B1E95> /usr/lib/system/libcommonCrypto.dylib | |
0x7fff96f37000 - 0x7fff96f3cfff libsystem_stats.dylib (163.30.2) <48A9387D-5C63-3E79-979C-F675552F6FC9> /usr/lib/system/libsystem_stats.dylib | |
0x7fff96f3e000 - 0x7fff96f3eff7 libunc.dylib (29) <5676F7EA-C1DF-329F-B006-D2C3022B7D70> /usr/lib/system/libunc.dylib | |
0x7fff98d75000 - 0x7fff98d76ffb libremovefile.dylib (35) <3485B5F4-6CE8-3C62-8DFD-8736ED6E8531> /usr/lib/system/libremovefile.dylib | |
0x7fff992ac000 - 0x7fff992b5fff libsystem_pthread.dylib (105.10.1) <3103AA7F-3BAE-3673-9649-47FFD7E15C97> /usr/lib/system/libsystem_pthread.dylib | |
0x7fff993fb000 - 0x7fff99474fe7 libcorecrypto.dylib (233.30.1) <5779FFA0-4D9A-3AD4-B7F2-618227621DC8> /usr/lib/system/libcorecrypto.dylib | |
0x7fff99583000 - 0x7fff99599ff7 libsystem_asl.dylib (267) <F153AC5B-0542-356E-88C8-20A62CA704E2> /usr/lib/system/libsystem_asl.dylib | |
External Modification Summary: | |
Calls made by other processes targeting this process: | |
task_for_pid: 0 | |
thread_create: 0 | |
thread_set_state: 0 | |
Calls made by this process: | |
task_for_pid: 0 | |
thread_create: 0 | |
thread_set_state: 0 | |
Calls made by all processes on this machine: | |
task_for_pid: 52083 | |
thread_create: 0 | |
thread_set_state: 0 | |
VM Region Summary: | |
ReadOnly portion of Libraries: Total=85.0M resident=121.3M(143%) swapped_out_or_unallocated=16777216.0T(20693836103680%) | |
Writable regions: Total=47.6M written=2312K(5%) resident=7132K(15%) swapped_out=0K(0%) unallocated=40.6M(85%) | |
REGION TYPE VIRTUAL | |
=========== ======= | |
Kernel Alloc Once 4K | |
MALLOC 39.2M | |
MALLOC (admin) 16K | |
STACK GUARD 4K | |
Stack 64.0M | |
VM_ALLOCATE 12K | |
__DATA 1272K | |
__LINKEDIT 71.2M | |
__TEXT 13.8M | |
__UNICODE 552K | |
shared memory 4K | |
=========== ======= | |
TOTAL 190.0M | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment