michaelrsweet / pappl

PAPPL - Printer Application Framework
https://www.msweet.org/pappl
Apache License 2.0
307 stars 49 forks source link

printer-app sometimes crashes #302

Closed tangyanli closed 10 months ago

tangyanli commented 10 months ago

Michael, the printer-app sometimes crashes. I don't even know how to investigate this crash. It would be appropriate if you could give some investigation suggestion.

Describe the bug printer-app sometimes crashes. There is no 100% reproduce steps.

To Reproduce Steps to reproduce the behavior:

  1. Install and run legacy-printer-app
  2. Do some add/delete/modify operations
  3. The printer-app crashes and show below message.

System Information: OS: Ubuntu22.10 Browser: Firefix Version: pappl-v1.4.x

case1:

$ sudo ./legacy-printer-app -o log-file=/var/log/printer-app/legacy.log -o log-level=debug server
legacy-printer-app: tpp.c:83: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= fifo_min_prio && new_prio <= fifo_max_prio)' failed.
Aborted

case2:

$ sudo ./legacy-printer-app -o log-file=/var/log/printer-app/legacy.log -o log-level=debug server
legacy-printer-app: pthread_mutex_lock.c:438: __pthread_mutex_lock_full: Assertion `e != ESRCH || !robust' failed.
Aborted
michaelrsweet commented 10 months ago

Need a backtrace, maybe run the legacy printer app inside gdb?

tangyanli commented 10 months ago

This is the backtrace for crashing case 3

....
[Thread 0x7fffcb7fe640 (LWP 115958) exited]
[New Thread 0x7fffcb7fe640 (LWP 115962)]
[Thread 0x7fffcb7fe640 (LWP 115962) exited]

The futex facility returned an unexpected error code.

Thread 2 "legacy-printer-app" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff5a26640 (LWP 109993)]
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737314448960) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.

(gdb) thread apply all bt

Thread 169 (Thread 0x7ffff4a24640 (LWP 113839) "libusb_event"):
#0  0x00007ffff7b6cdbf in __GI___poll (fds=0x7ffff4a23aa0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff6ad24c2 in ?? () from /lib/x86_64-linux-gnu/libusb-1.0.so.0
#2  0x00007ffff7ae8ac3 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
#3  0x00007ffff7b7aa40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 2 (Thread 0x7ffff5a26640 (LWP 109993) "legacy-printer-app"):
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737314448960) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737314448960) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737314448960, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7a96476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff7a7c7f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff7add3dc in __libc_message (action=do_abort, fmt=0x7ffff7c2f7b1 "%s", fmt=0x7ffff7c2f7b1 "%s", action=do_abort) at ../sysdeps/posix/libc_fatal.c:155
#6  0x00007ffff7add6f0 in __GI___libc_fatal (message=message@entry=0x7ffff7c31d28 "The futex facility returned an unexpected error code.\n") at ../sysdeps/posix/libc_fatal.c:164
#7  0x00007ffff7ae51a6 in futex_fatal_error () at ../sysdeps/nptl/futex-internal.h:87
#8  __futex_lock_pi64 (futex_word=futex_word@entry=0x7ffff0006178, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:203
#9  0x00007ffff7aebc7f in __pthread_mutex_lock_full (mutex=0x7ffff0006178) at ./nptl/pthread_mutex_lock.c:429
#10 0x00007ffff7aebfb5 in ___pthread_mutex_lock (mutex=mutex@entry=0x7ffff0006178) at ./nptl/pthread_mutex_lock.c:86
#11 0x00007ffff7ca18df in pappl_dnssd_query_cb (rdata=<optimised out>, rdlen=<optimised out>, context=0x7ffff0006170, flags=<optimised out>, rrtype=<optimised out>, rrclass=<optimised out>, fullName=<optimised out>, event=<optimised out>, protocol=<optimised out>, interfaceIndex=<optimised out>, browser=<optimised out>) at device-network.c:742
#12 0x00007ffff713857c in avahi_record_browser_event () from /lib/x86_64-linux-gnu/libavahi-client.so.3
#13 0x00007ffff7134286 in ?? () from /lib/x86_64-linux-gnu/libavahi-client.so.3
#14 0x00007ffff75f86a5 in dbus_connection_dispatch () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#15 0x00007ffff713ac74 in ?? () from /lib/x86_64-linux-gnu/libavahi-client.so.3
#16 0x00007ffff7149c88 in avahi_simple_poll_dispatch () from /lib/x86_64-linux-gnu/libavahi-common.so.3
#17 0x00007ffff7149f75 in avahi_simple_poll_loop () from /lib/x86_64-linux-gnu/libavahi-common.so.3
#18 0x00007ffff714a04b in ?? () from /lib/x86_64-linux-gnu/libavahi-common.so.3
#19 0x00007ffff7ae8ac3 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
#20 0x00007ffff7b7aa40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 1 (Thread 0x7ffff5a2d340 (LWP 109989) "legacy-printer-app"):
--Type <RET> for more, q to quit, c to continue without paging--
#0  0x00007ffff7b6cdbf in __GI___poll (fds=fds@entry=0x5555555ac69c, nfds=3, timeout=29969) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff7b8a6e2 in __poll_chk (fds=fds@entry=0x5555555ac69c, nfds=<optimised out>, timeout=<optimised out>, fdslen=fdslen@entry=256) at ./debug/poll_chk.c:27
#2  0x00007ffff7cc901b in poll (__timeout=<optimised out>, __nfds=<optimised out>, __fds=0x5555555ac69c) at /usr/include/x86_64-linux-gnu/bits/poll2.h:39
#3  papplSystemRun (system=system@entry=0x5555555ab9f0) at system.c:599
#4  0x00007ffff7cb0fe5 in _papplMainloopRunServer (base_name=base_name@entry=0x7fffffffe2d9 "legacy-printer-app", version=version@entry=0x55555556f0a8 "1.0", footer_html=footer_html@entry=0x0, num_drivers=num_drivers@entry=0, drivers=drivers@entry=0x0, autoadd_cb=autoadd_cb@entry=0x0, driver_cb=0x0, num_options=<optimised out>, options=0x7fffffff9d20, system_cb=0x5555555648c0 <_prSystemCB>, data=0x7fffffffbcf0) at mainloop-subcommands.c:806
#5  0x00007ffff7caec3f in papplMainloop (argc=argc@entry=2, argv=argv@entry=0x7fffffffdf28, version=0x55555556f0a8 "1.0", footer_html=footer_html@entry=0x0, num_drivers=num_drivers@entry=0, drivers=drivers@entry=0x0, autoadd_cb=0x0, driver_cb=0x0, subcmd_name=0x0, subcmd_cb=0x0, system_cb=0x5555555648c0 <_prSystemCB>, usage_cb=0x0, data=0x7fffffffbcf0) at mainloop.c:452
#6  0x000055555555b952 in prRetroFitPrinterApp (printer_app_config=printer_app_config@entry=0x7fffffffdd50, argc=argc@entry=2, argv=argv@entry=0x7fffffffdf28) at pappl-retrofit/pappl-retrofit.c:56
#7  0x000055555555b0df in main (argc=2, argv=0x7fffffffdf28) at legacy-printer-app.c:191
tangyanli commented 10 months ago

I will post the backtrace of case1 and case2 once I encounter them again.

michaelrsweet commented 10 months ago

Hmm, this looks like a locking issue in the DNS-SD code...

michaelrsweet commented 10 months ago

Might be related to #299.

michaelrsweet commented 10 months ago

Please re-test with the current 1.4.x branch.

tangyanli commented 10 months ago

Michael, the issue is not fixed. I used the current 1.4.x branch and the avahi-daemon was always running. The printer-app crashed again.

[Thread 0x7ffff5225640 (LWP 41619) exited]
legacy-printer-app: pthread_mutex_lock.c:438: __pthread_mutex_lock_full: Assertion `e != ESRCH || !robust' failed.

