From: Mark Hubbart Date: 2004-05-25T00:25:56+09:00 Subject: Re: compiling mmap? --Apple-Mail-7--269038399 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On May 24, 2004, at 2:23 AM, ts wrote: >>>>>> "M" == Mark Hubbart writes: > > M> #defining _P1003_1B_VISIBLE at the top of mmap.c allows it to > compile, > M> but running 'make test' generates a bus error on the 13th test. > > it's best to do > > svg% diff -u mmap.c~ mmap.c > --- mmap.c~ 2004-03-06 18:30:46.000000000 +0100 > +++ mmap.c 2004-05-24 11:20:04.000000000 +0200 > @@ -1722,9 +1722,10 @@ > #ifdef MAP_NOSYNC > rb_define_const(mm_cMap, "MAP_NOSYNC", INT2FIX(MAP_NOSYNC)); > #endif > +#ifdef MCL_CURRENT > rb_define_const(mm_cMap, "MCL_CURRENT", INT2FIX(MCL_CURRENT)); > rb_define_const(mm_cMap, "MCL_FUTURE", INT2FIX(MCL_FUTURE)); > - > +#endif > rb_include_module(mm_cMap, rb_mComparable); > rb_include_module(mm_cMap, rb_mEnumerable); > > svg% I tried this, and while it still crashes on the tests, it makes it plenty stable for me to play with it. thanks much :) > M> Any help would be greatly appreciated. > > can you run it with gdb and give me a backtrace ? I attached it at the end of the message. I hope I did it right :) > > > Guy Decoux --Apple-Mail-7--269038399 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-mac-type=54455854; x-unix-mode=0644; x-mac-creator=48647261; name="bt" Content-Disposition: attachment; filename=bt (gdb) run -d mmapt.rb Starting program: /usr/local/bin/ruby -d mmapt.rb mmapt.rb:2: warning: `*' interpreted as argument prefix Reading symbols for shared libraries . done Loaded suite mmapt Started ............. Program received signal EXC_BAD_ACCESS, Could not access memory. 0xffff87b8 in __memcpy () (gdb) bt #0 0xffff87b8 in __memcpy () #1 0x0004dc6c in mm_cat (str=1787828, ptr=0x62edf0 "azertyuiopqsdfghjklm", len=20) at mmap.c:1103 #2 0x0004dcd0 in mm_append (str1=1787828, str2=1788668) at mmap.c:1115 #3 0x0004dd24 in mm_concat (str1=950272, str2=6483440) at mmap.c:1130 #4 0x00202370 in rb_call0 (klass=105528, recv=1787828, id=334, oid=334, argc=1, argv=0xbffda490, body=0x190a8, nosuper=0) at eval.c:5479 #5 0x00202ca4 in rb_call (klass=105528, recv=334, mid=3221069616, argc=1, argv=0xbffda490, scope=2708276) at eval.c:5696 #6 0x001fd1d0 in rb_eval (self=3222536192, n=0x62edf0) at ruby.h:634 #7 0x001fd288 in rb_eval (self=0, n=0x62edf0) at eval.c:3233 #8 0x002027fc in rb_call0 (klass=1127219200, recv=2147483648, id=1082247168, oid=3221070996, argc=-1072431104, argv=0x0, body=0xbffdd3e0, nosuper=0) at eval.c:5603 #9 0x00202ca4 in rb_call (klass=520736, recv=3221070996, mid=3221070960, argc=1787828, argv=0x1, scope=0) at eval.c:5696 #10 0x00202ed0 in rb_f_send (argc=0, argv=0xbffdd9b4, recv=490416) at ruby.h:634 #11 0x00202370 in rb_call0 (klass=232608, recv=490416, id=3905, oid=490416, argc=1, argv=0xbffdd9b0, body=0x36d60, nosuper=0) at eval.c:5479 #12 0x00202ca4 in rb_call (klass=232608, recv=490416, mid=3221084596, argc=491896, argv=0x2a2dc8, scope=520736) at eval.c:5696 #13 0x001fd434 in rb_eval (self=3222536192, n=0x62edf0) at ruby.h:634 #14 0x001fc850 in rb_eval (self=490416, n=0x62edf0) at eval.c:3054 #15 0x001fc99c in rb_eval (self=490416, n=0x62edf0) at eval.c:3079 #16 0x002027fc in rb_call0 (klass=1127219200, recv=2147483648, id=1082247168, oid=3221084596, argc=-1072431104, argv=0x0, body=0xbffe1cf0, nosuper=0) at eval.c:5603 #17 0x00202ca4 in rb_call (klass=688856, recv=3221084596, mid=3221084560, argc=1, argv=0xbffdd9b0, scope=0) at eval.c:5696 #18 0x001fd1d0 in rb_eval (self=3222536192, n=0x62edf0) at ruby.h:634 #19 0x00208434 in block_pass (self=491636, node=0xa9430) at eval.c:8357 #20 0x001fc194 in rb_eval (self=491636, n=0x62edf0) at eval.c:2929 #21 0x00200724 in rb_yield_0 (val=490416, self=491636, klass=0, flags=-1073858896, avalue=0) at eval.c:4687 #22 0x001e6464 in rb_ary_each (ary=3221113792) at array.c:1155 #23 0x00202370 in rb_call0 (klass=204848, recv=490996, id=3849, oid=0, argc=0, argv=0x0, body=0x31c0c, nosuper=0) at eval.c:5479 #24 0x00202ca4 in rb_call (klass=204848, recv=0, mid=3221108400, argc=0, argv=0x0, scope=-1073853504) at eval.c:5696 #25 0x001fd1d0 in rb_eval (self=491636, n=0x62edf0) at ruby.h:634 #26 0x001fc350 in rb_eval (self=491636, n=0x62edf0) at eval.c:2943 #27 0x002027fc in rb_call0 (klass=1127219200, recv=2147483648, id=1082247168, oid=0, argc=-1072431104, argv=0x0, body=0xbffe8760, nosuper=0) at eval.c:5603 #28 0x00202ca4 in rb_call (klass=690036, recv=0, mid=3221117104, argc=490996, argv=0x0, scope=2708280) at eval.c:5696 #29 0x001fd1d0 in rb_eval (self=3222536192, n=0x62edf0) at ruby.h:634 #30 0x00208434 in block_pass (self=493596, node=0xa9430) at eval.c:8357 #31 0x001fc194 in rb_eval (self=493596, n=0x62edf0) at eval.c:2929 #32 0x00200724 in rb_yield_0 (val=491636, self=493596, klass=0, flags=-1073831648, avalue=0) at eval.c:4687 #33 0x001e6464 in rb_ary_each (ary=3221141040) at array.c:1155 #34 0x00202370 in rb_call0 (klass=204848, recv=493556, id=3849, oid=0, argc=0, argv=0x0, body=0x31c0c, nosuper=0) at eval.c:5479 #35 0x00202ca4 in rb_call (klass=204848, recv=0, mid=3221135648, argc=0, argv=0x0, scope=-1073826256) at eval.c:5696 #36 0x001fd1d0 in rb_eval (self=493596, n=0x62edf0) at ruby.h:634 #37 0x001fc350 in rb_eval (self=493596, n=0x62edf0) at eval.c:2943 #38 0x002027fc in rb_call0 (klass=1127219200, recv=2147483648, id=1082247168, oid=0, argc=-1072431104, argv=0x0, body=0xbffef1d0, nosuper=0) at eval.c:5603 #39 0x00202ca4 in rb_call (klass=690036, recv=0, mid=3221144352, argc=493556, argv=0x0, scope=2708280) at eval.c:5696 #40 0x001fd1d0 in rb_eval (self=3222536192, n=0x62edf0) at ruby.h:634 #41 0x001fc350 in rb_eval (self=3259744661, n=0x62edf0) at eval.c:2943 #42 0x002027fc in rb_call0 (klass=3259744661, recv=2273678227, id=3259744661, oid=3221156372, argc=1127219200, argv=0x80000000, body=0x4081c800, nosuper=0) at eval.c:5603 #43 0x00202ca4 in rb_call (klass=455496, recv=3221156372, mid=3221156336, argc=493596, argv=0x1, scope=0) at eval.c:5696 #44 0x001fd1d0 in rb_eval (self=454856, n=0x62edf0) at ruby.h:634 #45 0x002027fc in rb_call0 (klass=454696, recv=454856, id=13777, oid=485036, argc=0, argv=0x0, body=0x7660c, nosuper=0) at eval.c:5603 #46 0x00202ca4 in rb_call (klass=454696, recv=485036, mid=3221168400, argc=453956, argv=0x0, scope=0) at eval.c:5696 #47 0x001fd4f8 in rb_eval (self=454856, n=0x62edf0) at ruby.h:634 #48 0x002027fc in rb_call0 (klass=454696, recv=454856, id=5041, oid=487936, argc=0, argv=0x0, body=0x7719c, nosuper=0) at eval.c:5603 #49 0x00202ca4 in rb_call (klass=454696, recv=487936, mid=3221175008, argc=0, argv=0x0, scope=0) at eval.c:5696 #50 0x001fd1d0 in rb_eval (self=454696, n=0x62edf0) at ruby.h:634 #51 0x002027fc in rb_call0 (klass=1127219200, recv=2147483648, id=1082247168, oid=664196, argc=-1072431104, argv=0x0, body=0xbfff6eb0, nosuper=0) at eval.c:5603 #52 0x00202ca4 in rb_call (klass=662376, recv=664196, mid=3221181616, argc=454856, argv=0x0, scope=0) at eval.c:5696 #53 0x001fd1d0 in rb_eval (self=3222536192, n=0x62edf0) at ruby.h:634 #54 0x001fcfcc in rb_eval (self=519756, n=0x62edf0) at eval.c:3217 #55 0x002027fc in rb_call0 (klass=3222536192, recv=0, id=3221200240, oid=3221188344, argc=2108580, argv=0x87859393, body=0xc24bc195, nosuper=0) at eval.c:5603 #56 0x00202ca4 in rb_call (klass=522536, recv=3221188344, mid=3221188304, argc=454696, argv=0x2, scope=0) at eval.c:5696 #57 0x001fd1d0 in rb_eval (self=522536, n=0x62edf0) at ruby.h:634 #58 0x002027fc in rb_call0 (klass=1127219200, recv=2147483648, id=1082247168, oid=686956, argc=-1072431104, argv=0x0, body=0xbfffb770, nosuper=0) at eval.c:5603 #59 0x00202ca4 in rb_call (klass=522516, recv=686956, mid=3221200240, argc=519756, argv=0x0, scope=2708280) at eval.c:5696 #60 0x001fd1d0 in rb_eval (self=3222536192, n=0x62edf0) at ruby.h:634 #61 0x001fd288 in rb_eval (self=3222536192, n=0x62edf0) at eval.c:3233 #62 0x00200724 in rb_yield_0 (val=520636, self=227808, klass=0, flags=-1073760368, avalue=2) at eval.c:4687 #63 0x00207bf4 in proc_invoke (proc=521476, args=520636, self=6, klass=3221206928) at ruby.h:634 #64 0x002061d4 in call_end_proc (data=522536) at eval.c:7363 #65 0x00206524 in rb_exec_end_proc () at eval.c:7444 #66 0x001f8a9c in ruby_finalize_0 () at eval.c:1390 #67 0x001f8b78 in ruby_cleanup (ex=0) at eval.c:1418 #68 0x001f8dc4 in ruby_stop (ex=950272) at eval.c:1465 #69 0x001f8e28 in ruby_run () at eval.c:1477 #70 0x00001d84 in main (argc=0, argv=0x0, envp=0x617a6572) at main.c:50 #71 0x00001a84 in _start (argc=3, argv=0xbffffd2c, envp=0xbffffd3c) at /SourceCache/Csu/Csu-46/crt.c:267 #72 0x000018f8 in start () --Apple-Mail-7--269038399 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed --Apple-Mail-7--269038399--