Skip to content

Convert assert to if #556

@tsdgeos

Description

@tsdgeos

ddc_open_display has this code

TRACED_ASSERT(bus_info); // need to convert to a test?

On KDE we are getting asserts with this trace

Thread 1270936 Crashed:
0 libc.so.6 0x7f48d3881e9c __pthread_kill_implementation (source-5f134746-#usr#src#debug#glibc-2.41-11.fc42.x86_64#nptl#pthread_kill.c:45)
1 libc.so.6 0x7f48d3881f63 __pthread_kill_internal (source-5f134746-#usr#src#debug#glibc-2.41-11.fc42.x86_64#nptl#pthread_kill.c:90)
2 libc.so.6 0x7f48d3827f3e __GI_raise (source-5b0e7cae-#usr#src#debug#glibc-2.41-11.fc42.x86_64#signal#..#sysdeps#posix#raise.c:27)
3 libc.so.6 0x7f48d380f6d0 __GI_abort (source-cde0a3ef-#usr#src#debug#glibc-2.41-11.fc42.x86_64#stdlib#abort.c:78)
4 libc.so.6 0x7f48d380f639 __assert_fail_base (source-41a13c79-#usr#src#debug#glibc-2.41-11.fc42.x86_64#assert#assert.c:119)
5 libc.so.6 0x7f48d38200af __assert_fail (source-41a13c79-#usr#src#debug#glibc-2.41-11.fc42.x86_64#assert#assert.c:128)
6 libddcutil.so.5 0x7f48d34b0b6f ddc_open_display (source-63f8c033-#usr#src#debug#ddcutil-2.2.1-1.fc42.x86_64#src#ddc#ddc_packet_io.c:333)
7 libddcutil.so.5 0x7f48d352d9de ddci_open_display3 (source-b50cbc0d-#usr#src#debug#ddcutil-2.2.1-1.fc42.x86_64#src#libmain#api_displays.c:621)
8 libddcutil.so.5 0x7f48d3533f81 ddca_open_display2 (source-b50cbc0d-#usr#src#debug#ddcutil-2.2.1-1.fc42.x86_64#src#libmain#api_displays.c:653)
9 libpowerdevilcore.so.2 0x7f48d528becc BrightnessWorker::ddcSetBrightness (source-77a70433-#usr#src#debug#powerdevil-6.4.5-1.fc42.x86_64#daemon#controllers#ddcutildisplay.cpp:241)

[1270936] Assertion failed: "bus_info" in file ddc_packet_io.c at line 332

So it would seem that yes, it makes sense to turn that assert into a check.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions