c - I want to determine the cause of a sigsegv -


i'm writing applicaiton gentoo linux , redhat linux, 1 of funciton crashes on redhat machine

usleep(100000);     display *display;     display = xopendisplay(null);     window w;     int x,y,i;     unsigned m;     window root = xdefaultrootwindow(display);     xquerypointer(display,root,&root,&w,&x,&y,&i,&i,&m);     ximage *image;     sleep(1);     image = xgetimage(display,root,0,0,1366,768,allplanes,xypixmap);     int pixel = xgetpixel(image,x,y);     printf("\\clr(%i,%i,%i){}\n",x,y,pixel);     xclosedisplay(display); 

this function crashes segmentation fault on rhel machine

running progrma in gdb: program received signal sigsegv, segmentation fault. 0x000000369942cb48 in ?? () /usr/lib64/libx11.so.6 missing separate debuginfos, use: debuginfo-install atk-1.30.0-1.el6.x86_64 cairo-1.8.8-6.el6_6.x86_64 expat-2.0.1-11.el6_2.x86_64 fontconfig-2.8.0-5.el6.x86_64 freetype-2.3.11-15.el6_6.1.x86_64 gdk-pixbuf2-2.24.1-6.el6_7.x86_64 glib2-2.28.8-4.el6.x86_64 glibc-2.12-1.166.el6_7.1.x86_64 gtk2-2.24.23-6.el6.x86_64 libx11-1.6.0-6.el6.x86_64 libxau-1.0.6-4.el6.x86_64 libxcomposite-0.4.3-4.el6.x86_64 libxcursor-1.1.14-2.1.el6.x86_64 libxdamage-1.1.3-4.el6.x86_64 libxext-1.3.2-2.1.el6.x86_64 libxfixes-5.0.1-2.1.el6.x86_64 libxi-1.7.2-2.2.el6.x86_64 libxinerama-1.1.3-2.1.el6.x86_64 libxrandr-1.4.1-2.1.el6.x86_64 libxrender-0.9.8-2.1.el6.x86_64 libxtst-1.2.2-2.1.el6.x86_64 libpng-1.2.49-2.el6_7.x86_64 libselinux-2.0.94-5.8.el6.x86_64 libxcb-1.9.1-3.el6.x86_64 pango-1.28.1-10.el6.x86_64 pixman-0.32.4-4.el6.x86_64 zlib-1.2.3-29.el6.x86_64

unfortunately cannot install additional packages(or install 3rd party repos) rhel machines

backtrace: (gdb) bt

0 0x000000369942cb48 in ?? () /usr/lib64/libx11.so.6

1 0x00000000004048ce in main (argc=2, argv=0x7fffffffe148) @ tat.c:92

line 92 : int pixel = xgetpixel(image,x,y);

the application works fine if line removed

thanks

use xgetwindowattributes find real width/heitgh of screen. not use hardcoded values.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -