Description of problem: newt-0.51.6-rhel4-42-input-universal.patch broke compilation of anaconda Version-Release number of selected component (if applicable): RHEL4 U3, newt-0.51.6-7.rhel4.src.rpm, anaconda-10.1.1.37-1.src.rpm How reproducible: Steps to Reproduce: 1. rpmbuild --rebuild newt-0.51.6-7.rhel4.src.rpm 2. rpm -Uvh /usr/src/redhat/RPMS/i386/newt-* 3. rpmbuild --rebuild anaconda-10.1.1.37-1.src.rpm Actual results: diet gcc -g -static -o loader loader.o log.o moduleinfo.o loadermisc.o modules.o moduledeps.o windows.o lang.o kbd.o modstubs.o driverdisk.o selinux.o md5.o mediacheck.o kickstart.o driverselect.o getparts.o dirbrowser.o pcmcia.o usb.o firewire.o hardware.o method.o cdinstall.o hdinstall.o nfsinstall.o urlinstall.o dietstubs.o ctype.o net.o urls.o ftp.o telnet.o telnetd.o -lpopt \ -lkudzu_loader -lpci_loader ../isys/libisys-diet.a -lrpc ../isys/gzlib/libgunzip-diet.a \ -lpump -lresolv -lnewt -lslang -lbtermdiet -lbogldiet -lwlitediet /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x299): In function `entryDraw': : undefined reference to `__ctype_get_mb_cur_max' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x2b1): In function `entryDraw': : undefined reference to `mbtowc' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x317): In function `entryDraw': : undefined reference to `__ctype_get_mb_cur_max' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x332): In function `entryDraw': : undefined reference to `mbtowc' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x7d6): In function `entryEvent': : undefined reference to `__ctype_get_mb_cur_max' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x7e4): In function `entryEvent': : undefined reference to `mblen' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x82a): In function `entryEvent': : undefined reference to `__ctype_get_mb_cur_max' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x836): In function `entryEvent': : undefined reference to `mblen' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x96d): In function `entryEvent': : undefined reference to `__ctype_get_mb_cur_max' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x97e): In function `entryEvent': : undefined reference to `mblen' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x9c7): In function `entryEvent': : undefined reference to `__ctype_get_mb_cur_max' /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libnewt.a(entry.o)(.text+0x9d8): In function `entryEvent': : undefined reference to `mblen' collect2: ld returned 1 exit status make[1]: *** [loader] Error 1 make[1]: Leaving directory `/usr/src/redhat/BUILD/anaconda-10.1.1.37/loader2' make: *** [subdirs] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.35687 (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.35687 (%build) Expected results: success build of anaconda Additional info: When strings in newt src.rpm: %patch2 -p1 -b .input-universal %patch3 -p1 -b .input-fixes %patch4 -p0 -b .double-free is commented or deleted, and newt rebuilded without that patches, anaconda builds successfuly.
Confirmed. The problem is that there is no mbtowc in dietlibc which was used back then with anaconda. The two straightforward solutions that i can think of right now is: a) use newt without the fix for anaconda (eg. by including source of newt as a part of anaconda src.rpm and linking to that) or b) implementing mbtowc in anaconda in rhel4. The a) solution is probably fairly more safe, b) eventually solves the multibyte input problems in anaconda TUI (which is probably low enough priority to forget it). There's c) implement dummy mbtowc, but i will have to first investigate if it wouldn't introduce bad side-effects in newt code. In any case, i will also look into __ctype_get_mb_cur_max -- it may cause additional headache with b) or c).
After further investigation it turns out that anaconda has mbrtowc stub available. So converting newt to use mbrtowc instead of mbtowc would be probably a good idea (also considering that mbtowc is thread-unsafe). Unless something else pops up i'll go ahead with this plan.
Created attachment 126963 [details] proposed patch
Peter, I confirm, that with your patch (id=126963) everything is fine with anaconda compilation. Thanks for your work. Bug seems to be resolved.
This issue is on Red Hat Engineering's list of planned work items for the upcoming Red Hat Enterprise Linux 4.4 release. Engineering resources have been assigned and barring unforeseen circumstances, Red Hat intends to include this item in the 4.4 release.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2006-0309.html