Re: approaches to debugging a platform-dependant bug
by Corion (Patriarch) on Apr 09, 2006 at 18:04 UTC
|
First step of all steps would be to get an accurate error description. Maybe you have it already, but I think it would help if you shared that error description with us.
From what I've seen, there are some problems with the locale set on Red Hat systems - I think that Red Hat exports LANG=en_US.utf8 or something like that which has given people grief. Maybe deleting that entry from the environment or setting it to "C" or something like that helps.
As a general idea, I'd go for one of the many virtualization packages and run Red Hat in a virtual machine - almost every modern operating system offers virtual machines to contain other operating systems.
| [reply] [d/l] |
|
if (exists $ENV{LANG}) {
$ENV{LANG} =~ m/^(..)/;
$preferences{'language'} = lc($1);
}
So if red hat sets it to "en_US.utf8", it seems that the language would still be correctly recognized as "en". However, I think it's very likely that something along the lines of what you're saying must be the problem. Just on general principles, I should probably also do more error checking and sanity checking on the language code I'm extracting from $LANG. | [reply] [d/l] |
Re: approaches to debugging a platform-dependant bug
by graff (Chancellor) on Apr 09, 2006 at 23:50 UTC
|
These people seem to be running fairly modern versions of everything (e.g., Red Hat 9 and perl 5.8.0).
I'm sorry, but these days, RH-9 and perl 5.8.0 are not that current, and on top of that, this particular combination has some known problems that stem from the fact that perl's treatment of file i/o was dependent on the user's locale environment. From the "Perl 5.8.1 Official Announcement":
UTF-8 On Filehandles No Longer Activated By Locale
In Perl 5.8.0 all filehandles, including the standard filehandles, were implicitly set to be in Unicode UTF-8 if the locale settings indicated the use of UTF-8. This feature caused too many problems, so the feature was turned off and redesigned...
The problems involved getting a lot of mayhem from existing apps, which folks were expecting should have ported seemlessly from 5.6 or earlier, and had nothing to do with unicode data. They broke because instead of reading data "as-is", the user's default locale setting (which on RH9 involved utf8) was treating any sort of non-ascii data as something unexpected, usually producing "malformed utf8" errors.
I think the best fix might be to put "use bytes" at the top of the script (assuming this is appropriate) -- though I'm not sure if this is always adequate. Another idea would be to check the perl version and OS, and if it's 5.8.0 on RH9, apply binmode ":raw" on file handles, to disable the treatment of file i/o as utf8 (assuming this is appropriate).
You'll still need someone with that combo to serve as a beta tester. Someone might be willing to give you a user account on such a box, and if so, you can debug on your own. But short of that, package up a minimal app and test data that would demonstrate the problem you need to fix, and ask a beta tester with the target setup to run it and send you back the output. Iterate till you get it solved. (Bummer) | [reply] |
|
Thanks for the very informative post! I've verified now that it runs fine when I boot from a Fedora Core 3 bootable CD, which supports your hypothesis about that specific version of red hat and perl.
| [reply] |
Re: approaches to debugging a platform-dependant bug
by eXile (Priest) on Apr 09, 2006 at 19:13 UTC
|
http://www.sourceforge.net has a compile farm for open source projects. Never worked with it and don't know the details on how to get access to it, but it might be useful for running,debugging,testing your app on several platforms.
If you want to go for the Live CD approach, you might find a RedHat like live CD on http://distrowatch.com. | [reply] |
|
Thanks for the pointer to distrowatch! I downloaded a bootable CD called Adios, which runs Fedora Core 3, and verified that the program runs fine on it. So it looks like this problem only exists on specific older versions of Red Hat.
| [reply] |
Re: approaches to debugging a platform-dependant bug
by traveler (Parson) on Apr 09, 2006 at 18:49 UTC
|
Does anyone have any bright ideas on how to debug a platform-dependent problem like this?
This is where virtualization really shines. Get a copy of the free VMWare player, XEN or another favorite virtual machine tool, install RedHat and test! Linux Journal just did an issue with articles on virtualization. I know developers who have four simultaneous virtual machines up and running constantly to test apps on different platforms. Way cool and easy to implement.
--traveler | [reply] |
|
Hmm...I checked out vmware and xen, and decided to give xen a shot, since it's open source, and vmware isn't (?). I got xen runnning from the demo cd, but unfortunately Red Hat isn't one of the options that comes on the demo cd. Then I started working on getting a full install of xen working, but after putting a few hours into it, it looks like that's just beyond my expertise. Cool idea, but in my case, with my skills, it just doesn't seem to be practical.
| [reply] |
|
| [reply] |