Post
Topic
Board Bitcoin Discussion
Re: Analysis and list of top big blocks shills (XT #REKT ignorers)
by
valiz
on 19/01/2016, 14:36:29 UTC
Obviously, running your code does not always end up with "segmentation fault", it is only a possibility.

Code:
int main()
{
   [b]int array[10]; [/b]
   array[11] = 0;
   printf("stick with core\n");
}

Oops, I was wrong. Because you put the "array" array on the stack, there are no chances for "segmentation fault".

Peter TRoll 'developer' #REKT

 Cheesy Cheesy Cheesy


The array is neither static nor in a function, so its not on the stack. More likely ( dependent on your setup) its pre-allocated in the programs data section.
The fact that you dont core any time is down to blind luck.

int main() { ... } is not a function?

Look again!

Code:
(gdb) run
Starting program: /home/valiz/petertroll

Breakpoint 1, main () at petertroll.c:6
6    array[11] = 0;
(gdb) info registers rsp
rsp            0x7fffffffe2b0 0x7fffffffe2b0
(gdb) print &array[11]
$2 = (int *) 0x7fffffffe2dc
(gdb) l
1 #include
2
3 int main()
4 {
5    int array[10];
6    array[11] = 0;
7    printf("stick with core\n");
8 }
9