9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Axel Belinfante <Axel.Belinfante@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?
Date: Thu, 17 Jun 2004 23:35:26 +0200	[thread overview]
Message-ID: <200406172135.i5HLZQQ18405@zamenhof.cs.utwente.nl> (raw)
In-Reply-To: Your message of "Thu, 17 Jun 2004 12:11:42 -0400." <ee9e417a04061709114a545666@mail.gmail.com>

> 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 <libc.h>
 #include <bio.h>
 
+#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)


  reply	other threads:[~2004-06-17 21:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-17  2:33 Richard C Bilson
2004-06-17  7:53 ` Axel Belinfante
2004-06-17 16:11   ` Russ Cox
2004-06-17 21:35     ` Axel Belinfante [this message]
2004-06-18  9:06       ` Bengt Kleberg
2004-06-18 10:09         ` Axel Belinfante
2004-06-18  9:05     ` Bengt Kleberg
2004-06-17 17:08   ` Lyndon Nerenberg
2004-06-17 17:36     ` Russ Cox
2004-06-18  9:05       ` Bengt Kleberg
2004-06-18 13:02         ` Axel Belinfante
2004-06-18  9:06   ` Bengt Kleberg
2004-06-18  9:33     ` William Josephson
2004-06-18  9:47     ` Axel Belinfante
  -- strict thread matches above, loose matches on Subject: below --
2004-06-14 19:37 Richard C Bilson
2004-06-14 19:08 Richard C Bilson
2004-06-14 19:14 ` Charles Forsyth
2004-06-16  8:48 ` Bengt Kleberg
2004-06-16 23:50   ` Axel Belinfante
2004-06-17  9:05     ` Bengt Kleberg
2004-06-14 14:12 Richard C Bilson
2004-06-14 13:39 Richard C Bilson
2004-06-14 13:52 ` Axel Belinfante
2004-06-11 14:18 Richard C Bilson
2004-06-11 13:51 Richard C Bilson
2004-06-11 14:02 ` C H Forsyth
2004-06-11 13:58   ` William Josephson
2004-06-11 14:18     ` Russ Cox
2004-06-11 15:05 ` Axel Belinfante
2004-06-14 10:05 ` Bengt Kleberg
2004-06-14 11:30   ` Axel Belinfante
2004-06-16  8:48     ` Bengt Kleberg
2004-06-11 12:19 Axel Belinfante

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200406172135.i5HLZQQ18405@zamenhof.cs.utwente.nl \
    --to=axel.belinfante@cs.utwente.nl \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).