Bug 2569 - utf-16 iconv module breaks programs
Summary: utf-16 iconv module breaks programs
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.4
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
: 2597 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-13 13:27 UTC by Damian
Modified: 2019-04-10 09:11 UTC (History)
3 users (show)

See Also:
Host: i486-kateos-linux
Target: i486-kateos-linux
Build: i486-kateos-linux
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Damian 2006-04-13 13:27:26 UTC
I've noticed the following problem using samba/xine-ui:

gconv_db.c:232: __gconv_release_step: Assertion `step->__end_fct == ((void *)0)'
failed.

This happens when utf-16 iconv module is loading.

The bug is easy to replicate - just try to run xine-ui.

# xine
This is xine (X11 gui) - a free video player v0.99.4.
(c) 2000-2004 The xine Team.
xine: gconv_db.c:232: __gconv_release_step: Assertion `step->__end_fct == ((void
*)0)' failed.
Aborted
Comment 1 Ulrich Drepper 2006-04-13 16:23:13 UTC
Send a self-contained test case.  Not some reference to a program with dubious
quality.
Comment 2 Dwayne Grant McConnell 2006-04-19 21:47:39 UTC
Do you have a usable testcase for this?
Comment 3 Damian 2006-04-20 05:48:50 UTC
(In reply to comment #2)
> Do you have a usable testcase for this?

No, in all cases i've tested everything is fine. The problem must be elsewhere.
Comment 4 Damian 2006-04-20 10:18:15 UTC
No idea where the bug is, but when i use libiconv xine works. Maybe my glibc
libraries are corrupted, but they works for most of programs (except of xine and
samba). Also iconv tool converts codepages well. I have no time to debug xine
and glibc. I found few persons on google
(http://www.google.pl/search?hl=pl&q=+gconv_db.c%3A232%3A&btnG=Szukaj&lr=) who
have the same problem, so  maybe someone else someday will try to resolve this
problem :) The same bug was reported on samba's bugzilla
(https://bugzilla.samba.org/show_bug.cgi?id=3084), but is not fixed till now.
Comment 5 Damian 2006-04-20 11:10:54 UTC
Sorry guys, this is only samba issue. Xine samba plugin is linked with libsmbclient.

Sorry again. 
Comment 6 Ulrich Drepper 2006-04-24 17:56:03 UTC
*** Bug 2597 has been marked as a duplicate of this bug. ***
Comment 7 Theodoros V. Kalamatianos 2006-04-25 11:54:27 UTC
Ah, I managed to reproduce this with something much simpler than samba :-) :

#include <iconv.h>

int main() {
    iconv_t cd0, cd1;
    cd0 = iconv_open("ISO-8859-7", "UTF-16LE");
    cd1 = iconv_open("ISO-8859-7", "UTF-16LE");
    iconv_close(cd0);
    iconv_close(cd1);
    return 0;
}

It seems that opening two identical conversion descriptors is what triggers the
error. Is there any reason why two identical descriptors should not be allowed ?

Therefore I think that this is a glibc bug, after all. Perhaps reopening it is
in order ?

Regards,

Theodoros Kalamatianos
Comment 8 Damian 2006-04-25 12:26:03 UTC
(In reply to comment #7)
> Ah, I managed to reproduce this with something much simpler than samba :-) :
> 
> #include <iconv.h>
> 
> int main() {
>     iconv_t cd0, cd1;
>     cd0 = iconv_open("ISO-8859-7", "UTF-16LE");
>     cd1 = iconv_open("ISO-8859-7", "UTF-16LE");
>     iconv_close(cd0);
>     iconv_close(cd1);
>     return 0;
> }
> 
> It seems that opening two identical conversion descriptors is what triggers the
> error. Is there any reason why two identical descriptors should not be allowed ?
> 
> Therefore I think that this is a glibc bug, after all. Perhaps reopening it is
> in order ?


I confirm that on my system this code reproduces the bug. In my opinion this
code should work, so i will reopen this bug. Correct me if i'm wrong :) 

Regards.
Comment 9 Ulrich Drepper 2006-04-25 17:23:50 UTC
I cannot reproduce any problem.  Unless you provide detailed reports based on
the *current* sources I'll close the bug again.
Comment 10 Ulrich Drepper 2006-04-25 17:25:02 UTC
Actually, I was too quick.  It does fail on one machine.  I'll look at it.
Comment 11 Ulrich Drepper 2006-04-25 17:44:52 UTC
This is fixed upstream.  It was only an incomplete condition of an assert.  The
actual code is correct.
Comment 12 Florian Weimer 2019-04-10 09:11:54 UTC
Only crashes on startup have been reported, so flagging as security-.