rockowitz / ddcui

Graphical user interface for ddcutil - control monitor settings
http://www.ddcutil.com
GNU General Public License v2.0
147 stars 2 forks source link

ddcui-0.5.x: IOT instruction (core dumped) #55

Closed AndrewAmmerlaan closed 4 months ago

AndrewAmmerlaan commented 4 months ago

Launching version 0.5.0 or 0.5.2 results in:

andrew@andrew-gentoo-laptop ~ % ddcui
QSocketNotifier: Can only be used with threads started with QThread
ddcui: Applying combined options:
libddcutil: Options passed from client:
libddcutil: Applying combined options:
ddcui: /tmp/portage/app-misc/ddcui-0.5.2/work/ddcui-0.5.2/src/main/mainwindow.cpp:404: void MainWindow::initMonitors(Parsed_Ddcui_Cmd*): Assertion `ddcrc == 0' failed.
zsh: IOT instruction (core dumped)  ddcui

Version 0.4.2 works fine.

rockowitz commented 4 months ago

@AndrewAmmerlaan I replied directly to your post from my email program, but it looks like that that message went only to notifications@github.com and didn't get posted as a comment. In case you didn't receive the reply either, here is an updated version.

First, did you build with any configure options?

Please turn on some tracing and submit the command output.

Unfortunately, the trace facilities in ddcui aren't as sophisticated as those in ddcutil/libddcutil. Please edit file mainwindow.cpp and set "debug = true;" in methods MainWindow :: MainWindow and MainWindow::initMonitors(). Similarly, set "debug = true;" in function main() of file main.cpp.

Enabling the relevant tracing in the shared library is simpler. Add the following to the ddcui command: --libopts "--trace api --trcapi ddca_get_display_refs --trcapi --trcapi ddca_get_display_info --trcfunc validate_ddc_display_ref"

Also, please submit the output of "ddcutil interrogate".

rockowitz commented 4 months ago

Also:

Does behaviour change if you include option --f5 in the libopts strring?

Using the ddcutil executable built along with libddcutil, execute command ddcutil detect --settings.

It may be that this bug is specific to gentoo, but for now I'm treating it as blocking the submission of the current ddcutil/ddcui releases to Debian. This needs to happen very soon if the current releases are going to be included in Ubuntu 24.04, so a quick reply would be very helpful. Thank you.

AndrewAmmerlaan commented 4 months ago

Here's a full build log for ddcutil and ddcui showing the used configure options and CFLAGS

buildlogs.txt

And here's ddcutil interrogate: ddcutil-interrogate.txt

And detect --settings:

andrew@andrew-gentoo-pc ~ % ddcutil detect --settings
ddcutil version:            2.1.2
Configuration file:         (none)
Output level:               Normal
Reporting DDC data errors:  false
Force I2C slave address:    false
User defined features:      enabled
Mock feature values:        disabled

Trace Options:
Trace groups active:     none
Traced functions:        none
Traced API calls:        none
Traced call stack calls: none
Traced files:            none

Performance and Retry Options:
Deferred sleep enabled:                 false
Dynamic sleep algorithm enabled:        true
Minimum dynamic sleep multiplier:       0.00
Default sleep multiplier factor:        1.00

Experimental Options:
Utility option --f1 disabled: Suppress SE_POST_READ
Utility option --f2 disabled: Experimental sysfs analysis
Utility option --f3 disabled: DDC Null Message never indicates invalid feature
Utility option --f4 disabled: Read strategy tests
Utility option --f5 disabled: Use non-default value for EDID read uses I2C layer (default=true)
Utility option --f6 disabled: Unused
Utility option --f7 disabled: Disable phantom display detection
Utility option --f8 disabled: Slow down watch display polling
Utility option --f9 disabled: Use non-default watch mode (default = Watch_Mode_Simple_Udev)
Utility option --f10 disabled: Extended sleep for DDC Null Msg
Utility option --f11 disabled: Explore monitor state tests
Utility option --f12 disabled: Disable DRM services
Utility option --f13 disabled: Command C1 only report display connection changes
Utility option --f14 disabled: Command C1 only report display DPMS state changes
Utility option --i1:          Extra seconds to wait after apparent display disconnect (default = 6)
Utility option --i2:          NULL Response Hack Millis
Utility option --i3:          flock_poll_millisec (default = 500)
Utility option --i4:          flock_max_wait_millisec (default = 3000
Utility option --i5:          Unused
Utility option --i6:          Unused
Utility option --i7:          Unused
Utility option --i8:          Unused
Utility option --s1:          Unused
Utility option --s2:          Unused
Utility option --s3:          Unused
Utility option --s4:          Unused
Utility option --fl1:         Unused
Utility option --fl2:         Unused

Display 1
I2C bus:  /dev/i2c-0
DRM connector:           card0-HDMI-A-2
EDID synopsis:
Mfg id:               SAM - Samsung Electric Company
Model:                SyncMaster
Product code:         1314  (0x0522)
Serial number:        H1AK500000
Binary serial number: 1279341104 (0x4c413230)
Manufacture year:     2009,  Week: 14
VCP version:         2.0

Invalid display
I2C bus:  /dev/i2c-4
DRM connector:           card0-DP-2
EDID synopsis:
Mfg id:               IVM - Iiyama North America
Model:                PLE1900WS
Product code:         18480  (0x4830)
Serial number:        0578571500265
Binary serial number: 265 (0x00000109)
Manufacture year:     2007,  Week: 15
DDC communication failed. (getvcp of feature x10 returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: EREMOTEIO(10)])

Display 2
I2C bus:  /dev/i2c-12
DRM connector:           card1-DP-5
EDID synopsis:
Mfg id:               MSI - Microstep
Model:                MSI MAG342CQR
Product code:         15798  (0x3db6)
Serial number:        DB6H262103059
Binary serial number: 0 (0x00000000)
Manufacture year:     2022,  Week: 4
VCP version:         2.2

I'll try the other debugging steps you suggested later.

rockowitz commented 4 months ago

If you disconnect the Iiyama monitor that does not support DDC/CI, does the crash still happen?

AndrewAmmerlaan commented 4 months ago

If you disconnect the Iiyama monitor that does not support DDC/CI, does the crash still happen?

No! That makes it work. Plugging the old VGA display back in breaks it again.

I can also reproduce this issue on my laptop, which also does not support ddc since it is a laptop screen.

rockowitz commented 4 months ago

I've pushed my current working ddcutil branch to github as branch fix_validation. It dials back some overly aggressive display reference validation that was put in to make returned status codes clearer. ddcui branch 0.5.3-dev contains some small changes to report the status code from ddca_get_display_info() to both the terminal and to syslog. Let me know how it looks.

AndrewAmmerlaan commented 4 months ago

I've pushed my current working ddcutil branch to github as branch fix_validation. It dials back some overly aggressive display reference validation that was put in to make returned status codes clearer. ddcui branch 0.5.3-dev contains some small changes to report the status code from ddca_get_display_info() to both the terminal and to syslog. Let me know how it looks.

With this version I'm seeing a new "returned illegal argument" message:

andrew@andrew-gentoo-laptop ~ % ddcui
QSocketNotifier: Can only be used with threads started with QThread
ddcui: Applying combined options:
libddcutil: Options passed from client:
libddcutil: Applying combined options:
(MainWindow::initMonitors      ) ddca_get_display_info() returned illegal argument
ddcui: /tmp/portage/app-misc/ddcui-0.5.2_p1/work/ddcui-82a96790b84d999fd03e2f64991da9ede94bbda7/src/main/mainwindow.cpp:408: void MainWindow::initMonitors(Parsed_Ddcui_Cmd*): Assertion `ddcrc == 0' failed.
zsh: IOT instruction (core dumped)  ddcui
rockowitz commented 4 months ago

It looks like you've updated ddcui using branch 0.5.3-dev, but libddcutil is not being built from branch fix_validation.

AndrewAmmerlaan commented 4 months ago

It looks like you've updated ddcui using branch 0.5.3-dev, but libddcutil is not being built from branch fix_validation.

Aah yes, sorry, that's my mistake.

Rebuilt both ddcutil and ddcui from the branches you mentioned and now ddcui works as it should! Thanks!