/srv/irclogs.ubuntu.com/2012/04/01/#ubuntu-devel.txt

YickIs there anyone here works in the IT department ?00:00
cjwatsonhowever it is not entirely clear to me from the comments in that bug that the segfault is in fact within isprint00:00
penguin42cjwatson: Cool, so I think that bug 965341 is that it should be using iswprint00:00
ubottuLaunchpad bug 965341 in procps (Ubuntu) "watch command line utility crashes with segfault when processing binary output" [Medium,Triaged] https://launchpad.net/bugs/96534100:00
penguin42cjwatson: comment #3 from me ?00:00
cjwatsonI don't see how isprint could be getting inlined into main00:00
cjwatsonthat comment shows the segfault in main, afaics00:01
penguin42yeh that's what the backtrace is showing - I'd thought the isprint and friends were macros or the like00:01
juliohmi'm also curious how penguin42 inferred about isprint() from the actual bug.00:01
cjwatsonthey might be implemented as macros, true00:02
juliohmoh, strace :-)00:02
cjwatsonjuliohm: he correlated gdb's output against the source code00:02
juliohmoh, not strace, gdb output, nice.00:02
cjwatsonyeah, isprint is a macro that expands to an array lookup00:03
cjwatsonif the value is out of bounds then it might well segfault00:03
penguin42cjwatson: Yeh, see ctype.h - it's a macro to __isprint that ends up indexing __ctype_b_loc that's 384 bytes long ish00:03
YickIs there anyone here works in the IT department ?00:03
YickIs there anyone here works in the IT department ?00:03
cjwatsonnot necessarily iswprint, it might also be correct to simply check that c is representable as unsigned char before passing it to isprint00:03
cjwatsonYick: please don't repeat without adding further context.  Why do you want such a person?00:04
cjwatson(whose IT department?)00:04
Yickany IT department. Want to know anyone has connection to Microsoft.00:04
penguin42cjwatson: However I'm a bit uncomfortable saying it just needs a change from isprint to iswprint since I don't understand the wide character stuff it's wrangling with; it does have a && c<128 *after* the !isprint(c) - but I think it needs a little more understanding00:04
* penguin42 checks the date - oh yeh00:05
cjwatsonpenguin42: judging from the c<128 check, it isn't really interested in wide characters; I would say just  !isprint(c) && c<128  =>  c<128 && !isprint(c)00:05
* juliohm is curious about the details of following the execution of the watch command in gdb for backtracing the bug and fix it00:06
cjwatsonjuliohm: it prints a line number when the program crashes, so it's pretty easy to look up from there (in this case)00:06
cjwatsonfor the rest, man gdb :-)00:07
penguin42cjwatson: Yeh, the code seems to be trying to detect wide characters and set a 'carry' variable to indicate it should fetch the next byte - and I think that's probably still OK00:07
penguin42juliohm: I installed the procps debug sym package, I then ran gdb `which watch` and then ran it in gdb with your args00:07
juliohmcjwatson, so, you have to download the source code first, right?00:07
cjwatsonjuliohm: yes, of course00:07
penguin42juliohm: Then I grabbed the source (using apt-get source procps) and looked for line 54100:07
cjwatsondebugging programs without source code is no fun00:07
juliohmhmm, very interesting.00:08
juliohmlet me try now, because maybe i can help in the future00:08
juliohmpenguin42, what do you mean by procps debug sym package? is just the procps package?00:09
penguin42juliohm: Then I looked at that line and thought there's nothing that should seg fault, printed c, noticed it was HUGE, and wondered about isprint since I'd implement it using an array00:09
cjwatsonhmm, mind you, isprint on a wint_t is a kind of dodgy thing to do00:09
penguin42juliohm: https://wiki.ubuntu.com/DebuggingProgramCrash00:09
* juliohm is reading the link...00:10
penguin42cjwatson: Well, it does take an int (to allow EOF)00:10
cjwatsonpenguin42: sure, but technically, nothing in the standard requires int == wint_t00:11
penguin42nod00:11
cjwatsonpenguin42: I think your first instinct was correct and it should be iswprint00:11
cjwatsonassuming that tests out00:11
penguin42cjwatson: What worries me is that at that point it would have the first half of a wide character and then passing that to iswprint also makes no sense00:12
cjwatsonpenguin42: how so?  my_getwc appears to read a whole wide character00:12
cjwatsonor WEOF00:13
cjwatsonpenguin42: in any case, I think the important thing is that iswprint does *not* have a range of values specified as undefined behaviour00:14
cjwatsonoh no that's not true00:15
cjwatson"For all functions described in this subclause that accept an argument of type wint_t, the00:15
cjwatsonvalue shall be representable as a wchar_t or shall equal the value of the macro WEOF. If00:15
cjwatsonthis argument has any other value, the behavior is undefined.00:15
cjwatson"00:15
cjwatsonstill, my_getwc always returns something that meets that description, I think00:15
cjwatsongiven that it always returns either rval (which is a wchar_t and gets implicitly converted) or WEOF00:16
penguin42cjwatson: I'd be more comfortable if I understood what the heck that loop was actually trying to do00:16
cjwatsonI haven't bothered to work it out but I'm confident in my statement that iswprint should never segfault in this case from dataflow analysis alone :)00:17
cjwatsonit's some tedious display mangling, doesn't seem terribly interesting to work out the exact details00:18
penguin42yeh, I'm just not sure it does what the oriignal code was supposed to00:18
cjwatsonwell, the while condition basically asks for a non-printing character under 128 that isn't newline, tab, or (sometimes) esc; so promoting to iswprint for type compatibility doesn't seem to break anything there00:20
penguin42and my_getwc blows my mind - I can't see how it's while loop ever executes more than once given that it always returns in one of two ways00:20
cjwatsoneverything that manipulates c is typesafe00:20
penguin42oh, the if isn't indented - ok, I see how my_getwc works00:21
cjwatsonpenguin42: it just has rotten indentation00:21
cjwatsonyeah, the last return is conditional on 'byte == MAX_ENC_BYTES'00:21
cjwatsonbut again, I think you just need to verify that it always returns a promoted wchar_t or WEOF00:22
cjwatsonwhich is pretty clear00:22
cjwatsonit's fairly grotty code but just stick to analysing the bits you need and it's ok00:23
penguin42yeh, and so my_getwc either a valid WC, a WEOF on an EOF< or WEOF on a bad char, then I think I agree iswprint should work00:24
cjwatsonthe one thing I'd note is the FORCE_8BIT bit at the top of the file, which may or may not be obsolete now00:24
cjwatsonalthough leaving it there wouldn't actually hurt anything00:24
penguin42yeuch00:26
juliohmpenguin42, thank you very much for the link, it's really helpful. ;-)00:26
juliohmI'll try the process when i have time.00:26
penguin42cjwatson: The code there comes from one of the debian patches00:27
penguin42cjwatson: watch_unicode.patch00:27
cjwatsonyep00:27
cjwatsonis that a big deal?00:28
penguin42I was just wondering if it was a debian patch or an ubuntu patch, but I think it's a debian one00:28
cjwatsonlooks like it00:29
penguin42nod00:29
penguin42cjwatson: Is the right thing there to add another patch to the end of the set or to fix that patch?00:30
cjwatsonjudgement call in general - in this case I'd probably fix that patch00:31
penguin42ode for a 1 character tweek00:31
cjwatsonthough I wouldn't reject a branch that added another one, I guess00:31
cjwatsonbut yeah, seems overkill00:31
penguin42actually it needs one of the other patches tweeking as well because that is diff'd against it00:32
cjwatsonquilt push; quilt refresh your way up the stack00:33
cjwatsonbut basically trivial00:33
penguin42I could look at that tomorrow, but it's rather late now, and I can't actually remember any of teh quilt foo00:35
cjwatsonif you've tested a patch and confirmed it works, feel free to just attach it to the bug and I can take care of the packaging00:37
cjwatsonbut you might want the learning experience and if so I don't want to deprive you either :)00:37
penguin42I'll look tomorrow, or should I say at 1:37 am later today00:37
penguin42right, bed!00:43
=== vorian is now known as v
=== v is now known as Obama
=== Obama is now known as vorian
=== vorian is now known as heHATEme
=== Guest89637 is now known as jalcine
=== Guest16852 is now known as vibhav
YokoZarhttps://launchpad.net/ubuntu/precise/+queue  :D06:52
infinityYokoZar: Yeah, I'm trying to decide if that was a joke. :P06:54
infinityYokoZar: Do I review it or reject it?06:54
YokoZarinfinity: Review it of course, it fulfills its stated purpose ;)06:54
infinityOh dear...06:54
infinityOh, derp.  April 1.06:55
* micahg is curious if a second person signed off on it06:58
jhojhocjwatson: see that you have been updating openssl. could you add the elliptic curve compile flag for 64bit for the next round? thx.07:04
cjwatsonjhojho: no, I haven't got round to talking with the Debian maintainer about it yet08:59
Whoopiecjwatson: Hi, could you perhaps sponsor another package?  -> mail-notification, bug 88103909:23
ubottuLaunchpad bug 881039 in mail-notification (Ubuntu) "mail-notification-evolution only contains files in /usr/share/doc" [Undecided,Confirmed] https://launchpad.net/bugs/88103909:23
cjwatsonWhoopie: not right now, need to go out09:24
Whoopiecjwatson: ok09:25
Whoopiehave fun09:25
cjwatsonI can look later if nobody beats me to it09:25
DavieyWhoopie: you might find that some sponsors are unwilling to upload, without a Firstname Lastname in debian/changelog.09:30
WhoopieDaviey: might be. Even though I see a lot of packages with the same "issue".09:31
=== tkamppeter_ is now known as tkamppeter
infinityWhoopie: It's not terribly common for people to upload with a real name.10:06
infinityWhoopie: But if the code's good, I don't care deeply either.10:06
=== juliank__ is now known as juliank
=== Pici is now known as ZarroBoogs
nigelbZarroBoogs: awww <311:18
=== jalcine_ is now known as Guest91350
=== Guest91350 is now known as jalcine
=== dendro-afk is now known as dendrobates
=== dendrobates is now known as dendro-afk
=== bladernr_ is now known as bladernr_afk
PaoloRotoloHi all!15:24
=== dendro-afk is now known as dendrobates
=== mnepton is now known as mneptok
=== jbicha is now known as Guest20909
=== Guest20909 is now known as jbicha_
hallyntjaalton: hey, i thought i'd seen a push of xserver-xorg-video-qxl go by, but I don't see it in the archive?16:20
hallyn(maybe I mis-read a subject and it was another xserver-xorg...)16:21
=== dantti is now known as dantti_away
=== dendrobates is now known as dendro-afk
=== dendro-afk is now known as dendrobates
tjaaltonhallyn: you think we can just sync it? I mean it probably needs an FFe bug just to be on the safe side :)16:35
hallyntjaalton: I don't know, since Munzir hasn't responded I guess I will try installing kubuntu in a guest tomorrow and see if I can (a) reproduce the bug and (b) see it fixed with the new version.16:36
hallyntjaalton: if it doesn't explicitly fix a bug, then you might be right we should file ffe.16:37
hallynguess it coudln't hurt to file ffe anyway, and then comment there if it fixes a bug16:37
hallyn(really, spice should be seen as a tech preview right now)16:38
tjaaltonhallyn: I don't see any bugs open against -qxl, so this was something reported on irc?16:40
hallyntjaalton: bug 91331416:40
ubottuLaunchpad bug 913314 in xserver-xorg-video-qxl (Ubuntu) "Corrupted display with Spice" [High,Fix released] https://launchpad.net/bugs/91331416:40
hallynafter confirmation of the fix of original bug, he lists a few other things still going wrong.16:41
tjaaltonah, ok16:41
* penguin42 looks up16:44
=== dendrobates is now known as dendro-afk
=== dendro-afk is now known as dendrobates
=== dendrobates is now known as dendro-afk
=== dendro-afk is now known as dendrobates
=== yofel_ is now known as yofel
JamesJRHIs it possible for me to obtain a correct source of TAI from my system if I keep it in sync?18:05
JamesJRHImplementing TAI on top of UTC relies on UTC being correctly implemented. But Ubuntu seems to ignore leap seconds in it's implementation of UTC.18:06
=== dendrobates is now known as dendro-afk
mamemame187hello19:19
=== jalcine is now known as jalcine_
=== heHATEme is now known as vorian
=== mwhudson_ is now known as mwhudson
=== nijaba_ is now known as nijaba

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!