Re: Pike 8.0: Sql.pgsql objects don't get garbage collected?

Jeff Hungerford <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
Thanks for taking care of those issues!

I've moved on to testing a bunch of workers all creating and
destroying connections with some random delays thrown in.

No database connections appear to be leaking, but I've hit a few other
issues.  I've been testing against 5905e76.

Debug builds tend to abort with a core dump after a few minutes
of testing; It looks like the "exception in destruct()" check 
which is only enabled in debug builds gets triggered. (object.c:816)

I also once hit a second debug mode fatal error related to mutex
unlocking:
-=-=-=-=-
/home/hungerf3/git/pike/src/threads.c:2571: Fatal error:
Mutex unlock from wrong key 0xf7 != 0x11dd618!
Pike was in GC stage 400 when this fatal occurred.
Backtrace at time of fatal:
src/threads.c:3428: unknown function()
test4.pike:18: /main()->gc_runner()
Aborted (core dumped)
-=-=-=-=-

If there is anything useful I could extract from the core dumps for
you, let me know.

I also hit a few more issues with races between threads:

It looks like there is an issue with multiple threads trying to open a
connection at the same time; I've seen the following often when
starting up a bunch of test workers at the same time:
-=-=-=-=-
Attempting to clone an unfinished program
/usr/local/pike/8.0.175/lib/modules/Sql.pmod/Sql.pike:342:
    Sql.Sql()->create("localhost:5432","hungerf3","hungerf3","CENSORED",UNDEFINED)
-=-=-=-=-

I've also hit a few more issues with lookups in destructed objects. It
looks like sometimes the object is still trying to shut down while it
is being destructed:
-=-=-=-=-
Lookup in destructed object.
/usr/local/pike/8.0.175/lib/modules/Sql.pmod/pgsql.pike:604:
    unknown function(conxion  fd: 16 input queue: 0/224 queued
    portals: 1  out
    put queue: 0/224
    )
-=-=-=-=-

-=-=-=-=-
Cannot call functions in destructed objects.
Unknown program: destructed object->function()
/usr/local/pike/8.0.175/lib/modules/Sql.pmod/pgsql.pike:627:
    unknown function(conxion  fd: 14 input queue: 0/224 queued
    portals: 1  out
    put queue: 0/224
    )
-=-=-=-=-

-=-=-=-=-
Indexing the NULL value with "i".
/usr/local/pike/8.0.175/lib/modules/Sql.pmod/pgsql.pike:635:
    pgsql(hungerf3@localhost:5432/hungerf3,0,24878)->procmessage()
-=-=-=-=-

A couple of attempts to lock a mutex inside of a destructed object:
-=-=-=-=-
Indexing the NULL value with "trylock".
/usr/local/pike/8.0.175/lib/modules/Sql.pmod/pgsql_util.pmod:175:
    Sql.pgsql_util.bufcon(0 bytes, read=[..-1] data=[0..-1]
    free=[0..0] string
    )->sendcmd(1,UNDEFINED)
/usr/local/pike/8.0.175/lib/modules/Sql.pmod/pgsql.pike:1165:
    unknown function()

Indexing the NULL value with "trylock".
     /usr/local/pike/8.0.175/lib/modules/Sql.pmod/pgsql_util.pmod:257:
     conxion  fd: -1 input queue: 0/224 queued portals: 1
     output queue: 0/224
     ->start(UNDEFINED)
-=-=-=-=-

And one random error with no useful info as to from whence it came:
-=-=-=-=-
Attempt to call the NULL-value
Unknown program:
    0(conxion  fd: -1 input queue: 0/224 queued portals: 1  output
    queue: 0/22
    4
    )
-=-=-=-=-


Let me know if there is any more info I can provide.

-Jeff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.