From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200406172135.i5HLZQQ18405@zamenhof.cs.utwente.nl> To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] any success with current plan9port on sunos5.8? In-reply-to: Your message of "Thu, 17 Jun 2004 12:11:42 -0400." References: <200406170233.i5H2XUR02533@plg2.math.uwaterloo.ca> <200406170753.i5H7r4F23190@zamenhof.cs.utwente.nl> From: Axel Belinfante MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18401.1087508125.1@zamenhof.cs.utwente.nl> Date: Thu, 17 Jun 2004 23:35:26 +0200 Topicbox-Message-UUID: a57db362-eacd-11e9-9e20-41e7f4b1d025 > Give up on _EXTENSIONS_ whatever that means. > Yield is a function provided by a system library. > The right fix is to rename the one the Plan 9 libraries > are calling. #defining random things to make yield > disappear from view only makes the compiler think > there is no problem; it does not fix the problem. right. well put. thanks! done that, and seems things are ok again. that means, there are still a few things that fail, but they failed with a previous ports version in the same way. I'm sorry, but I simply do not see why or how they are failing, (maybe that's just because I don't know much about multi-threading?) so I'm posting this followup also to ask if someone has an explanation? Any insight would be appreciated. Axel. Details: the sort command called by ps sometimes gives me 'sort: note: sys: child' followed by Abort where does a SIGCHILD come from in this case? (I mean, I don't see a fork; is this from some thread related 'magic'?) when I do 'ls -lrt' I often get a bus error. it seems to be caused by an array bound read error in qsort (that's what purify and dbx tell me) but I miss to see how it is caused. In case it helps someone to understand (or explain) I'm including some purify output for the ls failure. Note: to avoid a name clash I slightly changed ls.c so line numbers will be off. Index: ls.c =================================================================== RCS file: /cvs/plan9/src/cmd/ls.c,v retrieving revision 1.2 diff -b -u -w -r1.2 ls.c --- ls.c 2004/05/11 17:51:27 1.2 +++ ls.c 2004/06/17 21:06:47 @@ -2,6 +2,8 @@ #include #include +#define dirbuf p9dirbuf + typedef struct NDir NDir; struct NDir { **** Purify instrumented o.ls (pid 17460 at Thu Jun 17 21:44:30 2004) * Purify 2003a.06.00 Solaris 2 (32-bit) Copyright (C) 1992-2003 Rational Soft ware Corp. All rights reserved. * For contact information type: "purify -help" * For TTY output, use the option "-windows=no" * Command-line: ./o.ls -lrt * Options settings: -purify \ -purify-home=/local/user/belinfan/puredemo/Rational/releases/purify.sol.200 3a.06.00 \ -cache-dir=/local/user/belinfan/puredemo/Rational/releases/purify.sol.2003a .06.00/cache \ -threads=yes -use-internal-locks=yes -thread_stack_change=0x4000 \ -mt_safe_malloc=yes -language=english * License successfully checked out. * Command-line: ./o.ls -lrt **** Purify instrumented o.ls (pid 17460) **** ABR: Array bounds read: * This is occurring while in: compar [ls.c:262] qsort [libc.so.1] output [ls.c:147] ls [ls.c:122] p9main [ls.c:78] main [main.c:12] * Reading 4 bytes from 0xce190 in the heap. * Address 0xce190 is 8 bytes before start of malloc'd block at 0xce198 of 188 8 bytes. * This block was allocated from: malloc [rtlib.o] realloc [rtlib.o] growto [ls.c:249] ls [ls.c:115] p9main [ls.c:78] main [main.c:12] **** Purify instrumented o.ls (pid 17460) **** COR: Fatal core dump: * This is occurring while in: _p1553static [rtlib.o] _p1243static [rtlib.o] compar [ls.c:269] qsort [libc.so.1] * Received signal 11 (SIGSEGV - Segmentation Fault) * Faulting address = 0xffbf0000 * Signal mask: (SIGSEGV) * Pending signals: dbx output of a similar crash (but different run): (/opt/SUNWspro/bin/../WS6/bin/sparcv9/dbx) run -lrt Running: o.ls -lrt (process id 18217) t@1 (l@1) signal BUS (invalid address alignment) in compar at line 269 in file "ls.c" 269 i = bd->mtime-ad->mtime; (/opt/SUNWspro/bin/../WS6/bin/sparcv9/dbx) up 0xff14b7ec: qsort+0x010c: jmpl %i5, %o7 (/opt/SUNWspro/bin/../WS6/bin/sparcv9/dbx) up Current function is output 147 qsort(dirbuf, ndir, sizeof dirbuf[0], (int (*)(const void*, const void*))compar); (/opt/SUNWspro/bin/../WS6/bin/sparcv9/dbx) where current thread: t@1 [1] compar(a = 0x48b98, b = 0x48ba8), line 269 in "ls.c" [2] qsort(0x48ba8, 0x8, 0x48b98, 0x48c10, 0x49318, 0x187f8), at 0xff14b7ec =>[3] output(), line 147 in "ls.c" [4] ls(s = 0x3dd50 ".", multi = 0), line 122 in "ls.c" [5] p9main(argc = 0, argv = 0xffbec864), line 78 in "ls.c" [6] main(0x2, 0xffbec85c, 0xffbec868, 0x3d000, 0x0, 0x0), at 0x1aec8 (/opt/SUNWspro/bin/../WS6/bin/sparcv9/dbx) print ndirbuf ndirbuf = 239 (/opt/SUNWspro/bin/../WS6/bin/sparcv9/dbx) print ndir ndir = 239 (/opt/SUNWspro/bin/../WS6/bin/sparcv9/dbx)