Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#25 Turning on debugging causes core dump

closed-fixed
Sean Morrison
Analysis (10)
8
2005-05-10
2005-03-15
Lee Butler
No

setting bu_debug to do debugging and checking causes rt_dirbuild to
fail.

See attached makefile & app

Discussion

  • Lee Butler
    Lee Butler
    2005-03-15

    Makefile & sample app

     
    Attachments
  • Sean Morrison
    Sean Morrison
    2005-05-09

    Logged In: YES
    user_id=785737

    From what I can tell so far, the problem is isolated to
    BU_DEBUG_MEM_CHECK (code 2) and BU_DEBUG_MEM_QCHECK
    (code 32) -- meaning the problem is likely a bonified memory bug, or a
    problem with the bounds checks in src/libbu/malloc.c

     
  • Sean Morrison
    Sean Morrison
    2005-05-09

    • priority: 5 --> 8
     
  • Sean Morrison
    Sean Morrison
    2005-05-10

    Logged In: YES
    user_id=785737

    One cup of coffee and 8 hours of non-stop debugging later, this problem
    was finally pinpointed and fixed. The debug code in malloc.c was correct,
    rt_dirbuild was a red herring, so was db_open and bu_ptbl_init -- in fact the
    problem manifested itself very very early in the app setup if you tested the
    memory conditions early enough. The problem was in bu_alloc where
    calloc was being called without the padding for the debug checks.

    So the debug tables were "wrong" -- it'd think 36 bytes were allocated when
    in reality only 32 were so when it came time to verify the table (which
    depended on your program and where you tossed in the checks), it would
    choke. The fix was of course trivial, though much ancillary code was
    debugged and cleaned up in the process especially including an efficiency
    improvement in the attribute management.

     
  • Sean Morrison
    Sean Morrison
    2005-05-10

    • assigned_to: nobody --> brlcad
    • status: open --> closed-fixed