home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume27 / efence / part01 next >
SHell self-extracting ARchive  |  1993-09-01  |  57.5 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: part01

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 75 6e 69 78 0a 46 72 |.sources|.unix.Fr|
|00000020| 6f 6d 3a 20 62 72 75 63 | 65 40 70 69 78 61 72 2e |om: bruc|e@pixar.|
|00000030| 63 6f 6d 20 28 42 72 75 | 63 65 20 50 65 72 65 6e |com (Bru|ce Peren|
|00000040| 73 29 0a 53 75 62 6a 65 | 63 74 3a 20 76 32 37 69 |s).Subje|ct: v27i|
|00000050| 30 32 36 3a 20 65 66 65 | 6e 63 65 20 2d 20 45 6c |026: efe|nce - El|
|00000060| 65 63 74 72 69 63 20 46 | 65 6e 63 65 2c 20 61 20 |ectric F|ence, a |
|00000070| 64 65 62 75 67 67 69 6e | 67 20 6d 61 6c 6c 6f 63 |debuggin|g malloc|
|00000080| 28 29 20 6c 69 62 72 61 | 72 79 2c 20 50 61 72 74 |() libra|ry, Part|
|00000090| 30 31 2f 30 31 0a 4d 65 | 73 73 61 67 65 2d 69 64 |01/01.Me|ssage-id|
|000000a0| 3a 20 3c 31 2e 37 34 36 | 39 31 32 39 35 32 2e 32 |: <1.746|912952.2|
|000000b0| 34 30 36 35 40 67 77 2e | 68 6f 6d 65 2e 76 69 78 |4065@gw.|home.vix|
|000000c0| 2e 63 6f 6d 3e 0a 53 65 | 6e 64 65 72 3a 20 75 6e |.com>.Se|nder: un|
|000000d0| 69 78 2d 73 6f 75 72 63 | 65 73 2d 6d 6f 64 65 72 |ix-sourc|es-moder|
|000000e0| 61 74 6f 72 40 67 77 2e | 68 6f 6d 65 2e 76 69 78 |ator@gw.|home.vix|
|000000f0| 2e 63 6f 6d 0a 41 70 70 | 72 6f 76 65 64 3a 20 76 |.com.App|roved: v|
|00000100| 69 78 69 65 40 67 77 2e | 68 6f 6d 65 2e 76 69 78 |ixie@gw.|home.vix|
|00000110| 2e 63 6f 6d 0a 0a 53 75 | 62 6d 69 74 74 65 64 2d |.com..Su|bmitted-|
|00000120| 42 79 3a 20 62 72 75 63 | 65 40 70 69 78 61 72 2e |By: bruc|e@pixar.|
|00000130| 63 6f 6d 20 28 42 72 75 | 63 65 20 50 65 72 65 6e |com (Bru|ce Peren|
|00000140| 73 29 0a 50 6f 73 74 69 | 6e 67 2d 4e 75 6d 62 65 |s).Posti|ng-Numbe|
|00000150| 72 3a 20 56 6f 6c 75 6d | 65 20 32 37 2c 20 49 73 |r: Volum|e 27, Is|
|00000160| 73 75 65 20 32 36 0a 41 | 72 63 68 69 76 65 2d 4e |sue 26.A|rchive-N|
|00000170| 61 6d 65 3a 20 65 66 65 | 6e 63 65 2f 70 61 72 74 |ame: efe|nce/part|
|00000180| 30 31 0a 0a 45 6c 65 63 | 74 72 69 63 20 46 65 6e |01..Elec|tric Fen|
|00000190| 63 65 20 69 73 20 61 20 | 64 69 66 66 65 72 65 6e |ce is a |differen|
|000001a0| 74 20 6b 69 6e 64 20 6f | 66 20 6d 61 6c 6c 6f 63 |t kind o|f malloc|
|000001b0| 28 29 20 64 65 62 75 67 | 67 65 72 2e 20 49 74 20 |() debug|ger. It |
|000001c0| 75 73 65 73 20 74 68 65 | 20 76 69 72 74 75 61 6c |uses the| virtual|
|000001d0| 0a 6d 65 6d 6f 72 79 20 | 68 61 72 64 77 61 72 65 |.memory |hardware|
|000001e0| 20 6f 66 20 79 6f 75 72 | 20 73 79 73 74 65 6d 20 | of your| system |
|000001f0| 74 6f 20 64 65 74 65 63 | 74 20 77 68 65 6e 20 73 |to detec|t when s|
|00000200| 6f 66 74 77 61 72 65 20 | 6f 76 65 72 72 75 6e 73 |oftware |overruns|
|00000210| 20 74 68 65 20 62 6f 75 | 6e 64 61 72 69 65 73 0a | the bou|ndaries.|
|00000220| 6f 66 20 61 20 6d 61 6c | 6c 6f 63 28 29 20 62 75 |of a mal|loc() bu|
|00000230| 66 66 65 72 2e 20 49 74 | 20 77 69 6c 6c 20 61 6c |ffer. It| will al|
|00000240| 73 6f 20 64 65 74 65 63 | 74 20 61 6e 79 20 61 63 |so detec|t any ac|
|00000250| 63 65 73 73 65 73 20 6f | 66 20 6d 65 6d 6f 72 79 |cesses o|f memory|
|00000260| 20 74 68 61 74 20 68 61 | 73 0a 62 65 65 6e 20 72 | that ha|s.been r|
|00000270| 65 6c 65 61 73 65 64 20 | 62 79 20 66 72 65 65 28 |eleased |by free(|
|00000280| 29 2e 20 42 65 63 61 75 | 73 65 20 69 74 20 75 73 |). Becau|se it us|
|00000290| 65 73 20 74 68 65 20 56 | 4d 20 68 61 72 64 77 61 |es the V|M hardwa|
|000002a0| 72 65 20 66 6f 72 20 64 | 65 74 65 63 74 69 6f 6e |re for d|etection|
|000002b0| 2c 0a 45 6c 65 63 74 72 | 69 63 20 46 65 6e 63 65 |,.Electr|ic Fence|
|000002c0| 20 73 74 6f 70 73 20 79 | 6f 75 72 20 70 72 6f 67 | stops y|our prog|
|000002d0| 72 61 6d 20 6f 6e 20 74 | 68 65 20 66 69 72 73 74 |ram on t|he first|
|000002e0| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 20 74 68 61 | instruc|tion tha|
|000002f0| 74 20 63 61 75 73 65 73 | 0a 61 20 62 6f 75 6e 64 |t causes|.a bound|
|00000300| 73 20 76 69 6f 6c 61 74 | 69 6f 6e 2e 20 49 74 27 |s violat|ion. It'|
|00000310| 73 20 74 68 65 6e 20 74 | 72 69 76 69 61 6c 20 74 |s then t|rivial t|
|00000320| 6f 20 75 73 65 20 61 20 | 64 65 62 75 67 67 65 72 |o use a |debugger|
|00000330| 20 74 6f 20 64 69 73 70 | 6c 61 79 20 74 68 65 0a | to disp|lay the.|
|00000340| 6f 66 66 65 6e 64 69 6e | 67 20 73 74 61 74 65 6d |offendin|g statem|
|00000350| 65 6e 74 2e 0a 0a 54 68 | 69 73 20 76 65 72 73 69 |ent...Th|is versi|
|00000360| 6f 6e 20 77 69 6c 6c 20 | 72 75 6e 20 6f 6e 3a 0a |on will |run on:.|
|00000370| 09 41 6c 6c 20 53 79 73 | 74 65 6d 20 56 20 52 65 |.All Sys|tem V Re|
|00000380| 76 69 73 69 6f 6e 20 34 | 20 70 6c 61 74 66 6f 72 |vision 4| platfor|
|00000390| 6d 73 20 28 61 6e 64 20 | 70 6f 73 73 69 62 6c 79 |ms (and |possibly|
|000003a0| 20 65 61 72 6c 69 65 72 | 20 72 65 76 69 73 69 6f | earlier| revisio|
|000003b0| 6e 73 29 0a 09 69 6e 63 | 6c 75 64 69 6e 67 3a 0a |ns)..inc|luding:.|
|000003c0| 09 09 45 76 65 72 79 20 | 33 38 36 20 53 79 73 74 |..Every |386 Syst|
|000003d0| 65 6d 20 56 20 49 27 76 | 65 20 68 65 61 72 64 20 |em V I'v|e heard |
|000003e0| 6f 66 2e 0a 09 09 53 6f | 6c 61 72 69 73 20 32 2e |of....So|laris 2.|
|000003f0| 78 0a 09 09 53 47 49 20 | 49 52 49 58 20 35 2e 30 |x...SGI |IRIX 5.0|
|00000400| 20 28 62 75 74 20 6e 6f | 74 20 34 2e 78 29 0a 0a | (but no|t 4.x)..|
|00000410| 09 49 42 4d 20 41 49 58 | 20 6f 6e 20 74 68 65 20 |.IBM AIX| on the |
|00000420| 52 53 2f 36 30 30 30 2e | 0a 09 53 75 6e 4f 53 20 |RS/6000.|..SunOS |
|00000430| 34 2e 58 20 28 75 73 69 | 6e 67 20 61 6e 20 41 4e |4.X (usi|ng an AN|
|00000440| 53 49 20 43 20 63 6f 6d | 70 69 6c 65 72 20 61 6e |SI C com|piler an|
|00000450| 64 20 70 72 6f 62 61 62 | 6c 79 20 73 74 61 74 69 |d probab|ly stati|
|00000460| 63 20 6c 69 6e 6b 69 6e | 67 29 2e 0a 0a 09 48 50 |c linkin|g)....HP|
|00000470| 2f 55 58 20 39 2e 30 31 | 2c 20 61 6e 64 20 70 6f |/UX 9.01|, and po|
|00000480| 73 73 69 62 6c 79 20 65 | 61 72 6c 69 65 72 20 76 |ssibly e|arlier v|
|00000490| 65 72 73 69 6f 6e 73 2e | 0a 0a 54 68 65 20 73 6f |ersions.|..The so|
|000004a0| 66 74 77 61 72 65 20 6c | 69 63 65 6e 73 65 20 61 |ftware l|icense a|
|000004b0| 6e 64 20 63 6f 6d 70 6c | 65 74 65 20 69 6e 66 6f |nd compl|ete info|
|000004c0| 72 6d 61 74 69 6f 6e 20 | 6f 6e 20 69 74 73 20 75 |rmation |on its u|
|000004d0| 73 65 20 61 72 65 20 69 | 6e 20 74 68 65 20 6d 61 |se are i|n the ma|
|000004e0| 6e 0a 70 61 67 65 3a 20 | 6c 69 62 65 66 65 6e 63 |n.page: |libefenc|
|000004f0| 65 2e 33 20 2e 0a 0a 09 | 62 72 75 63 65 40 70 69 |e.3 ....|bruce@pi|
|00000500| 78 61 72 2e 63 6f 6d 20 | 28 42 72 75 63 65 20 50 |xar.com |(Bruce P|
|00000510| 65 72 65 6e 73 29 0a 0a | 23 21 20 2f 62 69 6e 2f |erens)..|#! /bin/|
|00000520| 73 68 0a 23 20 54 68 69 | 73 20 69 73 20 61 20 73 |sh.# Thi|s is a s|
|00000530| 68 65 6c 6c 20 61 72 63 | 68 69 76 65 2e 20 20 52 |hell arc|hive. R|
|00000540| 65 6d 6f 76 65 20 61 6e | 79 74 68 69 6e 67 20 62 |emove an|ything b|
|00000550| 65 66 6f 72 65 20 74 68 | 69 73 20 6c 69 6e 65 2c |efore th|is line,|
|00000560| 20 74 68 65 6e 20 75 6e | 70 61 63 6b 0a 23 20 69 | then un|pack.# i|
|00000570| 74 20 62 79 20 73 61 76 | 69 6e 67 20 69 74 20 69 |t by sav|ing it i|
|00000580| 6e 74 6f 20 61 20 66 69 | 6c 65 20 61 6e 64 20 74 |nto a fi|le and t|
|00000590| 79 70 69 6e 67 20 22 73 | 68 20 66 69 6c 65 22 2e |yping "s|h file".|
|000005a0| 20 20 54 6f 20 6f 76 65 | 72 77 72 69 74 65 20 65 | To ove|rwrite e|
|000005b0| 78 69 73 74 69 6e 67 0a | 23 20 66 69 6c 65 73 2c |xisting.|# files,|
|000005c0| 20 74 79 70 65 20 22 73 | 68 20 66 69 6c 65 20 2d | type "s|h file -|
|000005d0| 63 22 2e 20 20 59 6f 75 | 20 63 61 6e 20 61 6c 73 |c". You| can als|
|000005e0| 6f 20 66 65 65 64 20 74 | 68 69 73 20 61 73 20 73 |o feed t|his as s|
|000005f0| 74 61 6e 64 61 72 64 20 | 69 6e 70 75 74 20 76 69 |tandard |input vi|
|00000600| 61 0a 23 20 75 6e 73 68 | 61 72 2c 20 6f 72 20 62 |a.# unsh|ar, or b|
|00000610| 79 20 74 79 70 69 6e 67 | 20 22 73 68 20 3c 66 69 |y typing| "sh <fi|
|00000620| 6c 65 22 2c 20 65 2e 67 | 2e 2e 20 20 49 66 20 74 |le", e.g|.. If t|
|00000630| 68 69 73 20 61 72 63 68 | 69 76 65 20 69 73 20 63 |his arch|ive is c|
|00000640| 6f 6d 70 6c 65 74 65 2c | 20 79 6f 75 0a 23 20 77 |omplete,| you.# w|
|00000650| 69 6c 6c 20 73 65 65 20 | 74 68 65 20 66 6f 6c 6c |ill see |the foll|
|00000660| 6f 77 69 6e 67 20 6d 65 | 73 73 61 67 65 20 61 74 |owing me|ssage at|
|00000670| 20 74 68 65 20 65 6e 64 | 3a 0a 23 09 09 22 45 6e | the end|:.#.."En|
|00000680| 64 20 6f 66 20 73 68 65 | 6c 6c 20 61 72 63 68 69 |d of she|ll archi|
|00000690| 76 65 2e 22 0a 23 20 43 | 6f 6e 74 65 6e 74 73 3a |ve.".# C|ontents:|
|000006a0| 20 20 52 45 41 44 4d 45 | 20 6c 69 62 65 66 65 6e | README| libefen|
|000006b0| 63 65 2e 33 20 4d 61 6b | 65 66 69 6c 65 20 65 66 |ce.3 Mak|efile ef|
|000006c0| 65 6e 63 65 2e 68 20 65 | 66 65 6e 63 65 2e 63 20 |ence.h e|fence.c |
|000006d0| 70 61 67 65 2e 63 0a 23 | 20 20 20 70 72 69 6e 74 |page.c.#| print|
|000006e0| 2e 63 20 65 66 74 65 73 | 74 2e 63 20 74 73 74 68 |.c eftes|t.c tsth|
|000006f0| 65 61 70 2e 63 0a 23 20 | 57 72 61 70 70 65 64 20 |eap.c.# |Wrapped |
|00000700| 62 79 20 62 72 75 63 65 | 40 6d 6f 6e 67 6f 20 6f |by bruce|@mongo o|
|00000710| 6e 20 57 65 64 20 53 65 | 70 20 20 31 20 31 31 3a |n Wed Se|p 1 11:|
|00000720| 32 30 3a 35 36 20 31 39 | 39 33 0a 50 41 54 48 3d |20:56 19|93.PATH=|
|00000730| 2f 62 69 6e 3a 2f 75 73 | 72 2f 62 69 6e 3a 2f 75 |/bin:/us|r/bin:/u|
|00000740| 73 72 2f 75 63 62 20 3b | 20 65 78 70 6f 72 74 20 |sr/ucb ;| export |
|00000750| 50 41 54 48 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |PATH.if |test -f |
|00000760| 27 52 45 41 44 4d 45 27 | 20 2d 61 20 22 24 7b 31 |'README'| -a "${1|
|00000770| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00000780| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|00000790| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|000007a0| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|000007b0| 22 27 52 45 41 44 4d 45 | 27 5c 22 0a 65 6c 73 65 |"'README|'\".else|
|000007c0| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 |.echo sh|ar: Extr|
|000007d0| 61 63 74 69 6e 67 20 5c | 22 27 52 45 41 44 4d 45 |acting \|"'README|
|000007e0| 27 5c 22 20 5c 28 31 34 | 31 30 20 63 68 61 72 61 |'\" \(14|10 chara|
|000007f0| 63 74 65 72 73 5c 29 0a | 73 65 64 20 22 73 2f 5e |cters\).|sed "s/^|
|00000800| 58 2f 2f 22 20 3e 27 52 | 45 41 44 4d 45 27 20 3c |X//" >'R|EADME' <|
|00000810| 3c 27 45 4e 44 5f 4f 46 | 5f 46 49 4c 45 27 0a 58 |<'END_OF|_FILE'.X|
|00000820| 54 68 69 73 20 69 73 20 | 45 6c 65 63 74 72 69 63 |This is |Electric|
|00000830| 20 46 65 6e 63 65 20 32 | 2e 30 2e 31 0a 58 0a 58 | Fence 2|.0.1.X.X|
|00000840| 45 6c 65 63 74 72 69 63 | 20 46 65 6e 63 65 20 69 |Electric| Fence i|
|00000850| 73 20 61 20 64 69 66 66 | 65 72 65 6e 74 20 6b 69 |s a diff|erent ki|
|00000860| 6e 64 20 6f 66 20 6d 61 | 6c 6c 6f 63 28 29 20 64 |nd of ma|lloc() d|
|00000870| 65 62 75 67 67 65 72 2e | 20 49 74 20 75 73 65 73 |ebugger.| It uses|
|00000880| 20 74 68 65 20 76 69 72 | 74 75 61 6c 0a 58 6d 65 | the vir|tual.Xme|
|00000890| 6d 6f 72 79 20 68 61 72 | 64 77 61 72 65 20 6f 66 |mory har|dware of|
|000008a0| 20 79 6f 75 72 20 73 79 | 73 74 65 6d 20 74 6f 20 | your sy|stem to |
|000008b0| 64 65 74 65 63 74 20 77 | 68 65 6e 20 73 6f 66 74 |detect w|hen soft|
|000008c0| 77 61 72 65 20 6f 76 65 | 72 72 75 6e 73 20 74 68 |ware ove|rruns th|
|000008d0| 65 20 62 6f 75 6e 64 61 | 72 69 65 73 0a 58 6f 66 |e bounda|ries.Xof|
|000008e0| 20 61 20 6d 61 6c 6c 6f | 63 28 29 20 62 75 66 66 | a mallo|c() buff|
|000008f0| 65 72 2e 20 49 74 20 77 | 69 6c 6c 20 61 6c 73 6f |er. It w|ill also|
|00000900| 20 64 65 74 65 63 74 20 | 61 6e 79 20 61 63 63 65 | detect |any acce|
|00000910| 73 73 65 73 20 6f 66 20 | 6d 65 6d 6f 72 79 20 74 |sses of |memory t|
|00000920| 68 61 74 20 68 61 73 0a | 58 62 65 65 6e 20 72 65 |hat has.|Xbeen re|
|00000930| 6c 65 61 73 65 64 20 62 | 79 20 66 72 65 65 28 29 |leased b|y free()|
|00000940| 2e 20 42 65 63 61 75 73 | 65 20 69 74 20 75 73 65 |. Becaus|e it use|
|00000950| 73 20 74 68 65 20 56 4d | 20 68 61 72 64 77 61 72 |s the VM| hardwar|
|00000960| 65 20 66 6f 72 20 64 65 | 74 65 63 74 69 6f 6e 2c |e for de|tection,|
|00000970| 0a 58 45 6c 65 63 74 72 | 69 63 20 46 65 6e 63 65 |.XElectr|ic Fence|
|00000980| 20 73 74 6f 70 73 20 79 | 6f 75 72 20 70 72 6f 67 | stops y|our prog|
|00000990| 72 61 6d 20 6f 6e 20 74 | 68 65 20 66 69 72 73 74 |ram on t|he first|
|000009a0| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 20 74 68 61 | instruc|tion tha|
|000009b0| 74 20 63 61 75 73 65 73 | 0a 58 61 20 62 6f 75 6e |t causes|.Xa boun|
|000009c0| 64 73 20 76 69 6f 6c 61 | 74 69 6f 6e 2e 20 49 74 |ds viola|tion. It|
|000009d0| 27 73 20 74 68 65 6e 20 | 74 72 69 76 69 61 6c 20 |'s then |trivial |
|000009e0| 74 6f 20 75 73 65 20 61 | 20 64 65 62 75 67 67 65 |to use a| debugge|
|000009f0| 72 20 74 6f 20 64 69 73 | 70 6c 61 79 20 74 68 65 |r to dis|play the|
|00000a00| 0a 58 6f 66 66 65 6e 64 | 69 6e 67 20 73 74 61 74 |.Xoffend|ing stat|
|00000a10| 65 6d 65 6e 74 2e 0a 58 | 0a 58 54 68 69 73 20 76 |ement..X|.XThis v|
|00000a20| 65 72 73 69 6f 6e 20 77 | 69 6c 6c 20 72 75 6e 20 |ersion w|ill run |
|00000a30| 6f 6e 3a 0a 58 09 41 6c | 6c 20 53 79 73 74 65 6d |on:.X.Al|l System|
|00000a40| 20 56 20 52 65 76 69 73 | 69 6f 6e 20 34 20 70 6c | V Revis|ion 4 pl|
|00000a50| 61 74 66 6f 72 6d 73 20 | 28 61 6e 64 20 70 6f 73 |atforms |(and pos|
|00000a60| 73 69 62 6c 79 20 65 61 | 72 6c 69 65 72 20 72 65 |sibly ea|rlier re|
|00000a70| 76 69 73 69 6f 6e 73 29 | 0a 58 09 69 6e 63 6c 75 |visions)|.X.inclu|
|00000a80| 64 69 6e 67 3a 0a 58 09 | 09 45 76 65 72 79 20 33 |ding:.X.|.Every 3|
|00000a90| 38 36 20 53 79 73 74 65 | 6d 20 56 20 49 27 76 65 |86 Syste|m V I've|
|00000aa0| 20 68 65 61 72 64 20 6f | 66 2e 0a 58 09 09 53 6f | heard o|f..X..So|
|00000ab0| 6c 61 72 69 73 20 32 2e | 78 0a 58 09 09 53 47 49 |laris 2.|x.X..SGI|
|00000ac0| 20 49 52 49 58 20 35 2e | 30 20 28 62 75 74 20 6e | IRIX 5.|0 (but n|
|00000ad0| 6f 74 20 34 2e 78 29 0a | 58 0a 58 09 49 42 4d 20 |ot 4.x).|X.X.IBM |
|00000ae0| 41 49 58 20 6f 6e 20 74 | 68 65 20 52 53 2f 36 30 |AIX on t|he RS/60|
|00000af0| 30 30 2e 0a 58 0a 58 09 | 53 75 6e 4f 53 20 34 2e |00..X.X.|SunOS 4.|
|00000b00| 58 20 28 75 73 69 6e 67 | 20 61 6e 20 41 4e 53 49 |X (using| an ANSI|
|00000b10| 20 43 20 63 6f 6d 70 69 | 6c 65 72 20 61 6e 64 20 | C compi|ler and |
|00000b20| 70 72 6f 62 61 62 6c 79 | 20 73 74 61 74 69 63 20 |probably| static |
|00000b30| 6c 69 6e 6b 69 6e 67 29 | 2e 0a 58 0a 58 09 48 50 |linking)|..X.X.HP|
|00000b40| 2f 55 58 20 39 2e 30 31 | 2c 20 61 6e 64 20 70 6f |/UX 9.01|, and po|
|00000b50| 73 73 69 62 6c 79 20 65 | 61 72 6c 69 65 72 20 76 |ssibly e|arlier v|
|00000b60| 65 72 73 69 6f 6e 73 2e | 0a 58 0a 58 4f 6e 20 73 |ersions.|.X.XOn s|
|00000b70| 6f 6d 65 20 6f 66 20 74 | 68 65 73 65 20 70 6c 61 |ome of t|hese pla|
|00000b80| 74 66 6f 72 6d 73 2c 20 | 79 6f 75 27 6c 6c 20 68 |tforms, |you'll h|
|00000b90| 61 76 65 20 74 6f 20 75 | 6e 63 6f 6d 6d 65 6e 74 |ave to u|ncomment|
|00000ba0| 20 6c 69 6e 65 73 20 69 | 6e 20 74 68 65 20 4d 61 | lines i|n the Ma|
|00000bb0| 6b 65 66 69 6c 65 0a 58 | 74 68 61 74 20 61 70 70 |kefile.X|that app|
|00000bc0| 6c 79 20 74 6f 20 79 6f | 75 72 20 70 61 72 74 69 |ly to yo|ur parti|
|00000bd0| 63 75 6c 61 72 20 73 79 | 73 74 65 6d 2e 0a 58 0a |cular sy|stem..X.|
|00000be0| 58 49 66 20 79 6f 75 20 | 74 65 73 74 20 45 6c 65 |XIf you |test Ele|
|00000bf0| 63 74 72 69 63 20 46 65 | 6e 63 65 20 6f 6e 20 61 |ctric Fe|nce on a|
|00000c00| 20 70 6c 61 74 66 6f 72 | 6d 20 6e 6f 74 20 6d 65 | platfor|m not me|
|00000c10| 6e 74 69 6f 6e 65 64 20 | 68 65 72 65 2c 20 70 6c |ntioned |here, pl|
|00000c20| 65 61 73 65 20 73 65 6e | 64 20 6d 65 20 61 0a 58 |ease sen|d me a.X|
|00000c30| 72 65 70 6f 72 74 2e 0a | 58 0a 58 49 74 20 77 69 |report..|X.XIt wi|
|00000c40| 6c 6c 20 70 72 6f 62 61 | 62 6c 79 20 70 6f 72 74 |ll proba|bly port|
|00000c50| 20 74 6f 20 61 6e 79 20 | 41 4e 53 49 2f 50 4f 53 | to any |ANSI/POS|
|00000c60| 49 58 20 73 79 73 74 65 | 6d 20 74 68 61 74 20 70 |IX syste|m that p|
|00000c70| 72 6f 76 69 64 65 73 20 | 6d 6d 61 70 28 29 2c 20 |rovides |mmap(), |
|00000c80| 61 6e 64 0a 58 6d 70 72 | 6f 74 65 63 74 28 29 2c |and.Xmpr|otect(),|
|00000c90| 20 61 73 20 6c 6f 6e 67 | 20 61 73 20 6d 70 72 6f | as long| as mpro|
|00000ca0| 74 65 63 74 28 29 20 68 | 61 73 20 74 68 65 20 63 |tect() h|as the c|
|00000cb0| 61 70 61 62 69 6c 69 74 | 79 20 74 6f 20 74 75 72 |apabilit|y to tur|
|00000cc0| 6e 20 6f 66 66 20 61 6c | 6c 20 61 63 63 65 73 73 |n off al|l access|
|00000cd0| 0a 58 74 6f 20 61 20 6d | 65 6d 6f 72 79 20 70 61 |.Xto a m|emory pa|
|00000ce0| 67 65 2c 20 61 6e 64 20 | 6d 6d 61 70 28 29 20 63 |ge, and |mmap() c|
|00000cf0| 61 6e 20 75 73 65 20 2f | 64 65 76 2f 7a 65 72 6f |an use /|dev/zero|
|00000d00| 20 6f 72 20 74 68 65 20 | 4d 41 50 5f 41 4e 4f 4e | or the |MAP_ANON|
|00000d10| 59 4d 4f 55 53 20 66 6c | 61 67 0a 58 74 6f 20 63 |YMOUS fl|ag.Xto c|
|00000d20| 72 65 61 74 65 20 76 69 | 72 74 75 61 6c 20 6d 65 |reate vi|rtual me|
|00000d30| 6d 6f 72 79 20 70 61 67 | 65 73 2e 0a 58 0a 58 54 |mory pag|es..X.XT|
|00000d40| 68 65 20 73 6f 66 74 77 | 61 72 65 20 6c 69 63 65 |he softw|are lice|
|00000d50| 6e 73 65 20 61 6e 64 20 | 63 6f 6d 70 6c 65 74 65 |nse and |complete|
|00000d60| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 6f 6e 20 | informa|tion on |
|00000d70| 69 74 73 20 75 73 65 20 | 61 72 65 20 69 6e 20 74 |its use |are in t|
|00000d80| 68 65 20 6d 61 6e 0a 58 | 70 61 67 65 3a 20 6c 69 |he man.X|page: li|
|00000d90| 62 65 66 65 6e 63 65 2e | 33 20 2e 0a 58 0a 58 09 |befence.|3 ..X.X.|
|00000da0| 54 68 61 6e 6b 73 0a 58 | 0a 58 09 42 72 75 63 65 |Thanks.X|.X.Bruce|
|00000db0| 20 50 65 72 65 6e 73 0a | 58 09 42 72 75 63 65 40 | Perens.|X.Bruce@|
|00000dc0| 50 69 78 61 72 2e 63 6f | 6d 0a 45 4e 44 5f 4f 46 |Pixar.co|m.END_OF|
|00000dd0| 5f 46 49 4c 45 0a 69 66 | 20 74 65 73 74 20 31 34 |_FILE.if| test 14|
|00000de0| 31 30 20 2d 6e 65 20 60 | 77 63 20 2d 63 20 3c 27 |10 -ne `|wc -c <'|
|00000df0| 52 45 41 44 4d 45 27 60 | 3b 20 74 68 65 6e 0a 20 |README'`|; then. |
|00000e00| 20 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 5c 22 | echo |shar: \"|
|00000e10| 27 52 45 41 44 4d 45 27 | 5c 22 20 75 6e 70 61 63 |'README'|\" unpac|
|00000e20| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|00000e30| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|00000e40| 20 27 52 45 41 44 4d 45 | 27 0a 66 69 0a 69 66 20 | 'README|'.fi.if |
|00000e50| 74 65 73 74 20 2d 66 20 | 27 6c 69 62 65 66 65 6e |test -f |'libefen|
|00000e60| 63 65 2e 33 27 20 2d 61 | 20 22 24 7b 31 7d 22 20 |ce.3' -a| "${1}" |
|00000e70| 21 3d 20 22 2d 63 22 20 | 3b 20 74 68 65 6e 20 0a |!= "-c" |; then .|
|00000e80| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 57 69 6c | echo s|har: Wil|
|00000e90| 6c 20 6e 6f 74 20 63 6c | 6f 62 62 65 72 20 65 78 |l not cl|obber ex|
|00000ea0| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 5c 22 27 6c |isting f|ile \"'l|
|00000eb0| 69 62 65 66 65 6e 63 65 | 2e 33 27 5c 22 0a 65 6c |ibefence|.3'\".el|
|00000ec0| 73 65 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 45 78 |se.echo |shar: Ex|
|00000ed0| 74 72 61 63 74 69 6e 67 | 20 5c 22 27 6c 69 62 65 |tracting| \"'libe|
|00000ee0| 66 65 6e 63 65 2e 33 27 | 5c 22 20 5c 28 31 34 35 |fence.3'|\" \(145|
|00000ef0| 30 38 20 63 68 61 72 61 | 63 74 65 72 73 5c 29 0a |08 chara|cters\).|
|00000f00| 73 65 64 20 22 73 2f 5e | 58 2f 2f 22 20 3e 27 6c |sed "s/^|X//" >'l|
|00000f10| 69 62 65 66 65 6e 63 65 | 2e 33 27 20 3c 3c 27 45 |ibefence|.3' <<'E|
|00000f20| 4e 44 5f 4f 46 5f 46 49 | 4c 45 27 0a 58 2e 54 48 |ND_OF_FI|LE'.X.TH|
|00000f30| 20 65 66 65 6e 63 65 20 | 33 20 32 37 2d 41 70 72 | efence |3 27-Apr|
|00000f40| 69 6c 2d 31 39 39 33 0a | 58 2e 53 48 20 4e 41 4d |il-1993.|X.SH NAM|
|00000f50| 45 0a 58 65 66 65 6e 63 | 65 20 5c 2d 20 45 6c 65 |E.Xefenc|e \- Ele|
|00000f60| 63 74 72 69 63 20 46 65 | 6e 63 65 20 4d 61 6c 6c |ctric Fe|nce Mall|
|00000f70| 6f 63 20 44 65 62 75 67 | 67 65 72 0a 58 2e 53 48 |oc Debug|ger.X.SH|
|00000f80| 20 53 59 4e 4f 50 53 49 | 53 0a 58 2e 6e 66 0a 58 | SYNOPSI|S.X.nf.X|
|00000f90| 2e 66 74 20 42 0a 58 23 | 69 6e 63 6c 75 64 65 20 |.ft B.X#|include |
|00000fa0| 3c 73 74 64 6c 69 62 2e | 68 3e 0a 58 2e 66 74 0a |<stdlib.|h>.X.ft.|
|00000fb0| 58 2e 66 69 0a 58 2e 4c | 50 0a 58 2e 6e 66 0a 58 |X.fi.X.L|P.X.nf.X|
|00000fc0| 2e 66 74 20 42 0a 58 76 | 6f 69 64 20 2a 20 6d 61 |.ft B.Xv|oid * ma|
|00000fd0| 6c 6c 6f 63 20 28 73 69 | 7a 65 5f 74 20 73 69 7a |lloc (si|ze_t siz|
|00000fe0| 65 29 3b 0a 58 2e 66 74 | 0a 58 2e 66 69 0a 58 2e |e);.X.ft|.X.fi.X.|
|00000ff0| 4c 50 0a 58 2e 6e 66 0a | 58 2e 66 74 20 42 0a 58 |LP.X.nf.|X.ft B.X|
|00001000| 76 6f 69 64 20 66 72 65 | 65 20 28 76 6f 69 64 20 |void fre|e (void |
|00001010| 2a 70 74 72 29 3b 0a 58 | 2e 66 74 0a 58 2e 66 69 |*ptr);.X|.ft.X.fi|
|00001020| 0a 58 2e 4c 50 0a 58 2e | 6e 66 0a 58 2e 66 74 20 |.X.LP.X.|nf.X.ft |
|00001030| 42 0a 58 76 6f 69 64 20 | 2a 20 72 65 61 6c 6c 6f |B.Xvoid |* reallo|
|00001040| 63 20 28 76 6f 69 64 20 | 2a 70 74 72 2c 20 73 69 |c (void |*ptr, si|
|00001050| 7a 65 5f 74 20 73 69 7a | 65 29 3b 0a 58 2e 66 74 |ze_t siz|e);.X.ft|
|00001060| 0a 58 2e 66 69 0a 58 2e | 4c 50 0a 58 2e 6e 66 0a |.X.fi.X.|LP.X.nf.|
|00001070| 58 2e 66 74 20 42 0a 58 | 76 6f 69 64 20 2a 20 63 |X.ft B.X|void * c|
|00001080| 61 6c 6c 6f 63 20 28 73 | 69 7a 65 5f 74 20 6e 65 |alloc (s|ize_t ne|
|00001090| 6c 65 6d 2c 20 73 69 7a | 65 5f 74 20 65 6c 73 69 |lem, siz|e_t elsi|
|000010a0| 7a 65 29 3b 0a 58 2e 66 | 74 0a 58 2e 66 69 0a 58 |ze);.X.f|t.X.fi.X|
|000010b0| 2e 4c 50 0a 58 2e 6e 66 | 0a 58 2e 66 74 20 42 0a |.LP.X.nf|.X.ft B.|
|000010c0| 58 76 6f 69 64 20 2a 20 | 6d 65 6d 61 6c 69 67 6e |Xvoid * |memalign|
|000010d0| 20 28 73 69 7a 65 5f 74 | 20 61 6c 69 67 6e 6d 65 | (size_t| alignme|
|000010e0| 6e 74 2c 20 73 69 7a 65 | 5f 74 20 73 69 7a 65 29 |nt, size|_t size)|
|000010f0| 3b 0a 58 2e 66 74 0a 58 | 2e 66 69 0a 58 2e 4c 50 |;.X.ft.X|.fi.X.LP|
|00001100| 0a 58 2e 6e 66 0a 58 2e | 66 74 20 42 0a 58 76 6f |.X.nf.X.|ft B.Xvo|
|00001110| 69 64 20 2a 20 76 61 6c | 6c 6f 63 20 28 73 69 7a |id * val|loc (siz|
|00001120| 65 5f 74 20 73 69 7a 65 | 29 3b 0a 58 2e 66 74 0a |e_t size|);.X.ft.|
|00001130| 58 2e 66 69 0a 58 2e 4c | 50 0a 58 2e 6e 66 0a 58 |X.fi.X.L|P.X.nf.X|
|00001140| 2e 66 74 20 42 0a 58 65 | 78 74 65 72 6e 20 69 6e |.ft B.Xe|xtern in|
|00001150| 74 20 45 46 5f 41 4c 49 | 47 4e 4d 45 4e 54 3b 0a |t EF_ALI|GNMENT;.|
|00001160| 58 2e 66 74 0a 58 2e 66 | 69 0a 58 2e 4c 50 0a 58 |X.ft.X.f|i.X.LP.X|
|00001170| 2e 6e 66 0a 58 2e 66 74 | 20 42 0a 58 65 78 74 65 |.nf.X.ft| B.Xexte|
|00001180| 72 6e 20 69 6e 74 20 45 | 46 5f 50 52 4f 54 45 43 |rn int E|F_PROTEC|
|00001190| 54 5f 42 45 4c 4f 57 3b | 0a 58 2e 66 74 0a 58 2e |T_BELOW;|.X.ft.X.|
|000011a0| 66 69 0a 58 2e 4c 50 0a | 58 2e 6e 66 0a 58 2e 66 |fi.X.LP.|X.nf.X.f|
|000011b0| 74 20 42 0a 58 65 78 74 | 65 72 6e 20 69 6e 74 20 |t B.Xext|ern int |
|000011c0| 45 46 5f 50 52 4f 54 45 | 43 54 5f 46 52 45 45 3b |EF_PROTE|CT_FREE;|
|000011d0| 0a 58 2e 66 74 0a 58 2e | 66 69 0a 58 2e 53 48 20 |.X.ft.X.|fi.X.SH |
|000011e0| 44 45 53 43 52 49 50 54 | 49 4f 4e 0a 58 2e 49 20 |DESCRIPT|ION.X.I |
|000011f0| 45 6c 65 63 74 72 69 63 | 20 46 65 6e 63 65 0a 58 |Electric| Fence.X|
|00001200| 68 65 6c 70 73 20 79 6f | 75 20 64 65 74 65 63 74 |helps yo|u detect|
|00001210| 20 74 77 6f 20 63 6f 6d | 6d 6f 6e 20 70 72 6f 67 | two com|mon prog|
|00001220| 72 61 6d 6d 69 6e 67 20 | 62 75 67 73 3a 0a 58 73 |ramming |bugs:.Xs|
|00001230| 6f 66 74 77 61 72 65 20 | 74 68 61 74 20 6f 76 65 |oftware |that ove|
|00001240| 72 72 75 6e 73 20 74 68 | 65 20 62 6f 75 6e 64 61 |rruns th|e bounda|
|00001250| 72 69 65 73 20 6f 66 20 | 61 20 6d 61 6c 6c 6f 63 |ries of |a malloc|
|00001260| 28 29 20 6d 65 6d 6f 72 | 79 0a 58 61 6c 6c 6f 63 |() memor|y.Xalloc|
|00001270| 61 74 69 6f 6e 2c 20 61 | 6e 64 20 73 6f 66 74 77 |ation, a|nd softw|
|00001280| 61 72 65 20 74 68 61 74 | 20 74 6f 75 63 68 65 73 |are that| touches|
|00001290| 20 61 20 6d 65 6d 6f 72 | 79 20 61 6c 6c 6f 63 61 | a memor|y alloca|
|000012a0| 74 69 6f 6e 20 74 68 61 | 74 20 68 61 73 20 62 65 |tion tha|t has be|
|000012b0| 65 6e 0a 58 72 65 6c 65 | 61 73 65 64 20 62 79 20 |en.Xrele|ased by |
|000012c0| 66 72 65 65 28 29 2e 20 | 55 6e 6c 69 6b 65 20 6f |free(). |Unlike o|
|000012d0| 74 68 65 72 20 6d 61 6c | 6c 6f 63 28 29 20 64 65 |ther mal|loc() de|
|000012e0| 62 75 67 67 65 72 73 2c | 20 45 6c 65 63 74 72 69 |buggers,| Electri|
|000012f0| 63 20 46 65 6e 63 65 20 | 77 69 6c 6c 0a 58 64 65 |c Fence |will.Xde|
|00001300| 74 65 63 74 0a 58 2e 49 | 20 72 65 61 64 0a 58 61 |tect.X.I| read.Xa|
|00001310| 63 63 65 73 73 65 73 20 | 61 73 20 77 65 6c 6c 20 |ccesses |as well |
|00001320| 61 73 20 77 72 69 74 65 | 73 2c 20 61 6e 64 20 69 |as write|s, and i|
|00001330| 74 20 77 69 6c 6c 20 70 | 69 6e 70 6f 69 6e 74 20 |t will p|inpoint |
|00001340| 74 68 65 20 65 78 61 63 | 74 20 69 6e 73 74 72 75 |the exac|t instru|
|00001350| 63 74 69 6f 6e 20 74 68 | 61 74 0a 58 63 61 75 73 |ction th|at.Xcaus|
|00001360| 65 73 20 61 6e 20 65 72 | 72 6f 72 2e 20 49 74 20 |es an er|ror. It |
|00001370| 68 61 73 20 62 65 65 6e | 20 69 6e 20 75 73 65 20 |has been| in use |
|00001380| 61 74 20 50 69 78 61 72 | 20 73 69 6e 63 65 20 31 |at Pixar| since 1|
|00001390| 39 38 37 2c 20 61 6e 64 | 20 61 74 20 6d 61 6e 79 |987, and| at many|
|000013a0| 20 6f 74 68 65 72 0a 58 | 73 69 74 65 73 20 66 6f | other.X|sites fo|
|000013b0| 72 20 79 65 61 72 73 2e | 0a 58 2e 4c 50 0a 58 45 |r years.|.X.LP.XE|
|000013c0| 6c 65 63 74 72 69 63 20 | 46 65 6e 63 65 20 75 73 |lectric |Fence us|
|000013d0| 65 73 20 74 68 65 20 76 | 69 72 74 75 61 6c 20 6d |es the v|irtual m|
|000013e0| 65 6d 6f 72 79 20 68 61 | 72 64 77 61 72 65 20 6f |emory ha|rdware o|
|000013f0| 66 20 79 6f 75 72 20 63 | 6f 6d 70 75 74 65 72 20 |f your c|omputer |
|00001400| 74 6f 20 70 6c 61 63 65 | 20 61 6e 0a 58 69 6e 61 |to place| an.Xina|
|00001410| 63 63 65 73 73 69 62 6c | 65 20 6d 65 6d 6f 72 79 |ccessibl|e memory|
|00001420| 20 70 61 67 65 20 69 6d | 6d 65 64 69 61 74 65 6c | page im|mediatel|
|00001430| 79 20 61 66 74 65 72 20 | 28 6f 72 20 62 65 66 6f |y after |(or befo|
|00001440| 72 65 2c 20 61 74 20 74 | 68 65 20 75 73 65 72 27 |re, at t|he user'|
|00001450| 73 20 6f 70 74 69 6f 6e | 29 0a 58 65 61 63 68 20 |s option|).Xeach |
|00001460| 6d 65 6d 6f 72 79 20 61 | 6c 6c 6f 63 61 74 69 6f |memory a|llocatio|
|00001470| 6e 2e 20 57 68 65 6e 20 | 73 6f 66 74 77 61 72 65 |n. When |software|
|00001480| 20 72 65 61 64 73 20 6f | 72 20 77 72 69 74 65 73 | reads o|r writes|
|00001490| 20 74 68 69 73 20 69 6e | 61 63 63 65 73 73 69 62 | this in|accessib|
|000014a0| 6c 65 20 70 61 67 65 2c | 0a 58 74 68 65 0a 58 68 |le page,|.Xthe.Xh|
|000014b0| 61 72 64 77 61 72 65 20 | 69 73 73 75 65 73 20 61 |ardware |issues a|
|000014c0| 20 73 65 67 6d 65 6e 74 | 61 74 69 6f 6e 20 66 61 | segment|ation fa|
|000014d0| 75 6c 74 2c 20 73 74 6f | 70 70 69 6e 67 20 74 68 |ult, sto|pping th|
|000014e0| 65 20 70 72 6f 67 72 61 | 6d 20 61 74 20 74 68 65 |e progra|m at the|
|000014f0| 20 6f 66 66 65 6e 64 69 | 6e 67 0a 58 69 6e 73 74 | offendi|ng.Xinst|
|00001500| 72 75 63 74 69 6f 6e 2e | 20 49 74 20 69 73 20 74 |ruction.| It is t|
|00001510| 68 65 6e 20 74 72 69 76 | 69 61 6c 20 74 6f 20 66 |hen triv|ial to f|
|00001520| 69 6e 64 20 74 68 65 20 | 65 72 72 6f 6e 65 6f 75 |ind the |erroneou|
|00001530| 73 20 73 74 61 74 65 6d | 65 6e 74 20 75 73 69 6e |s statem|ent usin|
|00001540| 67 20 79 6f 75 72 0a 58 | 66 61 76 6f 72 69 74 65 |g your.X|favorite|
|00001550| 20 64 65 62 75 67 67 65 | 72 2e 20 49 6e 20 61 20 | debugge|r. In a |
|00001560| 73 69 6d 69 6c 61 72 20 | 6d 61 6e 6e 65 72 2c 20 |similar |manner, |
|00001570| 6d 65 6d 6f 72 79 20 74 | 68 61 74 20 68 61 73 20 |memory t|hat has |
|00001580| 62 65 65 6e 20 72 65 6c | 65 61 73 65 64 20 62 79 |been rel|eased by|
|00001590| 0a 58 66 72 65 65 28 29 | 20 69 73 20 6d 61 64 65 |.Xfree()| is made|
|000015a0| 20 69 6e 61 63 63 65 73 | 73 69 62 6c 65 2c 20 61 | inacces|sible, a|
|000015b0| 6e 64 20 61 6e 79 20 63 | 6f 64 65 20 74 68 61 74 |nd any c|ode that|
|000015c0| 20 74 6f 75 63 68 65 73 | 20 69 74 20 77 69 6c 6c | touches| it will|
|000015d0| 20 67 65 74 20 61 0a 58 | 73 65 67 6d 65 6e 74 61 | get a.X|segmenta|
|000015e0| 74 69 6f 6e 20 66 61 75 | 6c 74 2e 0a 58 2e 4c 50 |tion fau|lt..X.LP|
|000015f0| 0a 58 53 69 6d 70 6c 79 | 20 6c 69 6e 6b 69 6e 67 |.XSimply| linking|
|00001600| 20 79 6f 75 72 20 61 70 | 70 6c 69 63 61 74 69 6f | your ap|plicatio|
|00001610| 6e 20 77 69 74 68 20 6c | 69 62 65 66 65 6e 63 65 |n with l|ibefence|
|00001620| 2e 61 20 77 69 6c 6c 20 | 61 6c 6c 6f 77 20 79 6f |.a will |allow yo|
|00001630| 75 20 74 6f 20 64 65 74 | 65 63 74 0a 58 6d 6f 73 |u to det|ect.Xmos|
|00001640| 74 2c 20 62 75 74 20 6e | 6f 74 20 61 6c 6c 2c 20 |t, but n|ot all, |
|00001650| 6d 61 6c 6c 6f 63 20 62 | 75 66 66 65 72 20 6f 76 |malloc b|uffer ov|
|00001660| 65 72 72 75 6e 73 20 61 | 6e 64 20 61 63 63 65 73 |erruns a|nd acces|
|00001670| 73 65 73 20 6f 66 20 66 | 72 65 65 20 6d 65 6d 6f |ses of f|ree memo|
|00001680| 72 79 2e 0a 58 49 66 20 | 79 6f 75 20 77 61 6e 74 |ry..XIf |you want|
|00001690| 20 74 6f 20 62 65 20 72 | 65 61 73 6f 6e 61 62 6c | to be r|easonabl|
|000016a0| 79 20 73 75 72 65 20 74 | 68 61 74 20 79 6f 75 27 |y sure t|hat you'|
|000016b0| 76 65 20 66 6f 75 6e 64 | 0a 58 2e 49 20 61 6c 6c |ve found|.X.I all|
|000016c0| 0a 58 62 75 67 73 20 6f | 66 20 74 68 69 73 20 74 |.Xbugs o|f this t|
|000016d0| 79 70 65 2c 20 79 6f 75 | 27 6c 6c 20 68 61 76 65 |ype, you|'ll have|
|000016e0| 20 74 6f 20 72 65 61 64 | 20 61 6e 64 20 75 6e 64 | to read| and und|
|000016f0| 65 72 73 74 61 6e 64 20 | 74 68 65 20 72 65 73 74 |erstand |the rest|
|00001700| 20 6f 66 20 74 68 69 73 | 0a 58 6d 61 6e 20 70 61 | of this|.Xman pa|
|00001710| 67 65 2e 0a 58 2e 53 48 | 20 55 53 41 47 45 0a 58 |ge..X.SH| USAGE.X|
|00001720| 4c 69 6e 6b 20 79 6f 75 | 72 20 70 72 6f 67 72 61 |Link you|r progra|
|00001730| 6d 20 77 69 74 68 20 74 | 68 65 20 6c 69 62 72 61 |m with t|he libra|
|00001740| 72 79 0a 58 2e 42 20 6c | 69 62 65 66 65 6e 63 65 |ry.X.B l|ibefence|
|00001750| 2e 61 20 2e 0a 58 4d 61 | 6b 65 20 73 75 72 65 20 |.a ..XMa|ke sure |
|00001760| 79 6f 75 20 61 72 65 0a | 58 2e 49 20 6e 6f 74 0a |you are.|X.I not.|
|00001770| 58 6c 69 6e 6b 69 6e 67 | 20 77 69 74 68 0a 58 2e |Xlinking| with.X.|
|00001780| 42 20 2d 6c 6d 61 6c 6c | 6f 63 2c 0a 58 2e 42 20 |B -lmall|oc,.X.B |
|00001790| 2d 6c 6d 61 6c 6c 6f 63 | 64 65 62 75 67 2c 0a 58 |-lmalloc|debug,.X|
|000017a0| 6f 72 20 77 69 74 68 20 | 6f 74 68 65 72 20 6d 61 |or with |other ma|
|000017b0| 6c 6c 6f 63 2d 64 65 62 | 75 67 67 65 72 20 6f 72 |lloc-deb|ugger or|
|000017c0| 20 6d 61 6c 6c 6f 63 2d | 65 6e 68 61 6e 63 65 72 | malloc-|enhancer|
|000017d0| 20 6c 69 62 72 61 72 69 | 65 73 2e 0a 58 59 6f 75 | librari|es..XYou|
|000017e0| 20 63 61 6e 20 6f 6e 6c | 79 20 75 73 65 20 6f 6e | can onl|y use on|
|000017f0| 65 20 61 74 20 61 20 74 | 69 6d 65 2e 0a 58 49 66 |e at a t|ime..XIf|
|00001800| 20 79 6f 75 72 20 73 79 | 73 74 65 6d 20 61 64 6d | your sy|stem adm|
|00001810| 69 6e 69 73 74 72 61 74 | 6f 72 0a 58 68 61 73 20 |inistrat|or.Xhas |
|00001820| 69 6e 73 74 61 6c 6c 65 | 64 20 45 6c 65 63 74 72 |installe|d Electr|
|00001830| 69 63 20 46 65 6e 63 65 | 20 66 6f 72 20 70 75 62 |ic Fence| for pub|
|00001840| 6c 69 63 20 75 73 65 2c | 20 79 6f 75 27 6c 6c 20 |lic use,| you'll |
|00001850| 62 65 20 61 62 6c 65 20 | 74 6f 20 75 73 65 20 74 |be able |to use t|
|00001860| 68 65 0a 58 2e 42 20 2d | 6c 65 66 65 6e 63 65 0a |he.X.B -|lefence.|
|00001870| 58 61 72 67 75 6d 65 6e | 74 20 74 6f 20 74 68 65 |Xargumen|t to the|
|00001880| 20 6c 69 6e 6b 65 72 2c | 20 6f 74 68 65 72 77 69 | linker,| otherwi|
|00001890| 73 65 20 79 6f 75 27 6c | 6c 20 68 61 76 65 20 74 |se you'l|l have t|
|000018a0| 6f 20 70 75 74 20 74 68 | 65 20 70 61 74 68 2d 6e |o put th|e path-n|
|000018b0| 61 6d 65 20 66 6f 72 0a | 58 2e 42 20 6c 69 62 65 |ame for.|X.B libe|
|000018c0| 66 65 6e 63 65 2e 61 0a | 58 69 6e 20 74 68 65 20 |fence.a.|Xin the |
|000018d0| 6c 69 6e 6b 65 72 27 73 | 20 63 6f 6d 6d 61 6e 64 |linker's| command|
|000018e0| 20 6c 69 6e 65 2e 0a 58 | 53 6f 6d 65 20 73 79 73 | line..X|Some sys|
|000018f0| 74 65 6d 73 20 77 69 6c | 6c 20 72 65 71 75 69 72 |tems wil|l requir|
|00001900| 65 20 73 70 65 63 69 61 | 6c 20 61 72 67 75 6d 65 |e specia|l argume|
|00001910| 6e 74 73 20 74 6f 20 74 | 68 65 20 6c 69 6e 6b 65 |nts to t|he linke|
|00001920| 72 20 74 6f 20 61 73 73 | 75 72 65 20 74 68 61 74 |r to ass|ure that|
|00001930| 0a 58 79 6f 75 20 61 72 | 65 20 75 73 69 6e 67 20 |.Xyou ar|e using |
|00001940| 74 68 65 20 45 6c 65 63 | 74 72 69 63 20 46 65 6e |the Elec|tric Fen|
|00001950| 63 65 20 6d 61 6c 6c 6f | 63 28 29 20 61 6e 64 20 |ce mallo|c() and |
|00001960| 6e 6f 74 20 74 68 65 20 | 6f 6e 65 20 66 72 6f 6d |not the |one from|
|00001970| 20 79 6f 75 72 20 43 20 | 6c 69 62 72 61 72 79 2e | your C |library.|
|00001980| 0a 58 4f 6e 20 41 49 58 | 20 73 79 73 74 65 6d 73 |.XOn AIX| systems|
|00001990| 2c 20 79 6f 75 20 6d 61 | 79 20 68 61 76 65 20 74 |, you ma|y have t|
|000019a0| 6f 20 75 73 65 20 74 68 | 65 20 66 6c 61 67 73 0a |o use th|e flags.|
|000019b0| 58 2e 62 72 0a 58 2e 42 | 20 2d 62 6e 73 6f 0a 58 |X.br.X.B| -bnso.X|
|000019c0| 2e 42 20 2d 62 6e 6f 64 | 65 6c 63 73 65 63 74 0a |.B -bnod|elcsect.|
|000019d0| 58 2e 42 20 2d 62 49 3a | 2f 6c 69 62 2f 73 79 73 |X.B -bI:|/lib/sys|
|000019e0| 63 61 6c 6c 73 2e 65 78 | 70 0a 58 2e 62 72 0a 58 |calls.ex|p.X.br.X|
|000019f0| 4f 6e 20 53 75 6e 20 73 | 79 73 74 65 6d 73 20 72 |On Sun s|ystems r|
|00001a00| 75 6e 6e 69 6e 67 20 53 | 75 6e 4f 53 20 34 2e 58 |unning S|unOS 4.X|
|00001a10| 2c 20 79 6f 75 27 6c 6c | 20 70 72 6f 62 61 62 6c |, you'll| probabl|
|00001a20| 79 20 68 61 76 65 20 74 | 6f 20 75 73 65 0a 58 2e |y have t|o use.X.|
|00001a30| 42 20 2d 42 73 74 61 74 | 69 63 2e 0a 58 2e 4c 50 |B -Bstat|ic..X.LP|
|00001a40| 0a 58 52 75 6e 20 79 6f | 75 72 20 70 72 6f 67 72 |.XRun yo|ur progr|
|00001a50| 61 6d 0a 58 2e 49 20 75 | 73 69 6e 67 20 61 20 64 |am.X.I u|sing a d|
|00001a60| 65 62 75 67 67 65 72 2e | 20 0a 58 49 74 27 73 20 |ebugger.| .XIt's |
|00001a70| 65 61 73 69 65 72 20 74 | 6f 20 77 6f 72 6b 20 74 |easier t|o work t|
|00001a80| 68 69 73 20 77 61 79 20 | 74 68 61 6e 20 74 6f 20 |his way |than to |
|00001a90| 63 72 65 61 74 65 20 61 | 0a 58 2e 42 20 63 6f 72 |create a|.X.B cor|
|00001aa0| 65 0a 58 66 69 6c 65 20 | 61 6e 64 20 70 6f 73 74 |e.Xfile |and post|
|00001ab0| 2d 6d 6f 72 74 65 6d 20 | 64 65 62 75 67 20 69 74 |-mortem |debug it|
|00001ac0| 2e 20 45 6c 65 63 74 72 | 69 63 20 46 65 6e 63 65 |. Electr|ic Fence|
|00001ad0| 20 63 61 6e 20 63 72 65 | 61 74 65 0a 58 2e 49 20 | can cre|ate.X.I |
|00001ae0| 68 75 67 65 0a 58 63 6f | 72 65 20 66 69 6c 65 73 |huge.Xco|re files|
|00001af0| 2c 20 61 6e 64 20 73 6f | 6d 65 20 6f 70 65 72 61 |, and so|me opera|
|00001b00| 74 69 6e 67 20 73 79 73 | 74 65 6d 73 20 77 69 6c |ting sys|tems wil|
|00001b10| 6c 20 74 68 75 73 20 74 | 61 6b 65 20 6d 69 6e 75 |l thus t|ake minu|
|00001b20| 74 65 73 20 73 69 6d 70 | 6c 79 20 74 6f 20 64 75 |tes simp|ly to du|
|00001b30| 6d 70 0a 58 63 6f 72 65 | 21 20 53 6f 6d 65 20 6f |mp.Xcore|! Some o|
|00001b40| 70 65 72 61 74 69 6e 67 | 20 73 79 73 74 65 6d 73 |perating| systems|
|00001b50| 20 77 69 6c 6c 20 6e 6f | 74 20 63 72 65 61 74 65 | will no|t create|
|00001b60| 20 75 73 61 62 6c 65 20 | 63 6f 72 65 20 66 69 6c | usable |core fil|
|00001b70| 65 73 20 66 72 6f 6d 20 | 70 72 6f 67 72 61 6d 73 |es from |programs|
|00001b80| 0a 58 74 68 61 74 20 61 | 72 65 20 6c 69 6e 6b 65 |.Xthat a|re linke|
|00001b90| 64 20 77 69 74 68 20 45 | 6c 65 63 74 72 69 63 20 |d with E|lectric |
|00001ba0| 46 65 6e 63 65 2e 0a 58 | 49 66 20 79 6f 75 72 20 |Fence..X|If your |
|00001bb0| 70 72 6f 67 72 61 6d 20 | 68 61 73 20 6f 6e 65 20 |program |has one |
|00001bc0| 6f 66 20 74 68 65 20 65 | 72 72 6f 72 73 20 64 65 |of the e|rrors de|
|00001bd0| 74 65 63 74 65 64 20 62 | 79 20 45 6c 65 63 74 72 |tected b|y Electr|
|00001be0| 69 63 20 46 65 6e 63 65 | 2c 20 69 74 20 77 69 6c |ic Fence|, it wil|
|00001bf0| 6c 0a 58 67 65 74 20 61 | 20 73 65 67 6d 65 6e 74 |l.Xget a| segment|
|00001c00| 61 74 69 6f 6e 20 66 61 | 75 6c 74 20 28 53 49 47 |ation fa|ult (SIG|
|00001c10| 53 45 47 56 29 20 61 74 | 20 74 68 65 20 6f 66 66 |SEGV) at| the off|
|00001c20| 65 6e 64 69 6e 67 20 69 | 6e 73 74 72 75 63 74 69 |ending i|nstructi|
|00001c30| 6f 6e 2e 20 55 73 65 20 | 74 68 65 0a 58 64 65 62 |on. Use |the.Xdeb|
|00001c40| 75 67 67 65 72 20 74 6f | 20 6c 6f 63 61 74 65 20 |ugger to| locate |
|00001c50| 74 68 65 20 65 72 72 6f | 6e 65 6f 75 73 20 73 74 |the erro|neous st|
|00001c60| 61 74 65 6d 65 6e 74 2c | 20 61 6e 64 20 72 65 70 |atement,| and rep|
|00001c70| 61 69 72 20 69 74 2e 0a | 58 2e 53 48 20 47 4c 4f |air it..|X.SH GLO|
|00001c80| 42 41 4c 20 41 4e 44 20 | 45 4e 56 49 52 4f 4e 4d |BAL AND |ENVIRONM|
|00001c90| 45 4e 54 20 56 41 52 49 | 41 42 4c 45 53 0a 58 45 |ENT VARI|ABLES.XE|
|00001ca0| 6c 65 63 74 72 69 63 20 | 46 65 6e 63 65 20 68 61 |lectric |Fence ha|
|00001cb0| 73 20 66 6f 75 72 20 63 | 6f 6e 66 69 67 75 72 61 |s four c|onfigura|
|00001cc0| 74 69 6f 6e 20 73 77 69 | 74 63 68 65 73 20 74 68 |tion swi|tches th|
|00001cd0| 61 74 20 63 61 6e 20 62 | 65 20 65 6e 61 62 6c 65 |at can b|e enable|
|00001ce0| 64 20 76 69 61 0a 58 74 | 68 65 20 73 68 65 6c 6c |d via.Xt|he shell|
|00001cf0| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 2c 20 6f 72 | environ|ment, or|
|00001d00| 20 62 79 20 73 65 74 74 | 69 6e 67 20 74 68 65 20 | by sett|ing the |
|00001d10| 76 61 6c 75 65 20 6f 66 | 20 67 6c 6f 62 61 6c 20 |value of| global |
|00001d20| 69 6e 74 65 67 65 72 20 | 76 61 72 69 61 62 6c 65 |integer |variable|
|00001d30| 73 0a 58 75 73 69 6e 67 | 20 61 20 64 65 62 75 67 |s.Xusing| a debug|
|00001d40| 67 65 72 2e 20 54 68 65 | 73 65 20 73 77 69 74 63 |ger. The|se switc|
|00001d50| 68 65 73 20 63 68 61 6e | 67 65 20 77 68 61 74 20 |hes chan|ge what |
|00001d60| 62 75 67 73 20 45 6c 65 | 63 74 72 69 63 20 46 65 |bugs Ele|ctric Fe|
|00001d70| 6e 63 65 20 77 69 6c 6c | 20 64 65 74 65 63 74 2c |nce will| detect,|
|00001d80| 0a 58 73 6f 20 69 74 27 | 73 20 69 6d 70 6f 72 74 |.Xso it'|s import|
|00001d90| 61 6e 74 20 74 68 61 74 | 20 79 6f 75 20 6b 6e 6f |ant that| you kno|
|00001da0| 77 20 68 6f 77 20 74 6f | 20 75 73 65 20 74 68 65 |w how to| use the|
|00001db0| 6d 2e 0a 58 2e 54 50 0a | 58 45 46 5f 41 4c 49 47 |m..X.TP.|XEF_ALIG|
|00001dc0| 4e 4d 45 4e 54 0a 58 54 | 68 69 73 20 69 73 20 61 |NMENT.XT|his is a|
|00001dd0| 6e 20 69 6e 74 65 67 65 | 72 20 74 68 61 74 20 73 |n intege|r that s|
|00001de0| 70 65 63 69 66 69 65 73 | 20 74 68 65 20 61 6c 69 |pecifies| the ali|
|00001df0| 67 6e 6d 65 6e 74 20 66 | 6f 72 20 61 6e 79 20 6d |gnment f|or any m|
|00001e00| 65 6d 6f 72 79 20 61 6c | 6c 6f 63 61 74 69 6f 6e |emory al|location|
|00001e10| 73 0a 58 74 68 61 74 20 | 77 69 6c 6c 20 62 65 20 |s.Xthat |will be |
|00001e20| 72 65 74 75 72 6e 65 64 | 20 62 79 20 6d 61 6c 6c |returned| by mall|
|00001e30| 6f 63 28 29 2c 20 63 61 | 6c 6c 6f 63 28 29 2c 20 |oc(), ca|lloc(), |
|00001e40| 61 6e 64 20 72 65 61 6c | 6c 6f 63 28 29 2e 0a 58 |and real|loc()..X|
|00001e50| 54 68 65 20 76 61 6c 75 | 65 20 69 73 20 73 70 65 |The valu|e is spe|
|00001e60| 63 69 66 69 65 64 20 69 | 6e 0a 58 62 79 74 65 73 |cified i|n.Xbytes|
|00001e70| 2c 20 74 68 75 73 20 61 | 20 76 61 6c 75 65 20 6f |, thus a| value o|
|00001e80| 66 20 34 20 77 69 6c 6c | 20 63 61 75 73 65 20 6d |f 4 will| cause m|
|00001e90| 65 6d 6f 72 79 20 74 6f | 20 62 65 20 61 6c 69 67 |emory to| be alig|
|00001ea0| 6e 65 64 20 74 6f 20 33 | 32 2d 62 69 74 20 62 6f |ned to 3|2-bit bo|
|00001eb0| 75 6e 64 61 72 69 65 73 | 0a 58 75 6e 6c 65 73 73 |undaries|.Xunless|
|00001ec0| 20 79 6f 75 72 20 73 79 | 73 74 65 6d 20 64 6f 65 | your sy|stem doe|
|00001ed0| 73 6e 27 74 20 68 61 76 | 65 20 61 20 38 2d 62 69 |sn't hav|e a 8-bi|
|00001ee0| 74 20 63 68 61 72 61 63 | 74 65 72 73 2e 20 45 46 |t charac|ters. EF|
|00001ef0| 5f 41 4c 49 47 4e 4d 45 | 4e 54 20 69 73 20 73 65 |_ALIGNME|NT is se|
|00001f00| 74 20 74 6f 0a 58 73 69 | 7a 65 6f 66 28 69 6e 74 |t to.Xsi|zeof(int|
|00001f10| 29 20 62 79 20 64 65 66 | 61 75 6c 74 2c 20 73 69 |) by def|ault, si|
|00001f20| 6e 63 65 20 74 68 61 74 | 20 69 73 20 67 65 6e 65 |nce that| is gene|
|00001f30| 72 61 6c 6c 79 20 74 68 | 65 20 77 6f 72 64 2d 73 |rally th|e word-s|
|00001f40| 69 7a 65 20 6f 66 20 79 | 6f 75 72 20 43 50 55 2e |ize of y|our CPU.|
|00001f50| 0a 58 49 66 20 79 6f 75 | 72 20 70 72 6f 67 72 61 |.XIf you|r progra|
|00001f60| 6d 20 72 65 71 75 69 72 | 65 73 20 74 68 61 74 20 |m requir|es that |
|00001f70| 61 6c 6c 6f 63 61 74 69 | 6f 6e 73 20 62 65 20 61 |allocati|ons be a|
|00001f80| 6c 69 67 6e 65 64 20 74 | 6f 20 36 34 2d 62 69 74 |ligned t|o 64-bit|
|00001f90| 0a 58 62 6f 75 6e 64 61 | 72 69 65 73 20 61 6e 64 |.Xbounda|ries and|
|00001fa0| 20 79 6f 75 20 68 61 76 | 65 20 61 20 33 32 2d 62 | you hav|e a 32-b|
|00001fb0| 69 74 0a 58 2e 42 20 69 | 6e 74 0a 58 79 6f 75 27 |it.X.B i|nt.Xyou'|
|00001fc0| 6c 6c 20 68 61 76 65 20 | 74 6f 20 73 65 74 20 74 |ll have |to set t|
|00001fd0| 68 69 73 20 76 61 6c 75 | 65 20 74 6f 20 38 2e 20 |his valu|e to 8. |
|00001fe0| 54 68 69 73 20 69 73 20 | 74 68 65 20 63 61 73 65 |This is |the case|
|00001ff0| 20 77 68 65 6e 20 63 6f | 6d 70 69 6c 69 6e 67 20 | when co|mpiling |
|00002000| 77 69 74 68 20 74 68 65 | 0a 58 2e 42 20 2d 6d 69 |with the|.X.B -mi|
|00002010| 70 73 32 0a 58 66 6c 61 | 67 20 6f 6e 20 4d 49 50 |ps2.Xfla|g on MIP|
|00002020| 53 2d 62 61 73 65 64 20 | 73 79 73 74 65 6d 73 20 |S-based |systems |
|00002030| 73 75 63 68 20 61 73 20 | 74 68 6f 73 65 20 66 72 |such as |those fr|
|00002040| 6f 6d 20 53 47 49 2e 0a | 58 54 68 65 20 6d 65 6d |om SGI..|XThe mem|
|00002050| 6f 72 79 20 61 6c 6c 6f | 63 61 74 69 6f 6e 20 74 |ory allo|cation t|
|00002060| 68 61 74 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |hat is r|eturned |
|00002070| 62 79 20 45 6c 65 63 74 | 72 69 63 20 46 65 6e 63 |by Elect|ric Fenc|
|00002080| 65 20 6d 61 6c 6c 6f 63 | 28 29 20 69 73 20 61 6c |e malloc|() is al|
|00002090| 69 67 6e 65 64 0a 58 75 | 73 69 6e 67 20 74 68 65 |igned.Xu|sing the|
|000020a0| 20 76 61 6c 75 65 20 69 | 6e 20 45 46 5f 41 4c 49 | value i|n EF_ALI|
|000020b0| 47 4e 4d 45 4e 54 2c 20 | 61 6e 64 0a 58 2e 49 20 |GNMENT, |and.X.I |
|000020c0| 69 74 73 20 73 69 7a 65 | 20 74 68 65 20 6d 75 6c |its size| the mul|
|000020d0| 74 69 70 6c 65 20 6f 66 | 0a 58 2e 49 20 74 68 61 |tiple of|.X.I tha|
|000020e0| 74 20 76 61 6c 75 65 0a | 58 74 68 61 74 20 69 73 |t value.|Xthat is|
|000020f0| 20 67 72 65 61 74 65 72 | 20 74 68 61 6e 20 6f 72 | greater| than or|
|00002100| 20 65 71 75 61 6c 20 74 | 6f 20 74 68 65 20 72 65 | equal t|o the re|
|00002110| 71 75 65 73 74 65 64 20 | 73 69 7a 65 2e 0a 58 46 |quested |size..XF|
|00002120| 6f 72 20 74 68 69 73 20 | 72 65 61 73 6f 6e 2c 20 |or this |reason, |
|00002130| 79 6f 75 20 77 69 6c 6c | 20 73 6f 6d 65 74 69 6d |you will| sometim|
|00002140| 65 73 20 77 61 6e 74 20 | 74 6f 20 73 65 74 20 45 |es want |to set E|
|00002150| 46 5f 41 4c 49 47 4e 4d | 45 4e 54 20 74 6f 20 30 |F_ALIGNM|ENT to 0|
|00002160| 20 28 6e 6f 0a 58 61 6c | 69 67 6e 6d 65 6e 74 29 | (no.Xal|ignment)|
|00002170| 2c 20 73 6f 20 74 68 61 | 74 0a 58 79 6f 75 20 63 |, so tha|t.Xyou c|
|00002180| 61 6e 20 64 65 74 65 63 | 74 20 6f 76 65 72 72 75 |an detec|t overru|
|00002190| 6e 73 20 6f 66 20 6c 65 | 73 73 20 74 68 61 6e 20 |ns of le|ss than |
|000021a0| 79 6f 75 72 20 43 50 55 | 27 73 20 77 6f 72 64 20 |your CPU|'s word |
|000021b0| 73 69 7a 65 2e 20 42 65 | 20 73 75 72 65 20 74 6f |size. Be| sure to|
|000021c0| 20 72 65 61 64 0a 58 74 | 68 65 20 73 65 63 74 69 | read.Xt|he secti|
|000021d0| 6f 6e 0a 58 2e 49 20 57 | 4f 52 44 2d 41 4c 49 47 |on.X.I W|ORD-ALIG|
|000021e0| 4e 4d 45 4e 54 20 41 4e | 44 20 4f 56 45 52 52 55 |NMENT AN|D OVERRU|
|000021f0| 4e 20 44 45 54 45 43 54 | 49 4f 4e 0a 58 69 6e 20 |N DETECT|ION.Xin |
|00002200| 74 68 69 73 20 6d 61 6e | 75 61 6c 20 70 61 67 65 |this man|ual page|
|00002210| 20 62 65 66 6f 72 65 20 | 79 6f 75 20 74 72 79 20 | before |you try |
|00002220| 74 68 69 73 2e 0a 58 54 | 6f 20 63 68 61 6e 67 65 |this..XT|o change|
|00002230| 20 74 68 69 73 20 76 61 | 6c 75 65 2c 20 73 65 74 | this va|lue, set|
|00002240| 20 45 46 5f 41 4c 49 47 | 4e 4d 45 4e 54 20 69 6e | EF_ALIG|NMENT in|
|00002250| 20 74 68 65 20 73 68 65 | 6c 6c 20 65 6e 76 69 72 | the she|ll envir|
|00002260| 6f 6e 6d 65 6e 74 20 74 | 6f 20 61 6e 0a 58 69 6e |onment t|o an.Xin|
|00002270| 74 65 67 65 72 20 76 61 | 6c 75 65 2c 20 6f 72 20 |teger va|lue, or |
|00002280| 61 73 73 69 67 6e 0a 58 | 74 6f 20 74 68 65 20 67 |assign.X|to the g|
|00002290| 6c 6f 62 61 6c 20 69 6e | 74 65 67 65 72 20 76 61 |lobal in|teger va|
|000022a0| 72 69 61 62 6c 65 20 45 | 46 5f 41 4c 49 47 4e 4d |riable E|F_ALIGNM|
|000022b0| 45 4e 54 20 75 73 69 6e | 67 20 61 20 64 65 62 75 |ENT usin|g a debu|
|000022c0| 67 67 65 72 2e 0a 58 2e | 54 50 0a 58 45 46 5f 50 |gger..X.|TP.XEF_P|
|000022d0| 52 4f 54 45 43 54 5f 42 | 45 4c 4f 57 0a 58 45 6c |ROTECT_B|ELOW.XEl|
|000022e0| 65 63 74 72 69 63 20 46 | 65 6e 63 65 20 75 73 75 |ectric F|ence usu|
|000022f0| 61 6c 6c 79 20 70 6c 61 | 63 65 73 20 61 6e 20 69 |ally pla|ces an i|
|00002300| 6e 61 63 63 65 73 73 69 | 62 6c 65 20 70 61 67 65 |naccessi|ble page|
|00002310| 20 69 6d 6d 65 64 69 61 | 74 65 6c 79 20 61 66 74 | immedia|tely aft|
|00002320| 65 72 20 65 61 63 68 0a | 58 6d 65 6d 6f 72 79 20 |er each.|Xmemory |
|00002330| 61 6c 6c 6f 63 61 74 69 | 6f 6e 2c 20 73 6f 20 74 |allocati|on, so t|
|00002340| 68 61 74 20 73 6f 66 74 | 77 61 72 65 20 74 68 61 |hat soft|ware tha|
|00002350| 74 20 72 75 6e 73 20 70 | 61 73 74 20 74 68 65 20 |t runs p|ast the |
|00002360| 65 6e 64 20 6f 66 20 74 | 68 65 20 61 6c 6c 6f 63 |end of t|he alloc|
|00002370| 61 74 69 6f 6e 0a 58 77 | 69 6c 6c 20 62 65 20 64 |ation.Xw|ill be d|
|00002380| 65 74 65 63 74 65 64 2e | 20 53 65 74 74 69 6e 67 |etected.| Setting|
|00002390| 20 45 46 5f 50 52 4f 54 | 45 43 54 5f 42 45 4c 4f | EF_PROT|ECT_BELO|
|000023a0| 57 20 74 6f 20 31 20 63 | 61 75 73 65 73 20 45 6c |W to 1 c|auses El|
|000023b0| 65 63 74 72 69 63 20 46 | 65 6e 63 65 0a 58 74 6f |ectric F|ence.Xto|
|000023c0| 20 70 6c 61 63 65 20 74 | 68 65 20 69 6e 61 63 63 | place t|he inacc|
|000023d0| 65 73 73 69 62 6c 65 20 | 70 61 67 65 0a 58 2e 49 |essible |page.X.I|
|000023e0| 20 62 65 66 6f 72 65 0a | 58 74 68 65 20 61 6c 6c | before.|Xthe all|
|000023f0| 6f 63 61 74 69 6f 6e 20 | 69 6e 20 74 68 65 20 61 |ocation |in the a|
|00002400| 64 64 72 65 73 73 20 73 | 70 61 63 65 2c 20 73 6f |ddress s|pace, so|
|00002410| 20 74 68 61 74 20 75 6e | 64 65 72 2d 72 75 6e 73 | that un|der-runs|
|00002420| 20 77 69 6c 6c 20 62 65 | 20 64 65 74 65 63 74 65 | will be| detecte|
|00002430| 64 0a 58 69 6e 73 74 65 | 61 64 20 6f 66 20 6f 76 |d.Xinste|ad of ov|
|00002440| 65 72 2d 72 75 6e 73 2e | 0a 58 57 68 65 6e 20 45 |er-runs.|.XWhen E|
|00002450| 46 5f 50 52 4f 54 45 43 | 54 5f 42 45 4c 4f 57 20 |F_PROTEC|T_BELOW |
|00002460| 69 73 20 73 65 74 2c 20 | 74 68 65 20 45 46 5f 41 |is set, |the EF_A|
|00002470| 4c 49 47 4e 4d 45 4e 54 | 20 70 61 72 61 6d 65 74 |LIGNMENT| paramet|
|00002480| 65 72 20 69 73 20 69 67 | 6e 6f 72 65 64 2e 0a 58 |er is ig|nored..X|
|00002490| 41 6c 6c 20 61 6c 6c 6f | 63 61 74 69 6f 6e 73 20 |All allo|cations |
|000024a0| 77 69 6c 6c 20 62 65 20 | 61 6c 69 67 6e 65 64 20 |will be |aligned |
|000024b0| 74 6f 20 76 69 72 74 75 | 61 6c 2d 6d 65 6d 6f 72 |to virtu|al-memor|
|000024c0| 79 2d 70 61 67 65 20 62 | 6f 75 6e 64 61 72 69 65 |y-page b|oundarie|
|000024d0| 73 2c 20 61 6e 64 0a 58 | 74 68 65 69 72 20 73 69 |s, and.X|their si|
|000024e0| 7a 65 20 77 69 6c 6c 20 | 62 65 20 74 68 65 20 65 |ze will |be the e|
|000024f0| 78 61 63 74 20 73 69 7a | 65 20 74 68 61 74 20 77 |xact siz|e that w|
|00002500| 61 73 20 72 65 71 75 65 | 73 74 65 64 2e 0a 58 54 |as reque|sted..XT|
|00002510| 6f 20 63 68 61 6e 67 65 | 20 74 68 69 73 20 76 61 |o change| this va|
|00002520| 6c 75 65 2c 20 73 65 74 | 20 45 46 5f 50 52 4f 54 |lue, set| EF_PROT|
|00002530| 45 43 54 5f 42 45 4c 4f | 57 20 69 6e 20 74 68 65 |ECT_BELO|W in the|
|00002540| 20 73 68 65 6c 6c 20 65 | 6e 76 69 72 6f 6e 6d 65 | shell e|nvironme|
|00002550| 6e 74 20 74 6f 20 61 6e | 0a 58 69 6e 74 65 67 65 |nt to an|.Xintege|
|00002560| 72 20 76 61 6c 75 65 2c | 20 6f 72 20 61 73 73 69 |r value,| or assi|
|00002570| 67 6e 20 74 6f 20 74 68 | 65 20 67 6c 6f 62 61 6c |gn to th|e global|
|00002580| 20 69 6e 74 65 67 65 72 | 20 76 61 72 69 61 62 6c | integer| variabl|
|00002590| 65 20 45 46 5f 50 52 4f | 54 45 43 54 5f 42 45 4c |e EF_PRO|TECT_BEL|
|000025a0| 4f 57 20 75 73 69 6e 67 | 0a 58 61 20 64 65 62 75 |OW using|.Xa debu|
|000025b0| 67 67 65 72 2e 0a 58 2e | 54 50 0a 58 45 46 5f 50 |gger..X.|TP.XEF_P|
|000025c0| 52 4f 54 45 43 54 5f 46 | 52 45 45 0a 58 45 6c 65 |ROTECT_F|REE.XEle|
|000025d0| 63 74 72 69 63 20 46 65 | 6e 63 65 20 75 73 75 61 |ctric Fe|nce usua|
|000025e0| 6c 6c 79 20 72 65 74 75 | 72 6e 73 20 66 72 65 65 |lly retu|rns free|
|000025f0| 20 6d 65 6d 6f 72 79 20 | 74 6f 20 61 20 70 6f 6f | memory |to a poo|
|00002600| 6c 20 66 72 6f 6d 20 77 | 68 69 63 68 20 69 74 20 |l from w|hich it |
|00002610| 6d 61 79 20 62 65 0a 58 | 72 65 2d 61 6c 6c 6f 63 |may be.X|re-alloc|
|00002620| 61 74 65 64 2e 20 49 66 | 20 79 6f 75 20 73 75 73 |ated. If| you sus|
|00002630| 70 65 63 74 20 74 68 61 | 74 20 61 20 70 72 6f 67 |pect tha|t a prog|
|00002640| 72 61 6d 20 6d 61 79 20 | 62 65 20 74 6f 75 63 68 |ram may |be touch|
|00002650| 69 6e 67 20 66 72 65 65 | 20 6d 65 6d 6f 72 79 2c |ing free| memory,|
|00002660| 0a 58 73 65 74 20 45 46 | 5f 50 52 4f 54 45 43 54 |.Xset EF|_PROTECT|
|00002670| 5f 46 52 45 45 20 74 6f | 20 31 2e 20 54 68 69 73 |_FREE to| 1. This|
|00002680| 20 77 69 6c 6c 20 63 61 | 75 73 65 20 45 6c 65 63 | will ca|use Elec|
|00002690| 74 72 69 63 20 46 65 6e | 63 65 20 74 6f 20 6e 65 |tric Fen|ce to ne|
|000026a0| 76 65 72 20 72 65 2d 61 | 6c 6c 6f 63 61 74 65 0a |ver re-a|llocate.|
|000026b0| 58 6d 65 6d 6f 72 79 20 | 6f 6e 63 65 20 69 74 20 |Xmemory |once it |
|000026c0| 68 61 73 20 62 65 65 6e | 20 66 72 65 65 64 2c 20 |has been| freed, |
|000026d0| 73 6f 20 74 68 61 74 20 | 61 6e 79 20 61 63 63 65 |so that |any acce|
|000026e0| 73 73 20 74 6f 20 66 72 | 65 65 20 6d 65 6d 6f 72 |ss to fr|ee memor|
|000026f0| 79 20 77 69 6c 6c 20 62 | 65 0a 58 64 65 74 65 63 |y will b|e.Xdetec|
|00002700| 74 65 64 2e 20 53 6f 6d | 65 20 70 72 6f 67 72 61 |ted. Som|e progra|
|00002710| 6d 73 20 77 69 6c 6c 20 | 75 73 65 20 74 72 65 6d |ms will |use trem|
|00002720| 65 6e 64 6f 75 73 20 61 | 6d 6f 75 6e 74 73 20 6f |endous a|mounts o|
|00002730| 66 20 6d 65 6d 6f 72 79 | 20 77 68 65 6e 20 74 68 |f memory| when th|
|00002740| 69 73 0a 58 70 61 72 61 | 6d 65 74 65 72 20 69 73 |is.Xpara|meter is|
|00002750| 20 73 65 74 2e 0a 58 54 | 6f 20 63 68 61 6e 67 65 | set..XT|o change|
|00002760| 20 74 68 69 73 20 76 61 | 6c 75 65 2c 20 73 65 74 | this va|lue, set|
|00002770| 20 45 46 5f 50 52 4f 54 | 45 43 54 5f 46 52 45 45 | EF_PROT|ECT_FREE|
|00002780| 20 69 6e 20 74 68 65 20 | 73 68 65 6c 6c 20 65 6e | in the |shell en|
|00002790| 76 69 72 6f 6e 6d 65 6e | 74 20 74 6f 20 61 6e 0a |vironmen|t to an.|
|000027a0| 58 69 6e 74 65 67 65 72 | 20 76 61 6c 75 65 2c 20 |Xinteger| value, |
|000027b0| 6f 72 20 61 73 73 69 67 | 6e 20 74 6f 20 74 68 65 |or assig|n to the|
|000027c0| 20 67 6c 6f 62 61 6c 20 | 69 6e 74 65 67 65 72 20 | global |integer |
|000027d0| 76 61 72 69 61 62 6c 65 | 20 45 46 5f 50 52 4f 54 |variable| EF_PROT|
|000027e0| 45 43 54 5f 46 52 45 45 | 20 75 73 69 6e 67 0a 58 |ECT_FREE| using.X|
|000027f0| 61 20 64 65 62 75 67 67 | 65 72 2e 0a 58 2e 54 50 |a debugg|er..X.TP|
|00002800| 0a 58 45 46 5f 41 4c 4c | 4f 57 5f 4d 41 4c 4c 4f |.XEF_ALL|OW_MALLO|
|00002810| 43 5f 30 0a 58 42 79 20 | 64 65 66 61 75 6c 74 2c |C_0.XBy |default,|
|00002820| 20 45 6c 65 63 74 72 69 | 63 20 46 65 6e 63 65 20 | Electri|c Fence |
|00002830| 74 72 61 70 73 20 63 61 | 6c 6c 73 20 74 6f 20 6d |traps ca|lls to m|
|00002840| 61 6c 6c 6f 63 28 29 20 | 77 69 74 68 20 61 20 73 |alloc() |with a s|
|00002850| 69 7a 65 20 6f 66 20 7a | 65 72 6f 2c 20 62 65 63 |ize of z|ero, bec|
|00002860| 61 75 73 65 0a 58 74 68 | 65 79 20 61 72 65 20 6f |ause.Xth|ey are o|
|00002870| 66 74 65 6e 20 74 68 65 | 20 72 65 73 75 6c 74 20 |ften the| result |
|00002880| 6f 66 20 61 20 73 6f 66 | 74 77 61 72 65 20 62 75 |of a sof|tware bu|
|00002890| 67 2e 20 49 66 20 45 46 | 5f 41 4c 4c 4f 57 5f 4d |g. If EF|_ALLOW_M|
|000028a0| 41 4c 4c 4f 43 5f 30 20 | 69 73 20 6e 6f 6e 2d 7a |ALLOC_0 |is non-z|
|000028b0| 65 72 6f 2c 0a 58 74 68 | 65 20 73 6f 66 74 77 61 |ero,.Xth|e softwa|
|000028c0| 72 65 20 77 69 6c 6c 20 | 6e 6f 74 20 74 72 61 70 |re will |not trap|
|000028d0| 20 63 61 6c 6c 73 20 74 | 6f 20 6d 61 6c 6c 6f 63 | calls t|o malloc|
|000028e0| 28 29 20 77 69 74 68 20 | 61 20 73 69 7a 65 20 6f |() with |a size o|
|000028f0| 66 20 7a 65 72 6f 2e 0a | 58 54 6f 20 63 68 61 6e |f zero..|XTo chan|
|00002900| 67 65 20 74 68 69 73 20 | 76 61 6c 75 65 2c 20 73 |ge this |value, s|
|00002910| 65 74 20 45 46 5f 41 4c | 4c 4f 43 5f 4d 41 4c 4c |et EF_AL|LOC_MALL|
|00002920| 4f 43 5f 30 20 69 6e 20 | 74 68 65 20 73 68 65 6c |OC_0 in |the shel|
|00002930| 6c 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 74 6f |l enviro|nment to|
|00002940| 20 61 6e 0a 58 69 6e 74 | 65 67 65 72 20 76 61 6c | an.Xint|eger val|
|00002950| 75 65 2c 20 6f 72 20 61 | 73 73 69 67 6e 20 74 6f |ue, or a|ssign to|
|00002960| 20 74 68 65 20 67 6c 6f | 62 61 6c 20 69 6e 74 65 | the glo|bal inte|
|00002970| 67 65 72 20 76 61 72 69 | 61 62 6c 65 20 45 46 5f |ger vari|able EF_|
|00002980| 41 4c 4c 4f 43 5f 4d 41 | 4c 4c 4f 43 5f 30 20 75 |ALLOC_MA|LLOC_0 u|
|00002990| 73 69 6e 67 0a 58 61 20 | 64 65 62 75 67 67 65 72 |sing.Xa |debugger|
|000029a0| 2e 0a 58 2e 53 48 20 57 | 4f 52 44 2d 41 4c 49 47 |..X.SH W|ORD-ALIG|
|000029b0| 4e 4d 45 4e 54 20 41 4e | 44 20 4f 56 45 52 52 55 |NMENT AN|D OVERRU|
|000029c0| 4e 20 44 45 54 45 43 54 | 49 4f 4e 0a 58 54 68 65 |N DETECT|ION.XThe|
|000029d0| 72 65 20 69 73 20 61 20 | 63 6f 6e 66 6c 69 63 74 |re is a |conflict|
|000029e0| 20 62 65 74 77 65 65 6e | 20 74 68 65 20 61 6c 69 | between| the ali|
|000029f0| 67 6e 6d 65 6e 74 20 72 | 65 73 74 72 69 63 74 69 |gnment r|estricti|
|00002a00| 6f 6e 73 20 74 68 61 74 | 20 6d 61 6c 6c 6f 63 28 |ons that| malloc(|
|00002a10| 29 20 6f 70 65 72 61 74 | 65 73 0a 58 75 6e 64 65 |) operat|es.Xunde|
|00002a20| 72 20 61 6e 64 20 74 68 | 65 20 64 65 62 75 67 67 |r and th|e debugg|
|00002a30| 69 6e 67 20 73 74 72 61 | 74 65 67 79 20 75 73 65 |ing stra|tegy use|
|00002a40| 64 20 62 79 20 45 6c 65 | 63 74 72 69 63 20 46 65 |d by Ele|ctric Fe|
|00002a50| 6e 63 65 2e 20 57 68 65 | 6e 20 64 65 74 65 63 74 |nce. Whe|n detect|
|00002a60| 69 6e 67 0a 58 6f 76 65 | 72 72 75 6e 73 2c 20 45 |ing.Xove|rruns, E|
|00002a70| 6c 65 63 74 72 69 63 20 | 46 65 6e 63 65 20 6d 61 |lectric |Fence ma|
|00002a80| 6c 6c 6f 63 28 29 20 61 | 6c 6c 6f 63 61 74 65 73 |lloc() a|llocates|
|00002a90| 20 74 77 6f 20 6f 72 20 | 6d 6f 72 65 20 76 69 72 | two or |more vir|
|00002aa0| 74 75 61 6c 20 6d 65 6d | 6f 72 79 0a 58 70 61 67 |tual mem|ory.Xpag|
|00002ab0| 65 73 20 66 6f 72 20 65 | 61 63 68 20 61 6c 6c 6f |es for e|ach allo|
|00002ac0| 63 61 74 69 6f 6e 2e 20 | 54 68 65 20 6c 61 73 74 |cation. |The last|
|00002ad0| 20 70 61 67 65 20 69 73 | 20 6d 61 64 65 20 69 6e | page is| made in|
|00002ae0| 61 63 63 65 73 73 69 62 | 6c 65 20 69 6e 20 73 75 |accessib|le in su|
|00002af0| 63 68 20 61 20 77 61 79 | 0a 58 74 68 61 74 20 61 |ch a way|.Xthat a|
|00002b00| 6e 79 20 72 65 61 64 2c | 20 77 72 69 74 65 2c 20 |ny read,| write, |
|00002b10| 6f 72 20 65 78 65 63 75 | 74 65 20 61 63 63 65 73 |or execu|te acces|
|00002b20| 73 20 77 69 6c 6c 20 63 | 61 75 73 65 20 61 20 73 |s will c|ause a s|
|00002b30| 65 67 6d 65 6e 74 61 74 | 69 6f 6e 20 66 61 75 6c |egmentat|ion faul|
|00002b40| 74 2e 0a 58 54 68 65 6e | 2c 20 45 6c 65 63 74 72 |t..XThen|, Electr|
|00002b50| 69 63 20 46 65 6e 63 65 | 20 6d 61 6c 6c 6f 63 28 |ic Fence| malloc(|
|00002b60| 29 20 77 69 6c 6c 20 72 | 65 74 75 72 6e 20 61 6e |) will r|eturn an|
|00002b70| 20 61 64 64 72 65 73 73 | 20 73 75 63 68 20 74 68 | address| such th|
|00002b80| 61 74 20 74 68 65 20 66 | 69 72 73 74 0a 58 62 79 |at the f|irst.Xby|
|00002b90| 74 65 20 61 66 74 65 72 | 0a 58 74 68 65 20 65 6e |te after|.Xthe en|
|00002ba0| 64 20 6f 66 20 74 68 65 | 20 61 6c 6c 6f 63 61 74 |d of the| allocat|
|00002bb0| 69 6f 6e 20 69 73 20 6f | 6e 20 74 68 65 20 69 6e |ion is o|n the in|
|00002bc0| 61 63 63 65 73 73 69 62 | 6c 65 20 70 61 67 65 2e |accessib|le page.|
|00002bd0| 0a 58 54 68 75 73 2c 20 | 61 6e 79 20 6f 76 65 72 |.XThus, |any over|
|00002be0| 72 75 6e 0a 58 6f 66 20 | 74 68 65 20 61 6c 6c 6f |run.Xof |the allo|
|00002bf0| 63 61 74 69 6f 6e 20 77 | 69 6c 6c 20 63 61 75 73 |cation w|ill caus|
|00002c00| 65 20 61 20 73 65 67 6d | 65 6e 74 61 74 69 6f 6e |e a segm|entation|
|00002c10| 20 66 61 75 6c 74 2e 0a | 58 2e 4c 50 0a 58 49 74 | fault..|X.LP.XIt|
|00002c20| 20 66 6f 6c 6c 6f 77 73 | 20 74 68 61 74 20 74 68 | follows| that th|
|00002c30| 65 0a 58 61 64 64 72 65 | 73 73 20 72 65 74 75 72 |e.Xaddre|ss retur|
|00002c40| 6e 65 64 20 62 79 20 6d | 61 6c 6c 6f 63 28 29 20 |ned by m|alloc() |
|00002c50| 69 73 20 74 68 65 20 61 | 64 64 72 65 73 73 20 6f |is the a|ddress o|
|00002c60| 66 20 74 68 65 20 69 6e | 61 63 63 65 73 73 69 62 |f the in|accessib|
|00002c70| 6c 65 20 70 61 67 65 20 | 6d 69 6e 75 73 0a 58 74 |le page |minus.Xt|
|00002c80| 68 65 20 73 69 7a 65 20 | 6f 66 20 74 68 65 20 6d |he size |of the m|
|00002c90| 65 6d 6f 72 79 20 61 6c | 6c 6f 63 61 74 69 6f 6e |emory al|location|
|00002ca0| 2e 0a 58 55 6e 66 6f 72 | 74 75 6e 61 74 65 6c 79 |..XUnfor|tunately|
|00002cb0| 2c 20 6d 61 6c 6c 6f 63 | 28 29 20 69 73 20 72 65 |, malloc|() is re|
|00002cc0| 71 75 69 72 65 64 20 74 | 6f 20 72 65 74 75 72 6e |quired t|o return|
|00002cd0| 0a 58 2e 49 20 77 6f 72 | 64 2d 61 6c 69 67 6e 65 |.X.I wor|d-aligne|
|00002ce0| 64 0a 58 61 6c 6c 6f 63 | 61 74 69 6f 6e 73 2c 20 |d.Xalloc|ations, |
|00002cf0| 73 69 6e 63 65 20 6d 61 | 6e 79 20 43 50 55 73 20 |since ma|ny CPUs |
|00002d00| 63 61 6e 20 6f 6e 6c 79 | 20 61 63 63 65 73 73 20 |can only| access |
|00002d10| 61 20 77 6f 72 64 20 77 | 68 65 6e 20 69 74 73 20 |a word w|hen its |
|00002d20| 61 64 64 72 65 73 73 20 | 69 73 20 61 6c 69 67 6e |address |is align|
|00002d30| 65 64 2e 0a 58 54 68 65 | 20 63 6f 6e 66 6c 69 63 |ed..XThe| conflic|
|00002d40| 74 20 68 61 70 70 65 6e | 73 20 77 68 65 6e 20 73 |t happen|s when s|
|00002d50| 6f 66 74 77 61 72 65 20 | 6d 61 6b 65 73 20 61 20 |oftware |makes a |
|00002d60| 6d 65 6d 6f 72 79 20 61 | 6c 6c 6f 63 61 74 69 6f |memory a|llocatio|
|00002d70| 6e 20 75 73 69 6e 67 20 | 61 20 73 69 7a 65 20 74 |n using |a size t|
|00002d80| 68 61 74 0a 58 69 73 20 | 6e 6f 74 20 61 20 6d 75 |hat.Xis |not a mu|
|00002d90| 6c 74 69 70 6c 65 20 6f | 66 20 74 68 65 20 77 6f |ltiple o|f the wo|
|00002da0| 72 64 20 73 69 7a 65 2c | 20 61 6e 64 20 65 78 70 |rd size,| and exp|
|00002db0| 65 63 74 73 20 74 6f 20 | 64 6f 20 77 6f 72 64 20 |ects to |do word |
|00002dc0| 61 63 63 65 73 73 65 73 | 20 74 6f 20 74 68 61 74 |accesses| to that|
|00002dd0| 0a 58 61 6c 6c 6f 63 61 | 74 69 6f 6e 2e 20 54 68 |.Xalloca|tion. Th|
|00002de0| 65 20 6c 6f 63 61 74 69 | 6f 6e 20 6f 66 20 74 68 |e locati|on of th|
|00002df0| 65 20 69 6e 61 63 63 65 | 73 73 69 62 6c 65 20 70 |e inacce|ssible p|
|00002e00| 61 67 65 20 69 73 20 66 | 69 78 65 64 20 62 79 20 |age is f|ixed by |
|00002e10| 68 61 72 64 77 61 72 65 | 20 61 74 0a 58 61 20 77 |hardware| at.Xa w|
|00002e20| 6f 72 64 2d 61 6c 69 67 | 6e 65 64 20 61 64 64 72 |ord-alig|ned addr|
|00002e30| 65 73 73 2e 20 49 66 20 | 45 6c 65 63 74 72 69 63 |ess. If |Electric|
|00002e40| 20 46 65 6e 63 65 20 6d | 61 6c 6c 6f 63 28 29 20 | Fence m|alloc() |
|00002e50| 69 73 20 74 6f 20 72 65 | 74 75 72 6e 20 61 6e 20 |is to re|turn an |
|00002e60| 61 6c 69 67 6e 65 64 0a | 58 61 64 64 72 65 73 73 |aligned.|Xaddress|
|00002e70| 2c 20 69 74 20 6d 75 73 | 74 20 69 6e 63 72 65 61 |, it mus|t increa|
|00002e80| 73 65 20 74 68 65 20 73 | 69 7a 65 20 6f 66 20 74 |se the s|ize of t|
|00002e90| 68 65 20 61 6c 6c 6f 63 | 61 74 69 6f 6e 20 74 6f |he alloc|ation to|
|00002ea0| 20 61 20 6d 75 6c 74 69 | 70 6c 65 20 6f 66 20 74 | a multi|ple of t|
|00002eb0| 68 65 0a 58 77 6f 72 64 | 20 73 69 7a 65 2e 0a 58 |he.Xword| size..X|
|00002ec0| 49 6e 20 61 64 64 69 74 | 69 6f 6e 2c 20 74 68 65 |In addit|ion, the|
|00002ed0| 20 66 75 6e 63 74 69 6f | 6e 73 20 6d 65 6d 61 6c | functio|ns memal|
|00002ee0| 69 67 6e 28 29 20 61 6e | 64 20 76 61 6c 6c 6f 63 |ign() an|d valloc|
|00002ef0| 28 29 20 6d 75 73 74 20 | 68 6f 6e 6f 72 20 65 78 |() must |honor ex|
|00002f00| 70 6c 69 63 69 74 0a 58 | 73 70 65 63 69 66 69 63 |plicit.X|specific|
|00002f10| 61 74 69 6f 6e 73 20 6f | 6e 20 74 68 65 20 61 6c |ations o|n the al|
|00002f20| 69 67 6e 6d 65 6e 74 20 | 6f 66 20 74 68 65 20 6d |ignment |of the m|
|00002f30| 65 6d 6f 72 79 20 61 6c | 6c 6f 63 61 74 69 6f 6e |emory al|location|
|00002f40| 2c 20 61 6e 64 20 74 68 | 69 73 2c 20 61 73 20 77 |, and th|is, as w|
|00002f50| 65 6c 6c 0a 58 63 61 6e | 20 6f 6e 6c 79 20 62 65 |ell.Xcan| only be|
|00002f60| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 20 62 79 20 | impleme|nted by |
|00002f70| 69 6e 63 72 65 61 73 69 | 6e 67 20 74 68 65 20 73 |increasi|ng the s|
|00002f80| 69 7a 65 20 6f 66 20 74 | 68 65 20 61 6c 6c 6f 63 |ize of t|he alloc|
|00002f90| 61 74 69 6f 6e 2e 0a 58 | 54 68 75 73 2c 20 74 68 |ation..X|Thus, th|
|00002fa0| 65 72 65 20 77 69 6c 6c | 20 62 65 20 73 69 74 75 |ere will| be situ|
|00002fb0| 61 74 69 6f 6e 73 20 69 | 6e 20 77 68 69 63 68 20 |ations i|n which |
|00002fc0| 74 68 65 20 65 6e 64 20 | 6f 66 20 61 20 6d 65 6d |the end |of a mem|
|00002fd0| 6f 72 79 20 61 6c 6c 6f | 63 61 74 69 6f 6e 0a 58 |ory allo|cation.X|
|00002fe0| 63 6f 6e 74 61 69 6e 73 | 20 73 6f 6d 65 20 70 61 |contains| some pa|
|00002ff0| 64 64 69 6e 67 20 73 70 | 61 63 65 2c 20 61 6e 64 |dding sp|ace, and|
|00003000| 20 61 63 63 65 73 73 65 | 73 20 6f 66 20 74 68 61 | accesse|s of tha|
|00003010| 74 20 70 61 64 64 69 6e | 67 20 73 70 61 63 65 20 |t paddin|g space |
|00003020| 77 69 6c 6c 20 6e 6f 74 | 0a 58 62 65 20 64 65 74 |will not|.Xbe det|
|00003030| 65 63 74 65 64 2c 20 65 | 76 65 6e 20 69 66 20 74 |ected, e|ven if t|
|00003040| 68 65 79 20 61 72 65 20 | 6f 76 65 72 72 75 6e 73 |hey are |overruns|
|00003050| 2e 0a 58 2e 4c 50 0a 58 | 45 6c 65 63 74 72 69 63 |..X.LP.X|Electric|
|00003060| 20 46 65 6e 63 65 20 70 | 72 6f 76 69 64 65 73 20 | Fence p|rovides |
|00003070| 74 68 65 20 76 61 72 69 | 61 62 6c 65 20 45 46 5f |the vari|able EF_|
|00003080| 41 4c 49 47 4e 4d 45 4e | 54 20 73 6f 20 74 68 61 |ALIGNMEN|T so tha|
|00003090| 74 20 74 68 65 20 75 73 | 65 72 20 63 61 6e 0a 58 |t the us|er can.X|
|000030a0| 63 6f 6e 74 72 6f 6c 20 | 74 68 65 20 64 65 66 61 |control |the defa|
|000030b0| 75 6c 74 20 61 6c 69 67 | 6e 6d 65 6e 74 20 75 73 |ult alig|nment us|
|000030c0| 65 64 20 62 79 20 6d 61 | 6c 6c 6f 63 28 29 2c 20 |ed by ma|lloc(), |
|000030d0| 63 61 6c 6c 6f 63 28 29 | 2c 20 61 6e 64 20 72 65 |calloc()|, and re|
|000030e0| 61 6c 6c 6f 63 28 29 2e | 0a 58 54 6f 20 64 65 62 |alloc().|.XTo deb|
|000030f0| 75 67 20 6f 76 65 72 72 | 75 6e 73 20 61 73 20 73 |ug overr|uns as s|
|00003100| 6d 61 6c 6c 20 61 73 20 | 61 20 73 69 6e 67 6c 65 |mall as |a single|
|00003110| 20 62 79 74 65 2c 20 79 | 6f 75 20 63 61 6e 20 73 | byte, y|ou can s|
|00003120| 65 74 20 45 46 5f 41 4c | 49 47 4e 4d 45 4e 54 20 |et EF_AL|IGNMENT |
|00003130| 74 6f 0a 58 7a 65 72 6f | 2e 20 54 68 69 73 20 77 |to.Xzero|. This w|
|00003140| 69 6c 6c 20 72 65 73 75 | 6c 74 20 69 6e 20 45 6c |ill resu|lt in El|
|00003150| 65 63 74 72 69 63 20 46 | 65 6e 63 65 20 6d 61 6c |ectric F|ence mal|
|00003160| 6c 6f 63 28 29 20 72 65 | 74 75 72 6e 69 6e 67 20 |loc() re|turning |
|00003170| 75 6e 61 6c 69 67 6e 65 | 64 0a 58 61 64 64 72 65 |unaligne|d.Xaddre|
|00003180| 73 73 65 73 20 66 6f 72 | 20 61 6c 6c 6f 63 61 74 |sses for| allocat|
|00003190| 69 6f 6e 73 20 77 69 74 | 68 20 73 69 7a 65 73 20 |ions wit|h sizes |
|000031a0| 74 68 61 74 20 61 72 65 | 20 6e 6f 74 20 61 20 6d |that are| not a m|
|000031b0| 75 6c 74 69 70 6c 65 20 | 6f 66 20 74 68 65 20 77 |ultiple |of the w|
|000031c0| 6f 72 64 0a 58 73 69 7a | 65 2e 20 54 68 69 73 20 |ord.Xsiz|e. This |
|000031d0| 69 73 20 6e 6f 74 20 61 | 20 70 72 6f 62 6c 65 6d |is not a| problem|
|000031e0| 20 69 6e 20 6d 6f 73 74 | 20 63 61 73 65 73 2c 20 | in most| cases, |
|000031f0| 62 65 63 61 75 73 65 20 | 63 6f 6d 70 69 6c 65 72 |because |compiler|
|00003200| 73 20 6d 75 73 74 20 70 | 61 64 20 74 68 65 0a 58 |s must p|ad the.X|
|00003210| 73 69 7a 65 20 6f 66 20 | 6f 62 6a 65 63 74 73 20 |size of |objects |
|00003220| 73 6f 20 74 68 61 74 20 | 61 6c 69 67 6e 6d 65 6e |so that |alignmen|
|00003230| 74 20 72 65 73 74 72 69 | 63 74 69 6f 6e 73 20 61 |t restri|ctions a|
|00003240| 72 65 20 68 6f 6e 6f 72 | 65 64 20 77 68 65 6e 20 |re honor|ed when |
|00003250| 73 74 6f 72 69 6e 67 0a | 58 74 68 6f 73 65 20 6f |storing.|Xthose o|
|00003260| 62 6a 65 63 74 73 20 69 | 6e 20 61 72 72 61 79 73 |bjects i|n arrays|
|00003270| 2e 20 54 68 65 20 70 72 | 6f 62 6c 65 6d 20 73 75 |. The pr|oblem su|
|00003280| 72 66 61 63 65 73 20 77 | 68 65 6e 20 73 6f 66 74 |rfaces w|hen soft|
|00003290| 77 61 72 65 20 61 6c 6c | 6f 63 61 74 65 73 0a 58 |ware all|ocates.X|
|000032a0| 6f 64 64 2d 73 69 7a 65 | 64 20 62 75 66 66 65 72 |odd-size|d buffer|
|000032b0| 73 20 66 6f 72 20 6f 62 | 6a 65 63 74 73 20 74 68 |s for ob|jects th|
|000032c0| 61 74 20 6d 75 73 74 20 | 62 65 20 77 6f 72 64 2d |at must |be word-|
|000032d0| 61 6c 69 67 6e 65 64 2e | 20 4f 6e 65 20 63 61 73 |aligned.| One cas|
|000032e0| 65 20 6f 66 20 74 68 69 | 73 0a 58 69 73 20 73 6f |e of thi|s.Xis so|
|000032f0| 66 74 77 61 72 65 20 74 | 68 61 74 20 61 6c 6c 6f |ftware t|hat allo|
|00003300| 63 61 74 65 73 20 61 20 | 62 75 66 66 65 72 20 74 |cates a |buffer t|
|00003310| 6f 20 63 6f 6e 74 61 69 | 6e 20 61 20 73 74 72 75 |o contai|n a stru|
|00003320| 63 74 75 72 65 20 61 6e | 64 20 61 0a 58 73 74 72 |cture an|d a.Xstr|
|00003330| 69 6e 67 2c 20 61 6e 64 | 20 74 68 65 20 73 74 72 |ing, and| the str|
|00003340| 69 6e 67 20 68 61 73 20 | 61 6e 20 6f 64 64 20 73 |ing has |an odd s|
|00003350| 69 7a 65 20 28 74 68 69 | 73 20 65 78 61 6d 70 6c |ize (thi|s exampl|
|00003360| 65 20 77 61 73 20 69 6e | 20 61 20 70 6f 70 75 6c |e was in| a popul|
|00003370| 61 72 20 54 49 46 46 0a | 58 6c 69 62 72 61 72 79 |ar TIFF.|Xlibrary|
|00003380| 29 2e 20 49 66 20 77 6f | 72 64 20 72 65 66 65 72 |). If wo|rd refer|
|00003390| 65 6e 63 65 73 20 61 72 | 65 20 6d 61 64 65 20 74 |ences ar|e made t|
|000033a0| 6f 20 75 6e 2d 61 6c 69 | 67 6e 65 64 20 62 75 66 |o un-ali|gned buf|
|000033b0| 66 65 72 73 2c 20 79 6f | 75 20 77 69 6c 6c 20 73 |fers, yo|u will s|
|000033c0| 65 65 0a 58 61 20 62 75 | 73 20 65 72 72 6f 72 20 |ee.Xa bu|s error |
|000033d0| 28 53 49 47 42 55 53 29 | 20 69 6e 73 74 65 61 64 |(SIGBUS)| instead|
|000033e0| 20 6f 66 20 61 20 73 65 | 67 6d 65 6e 74 61 74 69 | of a se|gmentati|
|000033f0| 6f 6e 20 66 61 75 6c 74 | 2e 20 54 68 65 20 6f 6e |on fault|. The on|
|00003400| 6c 79 20 77 61 79 20 74 | 6f 20 66 69 78 0a 58 74 |ly way t|o fix.Xt|
|00003410| 68 69 73 20 69 73 20 74 | 6f 20 72 65 2d 77 72 69 |his is t|o re-wri|
|00003420| 74 65 20 74 68 65 20 6f | 66 66 65 6e 64 69 6e 67 |te the o|ffending|
|00003430| 20 63 6f 64 65 20 74 6f | 20 6d 61 6b 65 20 62 79 | code to| make by|
|00003440| 74 65 20 72 65 66 65 72 | 65 6e 63 65 73 20 6f 72 |te refer|ences or|
|00003450| 20 6e 6f 74 20 6d 61 6b | 65 0a 58 6f 64 64 2d 73 | not mak|e.Xodd-s|
|00003460| 69 7a 65 64 20 61 6c 6c | 6f 63 61 74 69 6f 6e 73 |ized all|ocations|
|00003470| 2c 20 6f 72 20 74 6f 20 | 73 65 74 20 45 46 5f 41 |, or to |set EF_A|
|00003480| 4c 49 47 4e 4d 45 4e 54 | 20 74 6f 20 74 68 65 20 |LIGNMENT| to the |
|00003490| 77 6f 72 64 20 73 69 7a | 65 2e 0a 58 2e 4c 50 0a |word siz|e..X.LP.|
|000034a0| 58 41 6e 6f 74 68 65 72 | 20 65 78 61 6d 70 6c 65 |XAnother| example|
|000034b0| 20 6f 66 20 73 6f 66 74 | 77 61 72 65 20 69 6e 63 | of soft|ware inc|
|000034c0| 6f 6d 70 61 74 69 62 6c | 65 20 77 69 74 68 0a 58 |ompatibl|e with.X|
|000034d0| 45 46 5f 41 4c 49 47 4e | 4d 45 4e 54 20 3c 20 77 |EF_ALIGN|MENT < w|
|000034e0| 6f 72 64 2d 73 69 7a 65 | 0a 58 69 73 20 74 68 65 |ord-size|.Xis the|
|000034f0| 20 73 74 72 63 6d 70 28 | 29 20 66 75 6e 63 74 69 | strcmp(|) functi|
|00003500| 6f 6e 20 61 6e 64 20 6f | 74 68 65 72 20 73 74 72 |on and o|ther str|
|00003510| 69 6e 67 20 66 75 6e 63 | 74 69 6f 6e 73 20 6f 6e |ing func|tions on|
|00003520| 20 53 75 6e 4f 53 20 28 | 61 6e 64 20 70 72 6f 62 | SunOS (|and prob|
|00003530| 61 62 6c 79 0a 58 53 6f | 6c 61 72 69 73 29 2c 20 |ably.XSo|laris), |
|00003540| 77 68 69 63 68 20 6d 61 | 6b 65 20 77 6f 72 64 2d |which ma|ke word-|
|00003550| 73 69 7a 65 64 20 61 63 | 63 65 73 73 65 73 20 74 |sized ac|cesses t|
|00003560| 6f 20 63 68 61 72 61 63 | 74 65 72 20 73 74 72 69 |o charac|ter stri|
|00003570| 6e 67 73 2c 20 61 6e 64 | 20 6d 61 79 0a 58 61 74 |ngs, and| may.Xat|
|00003580| 74 65 6d 70 74 20 74 6f | 20 61 63 63 65 73 73 20 |tempt to| access |
|00003590| 75 70 20 74 6f 20 74 68 | 72 65 65 20 62 79 74 65 |up to th|ree byte|
|000035a0| 73 20 62 65 79 6f 6e 64 | 20 74 68 65 20 65 6e 64 |s beyond| the end|
|000035b0| 20 6f 66 20 61 20 73 74 | 72 69 6e 67 2e 20 54 68 | of a st|ring. Th|
|000035c0| 65 73 65 0a 58 72 65 73 | 75 6c 74 20 69 6e 20 61 |ese.Xres|ult in a|
|000035d0| 20 73 65 67 6d 65 6e 74 | 61 74 69 6f 6e 20 66 61 | segment|ation fa|
|000035e0| 75 6c 74 20 28 53 49 47 | 53 45 47 56 29 2e 20 54 |ult (SIG|SEGV). T|
|000035f0| 68 65 20 6f 6e 6c 79 20 | 77 61 79 20 61 72 6f 75 |he only |way arou|
|00003600| 6e 64 20 74 68 69 73 20 | 69 73 20 74 6f 0a 58 75 |nd this |is to.Xu|
|00003610| 73 65 20 76 65 72 73 69 | 6f 6e 73 20 6f 66 20 74 |se versi|ons of t|
|00003620| 68 65 20 73 74 72 69 6e | 67 20 66 75 6e 63 74 69 |he strin|g functi|
|00003630| 6f 6e 73 20 74 68 61 74 | 20 70 65 72 66 6f 72 6d |ons that| perform|
|00003640| 20 62 79 74 65 20 72 65 | 66 65 72 65 6e 63 65 73 | byte re|ferences|
|00003650| 20 69 6e 73 74 65 61 64 | 0a 58 6f 66 20 77 6f 72 | instead|.Xof wor|
|00003660| 64 20 72 65 66 65 72 65 | 6e 63 65 73 2e 0a 58 2e |d refere|nces..X.|
|00003670| 53 48 20 49 4e 53 54 52 | 55 43 54 49 4f 4e 53 20 |SH INSTR|UCTIONS |
|00003680| 46 4f 52 20 44 45 42 55 | 47 47 49 4e 47 20 59 4f |FOR DEBU|GGING YO|
|00003690| 55 52 20 50 52 4f 47 52 | 41 4d 0a 58 2e 54 50 0a |UR PROGR|AM.X.TP.|
|000036a0| 58 31 2e 0a 58 4c 69 6e | 6b 20 77 69 74 68 20 6c |X1..XLin|k with l|
|000036b0| 69 62 65 66 65 6e 63 65 | 2e 61 20 61 73 20 65 78 |ibefence|.a as ex|
|000036c0| 70 6c 61 69 6e 65 64 20 | 61 62 6f 76 65 2e 0a 58 |plained |above..X|
|000036d0| 2e 54 50 0a 58 32 2e 0a | 58 52 75 6e 20 79 6f 75 |.TP.X2..|XRun you|
|000036e0| 72 20 70 72 6f 67 72 61 | 6d 20 69 6e 20 61 20 64 |r progra|m in a d|
|000036f0| 65 62 75 67 67 65 72 20 | 61 6e 64 20 66 69 78 20 |ebugger |and fix |
|00003700| 61 6e 79 20 6f 76 65 72 | 72 75 6e 73 20 6f 72 20 |any over|runs or |
|00003710| 61 63 63 65 73 73 65 73 | 20 74 6f 20 66 72 65 65 |accesses| to free|
|00003720| 20 6d 65 6d 6f 72 79 2e | 0a 58 2e 54 50 0a 58 33 | memory.|.X.TP.X3|
|00003730| 2e 0a 58 51 75 69 74 20 | 74 68 65 20 64 65 62 75 |..XQuit |the debu|
|00003740| 67 67 65 72 2e 0a 58 2e | 54 50 0a 58 34 2e 0a 58 |gger..X.|TP.X4..X|
|00003750| 53 65 74 20 45 46 5f 50 | 52 4f 54 45 43 54 5f 42 |Set EF_P|ROTECT_B|
|00003760| 45 4c 4f 57 20 3d 20 31 | 20 69 6e 20 74 68 65 20 |ELOW = 1| in the |
|00003770| 73 68 65 6c 6c 20 65 6e | 76 69 72 6f 6e 6d 65 6e |shell en|vironmen|
|00003780| 74 2e 0a 58 2e 54 50 0a | 58 35 2e 0a 58 52 65 70 |t..X.TP.|X5..XRep|
|00003790| 65 61 74 20 73 74 65 70 | 20 32 2c 20 74 68 69 73 |eat step| 2, this|
|000037a0| 20 74 69 6d 65 20 72 65 | 70 61 69 72 69 6e 67 20 | time re|pairing |
|000037b0| 75 6e 64 65 72 72 75 6e | 73 20 69 66 20 74 68 65 |underrun|s if the|
|000037c0| 79 20 6f 63 63 75 72 2e | 0a 58 2e 54 50 0a 58 36 |y occur.|.X.TP.X6|
|000037d0| 2e 0a 58 51 75 69 74 20 | 74 68 65 20 64 65 62 75 |..XQuit |the debu|
|000037e0| 67 67 65 72 2e 0a 58 2e | 54 50 0a 58 37 2e 0a 58 |gger..X.|TP.X7..X|
|000037f0| 52 65 61 64 20 74 68 65 | 20 72 65 73 74 72 69 63 |Read the| restric|
|00003800| 74 69 6f 6e 73 20 69 6e | 20 74 68 65 20 73 65 63 |tions in| the sec|
|00003810| 74 69 6f 6e 20 6f 6e 0a | 58 2e 49 20 57 4f 52 44 |tion on.|X.I WORD|
|00003820| 2d 41 4c 49 47 4e 4d 45 | 4e 54 20 41 4e 44 20 4f |-ALIGNME|NT AND O|
|00003830| 56 45 52 52 55 4e 20 44 | 45 54 45 43 54 49 4f 4e |VERRUN D|ETECTION|
|00003840| 2e 0a 58 53 65 65 20 69 | 66 20 79 6f 75 20 63 61 |..XSee i|f you ca|
|00003850| 6e 0a 58 73 65 74 20 45 | 46 5f 41 4c 49 47 4e 4d |n.Xset E|F_ALIGNM|
|00003860| 45 4e 54 20 74 6f 20 30 | 20 61 6e 64 20 72 65 70 |ENT to 0| and rep|
|00003870| 65 61 74 20 73 74 65 70 | 20 32 2e 20 53 6f 6d 65 |eat step| 2. Some|
|00003880| 74 69 6d 65 73 20 74 68 | 69 73 20 77 69 6c 6c 20 |times th|is will |
|00003890| 62 65 20 74 6f 6f 20 6d | 75 63 68 20 77 6f 72 6b |be too m|uch work|
|000038a0| 2c 0a 58 6f 72 20 74 68 | 65 72 65 20 77 69 6c 6c |,.Xor th|ere will|
|000038b0| 20 62 65 20 70 72 6f 62 | 6c 65 6d 73 20 77 69 74 | be prob|lems wit|
|000038c0| 68 20 6c 69 62 72 61 72 | 79 20 72 6f 75 74 69 6e |h librar|y routin|
|000038d0| 65 73 20 66 6f 72 20 77 | 68 69 63 68 20 79 6f 75 |es for w|hich you|
|000038e0| 20 64 6f 6e 27 74 20 68 | 61 76 65 20 74 68 65 0a | don't h|ave the.|
|000038f0| 58 73 6f 75 72 63 65 2c | 20 74 68 61 74 20 77 69 |Xsource,| that wi|
|00003900| 6c 6c 20 70 72 65 76 65 | 6e 74 20 79 6f 75 20 66 |ll preve|nt you f|
|00003910| 72 6f 6d 20 64 6f 69 6e | 67 20 74 68 69 73 2e 0a |rom doin|g this..|
|00003920| 58 2e 53 48 20 4d 45 4d | 4f 52 59 20 55 53 41 47 |X.SH MEM|ORY USAG|
|00003930| 45 20 41 4e 44 20 45 58 | 45 43 55 54 49 4f 4e 20 |E AND EX|ECUTION |
|00003940| 53 50 45 45 44 0a 58 53 | 69 6e 63 65 20 45 6c 65 |SPEED.XS|ince Ele|
|00003950| 63 74 72 69 63 20 46 65 | 6e 63 65 20 75 73 65 73 |ctric Fe|nce uses|
|00003960| 20 61 74 20 6c 65 61 73 | 74 20 74 77 6f 20 76 69 | at leas|t two vi|
|00003970| 72 74 75 61 6c 20 6d 65 | 6d 6f 72 79 20 70 61 67 |rtual me|mory pag|
|00003980| 65 73 20 66 6f 72 20 65 | 61 63 68 20 6f 66 20 69 |es for e|ach of i|
|00003990| 74 73 0a 58 61 6c 6c 6f | 63 61 74 69 6f 6e 73 2c |ts.Xallo|cations,|
|000039a0| 20 69 74 27 73 20 61 20 | 74 65 72 72 69 62 6c 65 | it's a |terrible|
|000039b0| 20 6d 65 6d 6f 72 79 20 | 68 6f 67 2e 20 49 27 76 | memory |hog. I'v|
|000039c0| 65 20 73 6f 6d 65 74 69 | 6d 65 73 20 66 6f 75 6e |e someti|mes foun|
|000039d0| 64 20 69 74 20 6e 65 63 | 65 73 73 61 72 79 20 74 |d it nec|essary t|
|000039e0| 6f 0a 58 61 64 64 20 61 | 20 73 77 61 70 20 66 69 |o.Xadd a| swap fi|
|000039f0| 6c 65 20 75 73 69 6e 67 | 20 73 77 61 70 6f 6e 28 |le using| swapon(|
|00003a00| 38 29 20 73 6f 20 74 68 | 61 74 20 74 68 65 20 73 |8) so th|at the s|
|00003a10| 79 73 74 65 6d 20 77 6f | 75 6c 64 20 68 61 76 65 |ystem wo|uld have|
|00003a20| 20 65 6e 6f 75 67 68 20 | 76 69 72 74 75 61 6c 0a | enough |virtual.|
|00003a30| 58 6d 65 6d 6f 72 79 20 | 74 6f 20 64 65 62 75 67 |Xmemory |to debug|
|00003a40| 20 6d 79 20 70 72 6f 67 | 72 61 6d 2e 20 41 6c 73 | my prog|ram. Als|
|00003a50| 6f 2c 20 74 68 65 20 77 | 61 79 20 77 65 20 6d 61 |o, the w|ay we ma|
|00003a60| 6e 69 70 75 6c 61 74 65 | 20 6d 65 6d 6f 72 79 20 |nipulate| memory |
|00003a70| 72 65 73 75 6c 74 73 20 | 69 6e 0a 58 76 61 72 69 |results |in.Xvari|
|00003a80| 6f 75 73 20 63 61 63 68 | 65 20 61 6e 64 20 74 72 |ous cach|e and tr|
|00003a90| 61 6e 73 6c 61 74 69 6f | 6e 20 62 75 66 66 65 72 |anslatio|n buffer|
|00003aa0| 20 65 6e 74 72 69 65 73 | 20 62 65 69 6e 67 20 66 | entries| being f|
|00003ab0| 6c 75 73 68 65 64 20 77 | 69 74 68 20 65 61 63 68 |lushed w|ith each|
|00003ac0| 20 63 61 6c 6c 0a 58 74 | 6f 20 6d 61 6c 6c 6f 63 | call.Xt|o malloc|
|00003ad0| 20 6f 72 20 66 72 65 65 | 2e 20 54 68 65 20 65 6e | or free|. The en|
|00003ae0| 64 20 72 65 73 75 6c 74 | 20 69 73 20 74 68 61 74 |d result| is that|
|00003af0| 20 79 6f 75 72 20 70 72 | 6f 67 72 61 6d 20 77 69 | your pr|ogram wi|
|00003b00| 6c 6c 20 62 65 20 6d 75 | 63 68 20 73 6c 6f 77 65 |ll be mu|ch slowe|
|00003b10| 72 0a 58 61 6e 64 20 75 | 73 65 20 6d 6f 72 65 20 |r.Xand u|se more |
|00003b20| 72 65 73 6f 75 72 63 65 | 73 20 77 68 69 6c 65 20 |resource|s while |
|00003b30| 79 6f 75 20 61 72 65 20 | 64 65 62 75 67 67 69 6e |you are |debuggin|
|00003b40| 67 20 69 74 20 77 69 74 | 68 20 45 6c 65 63 74 72 |g it wit|h Electr|
|00003b50| 69 63 20 46 65 6e 63 65 | 2e 0a 58 2e 4c 50 0a 58 |ic Fence|..X.LP.X|
|00003b60| 44 6f 6e 27 74 20 6c 65 | 61 76 65 20 6c 69 62 65 |Don't le|ave libe|
|00003b70| 66 65 6e 63 65 2e 61 20 | 6c 69 6e 6b 65 64 20 69 |fence.a |linked i|
|00003b80| 6e 74 6f 20 70 72 6f 64 | 75 63 74 69 6f 6e 20 73 |nto prod|uction s|
|00003b90| 6f 66 74 77 61 72 65 21 | 20 55 73 65 20 69 74 20 |oftware!| Use it |
|00003ba0| 6f 6e 6c 79 0a 58 66 6f | 72 20 64 65 62 75 67 67 |only.Xfo|r debugg|
|00003bb0| 69 6e 67 2e 0a 58 2e 53 | 48 20 50 4f 52 54 49 4e |ing..X.S|H PORTIN|
|00003bc0| 47 0a 58 45 6c 65 63 74 | 72 69 63 20 46 65 6e 63 |G.XElect|ric Fenc|
|00003bd0| 65 20 69 73 20 77 72 69 | 74 74 65 6e 20 66 6f 72 |e is wri|tten for|
|00003be0| 20 41 4e 53 49 20 43 2e | 20 59 6f 75 20 73 68 6f | ANSI C.| You sho|
|00003bf0| 75 6c 64 20 62 65 20 61 | 62 6c 65 20 74 6f 20 70 |uld be a|ble to p|
|00003c00| 6f 72 74 20 69 74 20 77 | 69 74 68 0a 58 73 69 6d |ort it w|ith.Xsim|
|00003c10| 70 6c 65 20 63 68 61 6e | 67 65 73 20 74 6f 20 74 |ple chan|ges to t|
|00003c20| 68 65 20 4d 61 6b 65 66 | 69 6c 65 20 61 6e 64 20 |he Makef|ile and |
|00003c30| 74 6f 20 70 61 67 65 2e | 63 2c 0a 58 77 68 69 63 |to page.|c,.Xwhic|
|00003c40| 68 20 63 6f 6e 74 61 69 | 6e 73 20 74 68 65 20 6d |h contai|ns the m|
|00003c50| 65 6d 6f 72 79 20 6d 61 | 6e 61 67 65 6d 65 6e 74 |emory ma|nagement|
|00003c60| 20 70 72 69 6d 69 74 69 | 76 65 73 20 2e 0a 58 4d | primiti|ves ..XM|
|00003c70| 61 6e 79 20 50 4f 53 49 | 58 20 70 6c 61 74 66 6f |any POSI|X platfo|
|00003c80| 72 6d 73 20 77 69 6c 6c | 20 72 65 71 75 69 72 65 |rms will| require|
|00003c90| 20 6f 6e 6c 79 20 61 20 | 72 65 2d 63 6f 6d 70 69 | only a |re-compi|
|00003ca0| 6c 65 2e 0a 58 54 68 65 | 20 6f 70 65 72 61 74 69 |le..XThe| operati|
|00003cb0| 6e 67 20 73 79 73 74 65 | 6d 20 66 61 63 69 6c 69 |ng syste|m facili|
|00003cc0| 74 69 65 73 20 72 65 71 | 75 69 72 65 64 20 74 6f |ties req|uired to|
|00003cd0| 20 70 6f 72 74 20 45 6c | 65 63 74 72 69 63 20 46 | port El|ectric F|
|00003ce0| 65 6e 63 65 20 61 72 65 | 3a 0a 58 2e 49 50 0a 58 |ence are|:.X.IP.X|
|00003cf0| 41 20 77 61 79 20 74 6f | 20 61 6c 6c 6f 63 61 74 |A way to| allocat|
|00003d00| 65 20 6d 65 6d 6f 72 79 | 20 70 61 67 65 73 0a 58 |e memory| pages.X|
|00003d10| 2e 62 72 0a 58 41 20 77 | 61 79 20 74 6f 20 6d 61 |.br.XA w|ay to ma|
|00003d20| 6b 65 20 73 65 6c 65 63 | 74 65 64 20 70 61 67 65 |ke selec|ted page|
|00003d30| 73 20 69 6e 61 63 63 65 | 73 73 69 62 6c 65 2e 0a |s inacce|ssible..|
|00003d40| 58 2e 62 72 0a 58 41 20 | 77 61 79 20 74 6f 20 6d |X.br.XA |way to m|
|00003d50| 61 6b 65 20 74 68 65 20 | 70 61 67 65 73 20 61 63 |ake the |pages ac|
|00003d60| 63 65 73 73 69 62 6c 65 | 20 61 67 61 69 6e 2e 0a |cessible| again..|
|00003d70| 58 2e 62 72 0a 58 41 20 | 77 61 79 20 74 6f 20 64 |X.br.XA |way to d|
|00003d80| 65 74 65 63 74 20 77 68 | 65 6e 20 61 20 70 72 6f |etect wh|en a pro|
|00003d90| 67 72 61 6d 20 74 6f 75 | 63 68 65 73 20 61 6e 20 |gram tou|ches an |
|00003da0| 69 6e 61 63 63 65 73 73 | 69 62 6c 65 20 70 61 67 |inaccess|ible pag|
|00003db0| 65 2e 0a 58 2e 62 72 0a | 58 41 20 77 61 79 20 74 |e..X.br.|XA way t|
|00003dc0| 6f 20 70 72 69 6e 74 20 | 6d 65 73 73 61 67 65 73 |o print |messages|
|00003dd0| 2e 0a 58 2e 4c 50 0a 58 | 50 6c 65 61 73 65 20 65 |..X.LP.X|Please e|
|00003de0| 2d 6d 61 69 6c 20 6d 65 | 20 61 20 63 6f 70 79 20 |-mail me| a copy |
|00003df0| 6f 66 20 61 6e 79 20 63 | 68 61 6e 67 65 73 20 79 |of any c|hanges y|
|00003e00| 6f 75 20 68 61 76 65 20 | 74 6f 20 6d 61 6b 65 2c |ou have |to make,|
|00003e10| 20 73 6f 20 74 68 61 74 | 20 49 20 63 61 6e 0a 58 | so that| I can.X|
|00003e20| 6d 65 72 67 65 20 74 68 | 65 6d 20 69 6e 74 6f 20 |merge th|em into |
|00003e30| 74 68 65 20 64 69 73 74 | 72 69 62 75 74 69 6f 6e |the dist|ribution|
|00003e40| 2e 0a 58 2e 53 48 20 41 | 55 54 48 4f 52 0a 58 42 |..X.SH A|UTHOR.XB|
|00003e50| 72 75 63 65 20 50 65 72 | 65 6e 73 0a 58 2e 53 48 |ruce Per|ens.X.SH|
|00003e60| 20 57 41 52 4e 49 4e 47 | 53 0a 58 49 20 68 61 76 | WARNING|S.XI hav|
|00003e70| 65 20 74 72 69 65 64 20 | 74 6f 20 64 6f 20 61 73 |e tried |to do as|
|00003e80| 20 67 6f 6f 64 20 61 20 | 6a 6f 62 20 61 73 20 49 | good a |job as I|
|00003e90| 20 63 61 6e 20 6f 6e 20 | 74 68 69 73 20 73 6f 66 | can on |this sof|
|00003ea0| 74 77 61 72 65 2c 20 62 | 75 74 20 49 20 64 6f 75 |tware, b|ut I dou|
|00003eb0| 62 74 0a 58 74 68 61 74 | 20 69 74 20 69 73 20 65 |bt.Xthat| it is e|
|00003ec0| 76 65 6e 20 74 68 65 6f | 72 65 74 69 63 61 6c 6c |ven theo|reticall|
|00003ed0| 79 20 70 6f 73 73 69 62 | 6c 65 20 74 6f 20 6d 61 |y possib|le to ma|
|00003ee0| 6b 65 20 69 74 20 62 75 | 67 2d 66 72 65 65 2e 0a |ke it bu|g-free..|
|00003ef0| 58 54 68 69 73 20 73 6f | 66 74 77 61 72 65 20 68 |XThis so|ftware h|
|00003f00| 61 73 20 6e 6f 20 77 61 | 72 72 61 6e 74 79 2e 20 |as no wa|rranty. |
|00003f10| 49 74 20 77 69 6c 6c 20 | 6e 6f 74 20 64 65 74 65 |It will |not dete|
|00003f20| 63 74 20 73 6f 6d 65 20 | 62 75 67 73 20 74 68 61 |ct some |bugs tha|
|00003f30| 74 20 79 6f 75 20 6d 69 | 67 68 74 0a 58 65 78 70 |t you mi|ght.Xexp|
|00003f40| 65 63 74 20 69 74 20 74 | 6f 20 64 65 74 65 63 74 |ect it t|o detect|
|00003f50| 2c 20 61 6e 64 20 77 69 | 6c 6c 20 69 6e 64 69 63 |, and wi|ll indic|
|00003f60| 61 74 65 20 74 68 61 74 | 20 73 6f 6d 65 20 6e 6f |ate that| some no|
|00003f70| 6e 2d 62 75 67 73 20 61 | 72 65 20 62 75 67 73 2e |n-bugs a|re bugs.|
|00003f80| 0a 58 42 72 75 63 65 20 | 50 65 72 65 6e 73 20 61 |.XBruce |Perens a|
|00003f90| 6e 64 2f 6f 72 20 50 69 | 78 61 72 20 77 69 6c 6c |nd/or Pi|xar will|
|00003fa0| 20 6e 6f 74 20 62 65 20 | 6c 69 61 62 6c 65 20 74 | not be |liable t|
|00003fb0| 6f 20 61 6e 79 20 63 6c | 61 69 6d 73 20 72 65 73 |o any cl|aims res|
|00003fc0| 75 6c 74 69 6e 67 0a 58 | 66 72 6f 6d 20 74 68 65 |ulting.X|from the|
|00003fd0| 20 75 73 65 20 6f 66 20 | 74 68 69 73 20 73 6f 66 | use of |this sof|
|00003fe0| 74 77 61 72 65 20 6f 72 | 20 74 68 65 20 69 64 65 |tware or| the ide|
|00003ff0| 61 73 20 77 69 74 68 69 | 6e 20 69 74 2e 0a 58 54 |as withi|n it..XT|
|00004000| 68 65 20 65 6e 74 69 72 | 65 20 72 65 73 70 6f 6e |he entir|e respon|
|00004010| 73 69 62 69 6c 69 74 79 | 20 66 6f 72 20 69 74 73 |sibility| for its|
|00004020| 20 75 73 65 20 6d 75 73 | 74 0a 58 62 65 20 61 73 | use mus|t.Xbe as|
|00004030| 73 75 6d 65 64 20 62 79 | 20 74 68 65 20 75 73 65 |sumed by| the use|
|00004040| 72 2e 20 49 66 20 79 6f | 75 20 75 73 65 20 69 74 |r. If yo|u use it|
|00004050| 20 61 6e 64 20 69 74 20 | 72 65 73 75 6c 74 73 20 | and it |results |
|00004060| 69 6e 20 6c 6f 73 73 20 | 6f 66 20 6c 69 66 65 0a |in loss |of life.|
|00004070| 58 61 6e 64 2f 6f 72 20 | 70 72 6f 70 65 72 74 79 |Xand/or |property|
|00004080| 2c 20 74 6f 75 67 68 2e | 20 49 66 20 69 74 20 6c |, tough.| If it l|
|00004090| 65 61 64 73 20 79 6f 75 | 20 6f 6e 20 61 20 77 69 |eads you| on a wi|
|000040a0| 6c 64 20 67 6f 6f 73 65 | 20 63 68 61 73 65 20 61 |ld goose| chase a|
|000040b0| 6e 64 20 79 6f 75 20 77 | 61 73 74 65 0a 58 74 77 |nd you w|aste.Xtw|
|000040c0| 6f 20 77 65 65 6b 73 20 | 64 65 62 75 67 67 69 6e |o weeks |debuggin|
|000040d0| 67 20 73 6f 6d 65 74 68 | 69 6e 67 2c 20 74 6f 6f |g someth|ing, too|
|000040e0| 20 62 61 64 2e 0a 58 49 | 66 20 79 6f 75 20 63 61 | bad..XI|f you ca|
|000040f0| 6e 27 74 20 64 65 61 6c | 20 77 69 74 68 20 74 68 |n't deal| with th|
|00004100| 65 20 61 62 6f 76 65 2c | 20 70 6c 65 61 73 65 20 |e above,| please |
|00004110| 64 6f 6e 27 74 20 75 73 | 65 20 74 68 65 20 73 6f |don't us|e the so|
|00004120| 66 74 77 61 72 65 21 20 | 49 27 76 65 20 77 72 69 |ftware! |I've wri|
|00004130| 74 74 65 6e 0a 58 74 68 | 69 73 20 69 6e 20 61 6e |tten.Xth|is in an|
|00004140| 20 61 74 74 65 6d 70 74 | 20 74 6f 20 68 65 6c 70 | attempt| to help|
|00004150| 20 6f 74 68 65 72 20 70 | 65 6f 70 6c 65 2c 20 6e | other p|eople, n|
|00004160| 6f 74 20 74 6f 20 67 65 | 74 20 6d 79 73 65 6c 66 |ot to ge|t myself|
|00004170| 20 73 75 65 64 20 6f 72 | 20 70 72 6f 73 65 63 75 | sued or| prosecu|
|00004180| 74 65 64 2e 0a 58 2e 53 | 48 20 4c 49 43 45 4e 53 |ted..X.S|H LICENS|
|00004190| 45 0a 58 43 6f 70 79 72 | 69 67 68 74 20 31 39 38 |E.XCopyr|ight 198|
|000041a0| 37 2c 31 39 38 38 2c 31 | 39 38 39 2c 31 39 39 30 |7,1988,1|989,1990|
|000041b0| 2c 31 39 39 31 2c 31 39 | 39 32 2c 31 39 39 33 20 |,1991,19|92,1993 |
|000041c0| 42 72 75 63 65 20 50 65 | 72 65 6e 73 2e 0a 58 2e |Bruce Pe|rens..X.|
|000041d0| 62 72 0a 58 41 6c 6c 20 | 52 69 67 68 74 73 20 52 |br.XAll |Rights R|
|000041e0| 65 73 65 72 76 65 64 20 | 65 78 63 65 70 74 20 66 |eserved |except f|
|000041f0| 6f 72 20 74 68 6f 73 65 | 20 67 72 61 6e 74 65 64 |or those| granted|
|00004200| 20 69 6e 20 74 68 69 73 | 20 6e 6f 74 69 63 65 2e | in this| notice.|
|00004210| 0a 58 2e 62 72 0a 58 50 | 65 72 6d 69 73 73 69 6f |.X.br.XP|ermissio|
|00004220| 6e 20 69 73 20 67 72 61 | 6e 74 65 64 20 66 6f 72 |n is gra|nted for|
|00004230| 20 79 6f 75 20 74 6f 20 | 75 73 65 20 74 68 69 73 | you to |use this|
|00004240| 20 73 6f 66 74 77 61 72 | 65 20 74 6f 20 64 65 62 | softwar|e to deb|
|00004250| 75 67 20 6f 74 68 65 72 | 20 70 72 6f 67 72 61 6d |ug other| program|
|00004260| 73 2e 0a 58 59 6f 75 20 | 6d 61 79 20 72 65 2d 64 |s..XYou |may re-d|
|00004270| 69 73 74 72 69 62 75 74 | 65 20 69 74 20 74 68 65 |istribut|e it the|
|00004280| 20 6f 72 69 67 69 6e 61 | 6c 20 66 6f 72 6d 20 69 | origina|l form i|
|00004290| 6e 20 77 68 69 63 68 20 | 49 20 72 65 6c 65 61 73 |n which |I releas|
|000042a0| 65 64 20 69 74 20 74 6f | 20 79 6f 75 2e 0a 58 49 |ed it to| you..XI|
|000042b0| 66 20 79 6f 75 20 6d 61 | 6b 65 20 6d 6f 64 69 66 |f you ma|ke modif|
|000042c0| 69 63 61 74 69 6f 6e 73 | 20 74 6f 20 69 74 2c 20 |ications| to it, |
|000042d0| 70 6c 65 61 73 65 20 73 | 65 6e 64 20 74 68 65 6d |please s|end them|
|000042e0| 20 74 6f 20 6d 65 20 66 | 6f 72 0a 58 64 69 73 74 | to me f|or.Xdist|
|000042f0| 72 69 62 75 74 69 6f 6e | 20 2d 20 79 6f 75 20 6d |ribution| - you m|
|00004300| 61 79 20 6e 6f 74 20 72 | 65 2d 64 69 73 74 72 69 |ay not r|e-distri|
|00004310| 62 75 74 65 20 6d 6f 64 | 69 66 69 65 64 20 76 65 |bute mod|ified ve|
|00004320| 72 73 69 6f 6e 73 2e 0a | 58 59 6f 75 20 6d 61 79 |rsions..|XYou may|
|00004330| 20 6e 6f 74 20 73 65 6c | 6c 20 74 68 69 73 20 73 | not sel|l this s|
|00004340| 6f 66 74 77 61 72 65 2e | 20 59 6f 75 20 6d 61 79 |oftware.| You may|
|00004350| 20 6e 6f 74 20 73 65 6c | 6c 20 73 75 70 70 6f 72 | not sel|l suppor|
|00004360| 74 20 66 6f 72 20 74 68 | 69 73 20 73 6f 66 74 77 |t for th|is softw|
|00004370| 61 72 65 2e 0a 58 49 66 | 20 79 6f 75 20 75 73 65 |are..XIf| you use|
|00004380| 20 69 64 65 61 73 20 66 | 72 6f 6d 20 74 68 69 73 | ideas f|rom this|
|00004390| 20 73 6f 66 74 77 61 72 | 65 20 69 6e 20 79 6f 75 | softwar|e in you|
|000043a0| 72 20 6f 77 6e 20 70 72 | 6f 64 75 63 74 2c 20 70 |r own pr|oduct, p|
|000043b0| 6c 65 61 73 65 20 70 61 | 79 20 6d 65 20 66 6f 72 |lease pa|y me for|
|000043c0| 0a 58 74 68 65 6d 2e 0a | 58 2e 53 48 20 43 4f 4e |.Xthem..|X.SH CON|
|000043d0| 54 41 43 54 49 4e 47 20 | 54 48 45 20 41 55 54 48 |TACTING |THE AUTH|
|000043e0| 4f 52 0a 58 2e 6e 66 0a | 58 42 72 75 63 65 20 50 |OR.X.nf.|XBruce P|
|000043f0| 65 72 65 6e 73 0a 58 63 | 2f 6f 20 50 69 78 61 72 |erens.Xc|/o Pixar|
|00004400| 0a 58 31 30 30 31 20 57 | 65 73 74 20 43 75 74 74 |.X1001 W|est Cutt|
|00004410| 69 6e 67 20 42 6c 76 64 | 2e 2c 20 53 75 69 74 65 |ing Blvd|., Suite|
|00004420| 20 32 30 30 0a 58 52 69 | 63 68 6d 6f 6e 64 2c 20 | 200.XRi|chmond, |
|00004430| 43 41 20 39 34 38 30 34 | 0a 58 0a 58 54 65 6c 65 |CA 94804|.X.XTele|
|00004440| 70 68 6f 6e 65 3a 20 35 | 31 30 2d 32 31 35 2d 33 |phone: 5|10-215-3|
|00004450| 35 30 32 0a 58 46 61 78 | 3a 20 35 31 30 2d 32 33 |502.XFax|: 510-23|
|00004460| 36 2d 30 33 38 38 0a 58 | 49 6e 74 65 72 6e 65 74 |6-0388.X|Internet|
|00004470| 3a 20 42 72 75 63 65 40 | 50 69 78 61 72 2e 63 6f |: Bruce@|Pixar.co|
|00004480| 6d 0a 58 2e 66 69 0a 58 | 2e 66 74 0a 58 2e 53 48 |m.X.fi.X|.ft.X.SH|
|00004490| 20 46 49 4c 45 53 0a 58 | 2f 64 65 76 2f 7a 65 72 | FILES.X|/dev/zer|
|000044a0| 6f 3a 20 53 6f 75 72 63 | 65 20 6f 66 20 6d 65 6d |o: Sourc|e of mem|
|000044b0| 6f 72 79 20 70 61 67 65 | 73 20 28 76 69 61 20 6d |ory page|s (via m|
|000044c0| 6d 61 70 28 32 29 29 2e | 0a 58 2e 53 48 20 53 45 |map(2)).|.X.SH SE|
|000044d0| 45 20 41 4c 53 4f 0a 58 | 6d 61 6c 6c 6f 63 28 33 |E ALSO.X|malloc(3|
|000044e0| 29 2c 20 6d 6d 61 70 28 | 32 29 2c 20 6d 70 72 6f |), mmap(|2), mpro|
|000044f0| 74 65 63 74 28 32 29 2c | 20 73 77 61 70 6f 6e 28 |tect(2),| swapon(|
|00004500| 38 29 0a 58 2e 53 48 20 | 44 49 41 47 4e 4f 53 54 |8).X.SH |DIAGNOST|
|00004510| 49 43 53 0a 58 53 65 67 | 6d 65 6e 74 61 74 69 6f |ICS.XSeg|mentatio|
|00004520| 6e 20 46 61 75 6c 74 3a | 20 45 78 61 6d 69 6e 65 |n Fault:| Examine|
|00004530| 20 74 68 65 20 6f 66 66 | 65 6e 64 69 6e 67 20 73 | the off|ending s|
|00004540| 74 61 74 65 6d 65 6e 74 | 20 66 6f 72 20 76 69 6f |tatement| for vio|
|00004550| 6c 61 74 69 6f 6e 20 6f | 66 20 74 68 65 0a 58 62 |lation o|f the.Xb|
|00004560| 6f 75 6e 64 61 72 69 65 | 73 20 6f 66 20 61 20 6d |oundarie|s of a m|
|00004570| 65 6d 6f 72 79 20 61 6c | 6c 6f 63 61 74 69 6f 6e |emory al|location|
|00004580| 2e 0a 58 2e 62 72 0a 58 | 42 75 73 20 45 72 72 6f |..X.br.X|Bus Erro|
|00004590| 72 3a 20 53 65 65 20 74 | 68 65 20 73 65 63 74 69 |r: See t|he secti|
|000045a0| 6f 6e 20 6f 6e 0a 58 2e | 49 20 57 4f 52 44 2d 41 |on on.X.|I WORD-A|
|000045b0| 4c 49 47 4e 4d 45 4e 54 | 20 41 4e 44 20 4f 56 45 |LIGNMENT| AND OVE|
|000045c0| 52 52 55 4e 20 44 45 54 | 45 43 54 49 4f 4e 2e 0a |RRUN DET|ECTION..|
|000045d0| 58 69 6e 20 74 68 69 73 | 20 6d 61 6e 75 61 6c 20 |Xin this| manual |
|000045e0| 70 61 67 65 2e 0a 58 2e | 53 48 20 42 55 47 53 0a |page..X.|SH BUGS.|
|000045f0| 58 4d 79 20 65 78 70 6c | 61 6e 61 74 69 6f 6e 20 |XMy expl|anation |
|00004600| 6f 66 20 74 68 65 20 61 | 6c 69 67 6e 6d 65 6e 74 |of the a|lignment|
|00004610| 20 69 73 73 75 65 20 63 | 6f 75 6c 64 20 62 65 20 | issue c|ould be |
|00004620| 69 6d 70 72 6f 76 65 64 | 2e 0a 58 2e 4c 50 0a 58 |improved|..X.LP.X|
|00004630| 53 6f 6d 65 20 53 75 6e | 20 73 79 73 74 65 6d 73 |Some Sun| systems|
|00004640| 20 72 75 6e 6e 69 6e 67 | 20 53 75 6e 4f 53 20 34 | running| SunOS 4|
|00004650| 2e 31 20 61 72 65 20 72 | 65 70 6f 72 74 65 64 20 |.1 are r|eported |
|00004660| 74 6f 20 73 69 67 6e 61 | 6c 20 61 6e 20 61 63 63 |to signa|l an acc|
|00004670| 65 73 73 20 74 6f 20 61 | 0a 58 70 72 6f 74 65 63 |ess to a|.Xprotec|
|00004680| 74 65 64 20 70 61 67 65 | 20 77 69 74 68 0a 58 2e |ted page| with.X.|
|00004690| 42 20 20 53 49 47 42 55 | 53 0a 58 72 61 74 68 65 |B SIGBU|S.Xrathe|
|000046a0| 72 20 74 68 61 6e 0a 58 | 2e 42 20 53 49 47 53 45 |r than.X|.B SIGSE|
|000046b0| 47 56 2c 0a 58 49 20 73 | 75 73 70 65 63 74 20 74 |GV,.XI s|uspect t|
|000046c0| 68 69 73 20 69 73 20 61 | 6e 20 75 6e 64 6f 63 75 |his is a|n undocu|
|000046d0| 6d 65 6e 74 65 64 20 66 | 65 61 74 75 72 65 20 6f |mented f|eature o|
|000046e0| 66 20 61 20 70 61 72 74 | 69 63 75 6c 61 72 20 53 |f a part|icular S|
|000046f0| 75 6e 20 68 61 72 64 77 | 61 72 65 0a 58 76 65 72 |un hardw|are.Xver|
|00004700| 73 69 6f 6e 2c 20 6e 6f | 74 20 6a 75 73 74 20 74 |sion, no|t just t|
|00004710| 68 65 20 6f 70 65 72 61 | 74 69 6e 67 20 73 79 73 |he opera|ting sys|
|00004720| 74 65 6d 2e 0a 58 4f 6e | 20 74 68 65 73 65 20 73 |tem..XOn| these s|
|00004730| 79 73 74 65 6d 73 2c 20 | 65 66 74 65 73 74 20 77 |ystems, |eftest w|
|00004740| 69 6c 6c 20 66 61 69 6c | 20 77 69 74 68 20 61 20 |ill fail| with a |
|00004750| 62 75 73 20 65 72 72 6f | 72 20 75 6e 74 69 6c 20 |bus erro|r until |
|00004760| 79 6f 75 20 6d 6f 64 69 | 66 79 20 74 68 65 0a 58 |you modi|fy the.X|
|00004770| 4d 61 6b 65 66 69 6c 65 | 20 74 6f 20 64 65 66 69 |Makefile| to defi|
|00004780| 6e 65 0a 58 2e 42 20 50 | 41 47 45 5f 50 52 4f 54 |ne.X.B P|AGE_PROT|
|00004790| 45 43 54 49 4f 4e 5f 56 | 49 4f 4c 41 54 45 44 5f |ECTION_V|IOLATED_|
|000047a0| 53 49 47 4e 41 4c 0a 58 | 61 73 0a 58 2e 42 20 53 |SIGNAL.X|as.X.B S|
|000047b0| 49 47 42 55 53 2e 0a 58 | 2e 4c 50 0a 58 54 68 65 |IGBUS..X|.LP.XThe|
|000047c0| 72 65 20 61 72 65 2c 20 | 77 69 74 68 6f 75 74 20 |re are, |without |
|000047d0| 64 6f 75 62 74 2c 20 6f | 74 68 65 72 20 62 75 67 |doubt, o|ther bug|
|000047e0| 73 20 61 6e 64 20 70 6f | 72 74 69 6e 67 20 69 73 |s and po|rting is|
|000047f0| 73 75 65 73 2e 20 50 6c | 65 61 73 65 20 63 6f 6e |sues. Pl|ease con|
|00004800| 74 61 63 74 20 6d 65 20 | 76 69 61 0a 58 65 2d 6d |tact me |via.Xe-m|
|00004810| 61 69 6c 20 69 66 20 79 | 6f 75 20 68 61 76 65 20 |ail if y|ou have |
|00004820| 61 6e 79 20 62 75 67 20 | 72 65 70 6f 72 74 73 2c |any bug |reports,|
|00004830| 20 69 64 65 61 73 2c 20 | 65 74 63 2e 0a 58 2e 53 | ideas, |etc..X.S|
|00004840| 48 20 57 48 41 54 27 53 | 20 42 45 54 54 45 52 0a |H WHAT'S| BETTER.|
|00004850| 58 50 55 52 49 46 59 2c | 20 66 72 6f 6d 20 50 75 |XPURIFY,| from Pu|
|00004860| 72 69 66 79 20 53 79 73 | 74 65 6d 73 2c 20 64 6f |rify Sys|tems, do|
|00004870| 65 73 20 61 20 6d 75 63 | 68 20 62 65 74 74 65 72 |es a muc|h better|
|00004880| 20 6a 6f 62 20 74 68 61 | 6e 20 45 6c 65 63 74 72 | job tha|n Electr|
|00004890| 69 63 20 46 65 6e 63 65 | 2c 20 61 6e 64 0a 58 64 |ic Fence|, and.Xd|
|000048a0| 6f 65 73 20 6d 75 63 68 | 20 6d 6f 72 65 2e 20 49 |oes much| more. I|
|000048b0| 74 27 73 20 61 76 61 69 | 6c 61 62 6c 65 20 61 74 |t's avai|lable at|
|000048c0| 20 74 68 69 73 20 77 72 | 69 74 69 6e 67 20 6f 6e | this wr|iting on|
|000048d0| 20 53 50 41 52 43 20 73 | 79 73 74 65 6d 73 20 6f | SPARC s|ystems o|
|000048e0| 6e 6c 79 2c 20 73 6f 6f | 6e 0a 58 6f 6e 20 48 50 |nly, soo|n.Xon HP|
|000048f0| 2e 20 49 27 6d 20 6e 6f | 74 20 61 66 66 69 6c 69 |. I'm no|t affili|
|00004900| 61 74 65 64 20 77 69 74 | 68 20 50 75 72 69 66 79 |ated wit|h Purify|
|00004910| 2c 20 49 20 6a 75 73 74 | 20 74 68 69 6e 6b 20 69 |, I just| think i|
|00004920| 74 27 73 20 61 20 77 6f | 6e 64 65 72 66 75 6c 20 |t's a wo|nderful |
|00004930| 70 72 6f 64 75 63 74 0a | 58 61 6e 64 20 79 6f 75 |product.|Xand you|
|00004940| 20 73 68 6f 75 6c 64 20 | 63 68 65 63 6b 20 69 74 | should |check it|
|00004950| 20 6f 75 74 2e 0a 45 4e | 44 5f 4f 46 5f 46 49 4c | out..EN|D_OF_FIL|
|00004960| 45 0a 69 66 20 74 65 73 | 74 20 31 34 35 30 38 20 |E.if tes|t 14508 |
|00004970| 2d 6e 65 20 60 77 63 20 | 2d 63 20 3c 27 6c 69 62 |-ne `wc |-c <'lib|
|00004980| 65 66 65 6e 63 65 2e 33 | 27 60 3b 20 74 68 65 6e |efence.3|'`; then|
|00004990| 0a 20 20 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |. ech|o shar: |
|000049a0| 5c 22 27 6c 69 62 65 66 | 65 6e 63 65 2e 33 27 5c |\"'libef|ence.3'\|
|000049b0| 22 20 75 6e 70 61 63 6b | 65 64 20 77 69 74 68 20 |" unpack|ed with |
|000049c0| 77 72 6f 6e 67 20 73 69 | 7a 65 21 0a 66 69 0a 23 |wrong si|ze!.fi.#|
|000049d0| 20 65 6e 64 20 6f 66 20 | 27 6c 69 62 65 66 65 6e | end of |'libefen|
|000049e0| 63 65 2e 33 27 0a 66 69 | 0a 69 66 20 74 65 73 74 |ce.3'.fi|.if test|
|000049f0| 20 2d 66 20 27 4d 61 6b | 65 66 69 6c 65 27 20 2d | -f 'Mak|efile' -|
|00004a00| 61 20 22 24 7b 31 7d 22 | 20 21 3d 20 22 2d 63 22 |a "${1}"| != "-c"|
|00004a10| 20 3b 20 74 68 65 6e 20 | 0a 20 20 65 63 68 6f 20 | ; then |. echo |
|00004a20| 73 68 61 72 3a 20 57 69 | 6c 6c 20 6e 6f 74 20 63 |shar: Wi|ll not c|
|00004a30| 6c 6f 62 62 65 72 20 65 | 78 69 73 74 69 6e 67 20 |lobber e|xisting |
|00004a40| 66 69 6c 65 20 5c 22 27 | 4d 61 6b 65 66 69 6c 65 |file \"'|Makefile|
|00004a50| 27 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |'\".else|.echo sh|
|00004a60| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|00004a70| 22 27 4d 61 6b 65 66 69 | 6c 65 27 5c 22 20 5c 28 |"'Makefi|le'\" \(|
|00004a80| 32 30 30 38 20 63 68 61 | 72 61 63 74 65 72 73 5c |2008 cha|racters\|
|00004a90| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|00004aa0| 27 4d 61 6b 65 66 69 6c | 65 27 20 3c 3c 27 45 4e |'Makefil|e' <<'EN|
|00004ab0| 44 5f 4f 46 5f 46 49 4c | 45 27 0a 58 43 43 3d 20 |D_OF_FIL|E'.XCC= |
|00004ac0| 63 63 0a 58 41 52 3d 20 | 61 72 0a 58 43 50 3d 20 |cc.XAR= |ar.XCP= |
|00004ad0| 63 70 0a 58 4d 56 3d 20 | 6d 76 0a 58 43 48 4d 4f |cp.XMV= |mv.XCHMO|
|00004ae0| 44 3d 20 63 68 6d 6f 64 | 0a 58 43 46 4c 41 47 53 |D= chmod|.XCFLAGS|
|00004af0| 3d 20 2d 67 0a 58 4c 49 | 42 5f 49 4e 53 54 41 4c |= -g.XLI|B_INSTAL|
|00004b00| 4c 5f 44 49 52 3d 20 2f | 75 73 72 2f 6c 6f 63 61 |L_DIR= /|usr/loca|
|00004b10| 6c 2f 6c 69 62 0a 58 4d | 41 4e 5f 49 4e 53 54 41 |l/lib.XM|AN_INSTA|
|00004b20| 4c 4c 5f 44 49 52 3d 20 | 2f 75 73 72 2f 6c 6f 63 |LL_DIR= |/usr/loc|
|00004b30| 61 6c 2f 6d 61 6e 2f 6d | 61 6e 33 0a 58 0a 58 50 |al/man/m|an3.X.XP|
|00004b40| 41 43 4b 41 47 45 5f 53 | 4f 55 52 43 45 3d 20 52 |ACKAGE_S|OURCE= R|
|00004b50| 45 41 44 4d 45 20 6c 69 | 62 65 66 65 6e 63 65 2e |EADME li|befence.|
|00004b60| 33 20 4d 61 6b 65 66 69 | 6c 65 20 65 66 65 6e 63 |3 Makefi|le efenc|
|00004b70| 65 2e 68 20 5c 0a 58 09 | 65 66 65 6e 63 65 2e 63 |e.h \.X.|efence.c|
|00004b80| 20 70 61 67 65 2e 63 20 | 70 72 69 6e 74 2e 63 20 | page.c |print.c |
|00004b90| 65 66 74 65 73 74 2e 63 | 20 74 73 74 68 65 61 70 |eftest.c| tstheap|
|00004ba0| 2e 63 0a 58 0a 58 23 20 | 55 6e 2d 63 6f 6d 6d 65 |.c.X.X# |Un-comme|
|00004bb0| 6e 74 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |nt the f|ollowing|
|00004bc0| 20 69 66 20 79 6f 75 20 | 61 72 65 20 72 75 6e 6e | if you |are runn|
|00004bd0| 69 6e 67 20 48 50 2f 55 | 58 2e 0a 58 23 20 43 46 |ing HP/U|X..X# CF|
|00004be0| 4c 41 47 53 3d 20 2d 41 | 61 20 2d 67 20 2d 44 5f |LAGS= -A|a -g -D_|
|00004bf0| 48 50 55 58 5f 53 4f 55 | 52 43 45 20 2d 44 50 41 |HPUX_SOU|RCE -DPA|
|00004c00| 47 45 5f 50 52 4f 54 45 | 43 54 49 4f 4e 5f 56 49 |GE_PROTE|CTION_VI|
|00004c10| 4f 4c 41 54 45 44 5f 53 | 49 47 4e 41 4c 3d 53 49 |OLATED_S|IGNAL=SI|
|00004c20| 47 42 55 53 0a 58 0a 58 | 23 20 55 6e 2d 63 6f 6d |GBUS.X.X|# Un-com|
|00004c30| 6d 65 6e 74 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |ment the| followi|
|00004c40| 6e 67 20 69 66 20 79 6f | 75 20 61 72 65 20 72 75 |ng if yo|u are ru|
|00004c50| 6e 6e 69 6e 67 20 41 49 | 58 2e 20 54 68 69 73 20 |nning AI|X. This |
|00004c60| 6d 61 6b 65 73 20 73 75 | 72 65 20 79 6f 75 20 77 |makes su|re you w|
|00004c70| 6f 6e 27 74 0a 58 23 20 | 67 65 74 20 74 68 65 20 |on't.X# |get the |
|00004c80| 73 68 61 72 65 64 2d 6c | 69 62 72 61 72 79 20 6d |shared-l|ibrary m|
|00004c90| 61 6c 6c 6f 63 28 29 20 | 72 61 74 68 65 72 20 74 |alloc() |rather t|
|00004ca0| 68 61 6e 20 74 68 65 20 | 45 6c 65 63 74 72 69 63 |han the |Electric|
|00004cb0| 20 46 65 6e 63 65 20 6d | 61 6c 6c 6f 63 28 29 2e | Fence m|alloc().|
|00004cc0| 0a 58 23 20 43 4f 4d 50 | 49 4c 45 20 54 48 45 20 |.X# COMP|ILE THE |
|00004cd0| 50 52 4f 47 52 41 4d 53 | 20 59 4f 55 20 41 52 45 |PROGRAMS| YOU ARE|
|00004ce0| 20 44 45 42 55 47 47 49 | 4e 47 20 57 49 54 48 20 | DEBUGGI|NG WITH |
|00004cf0| 54 48 45 53 45 20 46 4c | 41 47 53 2c 20 54 4f 4f |THESE FL|AGS, TOO|
|00004d00| 2e 0a 58 23 20 43 46 4c | 41 47 53 3d 20 2d 67 20 |..X# CFL|AGS= -g |
|00004d10| 2d 62 6e 73 6f 20 2d 62 | 6e 6f 64 65 6c 63 73 65 |-bnso -b|nodelcse|
|00004d20| 63 74 20 2d 62 49 3a 2f | 6c 69 62 2f 73 79 73 63 |ct -bI:/|lib/sysc|
|00004d30| 61 6c 6c 73 2e 65 78 70 | 0a 58 0a 58 23 20 55 6e |alls.exp|.X.X# Un|
|00004d40| 2d 63 6f 6d 6d 65 6e 74 | 20 74 68 65 20 66 6f 6c |-comment| the fol|
|00004d50| 6c 6f 77 69 6e 67 20 69 | 66 20 79 6f 75 20 61 72 |lowing i|f you ar|
|00004d60| 65 20 72 75 6e 6e 69 6e | 67 20 53 75 6e 4f 53 20 |e runnin|g SunOS |
|00004d70| 34 2e 58 0a 58 23 20 4e | 6f 74 65 20 74 68 65 20 |4.X.X# N|ote the |
|00004d80| 64 65 66 69 6e 69 74 69 | 6f 6e 20 6f 66 20 50 41 |definiti|on of PA|
|00004d90| 47 45 5f 50 52 4f 54 45 | 43 54 49 4f 4e 5f 56 49 |GE_PROTE|CTION_VI|
|00004da0| 4f 4c 41 54 45 44 5f 53 | 49 47 4e 41 4c 2e 20 54 |OLATED_S|IGNAL. T|
|00004db0| 68 69 73 20 6d 61 79 20 | 76 61 72 79 0a 58 23 20 |his may |vary.X# |
|00004dc0| 64 65 70 65 6e 64 20 6f | 6e 20 77 68 61 74 20 76 |depend o|n what v|
|00004dd0| 65 72 73 69 6f 6e 20 6f | 66 20 53 75 6e 20 68 61 |ersion o|f Sun ha|
|00004de0| 72 64 77 61 72 65 20 79 | 6f 75 20 68 61 76 65 2e |rdware y|ou have.|
|00004df0| 0a 58 23 20 59 6f 75 27 | 6c 6c 20 70 72 6f 62 61 |.X# You'|ll proba|
|00004e00| 62 6c 79 20 68 61 76 65 | 20 74 6f 20 6c 69 6e 6b |bly have| to link|
|00004e10| 20 74 68 65 20 70 72 6f | 67 72 61 6d 20 79 6f 75 | the pro|gram you|
|00004e20| 20 61 72 65 20 64 65 62 | 75 67 67 69 6e 67 20 77 | are deb|ugging w|
|00004e30| 69 74 68 20 2d 42 73 74 | 61 74 69 63 2c 0a 58 23 |ith -Bst|atic,.X#|
|00004e40| 20 61 73 20 77 65 6c 6c | 2e 0a 58 23 20 43 46 4c | as well|..X# CFL|
|00004e50| 41 47 53 3d 20 2d 67 20 | 2d 42 73 74 61 74 69 63 |AGS= -g |-Bstatic|
|00004e60| 20 2d 44 50 41 47 45 5f | 50 52 4f 54 45 43 54 49 | -DPAGE_|PROTECTI|
|00004e70| 4f 4e 5f 56 49 4f 4c 41 | 54 45 44 5f 53 49 47 4e |ON_VIOLA|TED_SIGN|
|00004e80| 41 4c 3d 53 49 47 42 55 | 53 0a 58 0a 58 4f 42 4a |AL=SIGBU|S.X.XOBJ|
|00004e90| 45 43 54 53 3d 20 65 66 | 65 6e 63 65 2e 6f 20 70 |ECTS= ef|ence.o p|
|00004ea0| 61 67 65 2e 6f 20 70 72 | 69 6e 74 2e 6f 0a 58 0a |age.o pr|int.o.X.|
|00004eb0| 58 61 6c 6c 3a 09 6c 69 | 62 65 66 65 6e 63 65 2e |Xall:.li|befence.|
|00004ec0| 61 20 74 73 74 68 65 61 | 70 20 65 66 74 65 73 74 |a tsthea|p eftest|
|00004ed0| 0a 58 09 40 20 65 63 68 | 6f 0a 58 09 40 20 65 63 |.X.@ ech|o.X.@ ec|
|00004ee0| 68 6f 20 22 54 65 73 74 | 69 6e 67 20 45 6c 65 63 |ho "Test|ing Elec|
|00004ef0| 74 72 69 63 20 46 65 6e | 63 65 2e 22 0a 58 09 40 |tric Fen|ce.".X.@|
|00004f00| 20 65 63 68 6f 20 22 41 | 66 74 65 72 20 74 68 65 | echo "A|fter the|
|00004f10| 20 6c 61 73 74 20 74 65 | 73 74 2c 20 69 74 20 73 | last te|st, it s|
|00004f20| 68 6f 75 6c 64 20 70 72 | 69 6e 74 20 74 68 61 74 |hould pr|int that|
|00004f30| 20 74 68 65 20 74 65 73 | 74 20 68 61 73 20 50 41 | the tes|t has PA|
|00004f40| 53 53 45 44 2e 22 0a 58 | 09 2e 2f 65 66 74 65 73 |SSED.".X|../eftes|
|00004f50| 74 0a 58 09 2e 2f 74 73 | 74 68 65 61 70 20 33 30 |t.X../ts|theap 30|
|00004f60| 37 32 0a 58 09 40 20 65 | 63 68 6f 0a 58 09 40 20 |72.X.@ e|cho.X.@ |
|00004f70| 65 63 68 6f 20 22 45 6c | 65 63 74 72 69 63 20 46 |echo "El|ectric F|
|00004f80| 65 6e 63 65 20 63 6f 6e | 66 69 64 65 6e 63 65 20 |ence con|fidence |
|00004f90| 74 65 73 74 20 50 41 53 | 53 45 44 2e 22 20 0a 58 |test PAS|SED." .X|
|00004fa0| 09 40 20 65 63 68 6f 0a | 58 0a 58 69 6e 73 74 61 |.@ echo.|X.Xinsta|
|00004fb0| 6c 6c 3a 20 6c 69 62 65 | 66 65 6e 63 65 2e 61 20 |ll: libe|fence.a |
|00004fc0| 6c 69 62 65 66 65 6e 63 | 65 2e 33 0a 58 09 24 28 |libefenc|e.3.X.$(|
|00004fd0| 4d 56 29 20 6c 69 62 65 | 66 65 6e 63 65 2e 61 20 |MV) libe|fence.a |
|00004fe0| 24 28 4c 49 42 5f 49 4e | 53 54 41 4c 4c 5f 44 49 |$(LIB_IN|STALL_DI|
|00004ff0| 52 29 0a 58 09 24 28 43 | 48 4d 4f 44 29 20 36 34 |R).X.$(C|HMOD) 64|
|00005000| 34 20 24 28 4c 49 42 5f | 49 4e 53 54 41 4c 4c 5f |4 $(LIB_|INSTALL_|
|00005010| 44 49 52 29 2f 6c 69 62 | 65 66 65 6e 63 65 2e 61 |DIR)/lib|efence.a|
|00005020| 0a 58 09 24 28 43 50 29 | 20 6c 69 62 65 66 65 6e |.X.$(CP)| libefen|
|00005030| 63 65 2e 33 20 24 28 4d | 41 4e 5f 49 4e 53 54 41 |ce.3 $(M|AN_INSTA|
|00005040| 4c 4c 5f 44 49 52 29 0a | 58 09 24 28 43 48 4d 4f |LL_DIR).|X.$(CHMO|
|00005050| 44 29 20 36 34 34 20 24 | 28 4d 41 4e 5f 49 4e 53 |D) 644 $|(MAN_INS|
|00005060| 54 41 4c 4c 5f 44 49 52 | 29 2f 6c 69 62 65 66 65 |TALL_DIR|)/libefe|
|00005070| 6e 63 65 2e 33 0a 58 0a | 58 63 6c 65 61 6e 3a 0a |nce.3.X.|Xclean:.|
|00005080| 58 09 2d 20 72 6d 20 2d | 66 20 24 28 4f 42 4a 45 |X.- rm -|f $(OBJE|
|00005090| 43 54 53 29 20 74 73 74 | 68 65 61 70 2e 6f 20 65 |CTS) tst|heap.o e|
|000050a0| 66 74 65 73 74 2e 6f 20 | 74 73 74 68 65 61 70 20 |ftest.o |tstheap |
|000050b0| 65 66 74 65 73 74 20 6c | 69 62 65 66 65 6e 63 65 |eftest l|ibefence|
|000050c0| 2e 61 20 5c 0a 58 09 20 | 6c 69 62 65 66 65 6e 63 |.a \.X. |libefenc|
|000050d0| 65 2e 63 61 74 20 45 6c | 65 63 74 72 69 63 46 65 |e.cat El|ectricFe|
|000050e0| 6e 63 65 2e 73 68 61 72 | 0a 58 0a 58 72 6f 66 66 |nce.shar|.X.Xroff|
|000050f0| 3a 0a 58 09 6e 72 6f 66 | 66 20 2d 6d 61 6e 20 3c |:.X.nrof|f -man <|
|00005100| 20 6c 69 62 65 66 65 6e | 63 65 2e 33 20 3e 20 6c | libefen|ce.3 > l|
|00005110| 69 62 65 66 65 6e 63 65 | 2e 63 61 74 0a 58 0a 58 |ibefence|.cat.X.X|
|00005120| 0a 58 45 6c 65 63 74 72 | 69 63 46 65 6e 63 65 2e |.XElectr|icFence.|
|00005130| 73 68 61 72 3a 20 24 28 | 50 41 43 4b 41 47 45 5f |shar: $(|PACKAGE_|
|00005140| 53 4f 55 52 43 45 29 0a | 58 09 73 68 61 72 20 24 |SOURCE).|X.shar $|
|00005150| 28 50 41 43 4b 41 47 45 | 5f 53 4f 55 52 43 45 29 |(PACKAGE|_SOURCE)|
|00005160| 20 3e 20 45 6c 65 63 74 | 72 69 63 46 65 6e 63 65 | > Elect|ricFence|
|00005170| 2e 73 68 61 72 0a 58 0a | 58 73 68 61 72 3a 20 45 |.shar.X.|Xshar: E|
|00005180| 6c 65 63 74 72 69 63 46 | 65 6e 63 65 2e 73 68 61 |lectricF|ence.sha|
|00005190| 72 0a 58 0a 58 6c 69 62 | 65 66 65 6e 63 65 2e 61 |r.X.Xlib|efence.a|
|000051a0| 3a 20 24 28 4f 42 4a 45 | 43 54 53 29 0a 58 09 2d |: $(OBJE|CTS).X.-|
|000051b0| 20 72 6d 20 2d 66 20 6c | 69 62 65 66 65 6e 63 65 | rm -f l|ibefence|
|000051c0| 2e 61 0a 58 09 24 28 41 | 52 29 20 63 72 76 20 6c |.a.X.$(A|R) crv l|
|000051d0| 69 62 65 66 65 6e 63 65 | 2e 61 20 24 28 4f 42 4a |ibefence|.a $(OBJ|
|000051e0| 45 43 54 53 29 0a 58 0a | 58 74 73 74 68 65 61 70 |ECTS).X.|Xtstheap|
|000051f0| 3a 20 6c 69 62 65 66 65 | 6e 63 65 2e 61 20 74 73 |: libefe|nce.a ts|
|00005200| 74 68 65 61 70 2e 6f 0a | 58 09 2d 20 72 6d 20 2d |theap.o.|X.- rm -|
|00005210| 66 20 74 73 74 68 65 61 | 70 0a 58 09 24 28 43 43 |f tsthea|p.X.$(CC|
|00005220| 29 20 24 28 43 46 4c 41 | 47 53 29 20 74 73 74 68 |) $(CFLA|GS) tsth|
|00005230| 65 61 70 2e 6f 20 6c 69 | 62 65 66 65 6e 63 65 2e |eap.o li|befence.|
|00005240| 61 20 2d 6f 20 74 73 74 | 68 65 61 70 0a 58 0a 58 |a -o tst|heap.X.X|
|00005250| 65 66 74 65 73 74 3a 20 | 6c 69 62 65 66 65 6e 63 |eftest: |libefenc|
|00005260| 65 2e 61 20 65 66 74 65 | 73 74 2e 6f 0a 58 09 2d |e.a efte|st.o.X.-|
|00005270| 20 72 6d 20 2d 66 20 65 | 66 74 65 73 74 0a 58 09 | rm -f e|ftest.X.|
|00005280| 24 28 43 43 29 20 24 28 | 43 46 4c 41 47 53 29 20 |$(CC) $(|CFLAGS) |
|00005290| 65 66 74 65 73 74 2e 6f | 20 6c 69 62 65 66 65 6e |eftest.o| libefen|
|000052a0| 63 65 2e 61 20 2d 6f 20 | 65 66 74 65 73 74 0a 58 |ce.a -o |eftest.X|
|000052b0| 0a 58 24 28 4f 42 4a 45 | 43 54 53 29 20 74 73 74 |.X$(OBJE|CTS) tst|
|000052c0| 68 65 61 70 2e 6f 20 65 | 66 74 65 73 74 2e 6f 3a |heap.o e|ftest.o:|
|000052d0| 20 65 66 65 6e 63 65 2e | 68 0a 45 4e 44 5f 4f 46 | efence.|h.END_OF|
|000052e0| 5f 46 49 4c 45 0a 69 66 | 20 74 65 73 74 20 32 30 |_FILE.if| test 20|
|000052f0| 30 38 20 2d 6e 65 20 60 | 77 63 20 2d 63 20 3c 27 |08 -ne `|wc -c <'|
|00005300| 4d 61 6b 65 66 69 6c 65 | 27 60 3b 20 74 68 65 6e |Makefile|'`; then|
|00005310| 0a 20 20 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |. ech|o shar: |
|00005320| 5c 22 27 4d 61 6b 65 66 | 69 6c 65 27 5c 22 20 75 |\"'Makef|ile'\" u|
|00005330| 6e 70 61 63 6b 65 64 20 | 77 69 74 68 20 77 72 6f |npacked |with wro|
|00005340| 6e 67 20 73 69 7a 65 21 | 0a 66 69 0a 23 20 65 6e |ng size!|.fi.# en|
|00005350| 64 20 6f 66 20 27 4d 61 | 6b 65 66 69 6c 65 27 0a |d of 'Ma|kefile'.|
|00005360| 66 69 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 65 |fi.if te|st -f 'e|
|00005370| 66 65 6e 63 65 2e 68 27 | 20 2d 61 20 22 24 7b 31 |fence.h'| -a "${1|
|00005380| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00005390| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|000053a0| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|000053b0| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|000053c0| 22 27 65 66 65 6e 63 65 | 2e 68 27 5c 22 0a 65 6c |"'efence|.h'\".el|
|000053d0| 73 65 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 45 78 |se.echo |shar: Ex|
|000053e0| 74 72 61 63 74 69 6e 67 | 20 5c 22 27 65 66 65 6e |tracting| \"'efen|
|000053f0| 63 65 2e 68 27 5c 22 20 | 5c 28 35 34 31 20 63 68 |ce.h'\" |\(541 ch|
|00005400| 61 72 61 63 74 65 72 73 | 5c 29 0a 73 65 64 20 22 |aracters|\).sed "|
|00005410| 73 2f 5e 58 2f 2f 22 20 | 3e 27 65 66 65 6e 63 65 |s/^X//" |>'efence|
|00005420| 2e 68 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |.h' <<'E|ND_OF_FI|
|00005430| 4c 45 27 0a 58 23 69 6e | 63 6c 75 64 65 20 3c 73 |LE'.X#in|clude <s|
|00005440| 79 73 2f 74 79 70 65 73 | 2e 68 3e 0a 58 0a 58 2f |ys/types|.h>.X.X/|
|00005450| 2a 0a 58 20 2a 20 54 68 | 69 73 20 69 73 20 75 73 |*.X * Th|is is us|
|00005460| 65 64 20 74 6f 20 64 65 | 63 6c 61 72 65 20 66 75 |ed to de|clare fu|
|00005470| 6e 63 74 69 6f 6e 73 20 | 77 69 74 68 20 22 43 22 |nctions |with "C"|
|00005480| 20 6c 69 6e 6b 61 67 65 | 20 69 66 20 77 65 20 61 | linkage| if we a|
|00005490| 72 65 20 63 6f 6d 70 69 | 6c 69 6e 67 0a 58 20 2a |re compi|ling.X *|
|000054a0| 20 77 69 74 68 20 43 2b | 2b 20 2e 0a 58 20 2a 2f | with C+|+ ..X */|
|000054b0| 0a 58 23 69 66 64 65 66 | 09 5f 5f 63 70 6c 75 73 |.X#ifdef|.__cplus|
|000054c0| 70 6c 75 73 0a 58 23 64 | 65 66 69 6e 65 09 43 5f |plus.X#d|efine.C_|
|000054d0| 4c 49 4e 4b 41 47 45 09 | 22 43 22 0a 58 23 65 6c |LINKAGE.|"C".X#el|
|000054e0| 73 65 0a 58 23 64 65 66 | 69 6e 65 09 43 5f 4c 49 |se.X#def|ine.C_LI|
|000054f0| 4e 4b 41 47 45 0a 58 23 | 65 6e 64 69 66 0a 58 0a |NKAGE.X#|endif.X.|
|00005500| 58 76 6f 69 64 09 09 09 | 50 61 67 65 5f 41 6c 6c |Xvoid...|Page_All|
|00005510| 6f 77 41 63 63 65 73 73 | 28 76 6f 69 64 20 2a 20 |owAccess|(void * |
|00005520| 61 64 64 72 65 73 73 2c | 20 73 69 7a 65 5f 74 20 |address,| size_t |
|00005530| 73 69 7a 65 29 3b 0a 58 | 76 6f 69 64 20 2a 09 09 |size);.X|void *..|
|00005540| 09 50 61 67 65 5f 43 72 | 65 61 74 65 28 73 69 7a |.Page_Cr|eate(siz|
|00005550| 65 5f 74 20 73 69 7a 65 | 29 3b 0a 58 76 6f 69 64 |e_t size|);.Xvoid|
|00005560| 09 09 09 50 61 67 65 5f | 44 65 6c 65 74 65 28 76 |...Page_|Delete(v|
|00005570| 6f 69 64 20 2a 20 61 64 | 64 72 65 73 73 2c 20 73 |oid * ad|dress, s|
|00005580| 69 7a 65 5f 74 20 73 69 | 7a 65 29 3b 0a 58 76 6f |ize_t si|ze);.Xvo|
|00005590| 69 64 09 09 09 50 61 67 | 65 5f 44 65 6e 79 41 63 |id...Pag|e_DenyAc|
|000055a0| 63 65 73 73 28 76 6f 69 | 64 20 2a 20 61 64 64 72 |cess(voi|d * addr|
|000055b0| 65 73 73 2c 20 73 69 7a | 65 5f 74 20 73 69 7a 65 |ess, siz|e_t size|
|000055c0| 29 3b 0a 58 73 69 7a 65 | 5f 74 09 09 09 50 61 67 |);.Xsize|_t...Pag|
|000055d0| 65 5f 53 69 7a 65 28 76 | 6f 69 64 29 3b 0a 58 0a |e_Size(v|oid);.X.|
|000055e0| 58 76 6f 69 64 09 09 09 | 45 46 5f 41 62 6f 72 74 |Xvoid...|EF_Abort|
|000055f0| 28 63 6f 6e 73 74 20 63 | 68 61 72 20 2a 20 6d 65 |(const c|har * me|
|00005600| 73 73 61 67 65 2c 20 2e | 2e 2e 29 3b 0a 58 76 6f |ssage, .|..);.Xvo|
|00005610| 69 64 09 09 09 45 46 5f | 45 78 69 74 28 63 6f 6e |id...EF_|Exit(con|
|00005620| 73 74 20 63 68 61 72 20 | 2a 20 6d 65 73 73 61 67 |st char |* messag|
|00005630| 65 2c 20 2e 2e 2e 29 3b | 0a 58 76 6f 69 64 09 09 |e, ...);|.Xvoid..|
|00005640| 09 45 46 5f 50 72 69 6e | 74 28 63 6f 6e 73 74 20 |.EF_Prin|t(const |
|00005650| 63 68 61 72 20 2a 20 6d | 65 73 73 61 67 65 2c 20 |char * m|essage, |
|00005660| 2e 2e 2e 29 3b 0a 45 4e | 44 5f 4f 46 5f 46 49 4c |...);.EN|D_OF_FIL|
|00005670| 45 0a 69 66 20 74 65 73 | 74 20 35 34 31 20 2d 6e |E.if tes|t 541 -n|
|00005680| 65 20 60 77 63 20 2d 63 | 20 3c 27 65 66 65 6e 63 |e `wc -c| <'efenc|
|00005690| 65 2e 68 27 60 3b 20 74 | 68 65 6e 0a 20 20 20 20 |e.h'`; t|hen. |
|000056a0| 65 63 68 6f 20 73 68 61 | 72 3a 20 5c 22 27 65 66 |echo sha|r: \"'ef|
|000056b0| 65 6e 63 65 2e 68 27 5c | 22 20 75 6e 70 61 63 6b |ence.h'\|" unpack|
|000056c0| 65 64 20 77 69 74 68 20 | 77 72 6f 6e 67 20 73 69 |ed with |wrong si|
|000056d0| 7a 65 21 0a 66 69 0a 23 | 20 65 6e 64 20 6f 66 20 |ze!.fi.#| end of |
|000056e0| 27 65 66 65 6e 63 65 2e | 68 27 0a 66 69 0a 69 66 |'efence.|h'.fi.if|
|000056f0| 20 74 65 73 74 20 2d 66 | 20 27 65 66 65 6e 63 65 | test -f| 'efence|
|00005700| 2e 63 27 20 2d 61 20 22 | 24 7b 31 7d 22 20 21 3d |.c' -a "|${1}" !=|
|00005710| 20 22 2d 63 22 20 3b 20 | 74 68 65 6e 20 0a 20 20 | "-c" ; |then . |
|00005720| 65 63 68 6f 20 73 68 61 | 72 3a 20 57 69 6c 6c 20 |echo sha|r: Will |
|00005730| 6e 6f 74 20 63 6c 6f 62 | 62 65 72 20 65 78 69 73 |not clob|ber exis|
|00005740| 74 69 6e 67 20 66 69 6c | 65 20 5c 22 27 65 66 65 |ting fil|e \"'efe|
|00005750| 6e 63 65 2e 63 27 5c 22 | 0a 65 6c 73 65 0a 65 63 |nce.c'\"|.else.ec|
|00005760| 68 6f 20 73 68 61 72 3a | 20 45 78 74 72 61 63 74 |ho shar:| Extract|
|00005770| 69 6e 67 20 5c 22 27 65 | 66 65 6e 63 65 2e 63 27 |ing \"'e|fence.c'|
|00005780| 5c 22 20 5c 28 32 32 34 | 38 31 20 63 68 61 72 61 |\" \(224|81 chara|
|00005790| 63 74 65 72 73 5c 29 0a | 73 65 64 20 22 73 2f 5e |cters\).|sed "s/^|
|000057a0| 58 2f 2f 22 20 3e 27 65 | 66 65 6e 63 65 2e 63 27 |X//" >'e|fence.c'|
|000057b0| 20 3c 3c 27 45 4e 44 5f | 4f 46 5f 46 49 4c 45 27 | <<'END_|OF_FILE'|
|000057c0| 0a 58 2f 2a 0a 58 20 2a | 20 45 6c 65 63 74 72 69 |.X/*.X *| Electri|
|000057d0| 63 20 46 65 6e 63 65 20 | 2d 20 52 65 64 2d 5a 6f |c Fence |- Red-Zo|
|000057e0| 6e 65 20 6d 65 6d 6f 72 | 79 20 61 6c 6c 6f 63 61 |ne memor|y alloca|
|000057f0| 74 6f 72 2e 0a 58 20 2a | 20 42 72 75 63 65 20 50 |tor..X *| Bruce P|
|00005800| 65 72 65 6e 73 2c 20 31 | 39 38 38 2c 20 31 39 39 |erens, 1|988, 199|
|00005810| 33 0a 58 20 2a 20 0a 58 | 20 2a 20 54 68 69 73 20 |3.X * .X| * This |
|00005820| 69 73 20 61 20 73 70 65 | 63 69 61 6c 20 76 65 72 |is a spe|cial ver|
|00005830| 73 69 6f 6e 20 6f 66 20 | 6d 61 6c 6c 6f 63 28 29 |sion of |malloc()|
|00005840| 20 61 6e 64 20 63 6f 6d | 70 61 6e 79 20 66 6f 72 | and com|pany for|
|00005850| 20 64 65 62 75 67 67 69 | 6e 67 20 73 6f 66 74 77 | debuggi|ng softw|
|00005860| 61 72 65 0a 58 20 2a 20 | 74 68 61 74 20 69 73 20 |are.X * |that is |
|00005870| 73 75 73 70 65 63 74 65 | 64 20 6f 66 20 6f 76 65 |suspecte|d of ove|
|00005880| 72 72 75 6e 6e 69 6e 67 | 20 6f 72 20 75 6e 64 65 |rrunning| or unde|
|00005890| 72 72 75 6e 6e 69 6e 67 | 20 74 68 65 20 62 6f 75 |rrunning| the bou|
|000058a0| 6e 64 61 72 69 65 73 20 | 6f 66 20 61 0a 58 20 2a |ndaries |of a.X *|
|000058b0| 20 6d 61 6c 6c 6f 63 20 | 62 75 66 66 65 72 2c 20 | malloc |buffer, |
|000058c0| 6f 72 20 74 6f 75 63 68 | 69 6e 67 20 66 72 65 65 |or touch|ing free|
|000058d0| 20 6d 65 6d 6f 72 79 2e | 0a 58 20 2a 0a 58 20 2a | memory.|.X *.X *|
|000058e0| 20 49 74 20 61 72 72 61 | 6e 67 65 73 20 66 6f 72 | It arra|nges for|
|000058f0| 20 65 61 63 68 20 6d 61 | 6c 6c 6f 63 20 62 75 66 | each ma|lloc buf|
|00005900| 66 65 72 20 74 6f 20 62 | 65 20 66 6f 6c 6c 6f 77 |fer to b|e follow|
|00005910| 65 64 20 28 6f 72 20 70 | 72 65 63 65 64 65 64 29 |ed (or p|receded)|
|00005920| 0a 58 20 2a 20 69 6e 20 | 74 68 65 20 61 64 64 72 |.X * in |the addr|
|00005930| 65 73 73 20 73 70 61 63 | 65 20 62 79 20 61 6e 20 |ess spac|e by an |
|00005940| 69 6e 61 63 63 65 73 73 | 61 62 6c 65 20 76 69 72 |inaccess|able vir|
|00005950| 74 75 61 6c 20 6d 65 6d | 6f 72 79 20 70 61 67 65 |tual mem|ory page|
|00005960| 2c 0a 58 20 2a 20 61 6e | 64 20 66 6f 72 20 66 72 |,.X * an|d for fr|
|00005970| 65 65 20 6d 65 6d 6f 72 | 79 20 74 6f 20 62 65 20 |ee memor|y to be |
|00005980| 69 6e 61 63 63 65 73 73 | 61 62 6c 65 2e 20 49 66 |inaccess|able. If|
|00005990| 20 73 6f 66 74 77 61 72 | 65 20 74 6f 75 63 68 65 | softwar|e touche|
|000059a0| 73 20 74 68 65 0a 58 20 | 2a 20 69 6e 61 63 63 65 |s the.X |* inacce|
|000059b0| 73 73 61 62 6c 65 20 70 | 61 67 65 2c 20 69 74 20 |ssable p|age, it |
|000059c0| 77 69 6c 6c 20 67 65 74 | 20 61 6e 20 69 6d 6d 65 |will get| an imme|
|000059d0| 64 69 61 74 65 20 73 65 | 67 6d 65 6e 74 61 74 69 |diate se|gmentati|
|000059e0| 6f 6e 0a 58 20 2a 20 66 | 61 75 6c 74 2e 20 49 74 |on.X * f|ault. It|
|000059f0| 20 69 73 20 74 68 65 6e | 20 74 72 69 76 69 61 6c | is then| trivial|
|00005a00| 20 74 6f 20 75 6e 63 6f | 76 65 72 20 74 68 65 20 | to unco|ver the |
|00005a10| 6f 66 66 65 6e 64 69 6e | 67 20 63 6f 64 65 20 75 |offendin|g code u|
|00005a20| 73 69 6e 67 20 61 20 64 | 65 62 75 67 67 65 72 2e |sing a d|ebugger.|
|00005a30| 0a 58 20 2a 0a 58 20 2a | 20 41 6e 20 61 64 76 61 |.X *.X *| An adva|
|00005a40| 6e 74 61 67 65 20 6f 66 | 20 74 68 69 73 20 70 72 |ntage of| this pr|
|00005a50| 6f 64 75 63 74 20 6f 76 | 65 72 20 6d 6f 73 74 20 |oduct ov|er most |
|00005a60| 6d 61 6c 6c 6f 63 20 64 | 65 62 75 67 67 65 72 73 |malloc d|ebuggers|
|00005a70| 20 69 73 20 74 68 61 74 | 20 74 68 69 73 20 6f 6e | is that| this on|
|00005a80| 65 0a 58 20 2a 20 64 65 | 74 65 63 74 73 20 72 65 |e.X * de|tects re|
|00005a90| 61 64 69 6e 67 20 6f 75 | 74 20 6f 66 20 62 6f 75 |ading ou|t of bou|
|00005aa0| 6e 64 73 20 61 73 20 77 | 65 6c 6c 20 61 73 20 77 |nds as w|ell as w|
|00005ab0| 72 69 74 69 6e 67 2c 20 | 61 6e 64 20 74 68 69 73 |riting, |and this|
|00005ac0| 20 6f 6e 65 20 73 74 6f | 70 73 20 6f 6e 0a 58 20 | one sto|ps on.X |
|00005ad0| 2a 20 74 68 65 20 65 78 | 61 63 74 20 69 6e 73 74 |* the ex|act inst|
|00005ae0| 72 75 63 74 69 6f 6e 20 | 74 68 61 74 20 63 61 75 |ruction |that cau|
|00005af0| 73 65 73 20 74 68 65 20 | 65 72 72 6f 72 2c 20 72 |ses the |error, r|
|00005b00| 61 74 68 65 72 20 74 68 | 61 6e 20 77 61 69 74 69 |ather th|an waiti|
|00005b10| 6e 67 20 75 6e 74 69 6c | 20 74 68 65 0a 58 20 2a |ng until| the.X *|
|00005b20| 20 6e 65 78 74 20 62 6f | 75 6e 64 61 72 79 20 63 | next bo|undary c|
|00005b30| 68 65 63 6b 2e 0a 58 20 | 2a 0a 58 20 2a 20 54 68 |heck..X |*.X * Th|
|00005b40| 65 72 65 20 69 73 20 6f | 6e 65 20 70 72 6f 64 75 |ere is o|ne produ|
|00005b50| 63 74 20 74 68 61 74 20 | 64 65 62 75 67 73 20 6d |ct that |debugs m|
|00005b60| 61 6c 6c 6f 63 20 62 75 | 66 66 65 72 20 6f 76 65 |alloc bu|ffer ove|
|00005b70| 72 72 75 6e 73 0a 58 20 | 2a 20 62 65 74 74 65 72 |rruns.X |* better|
|00005b80| 20 74 68 61 6e 20 45 6c | 65 63 74 72 69 63 20 46 | than El|ectric F|
|00005b90| 65 6e 63 65 3a 20 22 50 | 75 72 69 66 79 22 20 66 |ence: "P|urify" f|
|00005ba0| 72 6f 6d 20 50 75 72 69 | 66 79 20 53 79 73 74 65 |rom Puri|fy Syste|
|00005bb0| 6d 73 2c 20 61 6e 64 20 | 74 68 61 74 27 73 20 6f |ms, and |that's o|
|00005bc0| 6e 6c 79 0a 58 20 2a 20 | 61 20 73 6d 61 6c 6c 20 |nly.X * |a small |
|00005bd0| 70 61 72 74 20 6f 66 20 | 77 68 61 74 20 50 75 72 |part of |what Pur|
|00005be0| 69 66 79 20 64 6f 65 73 | 2e 20 49 27 6d 20 6e 6f |ify does|. I'm no|
|00005bf0| 74 20 61 66 66 69 6c 69 | 61 74 65 64 20 77 69 74 |t affili|ated wit|
|00005c00| 68 20 50 75 72 69 66 79 | 2c 20 49 20 6a 75 73 74 |h Purify|, I just|
|00005c10| 0a 58 20 2a 20 72 65 73 | 70 65 63 74 20 61 20 6a |.X * res|pect a j|
|00005c20| 6f 62 20 77 65 6c 6c 20 | 64 6f 6e 65 2e 0a 58 20 |ob well |done..X |
|00005c30| 2a 0a 58 20 2a 20 54 68 | 69 73 20 76 65 72 73 69 |*.X * Th|is versi|
|00005c40| 6f 6e 20 6f 66 20 6d 61 | 6c 6c 6f 63 28 29 20 73 |on of ma|lloc() s|
|00005c50| 68 6f 75 6c 64 20 6e 6f | 74 20 62 65 20 6c 69 6e |hould no|t be lin|
|00005c60| 6b 65 64 20 69 6e 74 6f | 20 70 72 6f 64 75 63 74 |ked into| product|
|00005c70| 69 6f 6e 20 73 6f 66 74 | 77 61 72 65 2c 0a 58 20 |ion soft|ware,.X |
|00005c80| 2a 20 73 69 6e 63 65 20 | 69 74 20 74 72 65 6d 65 |* since |it treme|
|00005c90| 6e 64 6f 75 73 6c 79 20 | 69 6e 63 72 65 61 73 65 |ndously |increase|
|00005ca0| 73 20 74 68 65 20 74 69 | 6d 65 20 61 6e 64 20 6d |s the ti|me and m|
|00005cb0| 65 6d 6f 72 79 20 6f 76 | 65 72 68 65 61 64 20 6f |emory ov|erhead o|
|00005cc0| 66 20 6d 61 6c 6c 6f 63 | 28 29 2e 0a 58 20 2a 20 |f malloc|()..X * |
|00005cd0| 45 61 63 68 20 6d 61 6c | 6c 6f 63 20 62 75 66 66 |Each mal|loc buff|
|00005ce0| 65 72 20 77 69 6c 6c 20 | 63 6f 6e 73 75 6d 65 20 |er will |consume |
|00005cf0| 61 20 6d 69 6e 69 6d 75 | 6d 20 6f 66 20 74 77 6f |a minimu|m of two|
|00005d00| 20 76 69 72 74 75 61 6c | 20 6d 65 6d 6f 72 79 20 | virtual| memory |
|00005d10| 70 61 67 65 73 2c 0a 58 | 20 2a 20 74 68 69 73 20 |pages,.X| * this |
|00005d20| 69 73 20 31 36 20 6b 69 | 6c 6f 62 79 74 65 73 20 |is 16 ki|lobytes |
|00005d30| 6f 6e 20 6d 61 6e 79 20 | 73 79 73 74 65 6d 73 2e |on many |systems.|
|00005d40| 20 4f 6e 20 73 6f 6d 65 | 20 73 79 73 74 65 6d 73 | On some| systems|
|00005d50| 20 69 74 20 77 69 6c 6c | 20 62 65 20 6e 65 63 65 | it will| be nece|
|00005d60| 73 73 61 72 79 0a 58 20 | 2a 20 74 6f 20 69 6e 63 |ssary.X |* to inc|
|00005d70| 72 65 61 73 65 20 74 68 | 65 20 61 6d 6f 75 6e 74 |rease th|e amount|
|00005d80| 20 6f 66 20 73 77 61 70 | 20 73 70 61 63 65 20 69 | of swap| space i|
|00005d90| 6e 20 6f 72 64 65 72 20 | 74 6f 20 64 65 62 75 67 |n order |to debug|
|00005da0| 20 6c 61 72 67 65 20 70 | 72 6f 67 72 61 6d 73 20 | large p|rograms |
|00005db0| 74 68 61 74 0a 58 20 2a | 20 70 65 72 66 6f 72 6d |that.X *| perform|
|00005dc0| 20 6c 6f 74 73 20 6f 66 | 20 61 6c 6c 6f 63 61 74 | lots of| allocat|
|00005dd0| 69 6f 6e 2c 20 62 65 63 | 61 75 73 65 20 6f 66 20 |ion, bec|ause of |
|00005de0| 74 68 65 20 70 65 72 2d | 62 75 66 66 65 72 20 6f |the per-|buffer o|
|00005df0| 76 65 72 68 65 61 64 2e | 0a 58 20 2a 2f 0a 58 23 |verhead.|.X */.X#|
|00005e00| 69 6e 63 6c 75 64 65 20 | 22 65 66 65 6e 63 65 2e |include |"efence.|
|00005e10| 68 22 0a 58 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |h".X#inc|lude <st|
|00005e20| 64 6c 69 62 2e 68 3e 0a | 58 23 69 6e 63 6c 75 64 |dlib.h>.|X#includ|
|00005e30| 65 20 3c 75 6e 69 73 74 | 64 2e 68 3e 0a 58 23 69 |e <unist|d.h>.X#i|
|00005e40| 6e 63 6c 75 64 65 20 3c | 6d 65 6d 6f 72 79 2e 68 |nclude <|memory.h|
|00005e50| 3e 0a 58 23 69 6e 63 6c | 75 64 65 20 3c 73 74 72 |>.X#incl|ude <str|
|00005e60| 69 6e 67 2e 68 3e 0a 58 | 0a 58 73 74 61 74 69 63 |ing.h>.X|.Xstatic|
|00005e70| 20 63 6f 6e 73 74 20 63 | 68 61 72 09 76 65 72 73 | const c|har.vers|
|00005e80| 69 6f 6e 5b 5d 20 3d 20 | 22 5c 6e 20 20 45 6c 65 |ion[] = |"\n Ele|
|00005e90| 63 74 72 69 63 20 46 65 | 6e 63 65 20 32 2e 30 2e |ctric Fe|nce 2.0.|
|00005ea0| 31 22 0a 58 20 22 20 43 | 6f 70 79 72 69 67 68 74 |1".X " C|opyright|
|00005eb0| 20 28 43 29 20 31 39 38 | 37 2d 31 39 39 33 20 42 | (C) 198|7-1993 B|
|00005ec0| 72 75 63 65 20 50 65 72 | 65 6e 73 2e 5c 6e 22 3b |ruce Per|ens.\n";|
|00005ed0| 0a 58 0a 58 2f 2a 0a 58 | 20 2a 20 4d 45 4d 4f 52 |.X.X/*.X| * MEMOR|
|00005ee0| 59 5f 43 52 45 41 54 49 | 4f 4e 5f 53 49 5a 45 20 |Y_CREATI|ON_SIZE |
|00005ef0| 69 73 20 74 68 65 20 61 | 6d 6f 75 6e 74 20 6f 66 |is the a|mount of|
|00005f00| 20 6d 65 6d 6f 72 79 20 | 74 6f 20 67 65 74 20 66 | memory |to get f|
|00005f10| 72 6f 6d 20 74 68 65 20 | 6f 70 65 72 61 74 69 6e |rom the |operatin|
|00005f20| 67 0a 58 20 2a 20 73 79 | 73 74 65 6d 20 61 74 20 |g.X * sy|stem at |
|00005f30| 6f 6e 65 20 74 69 6d 65 | 2e 20 57 65 27 6c 6c 20 |one time|. We'll |
|00005f40| 62 72 65 61 6b 20 74 68 | 61 74 20 6d 65 6d 6f 72 |break th|at memor|
|00005f50| 79 20 64 6f 77 6e 20 69 | 6e 74 6f 20 73 6d 61 6c |y down i|nto smal|
|00005f60| 6c 65 72 20 70 69 65 63 | 65 73 20 66 6f 72 0a 58 |ler piec|es for.X|
|00005f70| 20 2a 20 6d 61 6c 6c 6f | 63 20 62 75 66 66 65 72 | * mallo|c buffer|
|00005f80| 73 2e 20 4f 6e 65 20 6d | 65 67 61 62 79 74 65 20 |s. One m|egabyte |
|00005f90| 69 73 20 70 72 6f 62 61 | 62 6c 79 20 61 20 67 6f |is proba|bly a go|
|00005fa0| 6f 64 20 76 61 6c 75 65 | 2e 0a 58 20 2a 2f 0a 58 |od value|..X */.X|
|00005fb0| 23 64 65 66 69 6e 65 09 | 09 09 4d 45 4d 4f 52 59 |#define.|..MEMORY|
|00005fc0| 5f 43 52 45 41 54 49 4f | 4e 5f 53 49 5a 45 09 31 |_CREATIO|N_SIZE.1|
|00005fd0| 30 32 34 20 2a 20 31 30 | 32 34 0a 58 0a 58 2f 2a |024 * 10|24.X.X/*|
|00005fe0| 0a 58 20 2a 20 45 6e 75 | 6d 20 4d 6f 64 65 20 69 |.X * Enu|m Mode i|
|00005ff0| 6e 64 69 63 61 74 65 73 | 20 74 68 65 20 73 74 61 |ndicates| the sta|
|00006000| 74 75 73 20 6f 66 20 61 | 20 6d 61 6c 6c 6f 63 20 |tus of a| malloc |
|00006010| 62 75 66 66 65 72 2e 0a | 58 20 2a 2f 0a 58 65 6e |buffer..|X */.Xen|
|00006020| 75 6d 20 5f 4d 6f 64 65 | 20 7b 0a 58 09 4e 4f 54 |um _Mode| {.X.NOT|
|00006030| 5f 49 4e 5f 55 53 45 20 | 3d 20 30 2c 09 2f 2a 20 |_IN_USE |= 0,./* |
|00006040| 41 76 61 69 6c 61 62 6c | 65 20 74 6f 20 72 65 70 |Availabl|e to rep|
|00006050| 72 65 73 65 6e 74 20 61 | 20 6d 61 6c 6c 6f 63 20 |resent a| malloc |
|00006060| 62 75 66 66 65 72 2e 20 | 2a 2f 0a 58 09 46 52 45 |buffer. |*/.X.FRE|
|00006070| 45 2c 09 09 2f 2a 20 41 | 20 66 72 65 65 20 62 75 |E,../* A| free bu|
|00006080| 66 66 65 72 2e 20 2a 2f | 0a 58 09 41 4c 4c 4f 43 |ffer. */|.X.ALLOC|
|00006090| 41 54 45 44 2c 09 2f 2a | 20 41 20 62 75 66 66 65 |ATED,./*| A buffe|
|000060a0| 72 20 74 68 61 74 20 69 | 73 20 69 6e 20 75 73 65 |r that i|s in use|
|000060b0| 2e 20 2a 2f 0a 58 09 50 | 52 4f 54 45 43 54 45 44 |. */.X.P|ROTECTED|
|000060c0| 2c 09 2f 2a 20 41 20 66 | 72 65 65 64 20 62 75 66 |,./* A f|reed buf|
|000060d0| 66 65 72 20 74 68 61 74 | 20 63 61 6e 20 6e 6f 74 |fer that| can not|
|000060e0| 20 62 65 20 61 6c 6c 6f | 63 61 74 65 64 20 61 67 | be allo|cated ag|
|000060f0| 61 69 6e 2e 20 2a 2f 0a | 58 09 49 4e 54 45 52 4e |ain. */.|X.INTERN|
|00006100| 41 4c 5f 55 53 45 09 2f | 2a 20 41 20 62 75 66 66 |AL_USE./|* A buff|
|00006110| 65 72 20 75 73 65 64 20 | 69 6e 74 65 72 6e 61 6c |er used |internal|
|00006120| 6c 79 20 62 79 20 6d 61 | 6c 6c 6f 63 28 29 2e 20 |ly by ma|lloc(). |
|00006130| 2a 2f 0a 58 7d 3b 0a 58 | 74 79 70 65 64 65 66 20 |*/.X};.X|typedef |
|00006140| 65 6e 75 6d 20 5f 4d 6f | 64 65 09 4d 6f 64 65 3b |enum _Mo|de.Mode;|
|00006150| 0a 58 0a 58 2f 2a 0a 58 | 20 2a 20 53 74 72 75 63 |.X.X/*.X| * Struc|
|00006160| 74 20 53 6c 6f 74 20 63 | 6f 6e 74 61 69 6e 73 20 |t Slot c|ontains |
|00006170| 61 6c 6c 20 6f 66 20 74 | 68 65 20 69 6e 66 6f 72 |all of t|he infor|
|00006180| 6d 61 74 69 6f 6e 20 61 | 62 6f 75 74 20 61 20 6d |mation a|bout a m|
|00006190| 61 6c 6c 6f 63 20 62 75 | 66 66 65 72 20 65 78 63 |alloc bu|ffer exc|
|000061a0| 65 70 74 0a 58 20 2a 20 | 66 6f 72 20 74 68 65 20 |ept.X * |for the |
|000061b0| 63 6f 6e 74 65 6e 74 73 | 20 6f 66 20 69 74 73 20 |contents| of its |
|000061c0| 6d 65 6d 6f 72 79 2e 0a | 58 20 2a 2f 0a 58 73 74 |memory..|X */.Xst|
|000061d0| 72 75 63 74 20 5f 53 6c | 6f 74 20 7b 0a 58 09 76 |ruct _Sl|ot {.X.v|
|000061e0| 6f 69 64 20 2a 09 09 75 | 73 65 72 41 64 64 72 65 |oid *..u|serAddre|
|000061f0| 73 73 3b 0a 58 09 76 6f | 69 64 20 2a 09 09 69 6e |ss;.X.vo|id *..in|
|00006200| 74 65 72 6e 61 6c 41 64 | 64 72 65 73 73 3b 0a 58 |ternalAd|dress;.X|
|00006210| 09 73 69 7a 65 5f 74 09 | 09 75 73 65 72 53 69 7a |.size_t.|.userSiz|
|00006220| 65 3b 0a 58 09 73 69 7a | 65 5f 74 09 09 69 6e 74 |e;.X.siz|e_t..int|
|00006230| 65 72 6e 61 6c 53 69 7a | 65 3b 0a 58 09 4d 6f 64 |ernalSiz|e;.X.Mod|
|00006240| 65 09 09 6d 6f 64 65 3b | 0a 58 7d 3b 0a 58 74 79 |e..mode;|.X};.Xty|
|00006250| 70 65 64 65 66 20 73 74 | 72 75 63 74 20 5f 53 6c |pedef st|ruct _Sl|
|00006260| 6f 74 09 53 6c 6f 74 3b | 0a 58 0a 58 2f 2a 0a 58 |ot.Slot;|.X.X/*.X|
|00006270| 20 2a 20 45 46 5f 41 4c | 49 47 4e 4d 45 4e 54 20 | * EF_AL|IGNMENT |
|00006280| 69 73 20 61 20 67 6c 6f | 62 61 6c 20 76 61 72 69 |is a glo|bal vari|
|00006290| 61 62 6c 65 20 75 73 65 | 64 20 74 6f 20 63 6f 6e |able use|d to con|
|000062a0| 74 72 6f 6c 20 74 68 65 | 20 64 65 66 61 75 6c 74 |trol the| default|
|000062b0| 20 61 6c 69 67 6e 6d 65 | 6e 74 0a 58 20 2a 20 6f | alignme|nt.X * o|
|000062c0| 66 20 62 75 66 66 65 72 | 73 20 72 65 74 75 72 6e |f buffer|s return|
|000062d0| 65 64 20 62 79 20 6d 61 | 6c 6c 6f 63 28 29 2c 20 |ed by ma|lloc(), |
|000062e0| 63 61 6c 6c 6f 63 28 29 | 2c 20 61 6e 64 20 72 65 |calloc()|, and re|
|000062f0| 61 6c 6c 6f 63 28 29 2e | 20 49 74 20 69 73 20 61 |alloc().| It is a|
|00006300| 6c 6c 2d 63 61 70 73 0a | 58 20 2a 20 73 6f 20 74 |ll-caps.|X * so t|
|00006310| 68 61 74 20 69 74 73 20 | 6e 61 6d 65 20 6d 61 74 |hat its |name mat|
|00006320| 63 68 65 73 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |ches the| name of|
|00006330| 20 74 68 65 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 | the env|ironment|
|00006340| 20 76 61 72 69 61 62 6c | 65 20 74 68 61 74 20 69 | variabl|e that i|
|00006350| 73 20 75 73 65 64 0a 58 | 20 2a 20 74 6f 20 73 65 |s used.X| * to se|
|00006360| 74 20 69 74 2e 20 54 68 | 69 73 20 67 69 76 65 73 |t it. Th|is gives|
|00006370| 20 74 68 65 20 70 72 6f | 67 72 61 6d 6d 65 72 20 | the pro|grammer |
|00006380| 6f 6e 65 20 6c 65 73 73 | 20 6e 61 6d 65 20 74 6f |one less| name to|
|00006390| 20 72 65 6d 65 6d 62 65 | 72 2e 0a 58 20 2a 20 49 | remembe|r..X * I|
|000063a0| 66 20 74 68 65 20 76 61 | 6c 75 65 20 69 73 20 2d |f the va|lue is -|
|000063b0| 31 2c 20 69 74 20 77 69 | 6c 6c 20 62 65 20 73 65 |1, it wi|ll be se|
|000063c0| 74 20 66 72 6f 6d 20 74 | 68 65 20 65 6e 76 69 72 |t from t|he envir|
|000063d0| 6f 6e 6d 65 6e 74 20 6f | 72 20 73 69 7a 65 6f 66 |onment o|r sizeof|
|000063e0| 28 69 6e 74 29 0a 58 20 | 2a 20 61 74 20 72 75 6e |(int).X |* at run|
|000063f0| 20 74 69 6d 65 2e 0a 58 | 20 2a 2f 0a 58 69 6e 74 | time..X| */.Xint|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.