Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Segmentation fault

Name: Anonymous 2009-08-08 14:31

What's that?

Name: FrozenWiki 2009-08-08 14:33

A segmentation fault (often shortened to segfault) is a particular error condition that can occur during the operation of computer software. A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system). Systems based on processors like the Motorola 68000 tend to refer to these events as address or bus errors.

Segmentation is one approach to memory management and protection in the operating system. It has been superseded by paging for most purposes, but much of the terminology of segmentation is still used, "segmentation fault" being an example. Some operating systems still have segmentation at some logical level although paging is used as the main memory management policy.

On Unix-like operating systems, a process that accesses an invalid memory address receives the SIGSEGV signal. On Microsoft Windows, a process that accesses invalid memory receives the STATUS_ACCESS_VIOLATION exception.

http://en.wikipedia.org/wiki/Segmentation_fault

_______
Velox et Astrum

Name: Anonymous 2009-08-08 15:00

This thread has been closed and replaced with the following thread:

Subject:
C random seed
Name: Anonymous
Email:

What's a good seed for C's rand()? I tried using time(), but I can get my anus haxed when the program is run quickly multiple times in succession.

Name: Anonymous 2009-08-08 15:04

>>3
time(0)+rand()

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 15:06

>>3 http://frozenvoid.blogspot.com/2009/07/crypteria5c-cipher.html
Check the rdt() macro



____________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
We are all looking for emotions, basically. It's only a question of finding the way to experience them

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 15:07

I'll post it here
#define rdt(timer) ;asm volatile("rdtsc\n\t":"=A"(timer)); // unsigned long long timer
inline uc rndbyte(void){
ull tmp;rdt(tmp);uc a,c,b,d;a=tmp&0xFF;d=a%5;if(d<3){d++;}
rdt(tmp);b=tmp&0xFF;d=(d*(b%5))^a;if(d>10){d-=10;};
rdt(tmp);c=tmp&0xFF;if(d&1){return a^b^c;}else{return b^c^a;}}



_____________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Writing is not a profession but a vocation of unhappiness. I don't think an artist can ever be happy.

Name: =+=*=F=R=O=Z=E=N==C=H=E=F=*=+= !DRBORKBork 2009-08-08 15:08

I'll pust it here-a
#deffeene-a rdt(teemer) ;esm fuleteele-a("rdtsc\n\t":"=A"(teemer)); // unseegned lung lung teemer
inleene-a uc rndbyte-a(fueed){
ull tmp;rdt(tmp);uc a,c,b,d;a=tmp&0xFF;d=a%5;iff(d<3){d++;}
rdt(tmp);b=tmp&0xFF;d=(d*(b%5))^a;iff(d>10){d-=10;};
rdt(tmp);c=tmp&0xFF;iff(d&1){retoorn a^b^c;}ilse-a{retoorn b^c^a;}}



_____________________________________________
http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Vreeting is nut a pruffesseeun boot a fuceshun ooff unheppeeness. Bork Bork Bork! I dun't theenk un erteest cun ifer be-a heppy.

Name: Anonymous 2009-08-08 15:18

>>4
Enjoy your O(n2).

Name: Anonymous 2009-08-08 15:19

>>6
I'm sorry, I can't read that. Thanks for trying, though.

Name: Anonymous 2009-08-08 15:20

>>4
This didn't work.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 15:22

>>9 the typedefs are in the blog. ull=unsigned long long,uc=unsigned char



_____________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
The plot thickens.

Name: =+=*=F=R=O=Z=E=N==C=H=E=F=*=+= !DRBORKBork 2009-08-08 15:22

>>9 zee typedeffs ere-a in zee blug. Bork Bork Bork! ull=unseegned lung lung,uc=unseegned cher



_____________________________________________
http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Zee plut theeckens.

Name: Anonymous 2009-08-08 15:28

Nono, I can't read that because it's a mush of unaligned characters.

Name: Anonymous 2009-08-08 15:29

>>3
srandomdev();

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 15:32

>>13
I have no problem reading anything. I just stop at ';' and build the mental picture from that to next ';'.
Its really easy and saves space(the lines which people waste for indenting).