Thread 2 "legacy-printer-app" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff5a26640 (LWP 39953)]
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737314448960) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737314448960) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737314448960) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737314448960, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7a96476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff7a7c7f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff7a7c71b in __assert_fail_base (fmt=0x7ffff7c31150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff7c2d5a3 "e != ESRCH || !robust", 
    file=0x7ffff7c2d58e "pthread_mutex_lock.c", line=438, function=<optimised out>) at ./assert/assert.c:92
#6  0x00007ffff7a8de96 in __GI___assert_fail (assertion=assertion@entry=0x7ffff7c2d5a3 "e != ESRCH || !robust", file=file@entry=0x7ffff7c2d58e "pthread_mutex_lock.c", line=line@entry=438, 
    function=function@entry=0x7ffff7c35840 <__PRETTY_FUNCTION__.1> "__pthread_mutex_lock_full") at ./assert/assert.c:101
#7  0x00007ffff7aebed1 in __pthread_mutex_lock_full (mutex=0x7ffff0000f78) at ./nptl/pthread_mutex_lock.c:438
#8  0x00007ffff7aebfb5 in ___pthread_mutex_lock (mutex=mutex@entry=0x7ffff0000f78) at ./nptl/pthread_mutex_lock.c:86
#9  0x00007ffff7ca18ec in pappl_dnssd_query_cb (rdata=<optimised out>, rdlen=<optimised out>, context=0x7ffff0000f70, flags=<optimised out>, rrtype=<optimised out>, rrclass=<optimised out>, 
    fullName=<optimised out>, event=<optimised out>, protocol=<optimised out>, interfaceIndex=<optimised out>, browser=<optimised out>) at device-network.c:740
