This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tokeefe
Recipients ned.deily, tokeefe
Date 2013-08-19.20:46:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376945168.73.0.0223366994795.issue18782@psf.upfronthosting.co.za>
In-reply-to
Content
Could you change the dummy function to do something other than simply return the row? For example:

#!/usr/bin/env python

import sqlite3
import multiprocessing as mp

def main():
    ## --- create a database
    conn = sqlite3.connect(':memory:')
    conn.row_factory = sqlite3.Row
    c = conn.cursor()

    ## --- create example table similar to python docs
    c.execute('''CREATE TABLE stocks (date text, trans text, symbol text, qty real, price real)''')
    c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','GOOG',100,869.29)")
    c.execute("INSERT INTO stocks VALUES ('1992-01-06','SELL','AAPL',20,512.99)")
    c.execute("SELECT * FROM stocks")

    ## --- map fun over cursor (fun does little to nothing)
    pool = mp.Pool(processes=mp.cpu_count())
    rows = pool.map(fun, c)

def fun(row):
    _ = len(row)
    return row

if __name__ == "__main__":
    main()

In this example the code simply hangs. For whatever reason, I can no longer provoke the segfault.

Regardless, there is something going on. Here are the results from the print statements you asked for:

2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
2.6.0
3.7.12
0.70a1
4
Darwin-12.4.0-x86_64-i386-64bit

I have also tried this on Ubuntu 12.04:

2.7.3 (default, Apr 10 2013, 06:20:15) 
[GCC 4.6.3]
2.6.0
3.7.9
0.70a1
4
Linux-3.2.0-24-generic-x86_64-with-Ubuntu-12.04-precise
History
Date User Action Args
2013-08-19 20:46:08tokeefesetrecipients: + tokeefe, ned.deily
2013-08-19 20:46:08tokeefesetmessageid: <1376945168.73.0.0223366994795.issue18782@psf.upfronthosting.co.za>
2013-08-19 20:46:08tokeefelinkissue18782 messages
2013-08-19 20:46:08tokeefecreate