Description of problem: Every invocation of i810switch results in a segfault. $ i810switch probe Segmentation fault $ i810switch lcd on Segmentation fault $ i810switch crt on Segmentation fault Version-Release number of selected component (if applicable): i810switch-0.6.5-6.fc7.x86_64 How reproducible: 100% Additional info: $ uname -r 2.6.22.9-91.fc7 $ gdb i810switch GNU gdb Red Hat Linux (6.6-16.fc7rh) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"... Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run probe [Detaching after fork from child process 9853. (Try `set detach-on-fork off'.)] [Detaching after fork from child process 9854.] Program received signal SIGSEGV, Segmentation fault. 0x00000030f566fd50 in _int_free (av=0x30f594c960, mem=0x603010) at malloc.c:4659 4659 unlink(nextchunk, bck, fwd);
Can you provide a backtrace? It looks like it's in free(), however i810switch code never calls free().
Oops, thought I'd pasted the backtrace. (gdb) bt #0 0x00000030f566fd50 in _int_free (av=0x30f594c960, mem=0x603010) at malloc.c:4659 #1 0x00000030f5673b1c in *__GI___libc_free (mem=0x2079726f6d654d09) at malloc.c:3622 #2 0x00000030f565f1eb in _IO_new_fclose (fp=0x603010) at iofclose.c:88 #3 0x00000000004011db in main (argc=<value optimized out>, argv=<value optimized out>) at i810switch.c:394 #4 0x00000030f561dab4 in __libc_start_main (main=0x400fc0 <main>, argc=2, ubp_av=0x7fff86d0e378, init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fff86d0e368) at libc-start.c:222 #5 0x00000000004008d9 in _start ()
Line 394 is a pclose(). Is there any chance you've got a bad copy of lspci installed in your path? pci_f = popen(lspcistr, "r"); if (!pci_f) { fprintf(stderr, "Something is wrong with lspci.\n"); exit(1); } addr = i810_addr(&buff, &len, pci_f); if (addr == 0) { fprintf(stderr, "Something is wrong with lspci.\n"); exit(1); } pclose(pci_f);
and what version is your glibc pls?
I don't have any funnies with pciutils or a broken lspci, alas. pciutils-2.2.4-3.fc7.x86_64 glibc-2.6-4.x86_64
Created attachment 242181 [details] strace -f -s 1024 -o strace.out i810switch probe
Not sure why I'm on the CC here. i810switch-0.6.5-6.fc7.i386 works for me. I don't have an x86_64. But I suppose I can leave myself CC'd since I must've been copied for a reason.
warlord, I was hoping you'd have an x86_64 system and could independently confirm this. I don't. You can remove yourself if you like.
Changing component to glibc to see if those folks have any ideas. Failing in pclose() is just plain odd given it had just finished reading from the same FILE *.
Created attachment 246751 [details] test.c Please test with this trimmed-down application. You can compile it with: export CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' gcc -o test test.c ./test
That program runs perfectly happily.
Gaaaaaah. Stupid, stupid i810switch author. Stupid, stupid C programming language. It's a size_t * / int * mismatch in the parameters to getline.
Created attachment 246891 [details] Bugfix This patch fixes the bug. Sigh.
indeed, looks like it'll fix it. Sorry for the delay, I'll get a build into F-7 testing.
i810switch-0.6.5-7.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update i810switch'
i810switch-0.6.5-7.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.