Code Monkey home page Code Monkey logo

Comments (4)

rockowitz avatar rockowitz commented on September 25, 2024

Thank you for the patch. Do you have a ddcutilrc configuration file? If so what is its contents?

from ddcutil.

giftick avatar giftick commented on September 25, 2024

Yes, I had this ~/.config/ddcutil/ddcutilrc file when the error occurred:

[global]
options: --sleep-less --sleep-multiplier .025 --timeout-i2c-io

[ddcutil]

[libddcutil]
--noverify

When I remove this config file, ddcutil git commit f2bc353 works fine without my patch.
I don't need the config file anyway. My app calls

ddca_enable_report_ddc_errors(false);
ddca_enable_verify(false);
ddca_enable_sleep_suppression(true); // I know this is a noop nowadays

on startup, and then does this in an async thread that processes queued change requests in a loop:

__useconds_t sleep_usec = 45000; // Philips 328E1: 45000 always works, 44000 occasionally drops a packet
for (;;) {
    ...
    DDCA_Status rc = ddca_set_non_table_vcp_value(ddca_dh,code,v >> 8,v & 0xff);
    if (rc) error(...);
    usleep(sleep_usec);
}

Sorry for not having thought about the config file myself.

from ddcutil.

rockowitz avatar rockowitz commented on September 25, 2024

I have pushed a fix for the crash you reported to branch 1.4.0-dev. The underlying problem was that function apply_config_file() in file ddcutil_config_file.c was not setting the proper return values for the case where the config file is invalid. The assert() failure in function ntsa_length() is a precondition failure.

The configuration file error that triggered the problem is the [libddcutil] segment, which should read "options: --noverify",
not "--noverify".

Thank you for reporting the problem. Getting all the bugs out of error handling code is difficult, since execution paths through error handlers are infrequent.

I have also modified the libddcutil initialization code to write the error message to the system log as well as syserr, since messages to syserr can be lost depending on how the program using the shared library is invoked. As the libddcutil initialization function __ddca_init() is a constructor it doesn't set the thread error detail that can be checked by the caller as with other API functions. Perhaps there needs to be an additional API function ddca_get_initialization_msgs() to get this information. Thoughts?

I'm interested to see how you're using libddcutil, but I'd rather not clutter this bug thread. If your code is on github I'll take a look. Or you can email me at [email protected].

Regards,
Sanford

from ddcutil.

rockowitz avatar rockowitz commented on September 25, 2024

Fixed in release 1.4.1

from ddcutil.

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.