[Bug 206936] devel/dmalloc: dmallocth pthread loop
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Feb 5 00:51:42 UTC 2016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206936
Bug ID: 206936
Summary: devel/dmalloc: dmallocth pthread loop
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: Individual Port(s)
Assignee: freebsd-ports-bugs at FreeBSD.org
Reporter: heas at shrubbery.net
CC: mjl at luckie.org.nz
Flags: maintainer-feedback?(mjl at luckie.org.nz)
CC: mjl at luckie.org.nz
I've not attempted to debug this, but this did work at point - its been a while
since I've needed dmalloc.
Linking the following program from a configure script with -ldmallocth results
in a segfault when it blows-out its stack space. The problem appears to be
completely in the start-up; using ktrace, it never reaches the first line of
main().
ISTR observing this in a much earlier version of dmalloc on solaris and it was
a problem with dmalloc repeatedly trying to re-initialize itself.
This is fbsd 10.2-p12 with the latest dmalloc from binary pkgs (or source).
# include <stdlib.h>
# include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <openssl/opensslv.h>
#define DATA "conftest.sslincver"
#include <dmalloc.h>
int main(void) {
FILE *fd;
int rc;
fd = fopen(DATA,"w");
if (fd == NULL)
exit(1);
if ((rc = fprintf(fd ,"%lx (%s)\n", (long)OPENSSL_VERSION_NUMBER,
OPENSSL_VERSION_TEXT)) <0)
exit(1);
exit(0);
}
gcc -o conftest -pthread -pthread -D_REENTRANT -D_THREAD_SAFE -DINET6
-I/usr/local/include -pthread -L/usr/local/lib -g conftest.c -lpthread -lutil
-ldmallocth -lssl -lz -lcrypto test.c
Core was generated by `conftest'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libutil.so.9...(no debugging symbols found)...done.
Loaded symbols for /lib/libutil.so.9
Reading symbols from /usr/local/lib/libdmallocth.so.1...(no debugging symbols
fo
und)...done.
Loaded symbols for /usr/local/lib/libdmallocth.so.1
Reading symbols from /usr/lib/libssl.so.7...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libssl.so.7
Reading symbols from /lib/libz.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.6
Reading symbols from /lib/libcrypto.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypto.so.7
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols
found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x0000000800c62b5a in dmalloc_malloc ()
from /usr/local/lib/libdmallocth.so.1
[New LWP 101621]
(gdb) whe
#0 0x0000000800c62b5a in dmalloc_malloc ()
from /usr/local/lib/libdmallocth.so.1
#1 0x0000000800c6387b in calloc () from /usr/local/lib/libdmallocth.so.1
#2 0x000000080082f0fa in pthread_kill () from /lib/libthr.so.3
#3 0x00000008008302d3 in pthread_timedjoin_np () from /lib/libthr.so.3
#4 0x000000080082d4ca in pthread_mutex_lock () from /lib/libthr.so.3
#5 0x0000000800c62944 in dmalloc_shutdown ()
from /usr/local/lib/libdmallocth.so.1
#6 0x0000000800c62e51 in dmalloc_malloc ()
from /usr/local/lib/libdmallocth.so.1
#7 0x0000000800c62b82 in dmalloc_malloc ()
from /usr/local/lib/libdmallocth.so.1
#8 0x0000000800c6387b in calloc () from /usr/local/lib/libdmallocth.so.1
#9 0x000000080082f0fa in pthread_kill () from /lib/libthr.so.3
#10 0x00000008008302d3 in pthread_timedjoin_np () from /lib/libthr.so.3
#11 0x000000080082d4ca in pthread_mutex_lock () from /lib/libthr.so.3
#12 0x0000000800c62944 in dmalloc_shutdown ()
from /usr/local/lib/libdmallocth.so.1
#13 0x0000000800c62e51 in dmalloc_malloc ()
from /usr/local/lib/libdmallocth.so.1
#14 0x0000000800c62b82 in dmalloc_malloc ()
from /usr/local/lib/libdmallocth.so.1
#15 0x0000000800c6387b in calloc () from /usr/local/lib/libdmallocth.so.1
#16 0x000000080082f0fa in pthread_kill () from /lib/libthr.so.3
#17 0x00000008008302d3 in pthread_timedjoin_np () from /lib/libthr.so.3
#18 0x000000080082d4ca in pthread_mutex_lock () from /lib/libthr.so.3
#19 0x0000000800c62944 in dmalloc_shutdown ()
from /usr/local/lib/libdmallocth.so.1
#20 0x0000000800c62e51 in dmalloc_malloc ()
from /usr/local/lib/libdmallocth.so.1
#21 0x0000000800c62b82 in dmalloc_malloc ()
from /usr/local/lib/libdmallocth.so.1
.... thousands of loops
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list