IRC channel logs
2023-08-21.log
back to list of logs
<daviid>cow_2001: it actually is an 'Object-oriented game engine for Guile', and his author is a goops wizard <cow_2001>"However one thing I don’t like about Scheme is that there are different function names for each type of arguments. E.g. adding numbers is done with +, adding lists is done with append, and adding strings is done with string-append." Strange. That's one of my favourite bits. <daviid>RhodiumToad: unlike i said above, the problem might not be with the (apply init-template (list g-inst 'skip-prepare-gi-arguments)) call - <daviid>but i still struggle to find what causes the segfault <daviid>RhodiumToad: the difficulty here is that %instance-init-func is called upon template 'subclass' (by GLib/GObject, Gtk in fact but ... not g-golf), so when we launch the demo, it calls %instance-init-func <adw-demo-window>, which triggers a call to %instance-init-func <adw-demo-page-welcome> and %instance-init-func <adw-demo-page-leaflet> <daviid>RhodiumToad: well speaking loudly, i still fail to identify the cause of the segfault - but here is a version (not gona push it) that helps to track these calls - https://paste.centos.org/view/4b70b828 - if you paste this and run the make danse, you should get those traces as well <RhodiumToad>I've not yet managed to reproduce the failure on the preferences option <daviid>in the gdn bt, i can see a pattern, it either is like the one we were looking at yesterday, or the one i pasted here today - https://paste.centos.org/view/918a2327 - this one shows the libguile code that is being run just before the segfault <daviid>RhodiumToad: did you pull the lates today? <RhodiumToad>not yet, waiting on rebuilding libs with debugging enabled <daviid>RhodiumToad: what i do here, to try to get it to segfault on the preferences window select, is i make a 'false' change in the scm files, ./adw1-demo/window.scm, the ./adw1-demo/preferences.scm - i add and delete a space, to force recompilation, it doesn't always work, but ... sometimes it does ... <RhodiumToad>and it came from here: user_data=0x80, which is also nonsense <RhodiumToad>so that looks to me like the closure was either improperly created, or it has been stomped on since creation <daviid>RhodiumToad: one thing i note is it either work - then it present the preferences window, and you may close and call it again 100's of times, it will never segfault - or it segfault at the first attempt <RhodiumToad>I still have never had it segfault on the preferences window <daviid>could you patch the %instance-init-func using the code above and try again ... also making those 'fake' changes in the scheme code ... <daviid>RhodiumToad: you might as well provoque a fake change in the adw1-demo/ui/preferences.scm, then in that directory run make, then launch the app again ... <RhodiumToad>only place it crashes is on startup, after the first or sometimes second %instance-init-func call <daviid>RhodiumToad: too bad, here it is a nightmare to try to run aninstance that works :) [ i wanted to trace the (%g-inst-construct-g-type) calls for a case that worked ..] <daviid>RhodiumToad: that crash 'pattern' shows it crashes calling the 'next template initialization' which if it worked would display ;; %instance-init-func <adw-demo-page-welcome> ... <daviid>this means that in this pattern, the pointer to the instance-iit-func for the <adw-demo-page-welcome> is/was corrupted, i think <daviid>RhodiumToad: and this makes me think maybe you could help me to try to run the demo, but forcing a lower lever optimazation guile default compilation flag <daviid>i never (had to) change the default guile's compilatyion flags :) <daviid>i can try no-autocompile, in the adw1-demo.scm script, would that also affect any modules it will use, i assume yes - then clear my cache ofc ... let's see <RhodiumToad>I don't think optimization at the guile level will make any difference at all <daviid>RhodiumToad: though using --no-auto-compile i can't get it to segfault anymore <daviid>i can't get it to segfault anymore <daviid>nor initially, nor the preferences window <daviid>i cleared my .cache/guile entirely - the only compiled file it uses are those g-golf core files .. <RhodiumToad>now it sometimes crashes even before the first %instance-init-func <daviid>that's really strange - maybe a guile version diffrerence then <daviid>here i manually install guile, and regularly update, currently, running GNU Guile 3.0.9.90-9d927-dirty <RhodiumToad>#1 0x0000000800375618 in scm_call_n (proc=proc@entry=0x100, argv=argv@entry=0x7fffffffc2c0, nargs=<optimized out>) at vm.c:1614 <daviid>RhodiumToad: but what does this tells us? i tracked the instance-init pointer(s), result of the %instance-init-func call prior to g-type-register-static-simple are (always) valid <daviid>RhodiumToad: yes, thanks for your help - let me add one more thing (need to try once more, then i'll write here) <RhodiumToad>ok. some closure is definitely being freed prematurely. <RhodiumToad>but that closure ends up called from g_type_create_instance later <daviid>ok, so as i just said, just keeping a ref to the procedure->pointer isn't suffcient <daviid>i mean i said i thought it was sfficient but it isn't <RhodiumToad>though the details are somewhat complex. the result of procedure->pointer is registered in a weak table with the closure as a value <RhodiumToad>so as long as the pointer is referenced from elsewhere, the weak table entry is not removed, and the closure remains in existence <daviid>right - what i could try, to make some progress and confirm your analysis, is to make the class-init and instance-init lambda top-level define procedures <rlb>Interesting - after reworking the tests to run everything in parallel, the popen-child.scm issue resurfaces: 6069e9733163cf802e806bfa55cb4fcc54fc6ac7 <rlb>i.e. it hangs at 100% cpu <RhodiumToad>since i have something i can consistently reproduce now, I should be able to track down at least one bug <daviid>RhodiumToad: ok, thanks - i'll try to outsource the code of the %instance-init-func and see - will ping you if it seems to solve the problem <daviid>i am doing this right now, when done, 'll try, then push and ask you - as time permit ofc - to pull and try ... many thanks again <daviid>RhodiumToad: i pushed a fix, when time allows, see if it fixes the problem on your side as well, here so far so good <daviid>RhodiumToad: i also just pushed a fix to the gtk-4/peg-solitaire.scm example, so you should no longer need to patch it yourself in freebsd <rlb>Hmm, surprised srfi-13 string-any seems to specify a boolean for string-any, rather than the matching char (say for a charset predicate). Seems like the former'd be more useful. <rlb>I have it returning the char in the current branch, but suppose I should change it. <wingo>civodul: hey. for -Wunused-toplevel and srfi-9 -- should we try to fix this? <wingo>no, i mean for the define-inlinable accessors <wingo>the "value" variant often ends up unused and causing a warning <wingo>so, an idea. embed metadata in the generated lamdba <civodul>more generally warnings about "unused" macro-introduced bindings <wingo>(lambda () #((maybe-unused)) body ...) <wingo>wanted to know what you thought about the idea, and if you liked it, if there was a better way to do it <wingo>#((disable-analysis unused-toplevel foo-bar)) or something... <civodul>there's currently no way to associate metadata like this, right? <wingo>a generalization of the docstring facility <wingo>well. clearly i didn't document it well ;) <civodul>so yes, a generic "ignore-warning pragma" of sorts would be perfect <civodul>and no, i can't think of another way to address those unused-toplevel false positives <wingo>ok let's call it ignore-warnings then <wingo>and pass some number of analysis names as args <civodul>-Wunused-variable has false positives too for macro-introduced bindings (like 'match') <civodul>initially i thought we could add metadata to the binding itself <wingo>haha that's your problem then ;) <civodul>like 'match' introduces a binding called 'failure', and it always shows up <wingo>ACTION not bothered by unused lexicals ;) <wingo>ok, i will see about the srfi-9 thing. conveniently it defines its own define-inlinable <viaken>Does Guile/Scheme provide something like with-open-port? I see call-with-port, but it doesn't close in case of errors. <lilyp>viaken I think it should close on errors after garbage collection <rlb>viaken: I don't know of one offhand, and so you'd have to dynamic-wind or similar, though I'd like one since I almost never want to leave the ports to gc, and it's convenient. <haugh>vlaken, I think with-intput-from-port and with-output-to-port have dynamic-wing builtin <haugh>but of course these use current-{input,output}-port <haugh>and now I see you're trying to open an ephemeral, not use an existing