Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mmap/SIGSEGV/gdb
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Mr. Anderson
l33t
l33t


Joined: 22 Apr 2004
Posts: 762

PostPosted: Wed Aug 22, 2007 3:14 pm    Post subject: mmap/SIGSEGV/gdb Reply with quote

Code:
#include <unistd.h>
#include <sys/mman.h>

int main(char argc, char** argv) {

  mmap(0x98000000, 268435456, PROT_NONE, MAP_PRIVATE | MAP_FIXED | MAP_NORESERVE | MAP_ANONYMOUS, -1, 0L);

}


Dieser Code führt bei mir meistens zu einem Segmentation Fault (System ist x86). Je weiter ich das zweite Argument verkleinere, desto seltener geschieht das. Weiß jemand, warum das zu einem Speicherzugriffsfehler führt? Oder wie ich weitere Informationen bekommen kann? Zum Beispiel wovon der Adressbereich ggf. belegt wird? Ich bin wirklich kein gdb-Guru. Bitte nichts als bekannt voraussetzen.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum