Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when using cupsGetDests #74

Closed
michaelrsweet opened this issue Jan 13, 2024 Discussed in #73 · 4 comments
Closed

Segfault when using cupsGetDests #74

michaelrsweet opened this issue Jan 13, 2024 Discussed in #73 · 4 comments
Assignees
Labels
bug Something isn't working priority-high
Milestone

Comments

@michaelrsweet
Copy link
Member

Discussed in #73

Originally posted by NJRoadfan January 12, 2024
Hello,

I am working on updating some code to support libcups3. I am at the point that I would like to test against the actual libcups3 library. How would one go about doing this? Can libcups3 co-exist with an existing CUPS 2.x install? Or do I have to start fresh with a new Linux VM without any CUPS packages installed and build libcups3?

Also, is the cups-local server needed to print? If so, I'll have to build/install it as well. My existing code calls libcups to submit a job (ultimately a PDF) via cupsCreateDestJob() and cupsStartDestDocument().

@michaelrsweet michaelrsweet self-assigned this Jan 13, 2024
@michaelrsweet michaelrsweet added bug Something isn't working priority-high labels Jan 13, 2024
@michaelrsweet michaelrsweet added this to the v3.0 milestone Jan 13, 2024
@NJRoadfan
Copy link

Adding some details here to reproduce.

Test environment:
Hardware: Raspberry Pi 400
OS: Raspberry Pi OS (Debian 11 "bullseye")

Running CUPS 2.3.3op2 included with OS with one printer queue, the CUPS-PDF printer.

Steps to reproduce:
-Clone current master of libcups3
-Configure with --prefix=/usr/
-Compile and install
-Built the "simple" application in the CUPS API docs that calls cupsEnumDests() and prints out the results.
-Application segfaults when calling cupsEnumDests().

Issue is not just limited to calling cupsEnumDests(). The application I am testing and updating for libcups3 support is also segfaulting when calling cupsGetDests().

Note: I tried testing with the tagged 3.0b2 release. It does not segfault, but still has issues. The sample application outputs a list of printer destinations and then hangs. Have to Ctrl-C at that point.

@michaelrsweet
Copy link
Member Author

OK, so the segfault is an easy fix - the value formatter didn't handle dateTime values...

The hang is occurring when shutting down the DNS-SD thread, not sure why yet.

@michaelrsweet
Copy link
Member Author

Looks like zdohnal fixed the hang in CUPS 2.5, so I brought that fix over:

[master 778600c] Fix hang and crash in cupsGetDests (Issue #74)

@NJRoadfan
Copy link

Just synced the changes and re-built. Looks like everything is working now, including my project. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high
Projects
None yet
Development

No branches or pull requests

2 participants