The always helpful community

Submitted by Robert Szeleney on Wed, 2006-04-19 18:34.

As we all have heard multiple times already, a real advantage of open source is the helpful community. You can just pop into an IRC channel, ask your questions, and bang, you have your answer.

Hah, just make sure to not visit #perl then.
Don't think that you get any reasonable answer when you post following question:

..
I have a small 15 line sample program which works correctly in Windows and Linux, but unfortunately not in SkyOS. A simple arithmetic operation failes. Could anyone tell me which source/function could be responsible for this?
..

I asked this in the hope to get a few hints where I can continue my debug session. (which I did for almost 6 hours to get the few lines of code to reproduce the error and make the work for the #perl people very easy).

Anyway, instead of hints I got following:

[18:53] RobertSze: Hi guys! I recently ported perl 5.8.8 to SkyOS. The port is know to work mostly because a lot of application use perl while building/compiling. (for instance: firefox, gtk, ...). Unfortunately it seems that there is a bug in the port which occures when running autoconf. Autoconf calls a lot of perl modules of which one failes. After debugging this for a while I have been able to reproduce this in a small program. (Link: .....). This programs works fine in windows and linux, but not in SkyOS. Has anyone an idea whats going wrong there?



After a long disussion and no answer I asked following:


RobertSze: is there something like a perl developer channel?

[18:58] amnesiac: RobertSze, and what do you think is this channel about?
[18:58] amnesiac: aahh, sorry this is #perl, we discuss life in here
[19:12] Ani-_: RobertSze: did you actual run the code you pasted?
[19:13] Ani-_: RobertSze: or did you simply select some random peieces of your code and posted those?
[19:14] Ani-_: RobertSze: and what is Skyos? And what perl version is that?

[19:15] RobertSze: Ani-_: (Link: http://www.skyos.org)http://www.skyos.org
[19:15] RobertSze: Ani-_: 5.8.8

[19:15] Ani-_: RobertSze, and why are you giving a script the extension of a module? .pm ==> module. Your code is not a module so don't use .pm.
[19:16] Ani-_: RobertSze: are you sure it's 5.8.8? Or are you simply guessing? (as in, how did you figure out it was 5.8.8?)

[19:16] RobertSze: Ani-_: I downloaded and ported it.
[19:16] RobertSze: (Link: http://www.cpan.org/src/stable.tar.gz)http://www.cpan.org/src/stable.tar.gz

[19:17] Ani-_: So YOU ported it? And then you are complaning that it doesn't work?
[19:17] dvtoo: that seems a little crazy
[19:18] Ani-_: YOU clearly did something wrong when porting it. Or maybe your system already has a perl?

[19:18] RobertSze: Ani-_: yes, I ported it and yes I try to get help on how to fix this problem

[19:18] Ani-_: Perhaps you need to run perl -V to verify it?
[19:18] Ani-_: RobertSze, I certainly wonder, did you botter running make test?

[19:18] RobertSze: it is definitely 5.8.8. SkyOS didn't have perl before

[19:19] Ani-_: Says you. I don't believe you. I only believe (to a certain extent) perl -V.

[19:19] RobertSze: Ani-_: man, I develop SkyOS and I know exactely whats running on it
[19:20] RobertSze: trust me, it is 5.8.8

[19:20] Ani-_: Yet you are unable to run make test and/or port Perl?
[19:20] obscurite: Stop antagonizing the poor man, Ani


[19:20] Ani-_: Or are you really saying that you did run make test and that no tests failed?
[19:20] obscurite: poor man/woman
[19:20] obscurite: I guess man, as they're called Robert
[19:21] obscurite: Anyway, did make test pass all tests?

[19:21] RobertSze: Ani-_: obviously something failes, as you can see in this very small TEST. Anyway, any ideas on what could be wrong there?
[19:22] RobertSze: obscurite: no, but the basic tests worked

[19:22] dvtoo: well, what you're doing is pretty basic
[19:22] dvtoo: and it's obviously not working...

[19:22] RobertSze: dvtoo: exactely, thats the reason why I'm here

And then after explaining more than three times that I had compiled perl without optimization (he didn't trust me again) I just gave up...
A 30 minute discussion where you just feel: oh my god, I'm so sorry, how can I imagine that I'm actually dignified to even talk to you. I'm so sorry, really sorry. Oh yes, and I will do my homework, I will learn how to actually use a compiler (what's that, btw?), and oh, I have to learn reading, 5.8.8 is not that easy to read, and btw, yes, of think I'm male.

Fortunately, most other people I had a talk with about problems while porting software were really friendly and helpful. (for instance: Mozilla, Mono, Blender, Freepascal, GCC, etc...).

For instance, once I had a bug when I ported Mono: The IL file had a few odd numbers in it after compiling an application. Something like: addl #-1.0e12 or something like that.
After a quick question in #mono I immediately got the name of a source file and a supposed line number range. Problem was the vsprintf implementation from SkyOS which was then fixed in a few minutes.

For these #perl people (to who I have talked to, because there are really competent and rational people on #perl too) I just hope that they will settle down a bit and try to give the OSS community a better image than this one.


http://www.reallylinux.com/docs/snobsoped.shtml

Another sad experience...

Btw, Changelog updated.





Update:
Bug fixed.
After serveral hours of debugging the bug is now finally fixed.

Perl code print 0.1; didn't work correctly (returned zero). I found out the perl uses sprintf to stringify values:
sprintf(buf, "%g.15", (float)f); also didn't work correctly.

Precision 0 - 14 work correctly, anything above 14 returned invalid results. (for instance: 0.1 ==> 0.0);

Callstack:
[1] perl code
[2] perl
[3] sprintf(str, fmt)
[4] vprintf(fp, fmt0, ap)
[5] cvt(data, value, ndigits, flags, sign, decpt, ch, length)
[6] dtoa(mode, ndigits, decpt, sign, rve)
[7] d2b(_d, e, bits) <-- This function had to be fixed



UgwGEZd

yQJTRu UgwGEZd

peyXwHqE

szEMAdj peyXwHqE

Hmm

Thank goodness that communication with all other OSS communities is nothing short of productive and helpful.

Still we shouldn't generalise, these people don't make up the whole perl community and the bigger a community, the more probable it is for an idiot or two to get vocal. Ignore and ask competent people in a few days :)

Fixed

Fixed

Full log file

First of all, excellent job on quoting only text that benefits your point and not telling the full story.
What follows at the end of this message is a full log. The names of the people that aren't involved in the 'issues' are removed.
The relevant messages are marked in bold.

This is the first and last thing I say about this.
My 'defence':

a) #perl has about 450 users. Between his initial question and my answer there is a gap of 55 lines and 15 minutes. I usually scroll up one page to see if I missed an initial question but in this case this was insufficient. The result? I didn't read his initial question.
b) The first thing I saw was the code he posted ( http://erxz.com/pb/1013 ). All he said about it: 07:06PM <RobertSze> print $1 + 4 return 0. He never said SkyOS in the lines surrounding this text. (Yes he did say it initially but I already say I didn't saw that)
c) I questioned wheter he ran the code or not since I couldn't duplicate the behaviour on any of my systems. He corrected this by posting his output ( http://erxz.com/pb/1014 ). This is were I learned he was talking about a completly different OS.
d) I also questioned if he was sure he was using 5.8.8. Some people have the ability to mess up their system so that they have an old and new install on their system and thinking they are using the new while they are in fact using the old (side note: at this point I didn't know he was the one that ported it! nor that SkyOS didn't had any previous ports.)
e) Note: 3 different people asked if make test passed all test before he answered the question.
f) The changes he made were only posted after they were explicetly asked for. If you are porting something then it is (IMOH) a good idea to start by saying what exactly you changed.
g) Note: dvtoo's question about it being compiled without optimizations was ignored until it was repeated.
h) The patch he posted had/has ( http://erxz.com/pb/1015 ): optimize="$optimize -g". This made it unclear wheter or not he was using optimzations (hence my questioning - the only time he gave a clear answer was when he said that -O0 was used when compiling every C file. All other answers are dubious.)
i) He confuses me by saying: 'This is from the current build, while porting I always used -O0'. Pay attention to the word USED. I read this as: I'm done porting it and I build it with optimizations
j) He confuses me some more: 'I used the patch I posted as base for porting Perl'. Read: 'as base for porting'. If it's only the 'base' then there must be some more. (Or atleast that's how I read it)
h) I finally gave up since I couldn't test (nor debug) it myself making me rely on his (confusing and dubious) answers. But do note that I gave him a final pointer where he could get some help.

