IRC Logs for #crux-devel Friday, 2019-03-01

jaegerI pushed a 3.5 branch for compat-3200:45
jaegerhrmm, on an upgraded machine I'm seeing segfaults and garbage in the terminal if I stop a prt-get operation with CTRL-C. Can anyone else duplicate this?00:46
ryuojaeger: "garbage in the terminal" sounds like as if a binary file was dumped to it.01:05
AbdullahI also have 2.1.27 as their ftp archives weren't working jaeger01:08
jaegerryuo: yeah, and that's what it looks like, too01:23
*** xor29ah has quit IRC02:09
*** xor29ah has joined #crux-devel02:11
*** xor29ah has quit IRC02:15
*** xor29ah has joined #crux-devel02:20
jaegerfound a grub2-efi problem with new binutils, looks like an easy fix02:33
jaegerer, wait... thought I already fixed that02:42
jaegerwill dig into it more02:42
*** ryuo has joined #crux-devel03:14
jaegerweird... the patch doesn't fix it anymore at all03:16
*** darfo has joined #crux-devel03:41
jaegerah ha! Need to patch grub2 *and* grub2-efi03:49
jaegerwonder how I missed that the first time04:25
juejaeger: can confirm the two issues: prt-get segfaults and grub cannot be installed on xfs08:10
jueguess the later is fixed with this patch -> http://git.savannah.gnu.org/cgit/grub.git/commit/?id=cda0a857dd7a27cd5d621747464bfe71e8727fff08:10
juetsss, don't get it why the grub people don't release something new, 2.02 is nearly two years old08:12
jue... and bloated crap anyway ;)08:13
jueyeah, gentoo is using that patch -> https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-boot/grub/files08:20
frinnstyeah I've seen the segfault thing since i moved to the 3.5. I've never seen any garbage on the terminal though08:27
frinnstfiled that under "low prio" in my mind08:28
juehmm, looks like the -02 optimalization is causing the problem08:48
juefrinnst: can you try to build prt-get without -O2?08:48
frinnstwill do. just a sec. updating a vps :-)08:54
frinnstthe installer didnt like my 512mb of ram :D08:54
juejust add a 'export CXXFLAGS=" "' before ./configure09:01
frinnstyep that seems to have resolved it09:08
frinnstused -Os09:08
frinnstshrunk it down to 152K from 223K also09:09
frinnstthats pretty massive09:10
juehmm, -Os didn't work for me09:10
frinnstyeah your right. segfault09:10
frinnstim blind09:11
jueyeah, make sense, from the man-page: -Os enables all -O2 optimizations that do not typically increase code size09:11
jueguess we should use:09:12
jueexport CXXFLAGS="$CXXFLAGS -O0"09:12
jueguess it's related to the warning we get with 3.5, but not with 3.409:17
jueprtget.cpp: In member function 'virtual SignalHandler::HandlerResult PrtGet::handleSignal(int)':09:17
jueprtget.cpp:1628:1: warning: no return statement in function returning non-void [-Wreturn-type] }09:17
juebut as I said, just a wild guess, I have no idea about C++ ;)09:19
frinnstACTION pokes ryuo 09:29
frinnstI know even less09:30
*** xor29ah has quit IRC11:46
*** xor29ah has joined #crux-devel11:47
*** xor29ah has quit IRC11:52
*** xor29ah has joined #crux-devel11:53
ryuofrinnst: ?16:07
ryuoUgh. Who designed this function?16:10
ryuoIt never returns a value yet states it should.16:11
frinnstnobody has touched it in a long time16:17
ryuoit has a number of rudimentary compile warnings.16:19
ryuonot just this one.16:19
ryuothough in this case the return value of handleSignal isn't even used.16:19
ryuoso i'll just make it return something to make it happy.16:19
ryuohttp://dpaste.com/0721GBJ16:22
ryuofrinnst: fixed.16:22
frinnst<316:26
jueryuo: yep, works, thanks a lot :)16:27
jueryuo: only this warning is visible without -Wall, that is with gcc 816:29
ryuodoes crux even have anyone left to work on these things?16:39
ryuoi thought jaeger knew this stuff at least.16:40
jaegerI think I could have figured out that one based on the clear warning message but I've not particularly looked at prt-get's code and I'm not a fan of C++16:52
jaegerNot sure I'd have linked the warning to the symptom, though16:52
ryuojaeger: well, i grepped the name of the function and the only place it showed up where it wasn't part of a definition or declaration, the RV wasn't even being used.16:56
ryuoso i just returned something that was valid.16:56
ryuothe function says "interrupted" so i figured "exit" was the most appropriate choice.16:56
ryuoseems a bit overengineered myself, the RV isn't even being used.16:57
ryuoincidently i preordered the sheeva64. should be interesting.16:58
ryuoit's basically an updated sheevaplug.16:58
ryuomore RAM and 64 bit CPU.16:58
jaegernice16:59
ryuobut nothing else was updated that I can tell.16:59
jaegeralong those lines, wonder when my la frite thingy will ship16:59
ryuoit's still capped at USB 2.0, but it does have gigabit ethernet.16:59
ryuobut in all seriousness, not all uses need 3.016:59
frinnstbtw I did a 3.4 install today with 1gb ram. that was enough18:05
frinnstwonder exacly how much 3.5 requires :-)18:06
ryuofrinnst: well, if it was purely binary distro, it could probably get by with a lot less.18:15
ryuofrinnst: 512M probably.18:15
frinnstits the installers ramdisk that causes problems18:17
frinnsti run a crux server with 512mb just fine18:17
ryuoah. i see.18:17
ryuojaeger: we should probably get together to revise pkgutils. why duplicate the effort? thoughts?18:19
jueryuo: is your frugalware email address still valid?18:19
ryuojue: not really, no.18:19
ryuoi thought no one still had that on file.18:19
jueI'd like commit your fix, so I need something ;)18:20
ryuoyou could just claim it as your own if you wanted, but ok.18:20
ryuoryuo@ryuo.xyz18:20
juethanks, I'll use that18:20
ryuoi guess Romster was right though. there's a shortage of C programmers here it seems.18:21
ryuoi don't really use C++ much, but i know it well enough to debug issues in simpler programs.18:22
ryuoprt-get could probably use a rewrite, but it'd be better to finish making pkgutils into a library for more code reuse.18:24
juecommitted18:31
juetsss, just another prt-get problem, the fix for FS#1646 seems to be wrong18:32
juehttps://crux.nu/bugs/index.php?getfile=67118:33
ryuoi'll look.18:33
ryuoheh. it's weird having my text editor integrated with my terminal...18:34
juehttps://dd6186cab64d082e.paste.se/18:35
ryuoOh.18:35
ryuothat needs to be fclose. whoever wrote that uses 'close', the one for raw file descriptors.18:36
ryuojust add an f to the front and it should be good.18:36
ryuoi see nothing else wrong with it.18:36
ryuothough, why did they use C stdio in a C++ program?18:37
ryuoifstream would have been better...18:37
ryuoand the destructor would run on every exit point of the function.18:37
jueryuo: works, thanks18:37
jueand committed18:45
jueguess we should roll out a new version of prt-get?18:49
ryuoif there's no more compile issues you care about.18:53
ryuojaeger: i think i'm going to write a generic dynamic array solution we could use for pkgutils.18:54
jueno, don't see remaining issues right now, even though the several warnings we can see with -Wall are not nice19:03
ryuojue: well, i can see what those mean.19:04
juegreat :)19:04
ryuojue: working on the comparison fixes right now.19:27
ryuoit's a common glitch. someone compares 'int' to the C++ functions that return size_t19:28
ryuooui. figures. the author is incorrectly using strtol's unusual error reporting convention.19:39
ryuoguess it's good enough though.19:39
ryuojue: http://dpaste.com/386KAP719:43
ryuoone set of warnings fixed.19:43
ryuoafaik that should not break it. i looked at how it was being used.19:44
ryuothe prtget functions are only used internally with only non-negative values.19:44
ryuoso it was a simple swap.19:45
ryuothe ones in versioncomparator were also non-negative and more or less used as array indices.19:45
ryuoshould be no regressions either19:45
ryuostringhelper should still work, though i had some doubts.19:46
ryuothe 2nd loop used a negative, but it seems to want to stop once it overflows to INT_MIN, which can be replaced by...19:47
ryuoa !=19:47
ryuounsigned overflow is defined. it'll always roll back to the largest representation.19:48
ryuowhen using --19:48
ryuowhich is the same as casting -1 to size_t19:48
ryuo-1 is special integer for "all bits turned on"19:48
ryuoReorder warning... time to check this out.19:51
ryuook, 2 classes fixed so far. let's see what else needs the fix.20:05
jueryuo: testing you first patch right now, no issues so far20:13
ryuojue: -Wreorder... is a warning from an initializer's list members being out of order from the class declaration's order of the fields.20:14
ryuovery trivial. just need to rearrange the initializer list.20:14
jaegerfrinnst: run du -sh while booted into the install media, that should be how much needs to fit in tmpfs20:16
jaegerryuo: I've already implemented most of pkginfo in c in my own time, only thing left is to add db file locking... I'll share it once I've had time to do that part20:17
jaegerOf course I'll say up front I'm not a professional programmer so there are probably lots of things that could be done better... but even so, it's much faster than the c++ pkginfo20:17
ryuojaeger: fair enough. i can give it a look once you're ready.20:18
jaegerMy intent was to first duplicate the existing functionality of pkgutils (pkgadd, pkgrm, pkginfo) while leaving pkgmk alone20:18
ryuopkgmk will likely have to remain as it is...20:18
jaegersecondly to duplicate prt-get's functionality with some enhancements20:18
jaegersuch as removing the distinction between 'install' and 'depinst' as well as keeping track of some metadata about the package20:19
ryuoi was hoping to have a library for pkgutils.20:19
jaegerwhether it's an implicit or explicit installation, when it was installed, etc.20:19
jaegerfrom which repo it was installed20:19
jaegerthings like that20:19
ryuois that something your thing does?20:20
jaegerThat's the intent at least20:20
ryuoif it's all one giant binary with no modular design...20:20
ryuothen it's not really.20:20
jaegeroh, you're asking about a lib, not the stuff I was listing20:20
ryuowell, your stuff is important too.20:21
jaegerI didn't plan that far ahead yet but I don't see any reason it couldn't be a lib20:21
ryuoi was just thinking a library would be good for 3rd party integration.20:21
ryuosome users have expressed an interest in that.20:21
juejaeger: you've seen the grub patch above?20:22
jaegerjue: If you mean the XFS one, yes. I'll add it soon20:24
ryuojue: http://dpaste.com/12R9QV920:28
ryuojue: fixed for -Wreorder20:29
jueyep, the xfs one20:29
ryuohm. 21 warnings left.20:31
ryuoall largely irrelevant.20:31
ryuojust warnings about the design more than anything.20:31
ryuothis program uses write() without checking the return value.20:31
ryuoan issue normally.20:31
ryuoi'd advise just disabling this warning as it can't be addressed without a drastic revision to the program.20:34
ryuook. disabling that one. let's see what's left.20:35
ryuojust some random misc warnings. i'll try to fix these.20:36
jueryuo: cool, we're almost clean with -Wall20:40
ryuojue: last set: http://dpaste.com/3THVAW320:41
ryuoone removes the completely unused outer len variable.20:41
ryuoit should have no side-effects.20:41
ryuoit was used to store a length but is never read from later.20:41
ryuobut an inner occurrence of len is used, but is declared there.20:42
ryuothe result is unused, but it does produce a side-effect from the initializer.20:42
ryuoi felt it safest to just use a compiler extension to declare it unused so the compiler won't care.20:42
ryuo(variable named result)20:43
ryuoalternately you can drop the variable entirely and just call the function alone.20:43
ryuoeither way it's not used.20:43
ryuothe last one is a warning GCC has about using assignment operator in a conditional without ()s.20:44
ryuobecause normally you check the assigned value, but it has to have raised priority with ()s20:44
jueryuo: everything applied and committed, you are our hero, thanks a lot :)20:49
jaegerryuo: I'll try to do the file locking bit this weekend and share the code so you can see how unsophisticated/inelegant it is :P21:19
jaegerI don't think it's bad code in that it has no memory leaks (as far as I can see with valgrind, etc.) but as I don't do a lot of programming it's pretty simplistic21:20
ryuoi see.21:27
ryuojaeger: i'll probably add a generic dynamic array framework to your project if it doesn't already have 1.21:29
ryuoi was wanting to try incorporating more C11 into my projects where it makes sense to.21:29
ryuothis kinda does. i can use static asserts to add some sanity checks.21:29
jaegerit doesn't have a generic one but could be converted to pretty easily21:31
ryuoi was implementing qsort for a libc project recently so.. i think i can easily make a generic one that only needs to know the size parameters.21:31
ryuopretty easy to setup.21:31
jaegerI'd imagine so. I was going to do that with my BST implementation before I decided to do dynamic arrays instead21:33
ryuoBSTs are another story.21:33
ryuoThe hardest aspect is balancing them correctly in the face of an unpredictable insertion order.21:34
ryuoi don't see the point myself. you can use the POSIX one if you really need them.21:34
jaegerMy intent with using a BST was for efficiency and sorting. They're automatically sorted and wouldn't allocate more memory than was used21:35
jaegerAnd for the sizes of data we're talking about with a package database, plenty fast21:35
jaegerbut for the same reason, using a dynamic array and wasting a very small amount of memory is probably fine21:35
ryuoyou have to factor in that BSTs waste memory for every node as well.21:36
ryuoat least 2 pointers.21:36
jaegerNot wasted if it's well-balanced, I guess21:36
ryuowell... you have the same number of nodes regardless of balancing approach.21:37
ryuodata nodes anyway.21:37
jaegerThough I didn't worry about balance with the small dataset, too21:37
jaegerfair enough21:37
ryuoi'd honestly probably have tried a skip list. they're a lot simpler though they're basically a fancy linked list with fast lists.21:38
*** isidore has joined #crux-devel21:58
*** isidore has quit IRC22:12
*** onodera has joined #crux-devel22:59
*** onodera has quit IRC23:15

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