bugGluster - Bugs: bug #26769, booster doesn't wrap fopen

 
 

bug #26769: booster doesn't wrap fopen

Submitted by:  Erick Tryzelaar <erickt>
Submitted on:  Wed 10 Jun 2009 01:58:09 AM UTC  
 
Category: GlusterFSSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Missing Feature
Status: Wont FixPrivacy: Public
Assigned to: Basavanagowda Kanur <gowda>Originator Name: Erick Tryzelaar
Open/Closed: ClosedRelease: 2.0.2
Operating System: GNU/LinuxReproducibility: Every Time

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 22 Jun 2009 03:17:03 PM UTC, comment #3:

Hello again,

Unfortunately that doesn't seem to be the case for our 2.4 version of glibc. I've seen a couple places [1], [2] say that fopen's use of open is statically resolved at link time, so it can't be replaced with LD_PRELOAD. To prove it, I copied the example from [1] and preloaded it before this:

#include <stdio.h>
int main(int argc, char** argv) {
FILE *f;
if ((f = fopen("preload-example.c", "r")) == NULL) return 1;
return 0;
}

and it didn't print out anything. To be thorough, I also tested this:

#include <fcntl.h>
int main(int argc, char** argv) {
int fd;
if ((fd = open("preload-example.c", O_RDONLY)) == -1) return 1;
return 0;
}

And it did print out "opened file 'preload-example.c'".

[1]: http://stackoverflow.com/questions/880263/how-can-i-detect-file-accesses-in-linux
[2]: http://plash.beasts.org/wiki/PlashFAQs

Erick Tryzelaar <erickt>
Mon 22 Jun 2009 01:59:56 PM UTC, comment #2:

booster wraps only the system calls.

fopen() internally calls open(), so fopen() is already covered by booster.

--
Gowda

Basavanagowda Kanur <gowda>
Project MemberIn charge of this item.
Wed 10 Jun 2009 02:01:56 AM UTC, comment #1:

Hm, or not since you may have to replace all the fread, fwrite, and etc functions...

Erick Tryzelaar <erickt>
Wed 10 Jun 2009 01:58:09 AM UTC, original submission:

Booster isn't able to wrap a lot of programs, like python. because it doesn't overload the fopen function. Any chance it will get betting wrapped soon? Could be relatively simple to add by using open with fdopen.

Erick Tryzelaar <erickt>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gowda (Posted a comment)
  • -unavailable- added by erickt (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 22 Jun 2009 01:59:56 PM UTCgowdaStatusNone=>Wont Fix
      Assigned toNone=>gowda
      Originator Name=>Erick Tryzelaar
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1