<shepheb>
if my interface function is partial, but only some of the function bodies are actually partial in practice, I have to add "if false then error end" to the total ones to make them appear partial
<shepheb>
fortunately that doesn't trigger an "unreachable code"
<SeanTAllen>
shepheb: jemc mentioned something involving the word parser, i think it was a parser for pony in pony but i dont remember
TwoNotes has joined #ponylang
<TwoNotes>
Segfault in ponyint_gc_markactor. Not sure how to proceed.
TwoNotes has quit [Quit: Leaving.]
copy` has quit [Quit: Connection closed for inactivity]
jemc has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
trapped has joined #ponylang
<SeanTAllen>
How recent is your compiler TwoNotes?
copy` has joined #ponylang
<SeanTAllen>
There's a bug that was fixed yesterday or the day before in the gc that may or may not be related.
trapped_ has joined #ponylang
trapped has quit [Ping timeout: 260 seconds]
TwoNotes has joined #ponylang
<TwoNotes>
If I build pony with "make config=debug" will I get a debug version of libponyrt as well?
prettyvanilla has quit [Remote host closed the connection]
trapped_ is now known as trapped
<TwoNotes>
aref==NULL in gc.c mark_remote_actor in libponyrt. What could cause this?
shepheb has quit [Ping timeout: 244 seconds]
<SeanTAllen>
which commit are you on?
trapped_ has joined #ponylang
trapped has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
Praetonus has joined #ponylang
lispmeister has joined #ponylang
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
_whitelogger has joined #ponylang
dos000 has joined #ponylang
Scramblejams has quit [Ping timeout: 240 seconds]
<TwoNotes>
SeanTAllen, what is the git command to show commit ID?
<TwoNotes>
Found it c866b780c469ee76da34978d078756b39cb220bf
<TwoNotes>
Dated Mar 7
<TwoNotes>
I have to install the new LLVM before I can upgrade
<dos000>
i think you are looking for git log
<dos000>
maybe ?
<TwoNotes>
Yes, I found git log.
<dos000>
i have this alias alias git-local-log="git log --oneline"
<TwoNotes>
It was the commit of pull request #554
<TwoNotes>
Oh oneline is much nicer. c866b78
<dos000>
))
<TwoNotes>
The gc code got back a NULL from the routine that looks up keys in the actor map.
<dos000>
i am newbie in ponyland ... would not get anything about what you said )
<dos000>
learn i must
<TwoNotes>
This is down in the guts of the Pony runtime code. (That has *very few comments* in this particular section, so I am just guessing at what is going on
<TwoNotes>
It is doing garbage collection of actors.
<SeanTAllen>
TwoNotes: I think Sylvan fixed that already
<SeanTAllen>
run with head
<TwoNotes>
I know my code detected an error condition, but that should not cause the runtime to barf
<TwoNotes>
aha
<SeanTAllen>
you dont have to upgrade to 3.7, there's an option to build for 3.6
<TwoNotes>
Well, I guess I need to do the LLVM thing.
<TwoNotes>
Id rather be using the latest stuff, same as the Pony devs
<TwoNotes>
Ive been on the other end of the support biz myself, and know what it is like.
<SeanTAllen>
During the day, I tend to use older. We have a fork for work. That said we almost have CI in place to test our stuff again latest Pony nightly so that is going to change soon
<TwoNotes>
I remember trying to fix customer problems when they were using stuff two major releases behind what I was working on. Now, how did that work again back then??? grrr
<TwoNotes>
That was when I got really picky about lack of comments explaining what the code was trying to do and why.
lispmeister has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lispmeister has joined #ponylang
<TwoNotes>
Updated to latest ponyc. Still get segfault in actor GC
lispmeister has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<SeanTAllen>
Do you have a minimal case that could be reproduceable TwoNotes? If yes, can you open an issue?
<TwoNotes>
The trouble is, I don't know what the cause is. This is a very complex program
<TwoNotes>
I will see if I can find clues using GDB as to what exactly it is doing.
jemc has quit [Ping timeout: 244 seconds]
<TwoNotes>
Next to last line in the BT is this: Julius_$trace () at main.pony:37
<TwoNotes>
What does that $trace mean?
<TwoNotes>
"Julius" is one of my actors
<TwoNotes>
main.pony:37 is a call to Debug.out
<doublec>
TwoNotes: Are you doing any FFI? Could there be a memory corruption there?
<TwoNotes>
No, this program is not doing any FFIs. The only place I do FFI is in those DB interfaces, and this program is not using any of that (yet)
<TwoNotes>
Tho some sort of memory corruption was my first thought. Poking around in the call frames within GC shows reasonable values
<TwoNotes>
That stack actually has none of my code in it, except for that "Julius_$trace" reference
<TwoNotes>
At the point of failure, routine mark_remote_actor is comparing aref->mark to something. The trouble is, aref==0.
<TwoNotes>
COntext: My actor (Julius) is trying to open a TCP connection to a server. The server is not running, so the connect fails. My code's 'connect_failed' routine in the TCPConnectNofity class has been called.
<doublec>
TwoNotes: does it happen consistently?
<TwoNotes>
oh yes.
<TwoNotes>
very repeatable. This code was working last week. I changed some things and now this.
<doublec>
TwoNotes: can you slowly remove parts of the code to narrow down what's the cause? You're probably already doing this but thought I'd mention anyway.
<TwoNotes>
I guess I will have to clone the whole project and do that.
<TwoNotes>
It is over 1100 lines of code...
<doublec>
Or git bisect from last known good to current bad
<TwoNotes>
hmm, yes, this sounds like a good case for bisect
<TwoNotes>
Ive narrowed it down to the last checkin
jemc has joined #ponylang
<doublec>
TwoNotes: Does it help narrow down what's triggering it?
<SeanTAllen>
Awesome.
<SeanTAllen>
Progress is good.
<TwoNotes>
It is not always in the same place, which suggests something happening asynchronously behind the scenes
<TwoNotes>
Single-stepping thru my code, the GC segfault will suddenly pop up
<TwoNotes>
It would help if somebody could tell me what a "$trace" function is.
<doublec>
I assume it's the function that does the tracking of references to it from other objects - part of GC operation.
<TwoNotes>
I put a breakpoint on it. Evrtything runs up to that point
<TwoNotes>
But the stack has none of my own code on it, so I assume it is one of the background actor threads running
<doublec>
Does your Julian actor have references to other actors?
<doublec>
Were any of those changed in the last commit?
<doublec>
ponyint_gc_markactor calls ponyint_gc_markactor to get the 'aref' which is null that you mentioned.
<TwoNotes>
The last commit had to do with UDB network comms. Julius actor does not refer to those, but anoter actor that it DOES refer to makes UDP calls.
<doublec>
So I assume it's tracing other actors it deals with
<TwoNotes>
Single stepping with GDB, it hops around from thread to thread, so it is kind of confusing
<doublec>
Maybe there's a bug in the udp librarie
<doublec>
Can you selectively comment out the UDP calls it makes and see if the crash goes away?
<TwoNotes>
The particular actor the GC code is looking at when it gets the segfualt is "SpeechOut", which is another actor in a different part of the program.
<TwoNotes>
SpeechOut makes no UDP calls, and does not communicate with Julius
<TwoNotes>
SpeechOut does invoke an external command though
<TwoNotes>
It calls @system
<TwoNotes>
The failing code has made this call: ponyint_actormap_getactor(&gc->foreign, actor);
<TwoNotes>
But that returns NULL. The code does not check for NULL at this point, and I have no idea what the significance of that is
<TwoNotes>
It then goes on to use this value as a pointer, resulting in the segfault
<TwoNotes>
This whole section of the gc code contains *no comments at all*, so it is hard to know what is intended
<TwoNotes>
I will write up this much as an Issue, at least. If that function can return NULL, that should be checked for
<TwoNotes>
#623
<SeanTAllen>
thanks TwoNotes
<TwoNotes>
Now, maybe that routine should NEVER return NULL, in which case something else is wrong
<TwoNotes>
The particular actor that GC is working on at the time, SpeechOut, is very simple. It has one behaviour, and all that does is call the @system function to run an external command. I have not touched that code in days
<TwoNotes>
So something else is messing up the actor map
TwoNotes has quit [Quit: Leaving.]
Praetonus has quit [Quit: Leaving]
trapped_ is now known as trapped
shepheb has joined #ponylang
<shepheb>
is there anywhere that gives docs or a good example of nontrivial generics usage?
<shepheb>
I'm getting impenetrable errors
<shepheb>
trying to write class PSeq[A] is Parser[Array[A]] basically
<shepheb>
that takes an array of Parser[A]s and combines their results into an Array[A]
prettyvanilla has joined #ponylang
<doublec>
shepheb: The package library code is the main example I think. Eg collections
<doublec>
shepheb: I'd try to get it working without generics then add generics piece by piece.
<doublec>
shepheb: Things like #send #read etc are undocumented.
<shepheb>
I've encountered those, yeah. can't figure out where they're legal to write, though.
<doublec>
shepheb: in the same place as rcaps I believe
<SeanTAllen>
shepheb: its an area that really needs documenting. happy to accept PRs to tutorial until I eventually get there.
<doublec>
shepheb: since they identify what rcaps are acceptable at that point
<shepheb>
yeah, but I can't figure out where to write refcaps on generics, either.
<doublec>
shepheb: eg. #read = {ref, val, box}
<doublec>
shepheb: do you have a code/pastebin example of a problem you are hitting?
<shepheb>
#send = {iso, val, tag} I know.
<shepheb>
I can pastebin the errors. the main one is "A #any ! is not a subtype of A #any" which makes sense in a way
<shepheb>
but I can't figure out how to specify #read or whatever.
<shepheb>
since importantly, A #read ! is a subtype of A #read
<doublec>
shepheb: I assume #any can match iso and you can't alias an iso. So you need to restrict the rcap somewhere or remove aliasing.
<doublec>
shepheb: that error seems to be saying you are aliasing something that may not be able to be aliased
<doublec>
shepheb: so Where you a defining the A, make it an "A #read"
<shepheb>
if I write class PSeq[A #read] it says that isn't allowed.
<shepheb>
likewise PSeq[A: A #read] and PSeq[A: #read]