llnl / llnl/UnifyFS

Newer glibc needs to have all variables be size_t even those which are computed into other variables.

Open
#731 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
122
Forks
34
PR merge metrics
No merged PRs in 30d

Description

## Description

In the newer version of glibc this is a compile-time error.

```
client_read.c:697:30: error: argument 1 range [18446744071562067968, 18446744073709551614] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
reqs = (read_req_t*) calloc(reqs_size, sizeof(read_req_t));

```

The solution is to change the signature of process_gfid_reads to use size_t in_count.

```
diff --git a/client/src/client_read.c b/client/src/client_read.c
index bb562e6..d187db6 100644
--- a/client/src/client_read.c
+++ b/client/src/client_read.c
@@ -584,7 +584,7 @@ static void update_read_req_result(unifyfs_client* client,
*/
int process_gfid_reads(unifyfs_client* client,
read_req_t* in_reqs,
- size_t in_count)
+ int in_count)
{
if (0 == in_count) {
return UNIFYFS_SUCCESS;
diff --git a/client/src/client_read.h b/client/src/client_read.h
index 45e89c3..517ca09 100644
--- a/client/src/client_read.h
+++ b/client/src/client_read.h
@@ -111,6 +111,6 @@ void update_read_req_coverage(read_req_t* req,
/* process a set of client read requests */
int process_gfid_reads(unifyfs_client* client,
read_req_t* in_reqs,
- size_t in_count);
+ int in_count);

#endif // UNIFYFS_CLIENT_READ_H

```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in client/src/client_read.c and client/src/client_read.h at the process_gfid_reads declaration and definition, then compare the requested size_t change with the inconsistent diff shown in the issue. Check its callers and build the client with the newer glibc; done means the alloc-size-larger-than compile error is resolved without introducing type mismatches.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.