When qpage in daemon mode receives a SIGHUP, it frees malloc-ed memory before rereading its configuration file. The problem occurs on line 1410 of config.c, where a pointer to a service declaration is freed. The memory at that address is not a separate allocation for each PAGER struct, and furthermore, the entire service list has been freed by the time free_pagers() is called. Calling free() on a pointer that points to unallocated memory appears to cause a segmentation fault. Fix: attached patch Patch attached with submission follows: How-To-Repeat: Build and install ports/qpage. No tunables are present in the Makefile. Install a working qpage.cf in /usr/local/etc (perhaps just using the qpage-example.cf provided). It is not necessary to have a modem available as long as the configuration file can be edited to reference an existing /dev/cua* device that is not otherwise in use ("modem=/dev/XXX" in qpage.cf). Execute '/usr/local/etc/rc.d/qpage.sh start'. At this point, there should be one qpage process running. Send the process a SIGHUP, wait a moment, and send another SIGHUP. qpage will have exited with a segmentation fault (logged to /var/log/messages by a standard FreeBSD configuration).
Hi Jeff, I wasn't able to put together a minimal working configuration file. Starting qpage always results in "Error reading configuration file". Can you provide a minimal configuration that allows me to test it without a modem? Regards, Stefan
Responsible Changed From-To: freebsd-ports-bugs->stefan Take.
stefan 2008-10-18 18:45:19 UTC FreeBSD ports repository Modified files: comms/qpage Makefile Added files: comms/qpage/files patch-config.c Log: - Fix segmentation faults on SIGHUP. - Assign maintainership to submitter. PR: 127075, 127827 Submitted by: Jeffrey Blank <jfb@mr-happy.com> Revision Changes Path 1.26 +2 -2 ports/comms/qpage/Makefile 1.1 +12 -0 ports/comms/qpage/files/patch-config.c (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Patch committed, thanks!