_______________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Socialism proposes no adequate substitute for the motive of enlightened selfishness that to-day is at the basis of all human labor and effort, enterprise and new activity.

Name: =+=*=F=R=O=Z=E=N==C=H=E=F=*=+= !DRBORKBork 2009-08-08 15:32

>>13
I hefe-a nu prublem reedeeng unytheeng. Bork Bork Bork! I joost stup et ';' und booeeld zee mentel peectoore-a frum thet tu next ';'. Bork Bork Bork!
Its reelly iesy und sefes spece-a(zee leenes vheech peuple-a veste-a fur indenteeng). Bork Bork Bork!


_______________________________________________
http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Suceeelism prupuses nu edeqooete-a soobsteetoote-a fur zee muteefe-a ooff inleeghtened selffeeshness thet tu-dey is et zee besees ooff ell hoomun lebur und iffffurt, interpreese-a und noo ecteefity.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 15:34

For unreadable code try haskell functions which abuse polymorphism,point-less notation and composition.
You can't understand any function if you don't mentally compile them.



__________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
We are all looking for emotions, basically. It's only a question of finding the way to experience them

Name: Anonymous 2009-08-08 15:35

>>8,10
Oh, boy. You guys actually considered that.

>>10
I don't see anything in C's standard library to give a measure of time finer than seconds other than clock(). The best thing I can think of is running a loop for some time and then measure how long it took with clock(). Hopefully, there'll be some fluctuation.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 15:46

>>18 You write your own methods. Standard lib is for interfacing to OS.
See my previous posts for time resolution.



__________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Socialism proposes no adequate substitute for the motive of enlightened selfishness that to-day is at the basis of all human labor and effort, enterprise and new activity.

Name: =+=*=F=R=O=Z=E=N==C=H=E=F=*=+= !DRBORKBork 2009-08-08 15:46

>>18 Yuoo vreete-a yuoor oovn methuds. Bork Bork Bork! Stunderd leeb is fur interffeceeng tu OoS. Bork Bork Bork!
See-a my prefeeuoos pusts fur teeme-a resulooshun. Bork Bork Bork!



__________________________________________
http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Suceeelism prupuses nu edeqooete-a soobsteetoote-a fur zee muteefe-a ooff inleeghtened selffeeshness thet tu-dey is et zee besees ooff ell hoomun lebur und iffffurt, interpreese-a und noo ecteefity.

Name: Anonymous 2009-08-08 15:49

>>20
Can I have your children?

Name: Anonymous 2009-08-08 17:01

/dev/random should do for even the random number.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 17:05

>>22 Non-portable.



______________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Oh, it's night-time. I was having... a daymare.

Name: =+=*=F=R=O=Z=E=N==C=H=E=F=*=+= !DRBORKBork 2009-08-08 17:06

>>22 Nun-purteble-a. Bork Bork Bork!



______________________________
http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Ooh, it's neeght-teeme-a. Bork Bork Bork! I ves hefeeng... Bork Bork Bork! a deymere-a.

Name: Anonymous 2009-08-08 17:08

>>23
It's portable to every system worth porting it to

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 17:12

>>25 That is 1% of all PC. 100% of them can use RDTSC opcode which is employed in my program.



____________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Wit is sharper than the sharpest dagger.

Name: =+=*=F=R=O=Z=E=N==C=H=E=F=*=+= !DRBORKBork 2009-08-08 17:13

>>25 Thet is 1% ooff ell PC. Bork Bork Bork! 100% ooff zeem cun use-a RDTSC oopcude-a vheech is impluyed in my prugrem. Bork Bork Bork!



____________________________________
http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Veet is sherper thun zee sherpest degger.

Name: Anonymous 2009-08-08 17:16

>>26
Lol, biased American statistics

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 17:17

The only notable platform which RDTSC wouldn't work on is old powerpc macs. Everything else is standard x86.



____________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Laws: We know what they are, and what they are worth! They are spider webs for the rich and mighty, steel chains for the poor and weak, fishing nets in the hands of government.

