#71 Segmentation Fault mged

closed-accepted
Sean Morrison
7
2011-03-29
2011-03-29
Matt Curry
No

Hello,

I presume this is still an open issue, but still getting segmentation faults running mged when compiling from source. OS X 10.6.6 and version 7.18.2.

I tried ./config --enable-opengl and make clean and re-making, to no avail.

Probably related to issue 3016416.

Is there any hope running brl-cad in osx?

Thanks.

Discussion

  • Matt Curry
    Matt Curry
    2011-03-29

    crash report

     
    Attachments
  • Matt Curry
    Matt Curry
    2011-03-29

    sorry, brl-cad ver 7.18.3, not 2.

     
  • Matt Curry
    Matt Curry
    2011-03-29

    After digging around a bit, found this. Wondering if quick fix is within my very limited programming abilities...

    /* FIXME: Applications on Mac OS X linking against the system
    * Tcl/Tk frameworks may crash here due to dpy being a high (7+
    * digit) value and the screens[] array it indexes into being 0x0.
    * Might have better luck calling functions instead of macros.
    */

    if (dmp->dm_width == 0) {
    dmp->dm_width =
    DisplayWidth(pubvars->dpy,
    DefaultScreen(pubvars->dpy)) - 30;
    ++make_square;
    }

     
  • Matt Curry
    Matt Curry
    2011-03-29

    Why is (pubvars->dpy)->screens not being initialized?

    Where is it supposed to be initialized?

    Program received signal EXC_BAD_ACCESS, Could not access memory.
    Reason: KERN_INVALID_ADDRESS at address: 0x0000000853410818
    0x000000010013a377 in X_open_dm (interp=0x110088010, argc=6, argv=0x11008d178) at dm-X.c:583
    583 dmp->dm_width =
    (gdb) list
    578 * digit) value and the screens[] array it indexes into being 0x0.
    579 * Might have better luck calling functions instead of macros.
    580 */
    581
    582 if (dmp->dm_width == 0) {
    583 dmp->dm_width =
    584 DisplayWidth(pubvars->dpy,
    585 DefaultScreen(pubvars->dpy)) - 30;
    586 ++make_square;
    587 }
    (gdb) print *pubvars->dpy
    $1 = {
    ext_data = 0x0,
    private1 = 0x0,
    fd = 0,
    private2 = 0,
    proto_major_version = 545,
    proto_minor_version = 0,
    vendor = 0x10f8a1ee0 "Apple AppKit RR 1038.35",
    private3 = 0,
    private4 = 0,
    private5 = 0,
    private6 = 0,
    resource_alloc = 0x10f8364b9 <TkpCloseDisplay+125>,
    byte_order = 0,
    bitmap_unit = 0,
    bitmap_pad = 0,
    bitmap_bit_order = 0,
    nformats = 0,
    pixmap_format = 0x0,
    private8 = 0,
    release = 4198,
    private9 = 0x0,
    private10 = 0x0,
    qlen = 0,
    last_request_read = 1,
    request = 0,
    private11 = 0x0,
    private12 = 0x0,
    private13 = 0x0,
    private14 = 0x0,
    max_request_size = 0,
    db = 0x0,
    private15 = 0x10f8531e1,
    display_name = 0x100000000 "????\a",
    default_screen = 279347728,
    nscreens = 1,
    screens = 0x0,
    motion_buffer = 0,
    private16 = 0,
    min_keycode = 0,
    max_keycode = 0,
    private17 = 0x0,
    private18 = 0x0,
    private19 = 0,
    xdefaults = 0x0
    }
    (gdb)

     
  • Sean Morrison
    Sean Morrison
    2011-03-29

    Sorry for taking a while to respond but the problem arises from the mixed use of the system Tcl/Tk with X11. If you rm *cache* and rerun configure with --enable-all then the build should complete and the crash should go away.

    The problem stems from the system Tk that is included with OSX not initializing X11 data structures. So any code that tries to make an X11 call ends up unexpectedly crashing. There's not much we can do on our end other than turn use of the system library on/off or completely rewriting our display code to not make any X11 calls. The option I mentioned (--enable-all) does the prior and should resolve this for you.

     
  • Sean Morrison
    Sean Morrison
    2011-03-29

    • labels: --> Compilation & Installation
    • priority: 5 --> 7
    • assigned_to: nobody --> brlcad
    • status: open --> pending-accepted
     
  • Matt Curry
    Matt Curry
    2011-03-29

    • status: pending-accepted --> open-accepted
     
  • Matt Curry
    Matt Curry
    2011-03-29

    Awesome, works. Thanks!

     
  • Sean Morrison
    Sean Morrison
    2011-03-29

    • status: open-accepted --> closed-accepted