Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2004 01:28:47 -0500
From:      Eric De la Cruz Lugo <eric@iteso.mx>
To:        freebsd-questions@freebsd.org
Subject:   Porting software to FreeBSD 5.2.1
Message-ID:  <1081751327.407a371fa817f@iteso.mx>

next in thread | raw e-mail | index | archive | help
Hi All: 
 
Am trying to modify a code in order to run it in FreeBSD, this code was 
intendend for Linux only, after several days modifying code a mannaged to 
compile it "successfully" and ended with a binary, called "post" this program 
is a client side of a systema called BhPos, the server side is working ok, but 
this client is dying every time with a segmentation fault. 
 
debugging the core file from the post excecution I found the following: 
 
 terra# gdb /usr/bin/post 
 GNU gdb 5.2.1 (FreeBSD) 
 Copyright 2002 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 "i386-unknown-freebsd"... 
 (gdb) core-file post.core 
 Core was generated by `post'. 
 Program terminated with signal 11, Segmentation fault. 
 Reading symbols from /usr/local/lib/libgtkmm-1.2.so.3...done. 
 Loaded symbols for /usr/local/lib/libgtkmm-1.2.so.3 
 Reading symbols from /usr/local/lib/libgdkmm-1.2.so.2...done. 
 Loaded symbols for /usr/local/lib/libgdkmm-1.2.so.2 
 Reading symbols from /usr/X11R6/lib/libgtk12.so.2...done. 
 Loaded symbols for /usr/X11R6/lib/libgtk12.so.2 
 Reading symbols from /usr/X11R6/lib/libgdk12.so.2...done. 
Loaded symbols for /usr/X11R6/lib/libgdk12.so.2 
 Reading symbols from /usr/local/lib/libgmodule12.so.3...done. 
 Loaded symbols for /usr/local/lib/libgmodule12.so.3 
 Reading symbols from /usr/local/lib/libglib12.so.3...done. 
 Loaded symbols for /usr/local/lib/libglib12.so.3 
 Reading symbols from /usr/local/lib/libintl.so.5...done. 
 Loaded symbols for /usr/local/lib/libintl.so.5 
 Reading symbols from /usr/X11R6/lib/libXi.so.6...done. 
 Loaded symbols for /usr/X11R6/lib/libXi.so.6 
 Reading symbols from /usr/X11R6/lib/libXext.so.6...done. 
 Loaded symbols for /usr/X11R6/lib/libXext.so.6 
 Reading symbols from /usr/X11R6/lib/libX11.so.6...done. 
 Loaded symbols for /usr/X11R6/lib/libX11.so.6 
 Reading symbols from /usr/local/lib/libsigc.so.1...done. 
 Loaded symbols for /usr/local/lib/libsigc.so.1 
 Reading symbols from /usr/local/lib/libxml2.so.5...done. 
 Loaded symbols for /usr/local/lib/libxml2.so.5 
 Reading symbols from /lib/libz.so.2...done. 
 Loaded symbols for /lib/libz.so.2 
 Reading symbols from /usr/local/lib/libiconv.so.3...done. 
 Loaded symbols for /usr/local/lib/libiconv.so.3 
 Reading symbols from /usr/lib/bhpos/libbhtrans.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhtrans.so.1 
Reading symbols from /usr/lib/bhpos/libbhcash.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhcash.so.1 
 Reading symbols from /usr/lib/bhpos/libbhcfg.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhcfg.so.1 
 Reading symbols from /usr/lib/bhpos/libbhwgt.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhwgt.so.1 
 Reading symbols from /usr/lib/bhpos/libbhkmap.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhkmap.so.1 
 Reading symbols from /usr/lib/bhpos/libbhgrp.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhgrp.so.1 
 Reading symbols from /usr/lib/bhpos/libbhlocale.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhlocale.so.1 
 ---Type <return> to continue, or q <return> to quit--- 
 Reading symbols from /usr/lib/bhpos/libbhdev.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhdev.so.1 
 Reading symbols from /usr/lib/bhpos/libbhbc.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhbc.so.1 
 Reading symbols from /usr/lib/bhpos/libbhkeyb.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhkeyb.so.1 
 Reading symbols from /usr/lib/bhpos/libbhkeyl.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhkeyl.so.1 
 Reading symbols from /usr/lib/bhpos/libbhdisp.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhdisp.so.1 
Reading symbols from /usr/lib/bhpos/libbhms.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhms.so.1 
 Reading symbols from /usr/lib/bhpos/libbhcashd.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhcashd.so.1 
 Reading symbols from /usr/lib/bhpos/libbhcustd.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhcustd.so.1 
 Reading symbols from /usr/lib/bhpos/libbhprinter.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhprinter.so.1 
 Reading symbols from /usr/lib/bhpos/libbhmicr.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhmicr.so.1 
 Reading symbols from /usr/lib/bhpos/libbhsc.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhsc.so.1 
 Reading symbols from /usr/lib/bhpos/libbhdt.so.1...done. 
 Loaded symbols for /usr/lib/bhpos/libbhdt.so.1 
 Reading symbols from /usr/lib/libstdc++.so.4...done. 
 Loaded symbols for /usr/lib/libstdc++.so.4 
 Reading symbols from /lib/libm.so.2...done. 
 Loaded symbols for /lib/libm.so.2 
 Reading symbols from /usr/lib/libc_r.so.5...done. 
 Loaded symbols for /usr/lib/libc_r.so.5 
 Reading symbols from /lib/libc.so.5...done. 
 Loaded symbols for /lib/libc.so.5 
 Reading symbols from /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2...done. 
 Loaded symbols for /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 
 Reading symbols from /libexec/ld-elf.so.1...done. 
 Loaded symbols for /libexec/ld-elf.so.1 
 #0 0x288c3c75 in strdup () from /lib/libc.so.5 
 (gdb) 
 
 hope this helps a bit to understand what is happening with the post 
program. 
 
 still working on my side. 
 
 Eric. 
 
I recieved the following answer from the creator of this software: 
 
 
Re: Still can't get client to connect to server  
 Sun, 11 April 2004 11:19   
 
 
You probably know that libc is the library that includes all the standard C 
commands (such as printf, read, open, etc.and so on) as well as system calls. 
Up until 1997, the only library available was the GNU libc v1, which since the 
move to ELF binary format was given major number 5 (/lib/libc.so.5). In 1997, 
the Free Software Foundation developed GNU libc v2, with the intention of 
being cleaner, more portable, and more standard (POSIX compliant). Under 
Linux, this version got major number 6, hence it's called libc6. These two 
libraries are incompatible - if a program is compiled with one libc's headers 
and stubs, it can't be used with the other. 
 
 
any one knows how i can use the libc6 in the linux compat directory? i have 
checked on my sistem and in fact i have it!  
 
/usr/compat/linux/lib/libc.so.6 
 
thanks in advance for your help on this. 
 
 
 

---



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1081751327.407a371fa817f>