Giter Site home page Giter Site logo

Comments (8)

urschrei avatar urschrei commented on June 17, 2024 1

I won't be able to reproduce this under WSL2 as I don't have access to a windows machine, but I can try to reproduce it under Linux and / or macOS – I'll need an example dataset that causes the failure, though.

from convertbng.

urschrei avatar urschrei commented on June 17, 2024 1

Just as a matter of interest, are you using the (slower!) ctypes functions for a reason? Switching to

from convertbng.cutil import convert_bng causes the test to pass on my machine.

from convertbng.

urschrei avatar urschrei commented on June 17, 2024 1

No prob! I'm going to leave this open for now as there's clearly something wrong with my ctypes code.

from convertbng.

joshuanunn avatar joshuanunn commented on June 17, 2024

To follow up, I reproduced the dev environment (including Python 3.8.5) on a native on-metal Ubuntu-18.04 machine, and I still get the same Segfault using ConvertBNG 0.6.25, so doesn't appear related to WSL2 specifically. Note that the CPUs for both machines were i7 based.

I then switched to Python 3.6.9, which was already on the machine and installed everything in a venv again - in contrast, this worked fine. After switching back to Python 3.8.5 and experimenting, I can see that it is specifically fast repeated calls that seems to trigger it (or makes more likely).

Here is a minimum working example that consistently fails:

from convertbng.util import convert_bng
lots_of_conversions = [convert_bng([-1.89983], [52.48142]) for x in range(10000)]

I had to relax the library versions to get everything installed in Python 3.6.9 - the key difference in terms of requirements for convert_bng was that the numpy version (numpy==1.19.5 for Python 3.6.9 and numpy==1.21.2 for Python 3.8.5). However, doing a minimum install of numpy and convert_bng in Python 3.8.5 still segfaulted for both versions of numpy.

Hence, I'm guessing there's an issue in the latest convert_bng wheels for python 3.8?

Happy to provide more info if needed - thank you.

from convertbng.

urschrei avatar urschrei commented on June 17, 2024

Well, I can trigger a segfault with that data…

from convertbng.

joshuanunn avatar joshuanunn commented on June 17, 2024

Perfect, your suggested change also makes everything work fine again on my side for both the test and the processing scripts!

No reason at all - in fact speed in this application isn't too important, more just the library functionality. It just hadn't occurred to me to try, thank you for the suggestion!

from convertbng.

joshuanunn avatar joshuanunn commented on June 17, 2024

Great, I imagine this issue won't affect too many users anyway, as it's only likely to occur when making a lot of repeated smaller calls, rather than larger batches.

Thank you for your time looking at this earlier - it's much appreciated!

from convertbng.

tmladek avatar tmladek commented on June 17, 2024

Hi, I can confirm the intermittent segfaults on a completely different setup (native x86_64 Arch Linux, Python 3.10.9).

Just like joshuanunn, switching to cutil fixed this - but it was a real head scratcher until then!

from convertbng.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.