failed to map segment from shared object: Operation not permitted

Discussion in 'Ruby' started by Tristin Davis, Jul 4, 2008.

  1. [Note: parts of this message were removed to make it a legal post.]

    I'm writing a ruby wrapper for a proprietary api. I compiled it, but when I
    require it in irb i get the following error. I'm stumped as to why its
    throwing this error. Anyone help?

    irb(main):001:0> require 'metadata'
    LoadError: ./metadata.so: failed to map segment from shared object:
    Operation not permitted - ./metadata.so
    from ./metadata.so
    from (irb):1


    =cut

    #include <ruby.h>
    #include "mdc.h"

    /* Module and class names */
    static VALUE md_mMetadata;
    static VALUE md_cClientAPI;

    VALUE
    md_initialize(int argc, VALUE *argv, VALUE self)
    {
    VALUE login, password, server, table_name, table_version;

    rb_scan_args(argc, argv, "41", &login, &password, &server,
    &table_name, &table_version);

    if(NIL_P(table_version)) {
    rb_iv_set( self, "@table_version", Qnil );
    }

    rb_iv_set(self, "@login", rb_funcall(login, rb_intern("to_s"), 0) );
    rb_iv_set(self, "@password", rb_funcall(password, rb_intern("to_s"),
    0) );
    rb_iv_set(self, "@server", rb_funcall(server, rb_intern("to_s"), 0) );

    rb_iv_set(self, "@table_name", rb_funcall(table_name,
    rb_intern("to_s"),0) );

    return self;

    }


    void Init_metadata() {
    md_mMetadata = rb_define_module("Metadata");
    md_cClientAPI = rb_define_class_under(md_mMetadata, "ClientAPI",
    rb_cObject);

    rb_define_method(md_cClientAPI, "initialize", md_initialize, 4);

    }
    Tristin Davis, Jul 4, 2008
    #1
    1. Advertising

  2. Tristin Davis

    Tim Pease Guest

    Re: failed to map segment from shared object: Operation notpermitted

    On Jul 3, 2008, at 9:46 PM, Tristin Davis wrote:

    > I'm writing a ruby wrapper for a proprietary api. I compiled it,
    > but when I
    > require it in irb i get the following error. I'm stumped as to why
    > its
    > throwing this error. Anyone help?
    >
    > irb(main):001:0> require 'metadata'
    > LoadError: ./metadata.so: failed to map segment from shared object:
    > Operation not permitted - ./metadata.so
    > from ./metadata.so
    > from (irb):1


    Are you compiling the code as one user and attempting to use it from a
    different user account? The "Operation not permitted" usually refers
    to a permissions problem.

    Found this link ...

    <http://citydesknews.com/FogBugz/KB/errors/fogutil.sofailedtomapsegm.html?isl=23903
    >


    Give the "restorecon" method a shot.

    Oh, and this link might shed some light as well ...

    <http://objectmix.com/tcl/34666-failed-map-segment-shared-object-operation-not-permitted.html
    >


    Blessings,
    TwP
    Tim Pease, Jul 4, 2008
    #2
    1. Advertising

  3. Re: failed to map segment from shared object: Operation notpermitted

    [Note: parts of this message were removed to make it a legal post.]

    I tried it the solution in the 1st link, but it didn't help.

    On Thu, Jul 3, 2008 at 11:01 PM, Tim Pease <> wrote:

    > On Jul 3, 2008, at 9:46 PM, Tristin Davis wrote:
    >
    > I'm writing a ruby wrapper for a proprietary api. I compiled it, but when
    >> I
    >> require it in irb i get the following error. I'm stumped as to why its
    >> throwing this error. Anyone help?
    >>
    >> irb(main):001:0> require 'metadata'
    >> LoadError: ./metadata.so: failed to map segment from shared object:
    >> Operation not permitted - ./metadata.so
    >> from ./metadata.so
    >> from (irb):1
    >>

    >
    > Are you compiling the code as one user and attempting to use it from a
    > different user account? The "Operation not permitted" usually refers to a
    > permissions problem.
    >
    > Found this link ...
    >
    > <
    > http://citydesknews.com/FogBugz/KB/errors/fogutil.sofailedtomapsegm.html?isl=23903
    > >

    >
    > Give the "restorecon" method a shot.
    >
    > Oh, and this link might shed some light as well ...
    >
    > <
    > http://objectmix.com/tcl/34666-failed-map-segment-shared-object-operation-not-permitted.html
    > >

    >
    > Blessings,
    > TwP
    >
    >
    Tristin Davis, Jul 4, 2008
    #3
  4. Re: failed to map segment from shared object: Operation notpermitted

    [Note: parts of this message were removed to make it a legal post.]

    I"m on Ubuntu 4.2.3-2ubuntu7.

    Anyone else have any suggestions. I've checked and rechecked the code. I
    can't find anything wrong at all.

    On Fri, Jul 4, 2008 at 12:17 AM, Tristin Davis <>
    wrote:

    > I tried it the solution in the 1st link, but it didn't help.
    >
    > On Thu, Jul 3, 2008 at 11:01 PM, Tim Pease <> wrote:
    >
    > > On Jul 3, 2008, at 9:46 PM, Tristin Davis wrote:
    > >
    > > I'm writing a ruby wrapper for a proprietary api. I compiled it, but

    > when
    > >> I
    > >> require it in irb i get the following error. I'm stumped as to why its
    > >> throwing this error. Anyone help?
    > >>
    > >> irb(main):001:0> require 'metadata'
    > >> LoadError: ./metadata.so: failed to map segment from shared object:
    > >> Operation not permitted - ./metadata.so
    > >> from ./metadata.so
    > >> from (irb):1
    > >>

    > >
    > > Are you compiling the code as one user and attempting to use it from a
    > > different user account? The "Operation not permitted" usually refers to a
    > > permissions problem.
    > >
    > > Found this link ...
    > >
    > > <
    > >

    > http://citydesknews.com/FogBugz/KB/errors/fogutil.sofailedtomapsegm.html?isl=23903
    > > >

    > >
    > > Give the "restorecon" method a shot.
    > >
    > > Oh, and this link might shed some light as well ...
    > >
    > > <
    > >

    > http://objectmix.com/tcl/34666-failed-map-segment-shared-object-operation-not-permitted.html
    > > >

    > >
    > > Blessings,
    > > TwP
    > >
    > >

    >
    Tristin Davis, Jul 4, 2008
    #4
  5. Re: failed to map segment from shared object: Operation notpermitted

    [Note: parts of this message were removed to make it a legal post.]

    Nevermind, I figured it out. I'm running working off of a flash drive and I
    guess by default, Ubuntu mounts it with the noexec option.


    /dev/sdb1 on /media/ext type vfat (rw,noexec,nosuid,nodev)


    Moving it to another directory fixed it.


    On Fri, Jul 4, 2008 at 1:55 PM, Tristin Davis <>
    wrote:

    > I"m on Ubuntu 4.2.3-2ubuntu7.
    >
    > Anyone else have any suggestions. I've checked and rechecked the code. I
    > can't find anything wrong at all.
    >
    > On Fri, Jul 4, 2008 at 12:17 AM, Tristin Davis <>
    > wrote:
    >
    > > I tried it the solution in the 1st link, but it didn't help.
    > >
    > > On Thu, Jul 3, 2008 at 11:01 PM, Tim Pease <> wrote:
    > >
    > > > On Jul 3, 2008, at 9:46 PM, Tristin Davis wrote:
    > > >
    > > > I'm writing a ruby wrapper for a proprietary api. I compiled it, but

    > > when
    > > >> I
    > > >> require it in irb i get the following error. I'm stumped as to why

    > its
    > > >> throwing this error. Anyone help?
    > > >>
    > > >> irb(main):001:0> require 'metadata'
    > > >> LoadError: ./metadata.so: failed to map segment from shared object:
    > > >> Operation not permitted - ./metadata.so
    > > >> from ./metadata.so
    > > >> from (irb):1
    > > >>
    > > >
    > > > Are you compiling the code as one user and attempting to use it from a
    > > > different user account? The "Operation not permitted" usually refers to

    > a
    > > > permissions problem.
    > > >
    > > > Found this link ...
    > > >
    > > > <
    > > >

    > >

    > http://citydesknews.com/FogBugz/KB/errors/fogutil.sofailedtomapsegm.html?isl=23903
    > > > >
    > > >
    > > > Give the "restorecon" method a shot.
    > > >
    > > > Oh, and this link might shed some light as well ...
    > > >
    > > > <
    > > >

    > >

    > http://objectmix.com/tcl/34666-failed-map-segment-shared-object-operation-not-permitted.html
    > > > >
    > > >
    > > > Blessings,
    > > > TwP
    > > >
    > > >

    > >

    >
    Tristin Davis, Jul 4, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles L
    Replies:
    5
    Views:
    1,205
    Ron Natalie
    Feb 8, 2005
  2. nass
    Replies:
    7
    Views:
    306
    Larry Smith
    Sep 26, 2006
  3. nass
    Replies:
    1
    Views:
    340
    mlimber
    Oct 5, 2006
  4. Sam

    Operation not permitted

    Sam, Feb 25, 2004, in forum: Perl Misc
    Replies:
    6
    Views:
    202
    James Willmore
    Mar 6, 2004
  5. @sh
    Replies:
    14
    Views:
    174
    Randy Webb
    Dec 22, 2005
Loading...

Share This Page