On 2026-Jul-24, Laurenz Albe wrote:

> When I build with meson/ninja with pretty much everything enabled
> and dtrace, I get the following warning:
> 
>   [40/2412] Generating src/include/utils/probes.h.tmp with a custom command
>   Warning: /usr/bin/dtrace:.dtrace-temp.cf7b554c.d:68: syntax error near:
>   probe smgr__md__read__start
> 
>   Warning: Proceeding as if --no-pyparsing was given.
> 
> I don't get the warning when I build with configure/make.
> 
> "git bisect" identifies the following commit as culprit:
> 
>   ca326e903d "Clean up read() return type" by Peter E.
> 
> I don't know enough about dtrace to track this down, but I think it
> should be fixed.

That's weird.  The only change that seems near enough in that commit was

diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 718c1cfc0f9..79febf12de3 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -863,7 +863,7 @@ mdreadv(SMgrRelation reln, ForkNumber forknum, BlockNumber 
blocknum,
                struct iovec iov[PG_IOV_MAX];
                int                     iovcnt;
                pgoff_t         seekpos;
-               int                     nbytes;
+               ssize_t         nbytes;
                MdfdVec    *v;
                BlockNumber nblocks_this_segment;
                size_t          transferred_this_segment;


But then, variable 'nbytes' is not used by the probe mentioned in the
error message.  It is used by the probe two lines below:

src/backend/storage/smgr/md.c:
            TRACE_POSTGRESQL_SMGR_MD_READ_START(forknum, blocknum,
                                                
reln->smgr_rlocator.locator.spcOid,
                                                
reln->smgr_rlocator.locator.dbOid,
                                                
reln->smgr_rlocator.locator.relNumber,
                                                reln->smgr_rlocator.backend);
            nbytes = FileReadV(v->mdfd_vfd, iov, iovcnt, seekpos,
                               WAIT_EVENT_DATA_FILE_READ);
            TRACE_POSTGRESQL_SMGR_MD_READ_DONE(forknum, blocknum,
                                               
reln->smgr_rlocator.locator.spcOid,
                                               
reln->smgr_rlocator.locator.dbOid,
                                               
reln->smgr_rlocator.locator.relNumber,
                                               reln->smgr_rlocator.backend,
                                               nbytes,
                                               size_this_segment - 
transferred_this_segment);

I wonder if changing the first 'long long int' to ssize_t in
src/backend/utils/probes.d for smgr__md__read__done would fix it:


     probe smgr__md__read__start(ForkNumber, BlockNumber, Oid, Oid, Oid, int);
-    probe smgr__md__read__done(ForkNumber, BlockNumber, Oid, Oid, Oid, int, 
long long int, long long int);
+    probe smgr__md__read__done(ForkNumber, BlockNumber, Oid, Oid, Oid, int, 
ssize_t, long long int);


(Making that one nbytes back to int from ssize_t in md.c and seeing if
that silences the warning would also be a way to be more certain that
this is the code that the warning is about.)

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/


Reply via email to