The full log:

06:49PM RobertSze has joined #perl
06:50PM <*****> *****, you want to slurp the file into a big string like { local $/; undef $/; $filestr = <OFH>; }
06:50PM <*****> and then split using normal string split functions?
06:50PM <*****> and foreach trough those... and print
06:50PM <*****> tnx :)
06:50PM <*****> in the same block, you can split into pieces like @matches = $filestr =~ /BEGIN(.*?)END/sg
06:51PM <*****> you need /s to treat as one string, g for multi match. ? for non greedy
06:51PM <*****> non greedy? to make it split on the first occurance of END you mean?
06:51PM <***** yeah or you'll end up with the whole string in your match
06:52PM <*****> that "{ local $/; undef $/; $filestr = <OFH>; }" part
06:52PM <*****> where to add the filename? :)
06:52PM <*****> or does that read from stdin?
06:52PM <*****> you need an open OFH "filename" of course
06:52PM <*****> and a close OFH
06:52PM <*****> ok
06:52PM <*****> is it even possible to sort values on the fly with a hash? please don't give me code examples, just want to know if it's possible
06:53PM <*****> before i start searching for something that is not even possible
06:53PM <*****> s/searching/reading
06:53PM <*****> hashes are by definition are not sorted
06:53PM <*****> no that i know
06:53PM <*****> but you can use sort on keys
06:53PM <*****> (sort keys %hash)
06:53PM <RobertSze> Hi guys! I recently ported perl 5.8.8 to SkyOS. The port is know to work mostly because a lot of application use perl while building/compiling. (for instance: firefox, gtk, ...). Unfortunately it seems that there is a bug in the port which occures when running autoconf. Autoconf calls a lot of perl modules of which one failes. After debugging this for a while I have been able to reproduce this in a small program. http://pastebin.com/669576 This programs
06:53PM <obscurite> yes you can sort any list
06:53PM <*****> The paste 669576 has been moved to http://erxz.com/pb/1012
06:53PM <obscurite> including a list of keys
06:53PM <*****> i want to sort on the value instead of the keys
06:53PM <RobertSze> The first "print "res: $res (should be 5)\n";" should print 5, which it does in window and linux, in skyos it just prints res: 0
06:53PM <*****> sort values %hash
06:54PM <*****> i thought so, but then my codeis b0rked
06:54PM <*****> that never happens. must be a bug in perl! :-)
06:54PM <*****> nah
06:54PM <*****> bug in my code of course
06:54PM <*****> it would be offensive to harry to say it's a bug in perl :- P
06:54PM <*****> harry?
06:54PM <*****> harry?
06:55PM <*****> haha
06:55PM <*****> larry
06:55PM <*****> larry with rogaine
06:55PM <obscurite> heh
06:55PM <*****> hahahaha
06:55PM <*****> wtf
06:55PM <*****> i type one name wrong and everybody is awake :- P
06:56PM <*****> obscurite: ok, great, and how do I make it keep the begin and end lines in?
06:56PM <*****> hi *****
06:56PM <obscurite> *****, put them in the ()
06:56PM <*****> hello, do i know you?
06:56PM <*****> ok
06:56PM <*****> tnx
06:56PM <obscurite> welcome
06:56PM <*****> probably not
06:56PM <*****> i thought so already :- )
06:57PM <RobertSze> is there something like a perl developer channel?
06:57PM <*****> I am trying to assign the result of du -s /var/www/html/| awk \'{print $1}\' to a variable, anyone able to help?
06:57PM <*****> RobertSze, what do you mean?
06:58PM <RobertSze> discussion about coding perl itself
06:58PM <*****> *****, what about using qx() or ``?
06:58PM <*****> RobertSze, and what do you think is this channel about?
06:58PM <*****> aahh, sorry this is #perl, we discuss life in here
06:58PM <RobertSze> no idea, there is no topic explaining it.
06:58PM <******> *****, if I use my $web2_size= `du -s /var/www/html/| awk \'{print $1}\'`; it gets the result but ignores the awk statement
06:59PM <*****> argh, my eyes
06:59PM <*****> *****, don't use awk that way, use Perl to do that job
06:59PM <*****> you can always do that in a more Perlish way
06:59PM <obscurite> RobertSze, can you create any other arithmatic errors?
07:00PM <*****> *****, what would be the perl way to do it?
07:00PM <*****> just point me in the direction
07:00PM <RobertSze> obscurite: not really. I tried a few other things without any error. I also tired quite a lot perl scripts from various sources which worked fine
07:00PM <*****> *****: it doesn't ignore the awk statement, it's just that interpolation is fucking with you there. good way: use perl to do it... something like $s = (`du -s /path` =~ /^\s*(\S+)/)[0];
07:01PM <*****> (better way: use perl to do the du -s part as well - but that's beyond my experience)
07:01PM <*****> *****, ugly, but works
07:03PM <*****> there's also Filesys::DiskUsage (never used it myself, but hey)
07:03PM <RobertSze> obscurite: any idea which source/function may be responsible for this error?
07:04PM <obscurite> RobertSze, please print out $var in the same line as $res just for curiousity
07:05PM <RobertSze> obscurite: oh, sorry. I uploaded a wrong file before, this one is correct: http://pastebin.com/669605
07:05PM <*****> The paste 669605 has been moved to http://erxz.com/pb/1013
07:05PM <*****> Hey folks, is there a interactive perl console out there?
07:05PM <RobertSze> obscurite: This is the line which failes: $res = ($1 + 4);
07:06PM <RobertSze> print $1 returns $1
07:06PM <RobertSze> print $1 + 4 return 0
07:07PM <RobertSze> obscurite: if I use $var (initialized to $1) instead of $1 it works
07:08PM <Ani-_> RobertSze, perhaps $1 is -4?
07:09PM <obscurite> RobertSze, that's a pretty big hint where the problem is right there, I guess.
07:12PM <Ani-_> RobertSze: did you actual run the code you pasted?
07:12PM <RobertSze> Ani: $1 is not 4
07:12PM <Ani-_> RobertSze: or did you simply select some random peieces of your code and posted those?
07:12PM <RobertSze> http://pastebin.com/669625
07:12PM <*****> The paste 669625 has been moved to http://erxz.com/pb/1014
07:12PM <RobertSze> With output from windows and skyos
07:14PM <obscurite> RobertSze, if your problem only occurs with match variables, then i'd assume that's where the bug lies
07:14PM <obscurite> RobertSze, though that's a big assumption right now
07:14PM <Ani-_> RobertSze: and what is Skyos? And what perl version is that?
07:14PM <RobertSze> Ani-_: http://www.skyos.org
07:14PM <RobertSze> Ani-_: 5.8.8
07:15PM <RobertSze> obscurite: hmm..
07:15PM <Ani-_> RobertSze, and why are you giving a script the extension of a module? .pm ==> module. Your code is not a module so don't use .pm.
07:15PM <RobertSze> Ani-_: right, you should know I'm not a perl developer at all, just try to fix this bug
07:15PM <Ani-_> RobertSze: are you sure it's 5.8.8? Or are you simply guessing? (as in, how did you figure out it was 5.8.8?)
07:16PM <RobertSze> Ani-_: I downloaded and ported it.
07:16PM <RobertSze> http://www.cpan.org/src/stable.tar.gz
07:17PM <dvtoo> huh, someone is actually trying to sell a new desktop commercial os?
07:17PM <Ani-_> So YOU ported it? And then you are complaning that it doesn't work?
07:17PM <dvtoo> that seems a little crazy
07:17PM <Ani-_> YOU clearly did something wrong when porting it. Or maybe your system already has a perl?
07:17PM <RobertSze> Ani-_: yes, I ported it and yes I try to get help on how to fix this problem
07:18PM <Ani-_> Perhaps you need to run perl -V to verify it?
07:18PM <Ani-_> RobertSze, I certainly wonder, did you botter running make test?
07:18PM <RobertSze> it is definitely 5.8.8. SkyOS didn't have perl before
07:19PM <Ani-_> Says you. I don't believe you. I only believe (to a certain extent) perl -V.
07:19PM <RobertSze> Ani-_: man, I develop SkyOS and I know exactely whats running on it
07:19PM <RobertSze> trust me, it is 5.8.8
07:19PM <Ani-_> Yet you are unable to run make test and/or port Perl?
07:20PM <obscurite> Stop antagonizing the poor man, Ani
07:20PM <Ani-_> Or are you really saying that you did run make test and that no tests failed?
07:20PM <obscurite> poor man/woman
07:20PM <obscurite> I guess man, as they're called Robert
07:21PM <obscurite> Anyway, did make test pass all tests?
07:21PM <RobertSze> Ani-_: obviously something failes, as you can see in this very small TEST. Anyway, any ideas on what could be wrong there?
07:21PM <dvtoo> did it pass make test?
07:21PM <RobertSze> obscurite: no, but the basic tests worked
07:21PM <dvtoo> well, what you're doing is pretty basic
07:22PM <dvtoo> and it's obviously not working...
07:22PM <obscurite> Ahh, it probably shouldn't be considered fit for public consumption until all tests pass
07:22PM <*****> bonsoir
07:22PM <RobertSze> dvtoo: exactely, thats the reason why I'm here
07:22PM <Ani-_> RobertSze, I'm guessing something yhat you changed. Perhaps now would be a good time to post your patch?
07:22PM <*****> If i have this: for my $destination (sort by_host keys %{$total_bytes{$source} }) This simple subroutine does not work: sub by_host {
07:22PM <*****> $total_bytes{$b} <=> $total_bytes{$a}
07:22PM <*****> }
07:22PM <*****> why is that?
07:22PM <Ani-_> *****: do you have use strict?
07:22PM <*****> yes
07:22PM <*****> any Net::Telnet::Cisco expert here ?
07:22PM <*****> but... how can i compare when having multiple values
07:22PM <obscurite> RobertSze, post another pasteurl of your failed tests
07:23PM <*****> {$a}{$a} does not work
07:23PM <*****> or {$b}{$b}
07:23PM <Ani-_> *****, you are not making much sense... Perhaps you should start all over again and begin by describing what datastructure you have and how dyou want to sort them...
07:24PM <Ani-_> *****, nevermind. Ignore that.
07:24PM <RobertSze> Patches: http://pastebin.com/669656
07:24PM <*****> The paste 669656 has been moved to http://erxz.com/pb/1015
07:24PM <RobertSze> no "perl" related changes
07:24PM <*****> Ani-_: I know what i want to sort, but i don't know how
07:24PM <Ani-_> *****: what you really want: $total_bytes{$source}{$b} <=> $total_bytes{$source}{$a}
07:24PM <dvtoo> that seems pretty basic
07:24PM <dvtoo> compiler bug?
07:25PM <dvtoo> have you tried compiling with no optimizations?
07:25PM <*****> Ani-_: I tried that already, but that does not work
07:25PM <*****r> Ani-_: Because $source is not known to the subroutine
07:26PM <*****> hi
07:26PM <Ani-_> *****: then you need to pass it to the subrtouine. Or stop using a subroutine for your sorting.
07:26PM <*****> eh
07:26PM <*****> I have a little problem with a hashtable
07:27PM <*****> where keys refers to a reference on a function
07:28PM <*****> do you use Tie::HashRef ?
07:28PM <*****> Ani-_: Is it even possible to pass parameters to a sort subroutine :-S
07:28PM <*****> Prof_Vince: no
07:28PM <*****> or RefHash, rather
07:28PM <*****> then do
07:28PM <*****> can't use any packages
07:29PM <Ani-_> There is no such thing as can't. And you really need to describe your problem in more detail.
07:29PM <*****> Quick ?: Instead of having a whole bunch of print statements, what can I use to print a bunch of text in my code? I forgot the syntax.
07:30PM <*****> eKo1: print $foo, "bar", $baz{blee}; or print $foo . "bar" . $baz{blee};
07:30PM <*****> interviewing via AIM for an asterisk project
07:31PM <RobertSze> So, is there anyone who is able to give me a few hints where the problem may be located?
07:31PM <Ani-_> 07:25PM <dvtoo> have you tried compiling with no optimizations?
07:32PM <Ani-_> Perhaps you should try that?
07:32PM <RobertSze> Ani-_: yes, compiled with -O0 already
07:33PM <*****> "*****" at 83.160.254.144 pasted "crap" (45 lines, 1.3K) at http://sial.org/pbot/16796
07:33PM <Ani-_> RobertSze: your hints file has optimize="$optimize -g"

Re: Full log file

First of all, excellent job on quoting only text that benefits your point and not telling the full story.

Excellent job...summarizing? Reading through your transcript I found nothing incriminating that had been previously left out, as you seemed to imply existed.

Not one of the points mentioned in your 'defense' defend. There is a defined difference between a defense of your behavior and an excuse for your behavior. I don't care that you jumped into the conversation uninformed about the situation. You shouldn't have.

By the way, excellent job reading through all 250 lines and blanking out curse words and all but two of the 450 users in that channel. It was well spent time, as I was planning to make a list of everyone involved in that completely public conversation and taunt them about perl's inabilities.

Exactely, I talked to a few

Exactely, I talked to a few #perl people months ago and that was really productive.
Anyway, I just can't imagine how dissapointing and frustrating for a not experienced user or even developer this must be, when someone like Ani-_ means he has to "talk" to you.

A perfect exemple of someone

A perfect exemple of someone asking nicely for help and getting picked on by someone :

1) aggressiv/angry
2) with no patience/shortsighted
3) not far from insulting...
that should definately NOT do support/help work...