#10 0x00007ffff713857c in avahi_record_browser_event () from /lib/x86_64-linux-gnu/libavahi-client.so.3
#11 0x00007ffff7134286 in ?? () from /lib/x86_64-linux-gnu/libavahi-client.so.3
#12 0x00007ffff75f86a5 in dbus_connection_dispatch () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#13 0x00007ffff713ac74 in ?? () from /lib/x86_64-linux-gnu/libavahi-client.so.3
#14 0x00007ffff7149c88 in avahi_simple_poll_dispatch () from /lib/x86_64-linux-gnu/libavahi-common.so.3
#15 0x00007ffff7149f75 in avahi_simple_poll_loop () from /lib/x86_64-linux-gnu/libavahi-common.so.3
#16 0x00007ffff714a04b in ?? () from /lib/x86_64-linux-gnu/libavahi-common.so.3
#17 0x00007ffff7ae8ac3 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
#18 0x00007ffff7b7aa40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
tangyanli commented 10 months ago

Once again

[Thread 0x7fffe7fff640 (LWP 194915) exited]
legacy-printer-app: tpp.c:83: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= fifo_min_prio && new_prio <= fifo_max_prio)' failed.

Thread 2 "legacy-printer-app" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff59fb640 (LWP 191912)]
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737314272832) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737314272832) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737314272832) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737314272832, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7a6b476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff7a517f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff7a5171b in __assert_fail_base (fmt=0x7ffff7c06150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=0x7ffff7c06fc8 "new_prio == -1 || (new_prio >= fifo_min_prio && new_prio <= fifo_max_prio)", file=0x7ffff7c0261d "tpp.c", line=83, function=<optimised out>) at ./assert/assert.c:92
#6  0x00007ffff7a62e96 in __GI___assert_fail (assertion=assertion@entry=0x7ffff7c06fc8 "new_prio == -1 || (new_prio >= fifo_min_prio && new_prio <= fifo_max_prio)", 
    file=file@entry=0x7ffff7c0261d "tpp.c", line=line@entry=83, function=function@entry=0x7ffff7c0a8c0 <__PRETTY_FUNCTION__.0> "__pthread_tpp_change_priority") at ./assert/assert.c:101
#7  0x00007ffff7ac6139 in __GI___pthread_tpp_change_priority (previous_prio=previous_prio@entry=-1, new_prio=new_prio@entry=7910) at ./nptl/tpp.c:83
#8  0x00007ffff7ac09cd in __pthread_mutex_lock_full (mutex=0x7ffff001e0a8) at ./nptl/pthread_mutex_lock.c:555
#9  0x00007ffff7c7a292 in pappl_dnssd_query_cb (browser=0x7ffff0054f60, interfaceIndex=2, protocol=1, event=AVAHI_BROWSER_NEW, 
    fullName=0x7ffff0051f5c "Canon\\032iR-ADV\\032C3835\\032\\040cf\\05861\\05848\\041._pdl-datastream._tcp.local", rrclass=1, rrtype=16, rdata=0x7ffff0051fb4, rdlen=426, 
    flags=AVAHI_LOOKUP_RESULT_MULTICAST, context=0x7ffff001e0a0) at device-network.c:740
