Reproductible signal 11 while linking with ftd2xx.lib

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Reproductible signal 11 while linking with ftd2xx.lib

Jean-Christian de Rivaz

I use i586-mingw32msvc-cc (GCC) 4.2.1-sjlj (mingw32-2) on a AMD64 Debian
Lenny. I have successfully produced simples executables with it, linked
with the glib for windows. Fine.

Now I try to use the ftd2xx library that can be found on this URL . Compiling an object using the
header file go right:

i586-mingw32msvc-cc -o main.o ../src/main.c -c -Istaging/CDM\ 2.04.06\
WHQL\ Certified -mms-bitfields -Istaging/include/glib-2.0
-Istaging/lib/glib-2.0/include   -std=gnu99 -Wall -Werror -O3 -g

But linking this object to make an executable alway return a
segmentation fault:

i586-mingw32msvc-cc -o gtest.exe main.o -Lstaging/CDM\ 2.04.06\ WHQL\
Certified/i386 -Lstaging/lib -lglib-2.0 -lintl   -static -lftd2xx
collect2: ld terminated with signal 11 [Erreur de segmentation]

I tested on two machines with the exact same result, so I am pretty
certain this is not a hardware issue. Using strace I found that the
linker open this file:

12380 open("staging/CDM 2.04.06 WHQL Certified/i386/ftd2xx.lib",

And do fstat, mmap, lseek, read, lseek... on it. Seem to be right. A lot
of strace lines after, it segfault at this:

12380 read(6,
32768) = 20438
12380 lseek(4, 458752, SEEK_SET)        = 458752
12380 lseek(6, -16182, SEEK_CUR)        = 4256
12380 write(6, "\360Q\0\0"..., 4)       = 4
12380 lseek(6, 0, SEEK_SET)             = 0
12380 read(6,
32768) = 20438
12380 --- SIGSEGV (Segmentation fault) @ 0 (0) ---

Rolling back, it seem that the files descriptors are from the open() below:

12380 open("gtest.exe", O_RDWR)         = 6

If I remove the -lftd2xx option, I get this (as expected):

i586-mingw32msvc-cc -o gtest.exe main.o -Lstaging/CDM\ 2.04.06\ WHQL\
Certified/i386 -Lstaging/lib -lglib-2.0 -lintl
main.o: In function `main':
/home/jcdr/try/mingw-validation/win32/../src/main.c:30: undefined
reference to `__imp__FT_CreateDeviceInfoList@4'
collect2: ld returned 1 exit status

The code I try to compile is roughly the example at this URL

Any idea ?

Best Regards,
Jean-Christian de Rivaz

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at: