bugThe GNU Hurd - Bugs: bug #28511, string_t is limited to 1024 bytes


bug #28511: string_t is limited to 1024 bytes

Submitted by:  Carl Fredrik Hammar <hammy>
Submitted on:  Thu 07 Jan 2010 04:36:28 PM UTC  
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenReproducibility: None
Size (loc): NonePlanned Release: None
Effort: 0.00
Wiki-like text discussion box: 

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Wed 07 Sep 2016 08:14:24 PM UTC, comment #1:

Removing the limit would require changing the prototypes of several public functions declared in <hurd/lookup.h> of glibc. 'string_t retry_name' might be replaced with a pointer to a buffer-descriptor structure that contains: the address of the buffer; the size of the buffer; and a code that indicates how the buffer was allocated (malloc, mmap, or stack), i.e. how to free it if it is replaced with a larger one.

Then if you're going to change those functions, it might be a good idea to add void* parameters to function pointers, like in qsort_r vs. qsort. That would reduce the need for nested functions, which require trampolines in an executable stack.

Kalle Olavi Niemitalo <kon>
Thu 07 Jan 2010 04:36:28 PM UTC, original submission:

The string type used by the Hurd in RPCs is limited to 1024 bytes.
This is because it is defined as the MIG type c_string[1024]. That is, it is stored in an 1024 char array.

The solution would be to declare it unbounded, i.e. c_string[].
Unfortunately, MIG doesn't support unbounded strings like it does
for other arrays.

Effectively this leads to the Hurd having a PATH_MAX=1024, which
can be triggered like so:

p=$(for (( i=0; i < 64; i++ )); do echo -n 123456789abcdef/; done;)
mkdir -p $p
ls $p

Carl Fredrik Hammar <hammy>
Project Member


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

Attach File(s):

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 kon (Posted a comment)
  • -unavailable- added by hammy (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):



    No Changes Have Been Made to This Item

    Back to the top

    Powered by Savane 3.1-cleanup