#10 0x00007ffff710d57c in avahi_record_browser_event () from /lib/x86_64-linux-gnu/libavahi-client.so.3
#11 0x00007ffff7109286 in ?? () from /lib/x86_64-linux-gnu/libavahi-client.so.3
#12 0x00007ffff75cd6a5 in dbus_connection_dispatch () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#13 0x00007ffff710fc74 in ?? () from /lib/x86_64-linux-gnu/libavahi-client.so.3
#14 0x00007ffff711ec88 in avahi_simple_poll_dispatch () from /lib/x86_64-linux-gnu/libavahi-common.so.3
#15 0x00007ffff711ef75 in avahi_simple_poll_loop () from /lib/x86_64-linux-gnu/libavahi-common.so.3
#16 0x00007ffff711f04b in ?? () from /lib/x86_64-linux-gnu/libavahi-common.so.3
#17 0x00007ffff7abdac3 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
#18 0x00007ffff7b4fa40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
tangyanli commented 10 months ago

Additional info: A usb printer was connected to the PC and ipp-usb was running.

michaelrsweet commented 10 months ago

I'm not sure what is going on here - the only function that calls pthread_mutex_lock/unlock is the query callback, and those calls are balanced, so this absolutely should not fail.

Can you try building PAPPL manually and then run:

testsuite/testpappl --list

to test the papplDeviceList API?

tangyanli commented 10 months ago

Michael, my investigation is as below:

Step1: [Purpose]: Confirm the return value of pthread_mutex_lock() and pthread_mutex_unlock in the function pappl_dnssd_query_cb()

redefine the pthread_mutex_lock() and pthread_mutex_unlock as below,

#    define _pappl_pthread_mutex_lock(mutex)        fprintf(stderr, "%p/%s: pthread_mutex_lock ret=[%d]\n", (void *)pthread_self(), __func__, pthread_mutex_lock(mutex)) 
#    define _pappl_pthread_mutex_unlock(mutex)      fprintf(stderr, "%p/%s: pthread_mutex_unlock ret=[%d]\n", (void *)pthread_self(), __func__, pthread_mutex_unlock(mutex)) 

When printer-app crashes again, the output is as below:

0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_lock ret=[22]
0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_unlock ret=[22]

The return value 22 means "EINVAL", so I guess the variable device in the pappl_dnssd_query_cb() may already be freed.

tangyanli commented 10 months ago

Step2: Add more logs to output the device's initialization, lock, unlock and free.

