Menu

#652 Linux ScreenList will crash app

open
nobody
None
gfxlib2
2013-11-07
2013-01-25
XUnwichtig
No

the linux screenlist command use "xrandr" without checking if xinerama exist. this is a bad idea and will crash the app if using screenlist command.

the ebst way is to check if xinerama is exist and running on the system 'XineramaIsActive(disp)' and if yes, use xinerama commands to resolve the posible resolutions. else if no, then can xrandr use.

Discussion

  • dkl

    dkl - 2013-01-25

    Could this be related to [65800c]?

    Also, I'm wondering, does it crash in the gfxlib2 code, or inside X11 functions?

    ScreenList can call XRRGetScreenInfo() without checking XRRQueryExtension() and XRRQueryVersion(), that could be related too.

     

    Related

    Commit: [65800c]


    Last edit: dkl 2013-01-25
  • XUnwichtig

    XUnwichtig - 2013-11-07

    xrandr and xinerama can't work together. xinerama causes xrandr to malfunction. So, its bedder to check manualy and then use the right function to get the resolution.

    the wiki-example to screenlist produce this error:

    tpm@kiste12:/media/data20_md0/Projekte/freeBASIC/test/test7$ fbc -version
    FreeBASIC Compiler - Version 0.24.0 (11-04-2013) for linux
    Copyright (C) 2004-2012 The FreeBASIC development team.
    objinfo disabled
    tpm@kiste12:/media/data20_md0/Projekte/freeBASIC/test/test7$ fbc test7.bas -g && valgrind ./test7
    ==12042== Memcheck, a memory error detector
    ==12042== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
    ==12042== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
    ==12042== Command: ./test7
    ==12042==
    Resolutions supported at 8 bits per pixel:
    ==12042== Invalid read of size 4
    ==12042== at 0x4A6461A: ??? (in /usr/lib32/libXrandr.so.2.2.0)
    ==12042== by 0x4A6474C: XRRGetScreenInfo (in /usr/lib32/libXrandr.so.2.2.0)
    ==12042== by 0x804B173: fb_hX11FetchModes (gfx_x11.c:863)
    ==12042== by 0x804ADA1: fb_GfxScreenList (gfx_screenlist.c:61)
    ==12042== by 0x804AC38: main (test7.bas:5)
    ==12042== Address 0x4 is not stack'd, malloc'd or (recently) free'd
    ==12042==
    ==12042==
    ==12042== HEAP SUMMARY:
    ==12042== in use at exit: 76,395 bytes in 43 blocks
    ==12042== total heap usage: 90 allocs, 47 frees, 93,708 bytes allocated
    ==12042==
    ==12042== LEAK SUMMARY:
    ==12042== definitely lost: 0 bytes in 0 blocks
    ==12042== indirectly lost: 0 bytes in 0 blocks
    ==12042== possibly lost: 10 bytes in 1 blocks
    ==12042== still reachable: 76,385 bytes in 42 blocks
    ==12042== suppressed: 0 bytes in 0 blocks
    ==12042== Rerun with --leak-check=full to see details of leaked memory
    ==12042==
    ==12042== For counts of detected and suppressed errors, rerun with: -v
    ==12042== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 35 from 6)
    Speicherzugriffsfehler
    tpm@kiste12:/media/data20_md0/Projekte/freeBASIC/test/test7$

     

    Last edit: XUnwichtig 2013-11-07

Log in to post a comment.

MongoDB Logo MongoDB