Git Product home page Git Product logo

Comments (5)

chad-earthscope avatar chad-earthscope commented on August 17, 2024 1

No worries. Thanks for the report. Valgrind is awesome for this kind of thing, keeps C honest until we wholesale move to Rust...

from libmseed.

chad-earthscope avatar chad-earthscope commented on August 17, 2024

Thanks. Is this on current master branch or some other tagged release?

from libmseed.

bakerb845 avatar bakerb845 commented on August 17, 2024

Hey Chad, this is on the current master. I think the issue may have existed for at least a few months on libmseed v3. Unfortunately, I was tracking a problem with my codes, valgrind complained, so I just pulled the latest from the master hoping the problem would magically disappear. I didn't note my previous libmseed3 version. Sorry!

from libmseed.

dsentinel avatar dsentinel commented on August 17, 2024

Related. Apologies for a terrible bug report, this is from memory.
When:
ms3_readtracelist( without UNPACKDATA and then again with UNPACKDATA
I think I saw datasamples alloc'd twice, leaving a dangling pointer from the first call.... or maybe some other memory bug that valgrind should easily catch.
I meant to make a proper case report, and PR, but alas, time.

from libmseed.

anowacki avatar anowacki commented on August 17, 2024

I'm pretty certain that the lack of initialisation of fpos on line 675 of fileutils.c has been causing errors for me, and that initialising it to 0 fixes those issues.

For background, I'm wrapping libmseed in a Julia package, and I have several tests calling ms3_readtracelist a total of I guess ~100 times. My tests were failing on certain machine and architecture combinations, with files not being read properly. (See e.g. https://github.com/anowacki/LibMseed.jl/runs/5971465915?check_suite_focus=true for error messages logged by libmseed amongst all the Julia stuff.) In short, calls to ms3_readtracelist for data which had just been written by msr3_writemseed and existing test data were returning a MS_NOTSEED error, even though the files were valid miniSEED on disk, and other OS-architecture combinations were working.

Initialising fpos to 0 as suggested by @bakerb845 fixes these problems for me (e.g., https://github.com/anowacki/LibMseed.jl/runs/5981051328?check_suite_focus=true), so I wonder if you might want to include this change in a future version of libmseed soon? I have submitted a PR to this effect (#80), but please do feel free to close that and deal with this as you see fit.

from libmseed.

Related Issues (20)

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.