LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-07-2011, 02:19 PM   #1
gquinlan
LQ Newbie
 
Registered: Apr 2006
Location: San Jose, California
Distribution: SuSE, STX, Debian
Posts: 16

Rep: Reputation: 1
Question Inconsistent error 75 using fchmod on shared memory file descriptors (x64)


My C application initialization loops 14 times allocating 12MB blocks of shared memory, assigns each to the video group, and grants RW permissions to video members. This works for the first about 7-10 blocks (a little different each run), after which fchmod starts returning error 75 - "Value too large for defined data type"! The same steps work when run in a bash script. I tried inserting a 2 milli-sec delay and a fsync in before the call to fchmod to emulate running from a script, but the problem still occurs. The values passed to fchmod are a file descriptor (varied from 5 to 19 in this test) and the octal permissions (0664). This leaves me with three questions:
1> Which value does the error message refer to? The fd, the permissions, or some internal value I can't see?
2> Why does the fchmod call work properly for the first several calls then suddenly start failing after about ten calls?
3> What can I do in my code to get this working?

FYI:
> I am using Fedora 15 with a 2.6.40.4-5.fc15.x86_64 kernel with 12 GB RAM.
> With the x32 kernel 12 MB shm buffers are difficult to get to work.
> I've tried increasing the maximum per process limit on file descriptors to 32K but it did not help with this problem.
 
Old 10-07-2011, 07:13 PM   #2
gquinlan
LQ Newbie
 
Registered: Apr 2006
Location: San Jose, California
Distribution: SuSE, STX, Debian
Posts: 16

Original Poster
Rep: Reputation: 1
Smile I cannot understand why this workaround works, but it does!


The last step in each loop after allocating a memory block and setting the group and permissions was to also to set some flags in a structure at the head of the memory block (to indicate that the block was ready for use). Moving the initialization of these flags until after ALL the file allocations and group and permissions were complete eliminated the errors! This makes a good workaround but I would still like to understand why it was failing before and not now!

Grant Q
 
  


Reply

Tags
chmod, shm, x64


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
installing Pixie renderer x64 linking shared library error obstinatesnooper Linux - Software 0 06-24-2009 07:55 AM
error 16 inconsistent file system velouria Linux - Newbie 8 04-18-2009 10:56 AM
File descriptors shared between child and parent causing parent to hang. bharadiaam Linux - Newbie 1 03-02-2009 01:01 AM
Error 16 Inconsistent File Structure gwh480 Fedora 2 11-03-2007 10:53 AM
Any test suite in linux for threads, file descriptors and shared memory segs. Basavaraj Linux - Newbie 2 08-31-2006 08:47 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration