LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-03-2005, 09:41 AM   #1
tim_l
LQ Newbie
 
Registered: Oct 2003
Posts: 18

Rep: Reputation: 0
Call to mprotect()


Not sure if this is the correct forum, but anyway I'm having a problem with a call to mprotect.

I have a program which is self-modifying so I want to make sure that the area that my executable is mapped to is both writable and executable. So I find the start of my executing program in memory, and the size, and set this are using mprotect.

Now this works on Debian but on Mandrake 9.2, it causes a signal 11 segmentation fault, which I guess is the system saying I can't change the permissions of the memory.

Is this something in the setup of Mandrake, something to do with user priveldges or something more low level? IS there something you can change in Mandrake setup to make it work?

Cheers,

Tim
 
Old 05-03-2005, 09:44 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
I doubt this is distribution specific: more likely kernel. Check the kernel versions to see if they're the same. Also, have you run gdb to check if that is what is really causing the segfault?

(BTW, in the future, threads like this are probably better in the programming forum)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
not sure what to call it Solvaut Linux - Newbie 12 07-18-2005 03:22 AM
mprotect() return codes tim_l Programming 2 05-09-2005 07:38 AM
mprotect and SIGSEGV tim_l Programming 1 05-04-2005 08:12 AM
mprotect Damaged Soul Programming 0 11-28-2004 05:18 AM
What do you call your remote control? I call mine... RHLinuxGUY General 19 10-18-2004 06:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration