Skip to content

Segfaulting Threaded code #325

Closed
Closed
@bryaan

Description

@bryaan

PythonCall

When running the following script you will get a segfault. Please help debug as it seems to be a problem with this lib and async methods. Seems to work when @Spawn is changed to @async but that causes it to execute sequentially, which is another issue.

using PythonCall

Web3 = pyimport("web3")

web3async = Web3.AsyncWeb3(Web3.AsyncHTTPProvider("https://mainnet.infura.io/v3/b048b4d49aad428babc12c0eb65dcdc9"))

while true
    @time for _ in range(1, 10)
        Threads.@spawn begin
            blockCoro = web3async.eth.get_block(17418534)
            # block = asyncio_run(blockCoro)
            # @show block 
        end
    end
    sleep(1)
end

wait()
[73021] signal (11.2): Segmentation fault: 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions