Re: mount_msdosfs tries to load nonexistent libiconv.so

From: Oleg V. Nauman <oleg_at_reis.zp.ua>
Date: Mon, 11 Oct 2004 16:07:49 +0300
On Sun, Oct 10, 2004 at 09:47:24AM -0500, Ryan Sommers wrote:
> Oleg V. Nauman wrote:
> 
> >	So, my questions:
> >1. Why dependens for the third party software not documented in the
> >man 8 mount_msdosfs?
> > 
> >
> What version of FreeBSD are you on? Your mount_msdosfs binary is looking 
> for /lib/libiconv.so which I think is now /lib/libkiconv.so.1 (that's 
> what my mount_msdosfs look for anyway). I imagine this is because of the 
> recent library version bump, and doing an upgrade of your world (and 
> kernel depending how out of date your world is) will get you going.

	It is looks like /lib/libkiconv.so.1 tries to load libiconv.so
After rebuilt my /sbin/mount_msdosfs, /lib/libkiconv.so.1 and
/usr/lib/libc.so.5 with debugging symbols I got (script with my
gdb session):

Script started on Mon Oct 11 13:09:36 2004
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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-marcel-freebsd"..
Breakpoint 1 at 0x8048c05: file mount_msdosfs.c, line 93.

Breakpoint 1, main (argc=7, argv=0xbfbfecd0) at mount_msdosfs.c:93
93		mntflags = set_gid = set_uid = set_mask = set_dirmask = 0;

(gdb) next
94		(void)memset(&args, '\0', sizeof(args));
(gdb) next
95		args.magic = MSDOSFS_ARGSMAGIC;
(gdb) next
97		args.cs_win = NULL;
(gdb) next
98		args.cs_dos = NULL;
(gdb) next
99		args.cs_local = NULL;
(gdb) next
101		while ((c = getopt(argc, argv, "sl9u:g:m:M:o:L:D:W:")) != -1) {
(gdb) next
181				break;
(gdb) next
105			switch (c) {
(gdb) next
132				if (setlocale(LC_CTYPE, optarg) == NULL)
(gdb) next
134				csp = strchr(optarg,'.');
(gdb) next
135				if (!csp)
(gdb) next
137				args.cs_local = malloc(ICONV_CSNMAXLEN);
(gdb) next
138				if (args.cs_local == NULL)
(gdb) next
140				strncpy(args.cs_local,
(gdb) next
143				break;
(gdb) next
181				break;
(gdb) next
105			switch (c) {
(gdb) next
155				args.cs_local = malloc(ICONV_CSNMAXLEN);
(gdb) next
156				if (args.cs_local == NULL)
(gdb) next
158				args.cs_dos = malloc(ICONV_CSNMAXLEN);
(gdb) next
159				if (args.cs_dos == NULL)
(gdb) next
161				if (strcmp(optarg, "iso22dos") == 0) {
(gdb) next
164				} else if (strcmp(optarg, "iso72dos") == 0) {
(gdb) next
167				} else if (strcmp(optarg, "koi2dos") == 0) {
(gdb) next
168					strcpy(args.cs_local, "KOI8-R");
(gdb) next
169					strcpy(args.cs_dos, "CP866");
(gdb) next
181				break;
(gdb) next
185		if (optind + 2 != argc)
(gdb) next
188		if (set_mask && !set_dirmask) {
(gdb) next
192		else if (set_dirmask && !set_mask) {
(gdb) next
197		dev = argv[optind];
(gdb) next
198		dir = argv[optind + 1];
(gdb) next
200		if (args.cs_local) {
(gdb) next
201			if (set_charset(&args) == -1)
(gdb) step
set_charset (args=0xbfbfead0) at mount_msdosfs.c:325
325		if (modfind("msdosfs_iconv") < 0)
(gdb) next
331		if ((args->cs_win = malloc(ICONV_CSNMAXLEN)) == NULL)
(gdb) next
332			return (-1);
(gdb) next
331		if ((args->cs_win = malloc(ICONV_CSNMAXLEN)) == NULL)
(gdb) next
333		strncpy(args->cs_win, ENCODING_UNICODE, ICONV_CSNMAXLEN);
(gdb) next
334		error = kiconv_add_xlat16_cspairs(args->cs_win, args->cs_local);
(gdb) step
kiconv_add_xlat16_cspairs (foreigncode=0x804b0a0 "ISO-10646-UCS-2", 
    localcode=0x804b060 "KOI8-R") at xlat16_iconv.c:121
121		error = kiconv_add_xlat16_cspair(foreigncode, localcode,
(gdb) step
kiconv_add_xlat16_cspair (tocode=0x804b0a0 "ISO-10646-UCS-2", 
    fromcode=0x804b060 "KOI8-R", flag=12) at xlat16_iconv.c:75
75		if (sysctlbyname("kern.iconv.cslist", NULL, &size, NULL, 0) == -1)
(gdb) next
76			return (-1);
(gdb) next
75		if (sysctlbyname("kern.iconv.cslist", NULL, &size, NULL, 0) == -1)
(gdb) next
77		if (size > 0) {
(gdb) next
92		xt = kiconv_xlat16_open(tocode, fromcode, flag);
(gdb) step
kiconv_xlat16_open (tocode=0x804b0a0 "ISO-10646-UCS-2", 
    fromcode=0x804b060 "KOI8-R", lcase=12) at xlat16_iconv.c:146
146		xt.data = NULL;
(gdb) next
147		xt.size = 0;
(gdb) next
149		src[2] = '\0';
(gdb) next
150		dst[3] = '\0';
(gdb) next
152		ret = my_iconv_init();
(gdb) next
mount_msdosfs: Unable to load iconv library: Shared object "libiconv.so" not found, required by "mount_msdosfs"
: Unknown error: 0
153		if (ret)
(gdb) quit
The program is running.  Exit anyway? (y or n) y

Script done on Mon Oct 11 13:11:54 2004

	My .dgbinit was:
file /sbin/mount_msdosfs
break main
run -L ru_RU.KOI8-R -W koi2dos /dev/ad0s1 /mnt/C

-- 
NO37-RIPE
Received on Mon Oct 11 2004 - 12:29:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:16 UTC