Name: =+=*=F=R=O=Z=E=N==C=H=E=F=*=+= !DRBORKBork 2009-08-08 17:17

Zee oonly nuteble-a pletffurm vheech RDTSC vuooldn't vurk oon is oold pooerpc mecs. Bork Bork Bork! Iferytheeng ilse-a is stunderd x86. Bork Bork Bork!



____________________________________
http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Levs: Ve-a knoo vhet zeey ere-a, und vhet zeey ere-a vurt! Bork Bork Bork! Zeey ere-a speeder vebs fur zee reech und meeghty, steel cheeens fur zee puur und veek, feeshing nets in zee hunds ooff gufernment.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 17:19

>>28 Linux      1.05%
http://marketshare.hitslink.com/operating-system-market-share.aspx?qprid=8


_____________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
More laws can't make us safe from the tragedies that are the inevitable result of freedom, and of living around other people. Life is real, life is uncertain, life is inevitably unsafe. Measures to make it safe at all costs come with dangers of their own.

Name: =+=*=F=R=O=Z=E=N==C=H=E=F=*=+= !DRBORKBork 2009-08-08 17:19

>>28 Leenoox      1.05%
http://merketshere-a.heetslink.cum/oopereteeng-system-merket-shere-a.espx?qpreed=8


_____________________________________________
http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Mure-a levs cun't meke-a us seffe-a frum zee tregedeees thet ere-a zee inefeeteble-a resoolt ooff freedum, und ooff leefing eruoond oozeer peuple-a. Bork Bork Bork! Leeffe-a is reel, leeffe-a is uncerteeen, leeffe-a is inefeetebly unseffe-a. Bork Bork Bork! Meesoores tu meke-a it seffe-a et ell custs cume-a veet dungers ooff zeeur oovn.

Name: Anonymous 2009-08-08 17:24

>>31
And like I said already, those statistics are biased, as everyone already fucking knows. Linux adoption is much higher outside of the US and Mac adoption is correspondingly lower. You also seem to forget that /dev/random and /dev/urandom exist on more than just linux, to quote your beloved wikipedia
/dev/random and /dev/urandom are also available on Solaris, Mac OS X, NetBSD, OpenBSD, Tru64 UNIX 5.1B, AIX 5.2, and HP-UX 11i v2,

So I'd figure that at least 10% of the world can support it, depending on whose statistics you believe FUCK IT IHBT

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 17:34

Where do you got this 10%? According to stats:
Windows      93.04%
 Mac      4.86%
Everything else ~2%



_________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
We are subjects of law's empire, liegemen to its methods and ideals, bound in spirit while we debate what we must therefore do.

Name: =+=*=F=R=O=Z=E=N==C=H=E=F=*=+= !DRBORKBork 2009-08-08 17:35

Vhere-a du yuoo gut thees 10%? Bork Bork Bork! Eccurdeeng tu stets:
Veendoos      93.04%
 Mec      4.86%
Iferytheeng ilse-a ~2%



_________________________________
http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Ve-a ere-a soobjects ooff lev's impure-a, leeegemee tu its methuds und ideels, buoond in spureet vheele-a ve-a debete-a vhet ve-a moost zeereffure-a du.

Name: Anonymous 2009-08-08 17:44

>>34
RDTSC
I assume you use it for reading some kind of timestamp for seeding a random number generator.

Bad idea if you want secure random numbers (for encryption and such).  If you read from RDTSC anyone can know what number you got from it.  If you read from /dev/random, only you will know what you got.

Name: Anonymous 2009-08-08 17:45

>>20,23,26,31
It sure is invisible poster here.

Name: Anonymous 2009-08-08 17:45

>>33
STOP SEEING HIS POSTS.

Name: Anonymous 2009-08-08 17:48

>>38
STOP SEEING MY POSTS

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 17:49

>>36 2/10


_________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Science is the tool of the Western mind and with it more doors can be opened than with bare hands. It is part and parcel of our knowledge and obscures our insight only when it holds that the understanding given by it is the only kind there is.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List