The code I'm working on launches a child process. That child process segvs. That child process actually WANTS to segv, because it's using libsigsegv to implement its own memory manager. Inside the handler for INTENTIONAL segv we calculate what page we want and index into array
-
Show this thread
-
2/ and that array of pages (or, rather, array of meta data, one entry per page) is of size 0x1000, and we calculate that we want page 0x3fff ...which is bigger than 0x1000. So we index past the end of the array. And segv a SECOND time.
1 reply 0 retweets 4 likesShow this thread -
3/ Which is NOT expected / good / acceptable.
1 reply 0 retweets 2 likesShow this thread -
4/ So that's my day. How's your day going?
3 replies 0 retweets 3 likesShow this thread -
5/ solved it! I was doing math wrong. if p is a pointer to addr 0x100 and q is a pointer to 0x104 what's the delta between the two? if (char *) pointers, then 4 if (word *) pointers, then 1 my bad
1 reply 0 retweets 12 likesShow this thread -
Replying to @MorlockP
Foo* pFoo; (uint8_t *)&pFoo[1]-(ui t8_t *)&pFoo[0] is equivalent to sizeof(Foo) is one way to think of it.
1 reply 0 retweets 0 likes
I don't need a way to think about it. I know how the language works. I just made a mistake. Which I found and fixed.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.