In function `pappl_dnssd_get_device()'

 if ((device->fullName = strdup(fullName)) == NULL)
  {
    cupsArrayRemove(devices, device);
    return (NULL);
  }

#ifdef DEBUG
    fprintf(stderr, "[%p] TESS:pappl_dnssd_get_device:new device[%p],[%s]\n", (void *)pthread_self(), (void*)device, device->fullName);
#endif

In function pappl_dnssd_query_cb()

#ifdef DEBUG
if (device != NULL)
    fprintf(stderr, "[%p] TESS:pappl_dnssd_query_cb:lock device[%p],[%s]\n", (void *)pthread_self(), (void*)device, device->fullName);
#endif

// Save the make and model and IEEE-1284 device ID...
_pappl_pthread_mutex_lock(&device->mutex);
device->device_id = strdup(device_id);
device->make_and_model = strdup(ty);
_pappl_pthread_mutex_unlock(&device->mutex);

In function pappl_dnssd_free()

// Free all memory...
#ifdef DEBUG
    fprintf(stderr, "[%p] TESS:pappl_dnssd_free:free device[%p],[%s]\n", (void *)pthread_self(), (void*)d, d->fullName);
#endif

free(d->name);
free(d->domain);
free(d->fullName);
free(d->make_and_model);
free(d->device_id);
free(d->uuid);
_pappl_pthread_mutex_destory(&d->mutex);
free(d);

For normal/ok case, the output is as below, the procedure is [new device]->[lock/unlock device]->[free device]

Line 57533: [0x7febb45e1640] TESS:pappl_dnssd_get_device:new device[0x7febac038700],[Canon\032LBP151._pdl-datastream._tcp.local]
Line 57757: [0x7febb45e1640] TESS:pappl_dnssd_query_cb:lock device[0x7febac038700],[Canon\032LBP151._pdl-datastream._tcp.local]
Line 57758:0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_lock ret=[0]
Line 57759:0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_unlock ret=[0]
Line 57760: [0x7febb45e1640] TESS:pappl_dnssd_query_cb:lock device[0x7febac038700],[Canon\032LBP151._pdl-datastream._tcp.local]
Line 57761:0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_lock ret=[0]
Line 57762:0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_unlock ret=[0]
Line 57835: [0x7febb3de0640] TESS:pappl_dnssd_free:free device[0x7febac038700],[Canon\032LBP151._pdl-datastream._tcp.local]

For crash/NG case, the output is as below, and the procedure is [new device]->[free device]->[lock/unlock device]

Line 80801: [0x7febb45e1640] TESS:pappl_dnssd_get_device:new device[0x7febac040d20],[Canon\032\032\04088\058c4\0588c\041._pdl-datastream._tcp.local]
Line 80889: [0x7febb3de0640] TESS:pappl_dnssd_free:free device[0x7febac040d20],[Canon\032\032\04088\058c4\0588c\041._pdl-datastream._tcp.local]
Line 81071: [0x7febb45e1640] TESS:pappl_dnssd_query_cb:lock device[0x7febac040d20],[A���]
Line 81072:0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_lock ret=[22]
Line 81073:0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_unlock ret=[22]
Line 82742: [0x7febb45e1640] TESS:pappl_dnssd_query_cb:lock device[0x7febac040d20],[A���]
Line 82743:0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_lock ret=[22]
Line 82744:0x7febb45e1640/pappl_dnssd_query_cb: pthread_mutex_unlock ret=[22]
tangyanli commented 10 months ago

Can you try building PAPPL manually and then run:

testsuite/testpappl --list

to test the papplDeviceList API?

The crash issue cannot be reproduced by using "testsuite/testpappl --list".

tangyanli commented 10 months ago

If I call the papplDeviceList() many times in the testpappl, then the issue can be reproduced.

else if (!strcmp(argv[i], "--list"))
{
      for (int i = 0; i < 100; i++)
      {
        sleep(10);
        papplDeviceList(PAPPL_DEVTYPE_ALL, device_list_cb, NULL, device_error_cb, NULL);        
      }
      return (0);
}
tangyanli commented 10 months ago

Michael, from the current investigation, it seems the call to function avahi_service_browser_free() in the function pappl_dnssd_list() does not stop the browsing. I tried to investigate, but I'm not familiar with Avahi's interface, so I can't figure out any result.

Do you have any ideas? Could this be avahi bug?

michaelrsweet commented 10 months ago

Certainly could be. I'll see what I can figure out on my end now that I have an idea of how to reproduce.

michaelrsweet commented 10 months ago

OK, I've been trying to reproduce on Ubuntu 22.04 LTS without success. 23.10 has a slightly newer version of Avahi, so maybe there is a bug there?

@tillkamppeter Any idea what changes exist in Avahi between Ubuntu 22.04 and 23.10?

tangyanli commented 10 months ago

After learning avahi interfaces and looking at how cups dnssd backend is implemented, I think this is not a bug of avahi, but a bug of pappl.

Reason The function avahi_record_browser_new() is called in the function pappl_dnssd_get_device(). But the record browser was never freed. So even the dnssd devices is freed, but the browsing isn't stopped.

Solution After trying to make the following change, this crash issue cannot be reproduced. (1) In the function pappl_dnssd_list()

_papplDNSSDLock();         ★ add
// Free memory and return...
cupsArrayDelete(devices);
_papplDNSSDUnlock();     ★ add

(2) In the function pappl_dnssd_free()

free(d->uuid);
if (d->ref)                                  ★ add
    avahi_record_browser_free(d->ref);        ★ add
_pappl_pthread_mutex_destory(&d->mutex);
free(d);

@michaelrsweet Please have a check.

michaelrsweet commented 10 months ago

[v1.4.x 3ac4dfd] Free DNS-SD query when freeing device (Issue #302) [v1.4.x b05d62c] Lock/unlock around free for Avahi (Issue #302)

Needed to make the code conditional (mDNSReponder or Avahi), but this makes sense. I put the lock/unlock in the pappl_dnssd_free function, and only for Avahi since mDNSResponder doesn't need it.

PAPPL 2.0 won't need this change since the CUPS DNS-SD APIs (new in CUPS 2.5/3.0) take care of this automatically...