This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: SEGV in conv_path_list_buf_size with xemacs-21.5-b13 and cygwin-snapshot-20030904-1
- From: Pete McCann <mccap at lucent dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 9 Sep 2003 15:33:42 -0500
- Subject: Re: SEGV in conv_path_list_buf_size with xemacs-21.5-b13 and cygwin-snapshot-20030904-1
Hi,
After some more hunting, I now understand there is a difference
between the cygwin heap and the user heap. My problem is that I'm
running out of cygwin heap:
(gdb) where
#0 _csbrk(int) (sbs=40) at ../../../../cygwin-snapshot-20030904-1/winsup/cygwin
/cygheap.cc:190
#1 0x61002354 in _cmalloc(unsigned) (size=28) at ../../../../cygwin-snapshot-20
030904-1/winsup/cygwin/cygheap.cc:235
#2 0x610024dd in cmalloc (x=HEAP_STR, n=20) at ../../../../cygwin-snapshot-2003
0904-1/winsup/cygwin/cygheap.cc:309
#3 0x61002839 in cstrdup (s=0x149d6d0 "/home/mccap/cygbugs") at ../../../../cyg
win-snapshot-20030904-1/winsup/cygwin/cygheap.cc:365
#4 0x61057d12 in path_conv::check(char const*, unsigned, suffix_info const*) (t
his=0x149d860, src=0x6105957c ".", opt=176, suffixes=0x0) at ../../../../cygwin-
snapshot-20030904-1/winsup/cygwin/path.cc:764
#5 0x610dec0d in path_conv::path_conv(char const*, unsigned, suffix_info const*
) (this=0x149d860, src=0x6105957c ".", opt=144, suffixes=0x0) at ../../../../cyg
win-snapshot-20030904-1/winsup/cygwin/path.h:141
#6 0x6105fa70 in conv_path_list_buf_size(char const*, bool) (path_list=0x149e2e
0 "c:/cygwin/home/mccap", to_posix=false) at ../../../../cygwin-snapshot-2003090
4-1/winsup/cygwin/path.cc:3627
#7 0x6105fce9 in cygwin_posix_to_win32_path_list_buf_size (path_list=0x149e2e0
"c:/cygwin/home/mccap") at ../../../../cygwin-snapshot-20030904-1/winsup/cygwin/
path.cc:3668
#8 0x005707d6 in readlink_and_correct_case (name=0x149e2e0 "c:/cygwin/home/mcca
p", buf=0x149dfb0 "", size=258) at realpath.c:86
#9 0x00571663 in qxe_realpath (path=0x149e0e4 "\\Mail\\MWIF", resolved_path=0x1
49e2e0 "c:/cygwin/home/mccap") at realpath.c:298
#10 0x0049c509 in Ffile_truename (filename=270244004, default_=6408196) at filei
o.c:1368
...
(gdb) print prebrk
$3 = (void *) 0x6189dfe4
(gdb) print sbs
$4 = 40
(gdb) print prebrka
$5 = (void *) 0x6189d000
(gdb) print cygheap_max
$6 = (void *) 0x6189dfe4
Note the #define in cygheap.h:
#define CYGHEAPSIZE (sizeof (init_cygheap) + (20000 * sizeof (fhandler_union)) + (5 * 65536))
(gdb) print sizeof (init_cygheap) + 20000 * sizeof(fhandler_union) + 5 * 65536
$10 = 2742052
(gdb) print (void*) 2742052
$11 = (void *) 0x29d724
...
(gdb) print (void*) 0x61600000 + 0x29d724
$13 = (void *) 0x6189d724
So, I reached the end of the cygheap. Maybe it's because xemacs with
VM opens/closes so many files, or maybe it is leaving some files
hanging open? Is there any way to get a list of the open files?
Maybe the memory is just getting fragmented, or there is a memory leak
somewhere. Is there a way to inspect the file table or the internal
state of the cygheap? Should I start stepping through the buckets
structure?
Here is a dump of the cygheap data structure:
(gdb) print *cygheap
$2 = {chain = 0x6189dfbc, buckets = {0x0, 0x0, 0x0, 0x0, 0x6160420c "", 0x0,
0x61604224 "\\E`a\fB`a\001", 0x6160448c "ôB`a\004D`a", 0x0,
0x6162c8dc "4Eba'Eba\003", 0x0 <repeats 22 times>}, root = {m = 0x0},
user = {pname = 0x61603a3c "mccap", plogsrv = 0x0, pdomain = 0x0,
homedrive = 0x61603dfc "C:", homepath = 0x61603e14 "\\", pwinname = 0x0,
puserprof = 0x0, psid = 0x61603db4, orig_psid = 0x61603e2c,
orig_uid = 1004, orig_gid = 513, real_uid = 1004, real_gid = 513,
groups = {pgsid = {<cygpsid> = {psid = 0x616000c0},
sbuf = "\001\005\000\000\000\000\000\005\025\000\000\000\230\024î}\216\"
#\025_M\206#\001\002", '\0' <repeats 13 times>}, sgsids = {maxcount = 0,
count = 0, sids = 0x0, type = cygsidlist_empty}, ischanged = 0},
external_token = 0xffffffff, internal_token = 0xffffffff,
current_token = 0xffffffff}, user_heap = {base = 0x10020000,
ptr = 0x10ae8000, top = 0x10ae8000, max = 0x30020000, chunk = 536870912},
umask = 0, shared_h = 0xc4, console_h = 0x0, cygwin_regname = 0x0, cwd = {
posix = 0x61604524 "/home/mccap/cygbugs",
win32 = 0x61603a54 "C:\\cygwin\\home\\mccap\\cygbugs", hash = 2812255647,
cwd_lock = 0x610e8a90}, fdtab = {fds = 0x61603cac, fds_on_hold = 0x0,
first_fd_for_open = 0, cnt_need_fixup_before = 0, size = 32}, debug = {
starth = {h = 0x0, name = 0x0, func = 0x0, ln = 0, inherited = false,
pid = 0, next = 0x61600170}, endh = 0x616003bc, freeh = {{h = 0xc4,
name = 0x6107cbf9 "cygheap->shared_h",
func = 0x6107cbe6 "void memory_init()", ln = 209, inherited = true,
pid = 2356, next = 0x6160018c}, {h = 0xd4,
---Type <return> to continue, or q <return> to quit---
name = 0x6107cc33 "cygwin_mount_h",
func = 0x6107cbe6 "void memory_init()", ln = 217, inherited = true,
pid = 2356, next = 0x616001a8}, {h = 0x80,
name = 0x61004d14 "hMainProc", func = 0x61004caf "void dll_crt0_1()",
ln = 630, inherited = false, pid = 2356, next = 0x616001c4}, {
h = 0x7c, name = 0x61004d1e "hMainThread",
func = 0x61004caf "void dll_crt0_1()", ln = 631, inherited = false,
pid = 2356, next = 0x616001e0}, {h = 0xe8,
name = 0x61014080 "title_mutex",
func = 0x6101406d "void events_init()", ln = 1133, inherited = false,
pid = 2356, next = 0x616001fc}, {h = 0x100,
name = 0x610610ee "pinfo_shared_handle",
func = 0x61061070 "void pinfo::init(int, long unsigned int, void*)",
ln = 180, inherited = false, pid = 2356, next = 0x61600234}, {
h = 0x2b8, name = 0x61080dc1 "events[0]",
func = 0x61080da8 "void subproc_init()", ln = 829, inherited = false,
pid = 2356, next = 0x616002f8}, {h = 0x22c,
name = 0x61080364 "signal_arrived",
func = 0x6108033e "void sigproc_init()", ln = 608, inherited = false,
pid = 2356, next = 0x61600250}, {h = 0xfc,
name = 0x610819d6 "sigcatch_nosync",
func = 0x61081993 "DWORD wait_sig(void*)", ln = 1107,
inherited = false, pid = 2356, next = 0x6160026c}, {h = 0x104,
name = 0x610819e6 "sigcatch_nonmain",
---Type <return> to continue, or q <return> to quit---
func = 0x61081993 "DWORD wait_sig(void*)", ln = 1108,
inherited = false, pid = 2356, next = 0x61600288}, {h = 0x108,
name = 0x610819f7 "sigcatch_main",
func = 0x61081993 "DWORD wait_sig(void*)", ln = 1109,
inherited = false, pid = 2356, next = 0x616002a4}, {h = 0x10c,
name = 0x61081a05 "sigcomplete_nonmain",
func = 0x61081993 "DWORD wait_sig(void*)", ln = 1110,
inherited = false, pid = 2356, next = 0x616002c0}, {h = 0x110,
name = 0x610805a8 "sigcomplete_main",
func = 0x61081993 "DWORD wait_sig(void*)", ln = 1111,
inherited = false, pid = 2356, next = 0x61600218}, {h = 0x0,
name = 0x0, func = 0x0, ln = 0, inherited = false, pid = 0,
next = 0x0}, {h = 0x2c8, name = 0x6107eecf "wval->ev",
func = 0x6107ec50 "int proc_subproc(long unsigned int, long unsigned int
)", ln = 409, inherited = false, pid = 2356, next = 0x616003d8}, {h = 0x0,
name = 0x0, func = 0x0, ln = 0, inherited = false, pid = 0,
next = 0x0}, {h = 0x0, name = 0x0, func = 0x0, ln = 0,
inherited = false, pid = 0, next = 0x0}, {h = 0x0, name = 0x0,
func = 0x0, ln = 0, inherited = false, pid = 0, next = 0x0}, {h = 0x0,
name = 0x0, func = 0x0, ln = 0, inherited = false, pid = 0,
next = 0x0}, {h = 0x2d0, name = 0x61040b3b "fork_stupidity",
func = 0x61040b20 "void slow_pid_reuse(void*)", ln = 339,
inherited = false, pid = 2356, next = 0x616003bc}, {h = 0x0,
name = 0x0, func = 0x0, ln = 0, inherited = false, pid = 0,
---Type <return> to continue, or q <return> to quit---
next = 0x0}, {h = 0x2e4, name = 0x61040b3b "fork_stupidity",
func = 0x61040b20 "void slow_pid_reuse(void*)", ln = 339,
inherited = false, pid = 2356, next = 0x0}, {h = 0x31c,
name = 0x61040b3b "fork_stupidity",
func = 0x61040b20 "void slow_pid_reuse(void*)", ln = 339,
inherited = false, pid = 2356, next = 0x616003f4}, {h = 0x30c,
name = 0x61040b3b "fork_stupidity",
func = 0x61040b20 "void slow_pid_reuse(void*)", ln = 339,
inherited = false, pid = 2356, next = 0x61600384}, {h = 0x0,
name = 0x0, func = 0x0, ln = 0, inherited = false, pid = 0,
next = 0x0} <repeats 476 times>}}, sigs = 0x61603834}
Anything look obviously wrong to anyone in the above?
-Pete
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/