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


bug #28511: string_t is limited to 1024 bytes

Submitter:  Carl Fredrik Hammar <hammy>
Submitted:  Thu 07 Jan 2010 04:36:28 PM UTC
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Reproducibility:  None
Size (loc):  None Planned Release:  None
Effort:  0.00
Wiki-like text discussion box: 

* Mandatory Fields

Add a New Comment Rich Markup

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>
Group Member


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by kon (Posted a comment)
  • -email is unavailable- added by hammy (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code