Ticket #5504 (closed bug: duplicate)

Opened 20 months ago

Last modified 20 months ago

Inconsistent sizes for struct rlimit

Reported by: daniel.is.fischer Owned by:
Priority: normal Milestone:
Component: libraries/unix Version: 7.3
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

On my 32-bit system, I find

/* Define to Haskell type for rlim_t */
#define HTYPE_RLIM_T Word64

in HsBaseConfig.h. gcc says sizeof(rlim_t) = 4 and thus sizeof(struct rlimit) = 8.

Previously (7.0 and before), get/setResourceLimit allocated a 16-byte buffer and wrote/read the hard limit at an 8-byte offset, consistent with HsBaseConfig.h (but not with sys/resource.h), and apparently it worked (test resourceLimit used to pass and getting the limits returned the previously set values in a few tests for various resources).

Now they allocate 8 bytes and read/write the hard limit at a 4-byte offset, consistent with sys/resource.h, but inconsistent with HsBaseConfig.h, and resourceLimit fails, the same tests as above always returned ResourceLimit (2^64-1) for both, soft and hard limits. (The compiled ways of resourceLimit fail with invalid argument on setting.)

Change History

Changed 20 months ago by simonmar

  • status changed from new to closed
  • resolution set to duplicate

More fallout from #2897

Note: See TracTickets for help on using tickets.