Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-27 Thread Jianghua Yang
Hi Nathan, Thank you for submitting this patch. Best regards, Jianghua Nathan Bossart 于2025年6月27日周五 11:44写道: > Committed. > > -- > nathan >

Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-27 Thread Nathan Bossart
Committed. -- nathan

Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-27 Thread Tom Lane
Nathan Bossart writes: > On Thu, Jun 26, 2025 at 01:46:10PM -0700, Jianghua Yang wrote: >> These errors trace back to failures in `dsm_attach()`, where the >> segment handle value was incorrectly interpreted due to sign extension >> from `int32`. > I think there might be something else going on.

Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-26 Thread Nathan Bossart
On Thu, Jun 26, 2025 at 01:46:10PM -0700, Jianghua Yang wrote: > Just to follow up - in our production system (pg_cron extension), > we´ve encountered real issues caused by passing a `Datum` to > `dsm_attach()` using `DatumGetInt32()` instead of `DatumGetUInt32()`. > > Here's a sample of the error

Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-26 Thread Jianghua Yang
Hi, Just to follow up — in our production system (pg_cron extension), we’ve encountered real issues caused by passing a `Datum` to `dsm_attach()` using `DatumGetInt32()` instead of `DatumGetUInt32()`. Here's a sample of the errors observed in our logs: ERROR: unable to map dynamic shared memory

Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-26 Thread Nathan Bossart
On Thu, Jun 26, 2025 at 12:51:10PM -0700, Jianghua Yang wrote: > The argument passed to `dsm_attach()` is expected to be a `uint32`, but the > code currently uses `DatumGetInt32()` to extract it from the `Datum` > argument. This can lead to incorrect behavior when the high bit is set, as > 'unable

[PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-26 Thread Jianghua Yang
Hi, The attached patch fixes a minor type mismatch in `test_shm_mq_main()`. The argument passed to `dsm_attach()` is expected to be a `uint32`, but the code currently uses `DatumGetInt32()` to extract it from the `Datum` argument. This can lead to incorrect behavior when the high bit is set, as '