.

On a side note, The "Ani"-man :D has really NO CLUE :
taking Robert (the man with 5 arms and godlike coding skills) for a noob... lol ... funnier than April's fool jokes..ain't it ? ;)

.

Btw, the article on linux snobinism was quite right on the target..., as a windows user (I used suse 6.2 1 year), this is one reason why I don't want to switch to linux (yet).

.

That and the fact that I have been spoiled on windows : just one or 2 clicks to (automatically) install something.

.

I just hate to have to compile sources through typing a medium sized list of cryptic commands (it's always more complicated than ./configure, ./make, whatever as there is always one thing that goes wrong)...

.

If you don't believe me...install cygwin (easy on windows) and then try to set up wxwidgets with wxxml2....(whereas you can do it in a few clicks with code::blocks and devpacks :D )

.

Maybe I should put this in

Maybe I should put this in your terms:
j00 art teh n00b!!!

You acted kinda aggresive, especially when he only wanted to port perl to a new system, he wasn't trying todo something retarted, like make an OS out of perl.

@ani_:

[edited]

As some members of a certain 'community' can't bear peppered speech I have removed the previous contents of this post.

remain polite

Please, keep the comments a bit on the decent side. With these last 2 comments you are making our communnity look just as bad. Take an example from Lakedaemon who makes his point very clear without calling him names.

We're just returning the

We're just returning the favor!

@darkness

I ain't speak for a community. I speak for myself, man.

I am entitled to free speech and expression of opinion as others are, ain't I? In any peppered manner as is to my liking, ain't it?

No bad feelings, I'll edit it away, so you don't feel offended anymore.