Thread

  1. Re: [PATCH] Add native windows on arm64 support

    Dave Cramer <davecramer@postgres.rocks> — 2024-02-12T21:01:01Z

    On Mon, 12 Feb 2024 at 15:50, Andres Freund <andres@anarazel.de> wrote:
    
    > Hi,
    >
    > On 2024-02-12 13:28:40 -0500, Andrew Dunstan wrote:
    > > On 2024-02-12 Mo 11:44, Dave Cramer wrote:
    > > > OK, so I have managed to get a debugger attached to postgres.exe when
    > it
    > > > faults and the fault occurs at
    > > >
    > https://github.com/postgres/postgres/blob/09eb633e1baa3b7cd7929f3cc77f9c46f63c20b1/src/backend/utils/mmgr/dsa.c#L869
    > > > span is pointing to 0x0
    > >
    > > Further data point. If I select a build type of 'debug' instead of
    > > 'debugoptimized' the error disappears.
    >
    > Oh, this is quite interesting.  Dave, could you post the backtrace?
    >
    
    Andres,
    
    I am using Visual Studio as the debugger. Here is what I have.
    
    > postgres.exe!dsa_free(dsa_area * area, unsigned __int64 dp) Line 869 C
      postgres.exe!resize(dshash_table * hash_table, unsigned __int64
    new_size_log2) Line 879 C
      postgres.exe!dshash_find_or_insert(dshash_table * hash_table, const void
    * key, bool * found) Line 480 C
      postgres.exe!pgstat_get_entry_ref(PgStat_Kind kind, unsigned int dboid,
    unsigned int objoid, bool create, bool * created_entry) Line 455 C
      postgres.exe!pgstat_prep_pending_entry(PgStat_Kind kind, unsigned int
    dboid, unsigned int objoid, bool * created_entry) Line 1123 C
      [Inline Frame] postgres.exe!pgstat_prep_relation_pending(unsigned int)
    Line 904 C
      postgres.exe!pgstat_assoc_relation(RelationData * rel) Line 139 C
      [Inline Frame] postgres.exe!ReadBufferExtended(RelationData *) Line 802 C
      postgres.exe!ReadBuffer(RelationData * reln, unsigned int blockNum) Line
    737 C
      postgres.exe!read_seq_tuple(RelationData * rel, int * buf, HeapTupleData
    * seqdatatuple) Line 1196 C
      postgres.exe!AlterSequence(ParseState * pstate, AlterSeqStmt * stmt) Line
    481 C
      postgres.exe!ProcessUtilitySlow(ParseState * pstate, PlannedStmt * pstmt,
    const char * queryString, ProcessUtilityContext context, ParamListInfoData
    * params, QueryEnvironment * queryEnv, _DestReceiver * dest,
    QueryCompletion * qc) Line 1679 C
      postgres.exe!standard_ProcessUtility(PlannedStmt * pstmt, const char *
    queryString, bool readOnlyTree, ProcessUtilityContext context,
    ParamListInfoData * params, QueryEnvironment * queryEnv, _DestReceiver *
    dest, QueryCompletion * qc) Line 1080 C
      postgres.exe!ProcessUtility(PlannedStmt * pstmt, const char *
    queryString, bool readOnlyTree, ProcessUtilityContext context,
    ParamListInfoData * params, QueryEnvironment * queryEnv, _DestReceiver *
    dest, QueryCompletion * qc) Line 530 C
      postgres.exe!ProcessUtilitySlow(ParseState * pstate, PlannedStmt * pstmt,
    const char * queryString, ProcessUtilityContext context, ParamListInfoData
    * params, QueryEnvironment * queryEnv, _DestReceiver * dest,
    QueryCompletion * qc) Line 1263 C
      postgres.exe!standard_ProcessUtility(PlannedStmt * pstmt, const char *
    queryString, bool readOnlyTree, ProcessUtilityContext context,
    ParamListInfoData * params, QueryEnvironment * queryEnv, _DestReceiver *
    dest, QueryCompletion * qc) Line 1080 C
    
    
    if there is a better debugger to use, please let me know
    
    Dave
    
    
    
    >
    > I wonder if this indicates that we are either missing memory barriers
    > somewhere or that the memory barriers we end up with on msvc + arm aren't
    > correct?  Either could explain why the problem doesn't occur when building
    > with optimizations.
    >
    > Greetings,
    >
    > Andres Freund
    >