From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 02:42:36 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A12A106566B for ; Sun, 20 Jun 2010 02:42:36 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id D5F858FC12 for ; Sun, 20 Jun 2010 02:42:35 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 7A3657E84A; Sun, 20 Jun 2010 12:42:34 +1000 (EST) Message-ID: <4C1D8019.5060206@freebsd.org> Date: Sun, 20 Jun 2010 12:42:33 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Fabian Keil References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> In-Reply-To: <20100619195823.53a7baaa@r500.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 02:42:36 -0000 Hi Fabian, Thank you for the the report. This is indeed an issue I've never seen before and exactly the sort of thing I wanted to uncover. On 06/20/10 03:58, Fabian Keil wrote: > Lawrence Stewart wrote: > >> On 06/13/10 18:12, Lawrence Stewart wrote: > >>> The time has come to solicit some external testing for my SIFTR tool. >>> I'm hoping to commit it within a week or so unless problems are discovered. > >>> I'm interested in all feedback and reports of success/failure, along >>> with details of the architecture tested and number of CPUs if you would >>> be so kind. > > I got the following hand-transcribed panic maybe a second after > sysctl net.inet.siftr.enabled=1 > > Fatal trap 12: page fault while in kernel mode > cpuid = 1; apic id = 01 > [...] > current process = 12 (swi4: clock) > [ thread pid 12 tid 100006 ] > Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) > db> where > Tracing pid 12 tid 100006 td 0xffffff00034037e0 > siftr_chkpt() at siftr_chkpkt+0xd0 > pfil_run_hooks() at pfil_run_hooks+0xb4 > ip_output() at ip_output+0x382 > tcp_output() tcp_output+0xa41 > tcp_timer_rexmt() at tcp_timer_rexmt+0x251 > softclock() at softclock+0x291 > intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > ithread_loop at ithread_loop+0x8e > fork_exit() at fork_exit+0x112 > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip = 0, rsp = 0xffffff800003ad30, rbp = 0 --- hmm I'd love to know which line of code siftr_chkpkt+0xd0 maps to. Let me read through the function carefully and see if I can spot an obvious null ptr deref. The hook function has received some major rototilling of late to get it ready for the import so I must have missed something. > This is from the third attempt, the second time I got a different > backtrace that also contained some *_iwn_* functions, the first > time I had X running, so I didn't get anything. Unfortunately > at that point the system seems to be too busted to dump core. Typically, packets are direct dispatched into the stack from the driver so it is normal to see driver functions in a thread's stack trace when it's executing in the siftr pfil hook. > I'm using: > FreeBSD 9.0-CURRENT #99 r+b768fe1: Sat Jun 19 15:01:37 CEST 2010 > fk@r500.local:/usr/obj/usr/src/sys/ZOEY amd64 > Timecounter "i8254" frequency 1193182 Hz quality 0 > CPU: Intel(R) Core(TM)2 Duo CPU T5870 @ 2.00GHz (1995.01-MHz K8-class CPU) > Origin = "GenuineIntel" Id = 0x6fd Family = 6 Model = f Stepping = 13 > Features=0xbfebfbff > Features2=0xe39d > AMD Features=0x20100800 > AMD Features2=0x1 > TSC: P-state invariant > real memory = 2147483648 (2048 MB) > avail memory = 1976610816 (1885 MB) > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs > FreeBSD/SMP: 1 package(s) x 2 core(s) > cpu0 (BSP): APIC ID: 0 > cpu1 (AP): APIC ID: 1 > ioapic0: Changing APIC ID to 1 > ioapic0 irqs 0-23 on motherboard > > I'm not using vanilla sources, but none of the modifications > should matter here. Yes this does not look like an issue with your sources but with the siftr code itself. Don't bother testing with GENERIC yet as I'm confident you've given me enough info to track this down. > I have powerd running and did not yet try without it. > > The system has bge0 and iwn0, but bge0 is mainly down. > > pf is compiled into the kernel, siftr is loaded as a module. > > The panic seems to occur without logging a single packet first: > fk@r500 ~ $cat /var/log/siftr.log > enable_time_secs=1276966161 enable_time_usecs=945080 siftrver=1.2.3 hz=100 tcp_rtt_scale=32 sysname=FreeBSD sysver=900014 ipmode=4 > enable_time_secs=1276966586 enable_time_usecs=314023 siftrver=1.2.3 hz=100 tcp_rtt_scale=32 sysname=FreeBSD sysver=900014 ipmode=4 > > I get the impression that this is reproducible, but only tried > three times (the last time with everything mounted read-only). Thanks again for the report and I'll be in touch as soon as I get a chance to look at it some more (hopefully later today). Cheers, Lawrence From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 02:53:40 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64EAC1065673 for ; Sun, 20 Jun 2010 02:53:40 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 172408FC13 for ; Sun, 20 Jun 2010 02:53:39 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5K2rZDh006588; Sat, 19 Jun 2010 20:53:36 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <4C1C0ED9.8090103@freemail.hu> Date: Sat, 19 Jun 2010 20:53:35 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <2F904ED8-BC95-459F-8536-A889ADDA8D31@samsco.org> References: <4C1AB4C0.4020604@freemail.hu> <4C1B3792.9000007@freemail.hu> <4C1C0ED9.8090103@freemail.hu> To: oizs X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: freebsd-current@freebsd.org Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 02:53:40 -0000 Two big things can affect RAID-5 performance: 1. Battery backup. If you don't have a working battery attached to the = card, it will turn off the write-back cache, no matter what you do. = Check this. If you're unsure, use the mfiutil tool that I added to = FreeBSD a few months ago and send me the output. 2. Partition alignment. If you're using classic MBR slices, everything = gets misaligned by 63 sectors, making it impossible for the controller = to optimize both reads and writes. If the array is used for secondary = storage, simply don't use an MBR scheme. If it's used for primary = storage, try using GPT instead and setting up your partitions so that = they are aligned to large power-of-2 boundaries. Scott On Jun 18, 2010, at 6:27 PM, oizs wrote: > Im using the Samsung F3 disks, which can do 140MB/s sequentially. I = have tried different raids raid0 will do just as bad as raid5. I even = tried one disk which performed as expected 100MB/s+ reads and writes so = I'm not sure anymore what could be the problem. Maybe the controller = hates samsung disks? >=20 > -zsozso >=20 > On 2010.06.19. 0:21, krad wrote: >> On 18 June 2010 10:08, oizs wrote: >>=20 >>=20 >>> I've seen people with the same configuration doing 160MB/s writes = and >>> 250MB/s+ reads with raid5 so I still think something isn't right. = And using >>> raid10 with 4 disks is a rather large waste of capacity. >>>=20 >>> -zsozso >>>=20 >>>=20 >>> On 2010.06.18. 1:55, Chuck Swiger wrote: >>>=20 >>>=20 >>>> On Jun 17, 2010, at 4:50 PM, oizs wrote: >>>>=20 >>>>=20 >>>>=20 >>>>> I've bought a Dell Perc 5/i because I couldn't make the onboard = marvell >>>>> 88sx7042 work with 8.0/8.1 or current, but as lucky as I am, the = best I can >>>>> do with 4x1.5tb samsung in raid5 is 60MB/s writes and 90MB/s = reads, with >>>>> bbu/write-back/adaptive-read-ahead. >>>>>=20 >>>>> I was expecting at least twice of that, and I'm not sure what can = I do to >>>>> get that speed. (I've read man 7 tuning with no success) >>>>>=20 >>>>>=20 >>>>>=20 >>>> Switch to using RAID-10 rather than RAID-5. It's normal for RAID-5 = to >>>> have worse write performance than that of a single drive. >>>>=20 >>>> Regards, >>>>=20 >>>>=20 >>>>=20 >>> _______________________________________________ >>> freebsd-current@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-current >>> To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org" >>>=20 >>>=20 >> what are your drives though? Are they SATA green/eco type drives or = proper >> SAS enterprise ones >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org" >>=20 >>=20 >>=20 > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org" From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 02:56:21 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69833106564A for ; Sun, 20 Jun 2010 02:56:21 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 067028FC14 for ; Sun, 20 Jun 2010 02:56:20 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5K2uH05006616; Sat, 19 Jun 2010 20:56:17 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: Date: Sat, 19 Jun 2010 20:56:16 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <51F37F5C-A497-46BD-836F-6AF7C83FEF98@samsco.org> References: <4C1AB4C0.4020604@freemail.hu> <4C1C88CD.3000506@stillbilde.net> <4C1C94D4.7040302@freemail.hu> <4C1CA852.6000900@freemail.hu> To: Garrett Cooper X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: oizs , freebsd-current@freebsd.org Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 02:56:21 -0000 On Jun 19, 2010, at 5:32 AM, Garrett Cooper wrote: > On Sat, Jun 19, 2010 at 4:24 AM, Garrett Cooper = wrote: >> On Sat, Jun 19, 2010 at 4:21 AM, oizs wrote: >>> Since I tested it on different kind of os's, and with at least 5 = testing >>> applications, I don't think that would be the case. >>>=20 >>> On 2010.06.19. 13:17, Garrett Cooper wrote: >>>>=20 >>>> On Sat, Jun 19, 2010 at 2:58 AM, oizs wrote: >>>>=20 >>>>>=20 >>>>> I tried almost everything raid 0 1 5 10 with all kind of stripes >>>>> 32/64/128 >>>>> and settings direct io/cached/read-ahead/wt/wb/disk-cache but = nothing >>>>> seems >>>>> to work. >>>>> I changed the card to another dell perc 5 which had an older = firmware. >>>>> Tried >>>>> 4 kind of motherboards even tried changing the os to linux and = windows >>>>> xp/7. >>>>> In windows I got some funny results 1.3MB/s with write-back and = 150MB/s >>>>> reads with 5 disks in raid0. >>>>> I just wanted to have a hw raid with no problems since the = motherboard >>>>> 88sx7042 and bsd did not like eachother. >>>>>=20 >>>>> On 2010.06.19. 11:07, Svein Skogen (Listmail Account) wrote: >>>>>=20 >>>>>>=20 >>>>>> On 18.06.2010 01:50, oizs wrote: >>>>>>=20 >>>>>>=20 >>>>>>>=20 >>>>>>> Hi, >>>>>>>=20 >>>>>>> I've bought a Dell Perc 5/i because I couldn't make the onboard = marvell >>>>>>> 88sx7042 work with 8.0/8.1 or current, but as lucky as I am, the = best I >>>>>>> can do with 4x1.5tb samsung in raid5 is 60MB/s writes and 90MB/s = reads, >>>>>>> with bbu/write-back/adaptive-read-ahead. >>>>>>>=20 >>>>>>> I was expecting at least twice of that, and I'm not sure what = can I do >>>>>>> to get that speed. (I've read man 7 tuning with no success) >>>>>>>=20 >>>>>>> As far as I know this controller should be as fast as on other = systems. >>>>>>> (Freebsd.org mx1 has one of these cards.) >>>>>>>=20 >>>>>>> I'm hoping somebody on the list reads this and helps because I = can't >>>>>>> afford to buy another card. >>>>>>>=20 >>>>>>>=20 >>>>>>=20 >>>>>> I've lost track of what actual boards Dell has OEMized to make = the >>>>>> various PERCs, but if I remember somewhat correctly, the PERC5 is >>>>>> basically an LSI Megaraid SAS 8308elp with different labels and >>>>>> firmware? >>>>>>=20 >>>>>> If so, I've got that exact controller (minus the dell labels and >>>>>> firmware) in my primary storage box here, and yes, you SHOULD be = able to >>>>>> get more performance out of it. What's your strip sizes and = logical disk >>>>>> layout? >>>>>>=20 >>>>>> (I've got the same board running on 8x 1T5 Seagates in RAID5+0, = and that >>>>>> setup easily pulls 5 times the values you're seeing, and by all = logic >>>>>> you should see about half of what I'm seeing) >>>>>>=20 >>>>=20 >>>> Dumb question: are you sure that the problem that you're seeing = isn't >>>> in fact inhibited by the application that you're getting = `performance' >>>> results with? >>=20 >> If your applications aren't well suited for your hardware's >> capabilities, then of course performance will be bad. >=20 > Furthermore, if the performance applications and your use scenarios > are centered around reading, as opposed to writing, there is an option > within mficontrol and the mfi(4) interface where you can actually > enable read-ahead, instead of writeback (you unfortunately can't > enable both scenarios). I realize that this is an artificial > improvement in a way, but you should judge whether or not your > application will be doing more reading than writing in whatever > capacity it's doing... >=20 > HTH, No, that doesn't help. I wrote the driver, and I have no flipping clue = what you're talking about. Scott From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 04:31:50 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F9E31065672 for ; Sun, 20 Jun 2010 04:31:49 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5058FC0A for ; Sun, 20 Jun 2010 04:31:49 +0000 (UTC) Received: by qyk11 with SMTP id 11so950751qyk.13 for ; Sat, 19 Jun 2010 21:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6qMw4usdqwF0l2SN5Ap6WdSugMyoKMo+zW5MxJOraRw=; b=Eag5DLc0YRr2wOusZh8pIXExffJuAhArk2NfXsYZqW/kwmjAHYCEGApw6LPCVMFft/ 9x4VygKIvVsdd/hh2iHfd8gWYUwBptBxAdKWQ1amw36sKehqUJrfjmDiZe4AlS4U5XSF EbOniF4S/VxkCKMZ8+e2irAkMs7gE/kMtWFe8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=M6dMZaMdUjmPYkmLTDsFVKtsPBFR47RQFtNIIhguDwOUcN9Q1ONepL2oGFlWIrSAsT QKqM2Jsm1bOAHTXJzrg4hmsEEGnYaS4oPhhcPtq+MPo2jy9Y1g9FQrj9o+vkEpmL4Pnw FEJ4m3vS9hiZX8wSV/sAAS+H++yquSPZNFOmc= MIME-Version: 1.0 Received: by 10.224.35.212 with SMTP id q20mr2208964qad.17.1277008308739; Sat, 19 Jun 2010 21:31:48 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Sat, 19 Jun 2010 21:31:48 -0700 (PDT) In-Reply-To: <51F37F5C-A497-46BD-836F-6AF7C83FEF98@samsco.org> References: <4C1AB4C0.4020604@freemail.hu> <4C1C88CD.3000506@stillbilde.net> <4C1C94D4.7040302@freemail.hu> <4C1CA852.6000900@freemail.hu> <51F37F5C-A497-46BD-836F-6AF7C83FEF98@samsco.org> Date: Sat, 19 Jun 2010 21:31:48 -0700 Message-ID: From: Garrett Cooper To: Scott Long Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: oizs , freebsd-current@freebsd.org Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 04:31:50 -0000 On Sat, Jun 19, 2010 at 7:56 PM, Scott Long wrote: > On Jun 19, 2010, at 5:32 AM, Garrett Cooper wrote: >> On Sat, Jun 19, 2010 at 4:24 AM, Garrett Cooper wro= te: >>> On Sat, Jun 19, 2010 at 4:21 AM, oizs wrote: >>>> Since I tested it on different kind of os's, and with at least 5 testi= ng >>>> applications, I don't think that would be the case. >>>> >>>> On 2010.06.19. 13:17, Garrett Cooper wrote: >>>>> >>>>> On Sat, Jun 19, 2010 at 2:58 AM, oizs =A0wrote: >>>>> >>>>>> >>>>>> I tried almost everything raid 0 1 5 10 with all kind of stripes >>>>>> 32/64/128 >>>>>> and settings direct io/cached/read-ahead/wt/wb/disk-cache but nothin= g >>>>>> seems >>>>>> to work. >>>>>> I changed the card to another dell perc 5 which had an older firmwar= e. >>>>>> Tried >>>>>> 4 kind of motherboards even tried changing the os to linux and windo= ws >>>>>> xp/7. >>>>>> In windows I got some funny results 1.3MB/s with write-back and 150M= B/s >>>>>> reads with 5 disks in raid0. >>>>>> I just wanted to have a hw raid with no problems since the motherboa= rd >>>>>> 88sx7042 and bsd did not like eachother. >>>>>> >>>>>> On 2010.06.19. 11:07, Svein Skogen (Listmail Account) wrote: >>>>>> >>>>>>> >>>>>>> On 18.06.2010 01:50, oizs wrote: >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I've bought a Dell Perc 5/i because I couldn't make the onboard ma= rvell >>>>>>>> 88sx7042 work with 8.0/8.1 or current, but as lucky as I am, the b= est I >>>>>>>> can do with 4x1.5tb samsung in raid5 is 60MB/s writes and 90MB/s r= eads, >>>>>>>> with bbu/write-back/adaptive-read-ahead. >>>>>>>> >>>>>>>> I was expecting at least twice of that, and I'm not sure what can = I do >>>>>>>> to get that speed. (I've read man 7 tuning with no success) >>>>>>>> >>>>>>>> As far as I know this controller should be as fast as on other sys= tems. >>>>>>>> (Freebsd.org mx1 has one of these cards.) >>>>>>>> >>>>>>>> I'm hoping somebody on the list reads this and helps because I can= 't >>>>>>>> afford to buy another card. >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> I've lost track of what actual boards Dell has OEMized to make the >>>>>>> various PERCs, but if I remember somewhat correctly, the PERC5 is >>>>>>> basically an LSI Megaraid SAS 8308elp with different labels and >>>>>>> firmware? >>>>>>> >>>>>>> If so, I've got that exact controller (minus the dell labels and >>>>>>> firmware) in my primary storage box here, and yes, you SHOULD be ab= le to >>>>>>> get more performance out of it. What's your strip sizes and logical= disk >>>>>>> layout? >>>>>>> >>>>>>> (I've got the same board running on 8x 1T5 Seagates in RAID5+0, and= that >>>>>>> setup easily pulls 5 times the values you're seeing, and by all log= ic >>>>>>> you should see about half of what I'm seeing) >>>>>>> >>>>> >>>>> Dumb question: are you sure that the problem that you're seeing isn't >>>>> in fact inhibited by the application that you're getting `performance= ' >>>>> results with? >>> >>> If your applications aren't well suited for your hardware's >>> capabilities, then of course performance will be bad. >> >> Furthermore, if the performance applications and your use scenarios >> are centered around reading, as opposed to writing, there is an option >> within mficontrol and the mfi(4) interface where you can actually >> enable read-ahead, instead of writeback (you unfortunately can't >> enable both scenarios). I realize that this is an artificial >> improvement in a way, but you should judge whether or not your >> application will be doing more reading than writing in whatever >> capacity it's doing... >> >> HTH, > > No, that doesn't help. =A0I wrote the driver, and I have no flipping clue= what you're talking about. Nevermind. It was a misunderstanding of what the subcommands... - mfiutil cache .. enable - mfiutil cache .. reads enable - mfiutil cache .. writes enable ... do. -Garrett From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 06:18:03 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC86106564A; Sun, 20 Jun 2010 06:18:03 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 01D668FC12; Sun, 20 Jun 2010 06:18:02 +0000 (UTC) Received: by fxm7 with SMTP id 7so1710816fxm.13 for ; Sat, 19 Jun 2010 23:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=Y7tgw5GNznr1TA0UwVIHCKGMOQ/IQ53XcDxQg8+cOE8=; b=XIxXRDQ7qUAtVWT5fB2qP5Sr7uTbEZP8g/X7dsLu9ME8d11RlMqxAk/Hf/7JMe1bgY 63Ql6j4WnfTeq3ZWOLaEVGpCMl6UNg5sx9Cv7mQwsMprEXH/PqPv0c6mZpcrl0xV/hxF nYWfqx7TkxQaXDRNkY7C7Iv/djV5Bjat0PR80= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=iPLvIVtWBEnMQJRqquUWfChW2FBjQ+Id6nqgC8ZQ725jH695asr/2RTKGSqFSarq8C Qf9+yH83gZHRhkhV5LFzfVSlDwsWMQFPrqk5Sf6IalCEfq5xnDy6WNGqsXSO7yIr09nZ SzWPGwlYRUgSyiyc6VfZ6ZNkaTDaqqd1nBDME= Received: by 10.223.101.4 with SMTP id a4mr3496802fao.71.1277014681668; Sat, 19 Jun 2010 23:18:01 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id r25sm24197971fai.35.2010.06.19.23.17.59 (version=SSLv3 cipher=RC4-MD5); Sat, 19 Jun 2010 23:18:00 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1DB296.5040605@FreeBSD.org> Date: Sun, 20 Jun 2010 09:17:58 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Brandon Gooch References: <4C0C1AE4.8050807@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD-Current , freebsd-arch@freebsd.org Subject: Re: RFC: New event timers infrastructure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 06:18:03 -0000 Brandon Gooch wrote: > I've been testing these patches since the first iteration > (et.20100606), and I haven't discovered any related issues. Thank you! > I am unclear about the number of interrupts I should expect from the > hpet0 device (compared to the 99 from the rtc at 100Hz), so here is > the output of vmstat -i with and without the "et" patches: > > With "et" patches: > > interrupt total rate > irq1: atkbd0 369 3 > irq9: acpi0 961 8 > irq12: psm0 1002 9 > irq18: uhci5 140 1 > irq19: uhci2 ehci0* 4823 45 > irq20: hpet0 23893 223 > irq23: uhci3 ehci1 11 0 > irq256: vgapci0 1031 9 > irq257: hdac0 14 0 > irq258: iwn0 4258 39 > irq259: bge0 1 0 > Total 36503 341 > > Without "et" patches: > > interrupt total rate > irq1: atkbd0 449 2 > irq0: clk 17334 99 > irq9: acpi0 1701 9 > irq12: psm0 8784 50 > irq18: uhci5 188 1 > irq19: uhci2 ehci0* 5828 33 > irq23: uhci3 ehci1 11 0 > irq256: vgapci0 1896 10 > irq257: hdac0 14 0 > irq258: iwn0 29571 169 > irq259: bge0 1 0 > Total 65777 378 > > And lastly, the values of the kern.eventtimer sysctls: > > $ sysctl kern.eventtimer > kern.eventtimer.choice: HPET(450) HPET1(440) HPET2(440) HPET3(440) i8254(100) > kern.eventtimer.timer2: HPET1 > kern.eventtimer.timer1: HPET > kern.eventtimer.singlemul: 4 I don't see there neither LAPIC, nor RTC timer. I suppose you have disabled them via device hints. I also suppose you've done it to left with only 100Hz IRQs of i8254 timer. Now, with the patch, these two are still disabled, but system got 4 more HPET timers. As they have higher precedence, two of them were taken (HPET and HPET1). Number if interrupts can be explained by the line: Starting kernel event timers: HPET @ 100Hz, HPET1 @ 128Hz As result, you've got 228Hz IRQs (which then redistributed to every CPU). As your HPET timer doesn't support FSB interrupts, all it's timers share same IRQ vector, seen as "hpet0". If you wish to get back to 100Hz IRQs as before, you may remove your previous clock-disabling hints and add instead: kern.eventtimer.timer1=HPET kern.eventtimer.timer2=NONE kern.eventtimer.singlemul=1 As result, you will have single timer, running at HZ rate. Instead of HPET there you may choose any timer: LAPIC - it is per-CPU, so saves on IPI interrupts, supports one-shot mode and so suitable for further tickless kernel, but it doesn't work in C3 state; HPET{x} - on this hardware it can't be used as per-CPU, it supports one-shot mode, but less suitable for further tickless kernel, as CPUs can't run independently; i8254 - somewhat faster, as it doesn't needs status reading, but due to being also a timecounter it can't be used in one-shot mode; RTC - somewhat slower, has limited set of supported frequencies (powers of 2), only periodic mode. -- Alexander Motin From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 10:27:37 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF1741065672 for ; Sun, 20 Jun 2010 10:27:37 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id A28718FC16 for ; Sun, 20 Jun 2010 10:27:37 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 3E1CE7E84A; Sun, 20 Jun 2010 20:27:35 +1000 (EST) Message-ID: <4C1DED16.8020209@freebsd.org> Date: Sun, 20 Jun 2010 20:27:34 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Fabian Keil References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> In-Reply-To: <20100619195823.53a7baaa@r500.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 10:27:37 -0000 Hi Fabian, On 06/20/10 03:58, Fabian Keil wrote: > Lawrence Stewart wrote: > >> On 06/13/10 18:12, Lawrence Stewart wrote: > >>> The time has come to solicit some external testing for my SIFTR tool. >>> I'm hoping to commit it within a week or so unless problems are discovered. > >>> I'm interested in all feedback and reports of success/failure, along >>> with details of the architecture tested and number of CPUs if you would >>> be so kind. > > I got the following hand-transcribed panic maybe a second after > sysctl net.inet.siftr.enabled=1 > > Fatal trap 12: page fault while in kernel mode > cpuid = 1; apic id = 01 > [...] > current process = 12 (swi4: clock) > [ thread pid 12 tid 100006 ] > Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) > db> where > Tracing pid 12 tid 100006 td 0xffffff00034037e0 > siftr_chkpt() at siftr_chkpkt+0xd0 > pfil_run_hooks() at pfil_run_hooks+0xb4 > ip_output() at ip_output+0x382 > tcp_output() tcp_output+0xa41 > tcp_timer_rexmt() at tcp_timer_rexmt+0x251 > softclock() at softclock+0x291 > intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > ithread_loop at ithread_loop+0x8e > fork_exit() at fork_exit+0x112 > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip = 0, rsp = 0xffffff800003ad30, rbp = 0 --- So I've tracked down the line of code where the page fault is occurring: if (dir == PFIL_IN) ss->n_in++; else ss->n_out++; ss is a DPCPU (dynamic per-cpu) variable used to keep a set of stats per-cpu and is initialised at the start of the function like so: ss = DPCPU_PTR(ss); So for ss to be NULL, that implies DPCPU_PTR() is returning NULL on your machine. I know very little about the inner workings of the DPCPU_* macros, but I'm pretty sure the way I use them in SIFTR is correct or at least as intended. Could you please go ahead and retest using a GENERIC kernel and see if you can reproduce? There could be something in your custom kernel causing the offsets or linker set magic used by the DPCPU bits to break which in turn is triggering this panic in SIFTR. Whether its your custom changes breaking DPCPU or DPCPU being fragile remains to be seen, but the good news for me is that it looks like SIFTR is off the hook :) Cheers, Lawrence From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 11:15:33 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91A681065672; Sun, 20 Jun 2010 11:15:33 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.31.37]) by mx1.freebsd.org (Postfix) with ESMTP id 1DF3C8FC18; Sun, 20 Jun 2010 11:15:32 +0000 (UTC) Received: from [87.79.248.113] (helo=r500.local) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1OQIUt-0008Is-BC; Sun, 20 Jun 2010 13:15:31 +0200 Date: Sun, 20 Jun 2010 13:15:44 +0200 From: Fabian Keil To: Lawrence Stewart Message-ID: <20100620131544.495ddecd@r500.local> In-Reply-To: <4C1DED16.8020209@freebsd.org> References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/lVFt+pxVZr2mG_YBfXZGKXy"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 11:15:33 -0000 --Sig_/lVFt+pxVZr2mG_YBfXZGKXy Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Lawrence Stewart wrote: > On 06/20/10 03:58, Fabian Keil wrote: > > Lawrence Stewart wrote: > > > >> On 06/13/10 18:12, Lawrence Stewart wrote: > > > >>> The time has come to solicit some external testing for my SIFTR tool. > >>> I'm hoping to commit it within a week or so unless problems are disco= vered. > > > >>> I'm interested in all feedback and reports of success/failure, along > >>> with details of the architecture tested and number of CPUs if you wou= ld > >>> be so kind. > > > > I got the following hand-transcribed panic maybe a second after > > sysctl net.inet.siftr.enabled=3D1 > > > > Fatal trap 12: page fault while in kernel mode > > cpuid =3D 1; apic id =3D 01 > > [...] > > current process =3D 12 (swi4: clock) > > [ thread pid 12 tid 100006 ] > > Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) > > db> where > > Tracing pid 12 tid 100006 td 0xffffff00034037e0 > > siftr_chkpt() at siftr_chkpkt+0xd0 > > pfil_run_hooks() at pfil_run_hooks+0xb4 > > ip_output() at ip_output+0x382 > > tcp_output() tcp_output+0xa41 > > tcp_timer_rexmt() at tcp_timer_rexmt+0x251 > > softclock() at softclock+0x291 > > intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > > ithread_loop at ithread_loop+0x8e > > fork_exit() at fork_exit+0x112 > > fork_trampoline() at fork_trampoline+0xe > > --- trap 0, rip =3D 0, rsp =3D 0xffffff800003ad30, rbp =3D 0 --- >=20 > So I've tracked down the line of code where the page fault is occurring: >=20 > if (dir =3D=3D PFIL_IN) > ss->n_in++; > else > ss->n_out++; >=20 > ss is a DPCPU (dynamic per-cpu) variable used to keep a set of stats=20 > per-cpu and is initialised at the start of the function like so: >=20 > ss =3D DPCPU_PTR(ss); >=20 > So for ss to be NULL, that implies DPCPU_PTR() is returning NULL on your= =20 > machine. I know very little about the inner workings of the DPCPU_*=20 > macros, but I'm pretty sure the way I use them in SIFTR is correct or at= =20 > least as intended. siftr_chkpkt() passes ss to siftr_chkreinject() before dereferencing it itself. I think if ss was NULL, the panic should already occur in siftr_chkreinject(). To be sure I added: diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index 8bc3498..b9fdfe4 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -788,6 +788,16 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct ifnet = *ifp, int dir, if (siftr_chkreinject(*m, dir, ss)) goto ret; =20 + if (ss =3D=3D NULL) { + printf("ss is NULL"); + ss =3D DPCPU_PTR(ss); + if (ss =3D=3D NULL) { + printf("ss is still NULL"); + goto ret; + } + } + + if (dir =3D=3D PFIL_IN) ss->n_in++; else which doesn't seem to affect the problem. > Could you please go ahead and retest using a GENERIC kernel and see if=20 > you can reproduce? There could be something in your custom kernel=20 > causing the offsets or linker set magic used by the DPCPU bits to break=20 > which in turn is triggering this panic in SIFTR. I'll retry without pf first, and with GENERIC afterwards. Fabian --Sig_/lVFt+pxVZr2mG_YBfXZGKXy Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwd+GcACgkQBYqIVf93VJ1bHQCgiBOEzBC5piR16rlNosEAo72m 0icAn0gDOsjeQqe1/WQ/SrYlocAyg799 =u8tV -----END PGP SIGNATURE----- --Sig_/lVFt+pxVZr2mG_YBfXZGKXy-- From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 11:44:02 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4EAB106564A; Sun, 20 Jun 2010 11:44:02 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id A02898FC14; Sun, 20 Jun 2010 11:44:02 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o5KBi1Kh039325; Sun, 20 Jun 2010 07:44:01 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o5KBi1wv039316; Sun, 20 Jun 2010 11:44:01 GMT (envelope-from tinderbox@freebsd.org) Date: Sun, 20 Jun 2010 11:44:01 GMT Message-Id: <201006201144.o5KBi1wv039316@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on arm/arm X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 11:44:02 -0000 TB --- 2010-06-20 11:25:00 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-06-20 11:25:00 - starting HEAD tinderbox run for arm/arm TB --- 2010-06-20 11:25:00 - cleaning the object tree TB --- 2010-06-20 11:25:06 - cvsupping the source tree TB --- 2010-06-20 11:25:06 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/arm/arm/supfile TB --- 2010-06-20 11:25:47 - building world TB --- 2010-06-20 11:25:47 - MAKEOBJDIRPREFIX=/obj TB --- 2010-06-20 11:25:47 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2010-06-20 11:25:47 - TARGET=arm TB --- 2010-06-20 11:25:47 - TARGET_ARCH=arm TB --- 2010-06-20 11:25:47 - TZ=UTC TB --- 2010-06-20 11:25:47 - __MAKE_CONF=/dev/null TB --- 2010-06-20 11:25:47 - cd /src TB --- 2010-06-20 11:25:47 - /usr/bin/make -B buildworld >>> World build started on Sun Jun 20 11:25:48 UTC 2010 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries [...] cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c dt_grammar.c cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_inttab.c cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c dt_lex.c cc1: warnings being treated as errors /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l: In function 'yylex': /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l:623: warning: comparison is always true due to limited range of data type *** Error code 1 Stop in /src/cddl/lib/libdtrace. *** Error code 1 Stop in /src/cddl/lib. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2010-06-20 11:44:01 - WARNING: /usr/bin/make returned exit code 1 TB --- 2010-06-20 11:44:01 - ERROR: failed to build world TB --- 2010-06-20 11:44:01 - 889.39 user 215.71 system 1141.02 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-arm-arm.full From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 11:55:14 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52EAF1065670 for ; Sun, 20 Jun 2010 11:55:14 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id AC3BA8FC1E for ; Sun, 20 Jun 2010 11:55:13 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 206647E84A; Sun, 20 Jun 2010 21:55:12 +1000 (EST) Message-ID: <4C1E019F.6060802@freebsd.org> Date: Sun, 20 Jun 2010 21:55:11 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Fabian Keil References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> In-Reply-To: <20100620131544.495ddecd@r500.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 11:55:14 -0000 On 06/20/10 21:15, Fabian Keil wrote: > Lawrence Stewart wrote: > >> On 06/20/10 03:58, Fabian Keil wrote: >>> Lawrence Stewart wrote: >>> >>>> On 06/13/10 18:12, Lawrence Stewart wrote: >>> >>>>> The time has come to solicit some external testing for my SIFTR tool. >>>>> I'm hoping to commit it within a week or so unless problems are discovered. >>> >>>>> I'm interested in all feedback and reports of success/failure, along >>>>> with details of the architecture tested and number of CPUs if you would >>>>> be so kind. >>> >>> I got the following hand-transcribed panic maybe a second after >>> sysctl net.inet.siftr.enabled=1 >>> >>> Fatal trap 12: page fault while in kernel mode >>> cpuid = 1; apic id = 01 >>> [...] >>> current process = 12 (swi4: clock) >>> [ thread pid 12 tid 100006 ] >>> Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) >>> db> where >>> Tracing pid 12 tid 100006 td 0xffffff00034037e0 >>> siftr_chkpt() at siftr_chkpkt+0xd0 >>> pfil_run_hooks() at pfil_run_hooks+0xb4 >>> ip_output() at ip_output+0x382 >>> tcp_output() tcp_output+0xa41 >>> tcp_timer_rexmt() at tcp_timer_rexmt+0x251 >>> softclock() at softclock+0x291 >>> intr_event_execute_handlers() at intr_event_execute_handlers+0x66 >>> ithread_loop at ithread_loop+0x8e >>> fork_exit() at fork_exit+0x112 >>> fork_trampoline() at fork_trampoline+0xe >>> --- trap 0, rip = 0, rsp = 0xffffff800003ad30, rbp = 0 --- >> >> So I've tracked down the line of code where the page fault is occurring: >> >> if (dir == PFIL_IN) >> ss->n_in++; >> else >> ss->n_out++; >> >> ss is a DPCPU (dynamic per-cpu) variable used to keep a set of stats >> per-cpu and is initialised at the start of the function like so: >> >> ss = DPCPU_PTR(ss); >> >> So for ss to be NULL, that implies DPCPU_PTR() is returning NULL on your >> machine. I know very little about the inner workings of the DPCPU_* >> macros, but I'm pretty sure the way I use them in SIFTR is correct or at >> least as intended. > > siftr_chkpkt() passes ss to siftr_chkreinject() before dereferencing > it itself. I think if ss was NULL, the panic should already occur in > siftr_chkreinject(). Yes but siftr_chkreinject() only dereferences ss in the exceptional case of a malloc failure or duplicate pkt. It's unlikely either case happens for you and so wouldn't trigger the panic. > To be sure I added: > > diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c > index 8bc3498..b9fdfe4 100644 > --- a/sys/netinet/siftr.c > +++ b/sys/netinet/siftr.c > @@ -788,6 +788,16 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, > if (siftr_chkreinject(*m, dir, ss)) > goto ret; > > + if (ss == NULL) { > + printf("ss is NULL"); > + ss = DPCPU_PTR(ss); > + if (ss == NULL) { > + printf("ss is still NULL"); > + goto ret; > + } > + } > + > + > if (dir == PFIL_IN) > ss->n_in++; > else > > which doesn't seem to affect the problem. As in it still panics and the "ss is NULL" message is not printed? I would have expected to at least see "ss is NULL" printed if my hypothesis was correct... hmm. Perhaps the way I discovered the line number at which the panic occurred was wrong. I compiled SIFTR on my amd64 dev server with "CFLAGS+=-g" in the SIFTR Makefile to get debug symbols, ran "objdump -Sd siftr.ko | vim -", searched for the instruction reported in the panic message i.e. "addq $0x1,0x8(%r14)" and then with a bit of trial and error, recompiled SIFTR with the line of code "volatile int blah = 0; blah = 2;" at various points in the function and looking at the change in the objdump output to pinpoint which line of C code corresponded with the "addq" instruction. The "volatile int blah = 0; blah = 2;" compiles to "movl $0x0,0xffffffffffffffd4(%rbp)" followed immediately by "movl $0x2,0xffffffffffffffd4(%rbp)". When I put that code above the "if (dir == PFIL_IN)" statement I see the objdump output show the assembly code before the "addq" instruction and when I move it after the if statement the assembly code moves after the "addq" instruction. Perhaps you could reproduce the above procedure and see if you identify the same point in the siftr_chkpkt function I did for the instruction referenced by the panic message? >> Could you please go ahead and retest using a GENERIC kernel and see if >> you can reproduce? There could be something in your custom kernel >> causing the offsets or linker set magic used by the DPCPU bits to break >> which in turn is triggering this panic in SIFTR. > > I'll retry without pf first, and with GENERIC afterwards. Sounds good, thanks. Cheers, Lawrence From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 12:03:59 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 44E2D106566C; Sun, 20 Jun 2010 12:03:58 +0000 (UTC) (envelope-from nork@FreeBSD.org) Date: Sun, 20 Jun 2010 21:03:51 +0900 From: Norikatsu Shigemura To: Kristof Provost Message-Id: <20100620210351.e6aa387b.nork@FreeBSD.org> In-Reply-To: <20100613201331.GA19653@nereid> References: <20100613233723.ed2c3a30.nork@FreeBSD.org> <20100613201331.GA19653@nereid> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; i386-portbld-freebsd8.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org, freebsd-current@freebsd.org, Norikatsu Shigemura , yongari@freebsd.org Subject: Re: [OpenRD Ultimate] e1000phy(88E1149/88E1121) has a initialize issue X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 12:03:59 -0000 Hi Kristof. On Sun, 13 Jun 2010 22:13:31 +0200 Kristof Provost wrote: > > I have a OpenRD Ultimate, which has two GbE ports - if_mge(4). But > > I couldn't use mge1 like following. So I tried to investigate. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > Jun 13 05:02:14 sidearms kernel: mge1: watchdog timeout > > Jun 13 05:02:14 sidearms kernel: mge1: Timeout on link-up > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > I believe the mge(4) driver incorrectly configures the PHY address for > the second interface. Can you give the attached patch a try? Thank you. I think so, too. And, by FDT, I suggest following patch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* Tell the MAC where to find the PHY so autoneg works */ - miisc = LIST_FIRST(&sc->mii->mii_phys); - MGE_WRITE(sc, MGE_REG_PHYDEV, miisc->mii_phy); + MGE_WRITE(sc, MGE_REG_PHYDEV, sc->phyaddr); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- Norikatsu Shigemura From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 12:15:08 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id F124E106566B; Sun, 20 Jun 2010 12:15:06 +0000 (UTC) (envelope-from nork@FreeBSD.org) Date: Sun, 20 Jun 2010 21:15:00 +0900 From: Norikatsu Shigemura To: Pyun YongHyeon Message-Id: <20100620211500.c344b654.nork@FreeBSD.org> In-Reply-To: <20100615180923.GH4257@michelle.cdnetworks.com> References: <20100613233723.ed2c3a30.nork@FreeBSD.org> <20100615180923.GH4257@michelle.cdnetworks.com> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; i386-portbld-freebsd8.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Kristof, Norikatsu Shigemura , freebsd-arm@freebsd.org, freebsd-current@freebsd.org, Provost , yongari@freebsd.org Subject: Re: [OpenRD Ultimate] e1000phy(88E1149/88E1121) has a initialize issue X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 12:15:08 -0000 Hi yongari. On Tue, 15 Jun 2010 11:09:23 -0700 Pyun YongHyeon wrote: > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > Jun 13 05:02:14 sidearms kernel: mge1: watchdog timeout > > Jun 13 05:02:14 sidearms kernel: mge1: Timeout on link-up > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > This part looks like a bug in mge(4). Driver does not know how long > it would take to get a valid link. Waiting for valid link in driver > initialization does not work(e.g Starting controller without UTP > cable may always fail on mge(4)). I think mge(4) should implement > correct link state change handling. Thanks for your pointed out. I didn't notice. I'll fix this issue like following on mge_start_locked(). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) + if (IFM_SUBTYPE(sc->mii->mii_media_active) == IFM_NONE || + (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > I found a initialize issue in e1000phy.c. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > --- sys/dev/mii/e1000phy.c.orig 2010-05-01 10:17:15.282196000 +0900 > > +++ sys/dev/mii/e1000phy.c 2010-06-13 16:19:46.616650536 +0900 > > @@ -278,6 +278,7 @@ > > case MII_MODEL_MARVELL_E1118: > > break; > > case MII_MODEL_MARVELL_E1116: > > + case MII_MODEL_MARVELL_E1149: > > page = PHY_READ(sc, E1000_EADR); > > /* Select page 3, LED control register. */ > > PHY_WRITE(sc, E1000_EADR, 3); > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > I confirmed OK on my environment, OpenRD Ultimate has a 88E1121(I > > saw it, physically): > Once it was there but I removed it due to some other issues seen on > Yukon Ultra. That part will program LED access so I guess it > wouldn't affect normal network activity. Hum..., like following? At least, by current way, second NIC doesn't link-up if link connected. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case MII_MODEL_MARVELL_E1118: + case MII_MODEL_MARVELL_E1149: break; case MII_MODEL_MARVELL_E1116: page = PHY_READ(sc, E1000_EADR); /* Select page 3, LED control register. */ PHY_WRITE(sc, E1000_EADR, 3); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 88E1116R might be RGMII variant of 88E1116. Because I don't have > controller that has 88E1116R I didn't treat it as 88E1116. With > that change could you use straight cable without help of MDI/MDI-X > converter? Sorry, I don't have 88E1116R machine, so I don't know. From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 12:29:09 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1D3F1065672; Sun, 20 Jun 2010 12:29:09 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.24]) by mx1.freebsd.org (Postfix) with ESMTP id 518538FC23; Sun, 20 Jun 2010 12:29:09 +0000 (UTC) Received: from [87.79.248.113] (helo=r500.local) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1OQJdc-00081Q-Ab; Sun, 20 Jun 2010 14:28:36 +0200 Date: Sun, 20 Jun 2010 14:28:41 +0200 From: Fabian Keil To: Lawrence Stewart Message-ID: <20100620142841.4803dac3@r500.local> In-Reply-To: <4C1E019F.6060802@freebsd.org> References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/Y6Nt./LTWzcbybArOHJ5VM7"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 12:29:10 -0000 --Sig_/Y6Nt./LTWzcbybArOHJ5VM7 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Lawrence Stewart wrote: > On 06/20/10 21:15, Fabian Keil wrote: > > Lawrence Stewart wrote: > > > >> On 06/20/10 03:58, Fabian Keil wrote: > >>> Lawrence Stewart wrote: > >>> > >>>> On 06/13/10 18:12, Lawrence Stewart wrote: > >>> > >>>>> The time has come to solicit some external testing for my SIFTR too= l. > >>>>> I'm hoping to commit it within a week or so unless problems are dis= covered. > >>> > >>>>> I'm interested in all feedback and reports of success/failure, along > >>>>> with details of the architecture tested and number of CPUs if you w= ould > >>>>> be so kind. > >>> > >>> I got the following hand-transcribed panic maybe a second after > >>> sysctl net.inet.siftr.enabled=3D1 > >>> > >>> Fatal trap 12: page fault while in kernel mode > >>> cpuid =3D 1; apic id =3D 01 > >>> [...] > >>> current process =3D 12 (swi4: clock) > >>> [ thread pid 12 tid 100006 ] > >>> Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) > >>> db> where > >>> Tracing pid 12 tid 100006 td 0xffffff00034037e0 > >>> siftr_chkpt() at siftr_chkpkt+0xd0 > >>> pfil_run_hooks() at pfil_run_hooks+0xb4 > >>> ip_output() at ip_output+0x382 > >>> tcp_output() tcp_output+0xa41 > >>> tcp_timer_rexmt() at tcp_timer_rexmt+0x251 > >>> softclock() at softclock+0x291 > >>> intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > >>> ithread_loop at ithread_loop+0x8e > >>> fork_exit() at fork_exit+0x112 > >>> fork_trampoline() at fork_trampoline+0xe > >>> --- trap 0, rip =3D 0, rsp =3D 0xffffff800003ad30, rbp =3D 0 --- > >> > >> So I've tracked down the line of code where the page fault is occurrin= g: > >> > >> if (dir =3D=3D PFIL_IN) > >> ss->n_in++; > >> else > >> ss->n_out++; > >> > >> ss is a DPCPU (dynamic per-cpu) variable used to keep a set of stats > >> per-cpu and is initialised at the start of the function like so: > >> > >> ss =3D DPCPU_PTR(ss); > >> > >> So for ss to be NULL, that implies DPCPU_PTR() is returning NULL on yo= ur > >> machine. I know very little about the inner workings of the DPCPU_* > >> macros, but I'm pretty sure the way I use them in SIFTR is correct or = at > >> least as intended. > > > > siftr_chkpkt() passes ss to siftr_chkreinject() before dereferencing > > it itself. I think if ss was NULL, the panic should already occur in > > siftr_chkreinject(). >=20 > Yes but siftr_chkreinject() only dereferences ss in the exceptional case= =20 > of a malloc failure or duplicate pkt. It's unlikely either case happens=20 > for you and so wouldn't trigger the panic. >=20 > > To be sure I added: > > > > diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c > > index 8bc3498..b9fdfe4 100644 > > --- a/sys/netinet/siftr.c > > +++ b/sys/netinet/siftr.c > > @@ -788,6 +788,16 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct if= net *ifp, int dir, > > if (siftr_chkreinject(*m, dir, ss)) > > goto ret; > > > > + if (ss =3D=3D NULL) { > > + printf("ss is NULL"); > > + ss =3D DPCPU_PTR(ss); > > + if (ss =3D=3D NULL) { > > + printf("ss is still NULL"); > > + goto ret; > > + } > > + } > > + > > + > > if (dir =3D=3D PFIL_IN) > > ss->n_in++; > > else > > > > which doesn't seem to affect the problem. >=20 > As in it still panics and the "ss is NULL" message is not printed? I=20 > would have expected to at least see "ss is NULL" printed if my=20 > hypothesis was correct... hmm. Yes, it still panics, but no message is printed. > Perhaps the way I discovered the line number at which the panic occurred= =20 > was wrong. I compiled SIFTR on my amd64 dev server with "CFLAGS+=3D-g" in= =20 > the SIFTR Makefile to get debug symbols, ran "objdump -Sd siftr.ko | vim= =20 > -", searched for the instruction reported in the panic message i.e.=20 > "addq $0x1,0x8(%r14)" and then with a bit of trial and error, recompiled= =20 > SIFTR with the line of code "volatile int blah =3D 0; blah =3D 2;" at=20 > various points in the function and looking at the change in the objdump=20 > output to pinpoint which line of C code corresponded with the "addq"=20 > instruction. >=20 > The "volatile int blah =3D 0; blah =3D 2;" compiles to "movl=20 > $0x0,0xffffffffffffffd4(%rbp)" followed immediately by "movl=20 > $0x2,0xffffffffffffffd4(%rbp)". When I put that code above the "if (dir=20 > =3D=3D PFIL_IN)" statement I see the objdump output show the assembly cod= e=20 > before the "addq" instruction and when I move it after the if statement=20 > the assembly code moves after the "addq" instruction. That's a neat trick. =20 > Perhaps you could reproduce the above procedure and see if you identify=20 > the same point in the siftr_chkpkt function I did for the instruction=20 > referenced by the panic message? I do. Using: diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index b9fdfe4..fc6bd9a 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -797,12 +797,15 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct ifnet= *ifp, int dir, } } =20 + volatile int blah =3D 0; blah =3D 2; =20 if (dir =3D=3D PFIL_IN) ss->n_in++; else ss->n_out++; =20 + volatile int foo =3D 0; foo =3D 3; + /* * Create a tcphdr struct starting at the correct offset * in the IP packet. ip->ip_hl gives the ip header length I get: 803: c7 45 d4 00 00 00 00 movl $0x0,0xffffffffffffffd4(%rbp) 80a: c7 45 d4 02 00 00 00 movl $0x2,0xffffffffffffffd4(%rbp) 811: 0f 84 8a 02 00 00 je aa1 817: 49 83 46 08 01 addq $0x1,0x8(%r14) 81c: c7 45 d0 00 00 00 00 movl $0x0,0xffffffffffffffd0(%rbp) 823: c7 45 d0 03 00 00 00 movl $0x3,0xffffffffffffffd0(%rbp) > >> Could you please go ahead and retest using a GENERIC kernel and see if > >> you can reproduce? There could be something in your custom kernel > >> causing the offsets or linker set magic used by the DPCPU bits to break > >> which in turn is triggering this panic in SIFTR. > > > > I'll retry without pf first, and with GENERIC afterwards. >=20 > Sounds good, thanks. Taking pf (and altq) out of the picture doesn't seem to make a difference. Fabian --Sig_/Y6Nt./LTWzcbybArOHJ5VM7 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkweCXsACgkQBYqIVf93VJ1qcwCeMBy8mvXtUBqp3BUkD9K8fK6x 9GYAn3enB+kNR4h0jO8BS8YEYJA2z/dD =ifET -----END PGP SIGNATURE----- --Sig_/Y6Nt./LTWzcbybArOHJ5VM7-- From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 12:48:23 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 912DF106566B for ; Sun, 20 Jun 2010 12:48:23 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 0EAA08FC20 for ; Sun, 20 Jun 2010 12:48:22 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 3CFA77E84A; Sun, 20 Jun 2010 22:48:21 +1000 (EST) Message-ID: <4C1E0E14.3090506@freebsd.org> Date: Sun, 20 Jun 2010 22:48:20 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Fabian Keil References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> In-Reply-To: <20100620142841.4803dac3@r500.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 12:48:23 -0000 On 06/20/10 22:28, Fabian Keil wrote: > Lawrence Stewart wrote: > >> On 06/20/10 21:15, Fabian Keil wrote: >>> Lawrence Stewart wrote: >>> >>>> On 06/20/10 03:58, Fabian Keil wrote: >>>>> Lawrence Stewart wrote: >>>>> >>>>>> On 06/13/10 18:12, Lawrence Stewart wrote: >>>>> >>>>>>> The time has come to solicit some external testing for my SIFTR tool. >>>>>>> I'm hoping to commit it within a week or so unless problems are discovered. >>>>> >>>>>>> I'm interested in all feedback and reports of success/failure, along >>>>>>> with details of the architecture tested and number of CPUs if you would >>>>>>> be so kind. >>>>> >>>>> I got the following hand-transcribed panic maybe a second after >>>>> sysctl net.inet.siftr.enabled=1 >>>>> >>>>> Fatal trap 12: page fault while in kernel mode >>>>> cpuid = 1; apic id = 01 >>>>> [...] >>>>> current process = 12 (swi4: clock) >>>>> [ thread pid 12 tid 100006 ] >>>>> Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) >>>>> db> where >>>>> Tracing pid 12 tid 100006 td 0xffffff00034037e0 >>>>> siftr_chkpt() at siftr_chkpkt+0xd0 >>>>> pfil_run_hooks() at pfil_run_hooks+0xb4 >>>>> ip_output() at ip_output+0x382 >>>>> tcp_output() tcp_output+0xa41 >>>>> tcp_timer_rexmt() at tcp_timer_rexmt+0x251 >>>>> softclock() at softclock+0x291 >>>>> intr_event_execute_handlers() at intr_event_execute_handlers+0x66 >>>>> ithread_loop at ithread_loop+0x8e >>>>> fork_exit() at fork_exit+0x112 >>>>> fork_trampoline() at fork_trampoline+0xe >>>>> --- trap 0, rip = 0, rsp = 0xffffff800003ad30, rbp = 0 --- >>>> >>>> So I've tracked down the line of code where the page fault is occurring: >>>> >>>> if (dir == PFIL_IN) >>>> ss->n_in++; >>>> else >>>> ss->n_out++; >>>> >>>> ss is a DPCPU (dynamic per-cpu) variable used to keep a set of stats >>>> per-cpu and is initialised at the start of the function like so: >>>> >>>> ss = DPCPU_PTR(ss); >>>> >>>> So for ss to be NULL, that implies DPCPU_PTR() is returning NULL on your >>>> machine. I know very little about the inner workings of the DPCPU_* >>>> macros, but I'm pretty sure the way I use them in SIFTR is correct or at >>>> least as intended. >>> >>> siftr_chkpkt() passes ss to siftr_chkreinject() before dereferencing >>> it itself. I think if ss was NULL, the panic should already occur in >>> siftr_chkreinject(). >> >> Yes but siftr_chkreinject() only dereferences ss in the exceptional case >> of a malloc failure or duplicate pkt. It's unlikely either case happens >> for you and so wouldn't trigger the panic. >> >>> To be sure I added: >>> >>> diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c >>> index 8bc3498..b9fdfe4 100644 >>> --- a/sys/netinet/siftr.c >>> +++ b/sys/netinet/siftr.c >>> @@ -788,6 +788,16 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, >>> if (siftr_chkreinject(*m, dir, ss)) >>> goto ret; >>> >>> + if (ss == NULL) { >>> + printf("ss is NULL"); >>> + ss = DPCPU_PTR(ss); >>> + if (ss == NULL) { >>> + printf("ss is still NULL"); >>> + goto ret; >>> + } >>> + } >>> + >>> + >>> if (dir == PFIL_IN) >>> ss->n_in++; >>> else >>> >>> which doesn't seem to affect the problem. >> >> As in it still panics and the "ss is NULL" message is not printed? I >> would have expected to at least see "ss is NULL" printed if my >> hypothesis was correct... hmm. > > Yes, it still panics, but no message is printed. It was just pointed out to me that ss doesn't have to be NULL in order to cause the page fault (duh). It could also just be a garbage ptr which is why your print statement isn't firing. Can you trigger the panic again and look for some information along the lines of "fault virtual address = ..." as part of the panic info. Knowing the faulting address would be useful and may help further diagnosis. >> Perhaps the way I discovered the line number at which the panic occurred >> was wrong. I compiled SIFTR on my amd64 dev server with "CFLAGS+=-g" in >> the SIFTR Makefile to get debug symbols, ran "objdump -Sd siftr.ko | vim >> -", searched for the instruction reported in the panic message i.e. >> "addq $0x1,0x8(%r14)" and then with a bit of trial and error, recompiled >> SIFTR with the line of code "volatile int blah = 0; blah = 2;" at >> various points in the function and looking at the change in the objdump >> output to pinpoint which line of C code corresponded with the "addq" >> instruction. >> >> The "volatile int blah = 0; blah = 2;" compiles to "movl >> $0x0,0xffffffffffffffd4(%rbp)" followed immediately by "movl >> $0x2,0xffffffffffffffd4(%rbp)". When I put that code above the "if (dir >> == PFIL_IN)" statement I see the objdump output show the assembly code >> before the "addq" instruction and when I move it after the if statement >> the assembly code moves after the "addq" instruction. > > That's a neat trick. Indeed, and I thank phk@ for suggesting it to me. >> Perhaps you could reproduce the above procedure and see if you identify >> the same point in the siftr_chkpkt function I did for the instruction >> referenced by the panic message? > > I do. Using: > > diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c > index b9fdfe4..fc6bd9a 100644 > --- a/sys/netinet/siftr.c > +++ b/sys/netinet/siftr.c > @@ -797,12 +797,15 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, > } > } > > + volatile int blah = 0; blah = 2; > > if (dir == PFIL_IN) > ss->n_in++; > else > ss->n_out++; > > + volatile int foo = 0; foo = 3; > + > /* > * Create a tcphdr struct starting at the correct offset > * in the IP packet. ip->ip_hl gives the ip header length > > I get: > > 803: c7 45 d4 00 00 00 00 movl $0x0,0xffffffffffffffd4(%rbp) > 80a: c7 45 d4 02 00 00 00 movl $0x2,0xffffffffffffffd4(%rbp) > 811: 0f 84 8a 02 00 00 je aa1 > 817: 49 83 46 08 01 addq $0x1,0x8(%r14) > 81c: c7 45 d0 00 00 00 00 movl $0x0,0xffffffffffffffd0(%rbp) > 823: c7 45 d0 03 00 00 00 movl $0x3,0xffffffffffffffd0(%rbp) > Ok cool, nice to be assured I didn't botch the detective work up. >>>> Could you please go ahead and retest using a GENERIC kernel and see if >>>> you can reproduce? There could be something in your custom kernel >>>> causing the offsets or linker set magic used by the DPCPU bits to break >>>> which in turn is triggering this panic in SIFTR. >>> >>> I'll retry without pf first, and with GENERIC afterwards. >> >> Sounds good, thanks. > > Taking pf (and altq) out of the picture doesn't seem to make > a difference. Wouldn't have expected it to. Will be very curious to know if the panic is triggered in GENERIC. Cheers, Lawrence From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 13:01:08 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D9A21065673 for ; Sun, 20 Jun 2010 13:01:08 +0000 (UTC) (envelope-from kristof@sigsegv.be) Received: from jacques.telenet-ops.be (jacques.telenet-ops.be [195.130.132.50]) by mx1.freebsd.org (Postfix) with ESMTP id 909AA8FC19 for ; Sun, 20 Jun 2010 13:01:04 +0000 (UTC) Received: from triton.sigsegv.be ([213.119.97.224]) by jacques.telenet-ops.be with bizsmtp id YD131e00A4qUA0t0JD13eV; Sun, 20 Jun 2010 15:01:03 +0200 Received: from nereid (nereid.neptune.sigsegv.be [IPv6:2001:470:c8f4:0:200:ff:fe00:8]) by triton.sigsegv.be (Postfix) with SMTP id 38B6D1C127; Sun, 20 Jun 2010 15:01:02 +0200 (CEST) Received: by nereid (sSMTP sendmail emulation); Sun, 20 Jun 2010 15:01:02 +0200 Date: Sun, 20 Jun 2010 15:01:00 +0200 From: Kristof Provost To: Norikatsu Shigemura Message-ID: <20100620130100.GB31846@nereid> References: <20100613233723.ed2c3a30.nork@FreeBSD.org> <20100613201331.GA19653@nereid> <20100620210351.e6aa387b.nork@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100620210351.e6aa387b.nork@FreeBSD.org> X-PGP-Fingerprint: 6B6E 5EED 8ECF FAE7 1F61 7458 5046 7D0E 11B0 0EE8 User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-arm@freebsd.org, freebsd-current@freebsd.org, yongari@freebsd.org Subject: Re: [OpenRD Ultimate] e1000phy(88E1149/88E1121) has a initialize issue X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 13:01:08 -0000 On 2010-06-20 21:03:51 (+0900), Norikatsu Shigemura wrote: > On Sun, 13 Jun 2010 22:13:31 +0200 > Kristof Provost wrote: > > > I have a OpenRD Ultimate, which has two GbE ports - if_mge(4). But > > > I couldn't use mge1 like following. So I tried to investigate. > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > Jun 13 05:02:14 sidearms kernel: mge1: watchdog timeout > > > Jun 13 05:02:14 sidearms kernel: mge1: Timeout on link-up > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > I believe the mge(4) driver incorrectly configures the PHY address for > > the second interface. Can you give the attached patch a try? > > Thank you. I think so, too. And, by FDT, I suggest following > patch. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > /* Tell the MAC where to find the PHY so autoneg works */ > - miisc = LIST_FIRST(&sc->mii->mii_phys); > - MGE_WRITE(sc, MGE_REG_PHYDEV, miisc->mii_phy); > + MGE_WRITE(sc, MGE_REG_PHYDEV, sc->phyaddr); > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > I think that's correct, but I haven't been able to test it on my board yet. Does this work for you on a board with two GbE ports? If so I'll try to get someone to commit it. Regards, Kristof From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 13:15:41 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E22C106566C; Sun, 20 Jun 2010 13:15:41 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.29.23]) by mx1.freebsd.org (Postfix) with ESMTP id C67A68FC1D; Sun, 20 Jun 2010 13:15:40 +0000 (UTC) Received: from [87.79.248.113] (helo=r500.local) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1OQKN9-00071r-5d; Sun, 20 Jun 2010 15:15:39 +0200 Date: Sun, 20 Jun 2010 15:15:54 +0200 From: Fabian Keil To: Lawrence Stewart Message-ID: <20100620151554.58e486db@r500.local> In-Reply-To: <4C1E0E14.3090506@freebsd.org> References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> <4C1E0E14.3090506@freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/KOfakMhdKJkZMtuiyHRGJ_N"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 13:15:41 -0000 --Sig_/KOfakMhdKJkZMtuiyHRGJ_N Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Lawrence Stewart wrote: > On 06/20/10 22:28, Fabian Keil wrote: > > Lawrence Stewart wrote: > > > >> On 06/20/10 21:15, Fabian Keil wrote: > >>> Lawrence Stewart wrote: > >>> > >>>> On 06/20/10 03:58, Fabian Keil wrote: > >>>>> Lawrence Stewart wrote: > >>>>> > >>>>>> On 06/13/10 18:12, Lawrence Stewart wrote: > >>>>> > >>>>>>> The time has come to solicit some external testing for my SIFTR t= ool. > >>>>>>> I'm hoping to commit it within a week or so unless problems are d= iscovered. > >>>>> > >>>>>>> I'm interested in all feedback and reports of success/failure, al= ong > >>>>>>> with details of the architecture tested and number of CPUs if you= would > >>>>>>> be so kind. > >>>>> > >>>>> I got the following hand-transcribed panic maybe a second after > >>>>> sysctl net.inet.siftr.enabled=3D1 > >>>>> > >>>>> Fatal trap 12: page fault while in kernel mode > >>>>> cpuid =3D 1; apic id =3D 01 > >>>>> [...] > >>>>> current process =3D 12 (swi4: clock) > >>>>> [ thread pid 12 tid 100006 ] > >>>>> Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) > >>>>> db> where > >>>>> Tracing pid 12 tid 100006 td 0xffffff00034037e0 > >>>>> siftr_chkpt() at siftr_chkpkt+0xd0 > >>>>> pfil_run_hooks() at pfil_run_hooks+0xb4 > >>>>> ip_output() at ip_output+0x382 > >>>>> tcp_output() tcp_output+0xa41 > >>>>> tcp_timer_rexmt() at tcp_timer_rexmt+0x251 > >>>>> softclock() at softclock+0x291 > >>>>> intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > >>>>> ithread_loop at ithread_loop+0x8e > >>>>> fork_exit() at fork_exit+0x112 > >>>>> fork_trampoline() at fork_trampoline+0xe > >>>>> --- trap 0, rip =3D 0, rsp =3D 0xffffff800003ad30, rbp =3D 0 --- > >>>> > >>>> So I've tracked down the line of code where the page fault is occurr= ing: > >>>> > >>>> if (dir =3D=3D PFIL_IN) > >>>> ss->n_in++; > >>>> else > >>>> ss->n_out++; > >>>> > >>>> ss is a DPCPU (dynamic per-cpu) variable used to keep a set of stats > >>>> per-cpu and is initialised at the start of the function like so: > >>>> > >>>> ss =3D DPCPU_PTR(ss); > >>>> > >>>> So for ss to be NULL, that implies DPCPU_PTR() is returning NULL on = your > >>>> machine. I know very little about the inner workings of the DPCPU_* > >>>> macros, but I'm pretty sure the way I use them in SIFTR is correct o= r at > >>>> least as intended. > >>> > >>> siftr_chkpkt() passes ss to siftr_chkreinject() before dereferencing > >>> it itself. I think if ss was NULL, the panic should already occur in > >>> siftr_chkreinject(). > >> > >> Yes but siftr_chkreinject() only dereferences ss in the exceptional ca= se > >> of a malloc failure or duplicate pkt. It's unlikely either case happens > >> for you and so wouldn't trigger the panic. > >> > >>> To be sure I added: > >>> > >>> diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c > >>> index 8bc3498..b9fdfe4 100644 > >>> --- a/sys/netinet/siftr.c > >>> +++ b/sys/netinet/siftr.c > >>> @@ -788,6 +788,16 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct = ifnet *ifp, int dir, > >>> if (siftr_chkreinject(*m, dir, ss)) > >>> goto ret; > >>> > >>> + if (ss =3D=3D NULL) { > >>> + printf("ss is NULL"); > >>> + ss =3D DPCPU_PTR(ss); > >>> + if (ss =3D=3D NULL) { > >>> + printf("ss is still NULL"); > >>> + goto ret; > >>> + } > >>> + } > >>> + > >>> + > >>> if (dir =3D=3D PFIL_IN) > >>> ss->n_in++; > >>> else > >>> > >>> which doesn't seem to affect the problem. > >> > >> As in it still panics and the "ss is NULL" message is not printed? I > >> would have expected to at least see "ss is NULL" printed if my > >> hypothesis was correct... hmm. > > > > Yes, it still panics, but no message is printed. >=20 > It was just pointed out to me that ss doesn't have to be NULL in order=20 > to cause the page fault (duh). It could also just be a garbage ptr which= =20 > is why your print statement isn't firing. >=20 > Can you trigger the panic again and look for some information along the=20 > lines of "fault virtual address =3D ..." as part of the panic info.=20 > Knowing the faulting address would be useful and may help further diagnos= is. Fatal trap 12: page fault while in kernel mode cpuid =3D 1; apic id =3D 01 fault virtual address =3D 0xffffff7f808f9de8 fault code =3D supervisor write data, page not present instruction pointer =3D 0x20:0xffffffff8241f800 stack pointer =3D 0x28:0xffffff800003a7d0 frame pointer =3D 0x28:0xffffff800003a840 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 12 (swi4: clock) [ thread pid 12 tid 100006 ] Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) db> where =20 Tracing pid 12 tid 100006 td 0xffffff00034037e0 siftr_chkpt() at siftr_chkpkt+0xd0 pfil_run_hooks() at pfil_run_hooks+0xb4 ip_output() at ip_output+0x382 tcp_output() tcp_output+0xa41 tcp_timer_rexmt() at tcp_timer_rexmt+0x251 softclock() at softclock+0x291 intr_event_execute_handlers() at intr_event_execute_handlers+0x66 ithread_loop at ithread_loop+0x8e fork_exit() at fork_exit+0x112 fork_trampoline() at fork_trampoline+0xe --- trap 0, rip =3D 0, rsp =3D 0xffffff800003ad30, rbp =3D 0 --- > >>>> Could you please go ahead and retest using a GENERIC kernel and see = if > >>>> you can reproduce? There could be something in your custom kernel > >>>> causing the offsets or linker set magic used by the DPCPU bits to br= eak > >>>> which in turn is triggering this panic in SIFTR. > >>> > >>> I'll retry without pf first, and with GENERIC afterwards. > >> > >> Sounds good, thanks. > > > > Taking pf (and altq) out of the picture doesn't seem to make > > a difference. >=20 > Wouldn't have expected it to. Will be very curious to know if the panic=20 > is triggered in GENERIC. It's not. I, too, get pfil.c related LORs though: lock order reversal: 1st 0xffffffff80e5c568 PFil hook read/write mutex (PFil hook read/write mu= tex) @ /usr/src/sys/net/pfil.c:77 2nd 0xffffffff80e5dd68 udp (udp) @ /usr/src/sys/modules/pf/../../contrib/p= f/net/pf.c:3035 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2a _witness_debugger() at _witness_debugger+0x2e witness_checkorder() at witness_checkorder+0x81e _rw_rlock() at _rw_rlock+0x5f pf_socket_lookup() at pf_socket_lookup+0x1c5 pf_test_udp() at pf_test_udp+0x8b0 pf_test() at pf_test+0x1089 pf_check_in() at pf_check_in+0x39 pfil_run_hooks() at pfil_run_hooks+0xcf ip_input() at ip_input+0x2ae swi_net() at swi_net+0x151 intr_event_execute_handlers() at intr_event_execute_handlers+0x66 ithread_loop() at ithread_loop+0xb2 fork_exit() at fork_exit+0x12a fork_trampoline() at fork_trampoline+0xe --- trap 0, rip =3D 0, rsp =3D 0xffffff8000044d30, rbp =3D 0 --- lock order reversal: 1st 0xffffffff80e5c568 PFil hook read/write mutex (PFil hook read/write mu= tex) @ /usr/src/sys/net/pfil.c:77 2nd 0xffffffff80e5d788 tcp (tcp) @ /usr/src/sys/modules/siftr/../../netine= t/siftr.c:698 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2a _witness_debugger() at _witness_debugger+0x2e witness_checkorder() at witness_checkorder+0x81e _rw_rlock() at _rw_rlock+0x5f siftr_chkpkt() at siftr_chkpkt+0x3c4 pfil_run_hooks() at pfil_run_hooks+0xcf ip_input() at ip_input+0x2ae swi_net() at swi_net+0x151 intr_event_execute_handlers() at intr_event_execute_handlers+0x66 ithread_loop() at ithread_loop+0xb2 fork_exit() at fork_exit+0x12a fork_trampoline() at fork_trampoline+0xe --- trap 0, rip =3D 0, rsp =3D 0xffffff8000044d30, rbp =3D 0 --- My custom kernel normally doesn't have INVARIANTS and WITNESS enabled, so I'll try to enable them next. Fabian --Sig_/KOfakMhdKJkZMtuiyHRGJ_N Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkweFI8ACgkQBYqIVf93VJ2cagCfSbFY5gfh6GeDW3kKiCQBv3+n OesAn33UJRR0XanMCLSSddSzKN8Tg6v4 =DAmj -----END PGP SIGNATURE----- --Sig_/KOfakMhdKJkZMtuiyHRGJ_N-- From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 14:09:17 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 498BC1065670 for ; Sun, 20 Jun 2010 14:09:17 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 895D38FC19 for ; Sun, 20 Jun 2010 14:09:16 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 885E97E84A; Mon, 21 Jun 2010 00:09:14 +1000 (EST) Message-ID: <4C1E2109.8090209@freebsd.org> Date: Mon, 21 Jun 2010 00:09:13 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Fabian Keil References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> <4C1E0E14.3090506@freebsd.org> <20100620151554.58e486db@r500.local> In-Reply-To: <20100620151554.58e486db@r500.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 14:09:17 -0000 On 06/20/10 23:15, Fabian Keil wrote: > Lawrence Stewart wrote: > >> On 06/20/10 22:28, Fabian Keil wrote: >>> Lawrence Stewart wrote: >>> >>>> On 06/20/10 21:15, Fabian Keil wrote: >>>>> Lawrence Stewart wrote: >>>>> >>>>>> On 06/20/10 03:58, Fabian Keil wrote: >>>>>>> Lawrence Stewart wrote: >>>>>>> >>>>>>>> On 06/13/10 18:12, Lawrence Stewart wrote: >>>>>>> >>>>>>>>> The time has come to solicit some external testing for my SIFTR tool. >>>>>>>>> I'm hoping to commit it within a week or so unless problems are discovered. >>>>>>> >>>>>>>>> I'm interested in all feedback and reports of success/failure, along >>>>>>>>> with details of the architecture tested and number of CPUs if you would >>>>>>>>> be so kind. >>>>>>> >>>>>>> I got the following hand-transcribed panic maybe a second after >>>>>>> sysctl net.inet.siftr.enabled=1 >>>>>>> >>>>>>> Fatal trap 12: page fault while in kernel mode >>>>>>> cpuid = 1; apic id = 01 >>>>>>> [...] >>>>>>> current process = 12 (swi4: clock) >>>>>>> [ thread pid 12 tid 100006 ] >>>>>>> Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) >>>>>>> db> where >>>>>>> Tracing pid 12 tid 100006 td 0xffffff00034037e0 >>>>>>> siftr_chkpt() at siftr_chkpkt+0xd0 >>>>>>> pfil_run_hooks() at pfil_run_hooks+0xb4 >>>>>>> ip_output() at ip_output+0x382 >>>>>>> tcp_output() tcp_output+0xa41 >>>>>>> tcp_timer_rexmt() at tcp_timer_rexmt+0x251 >>>>>>> softclock() at softclock+0x291 >>>>>>> intr_event_execute_handlers() at intr_event_execute_handlers+0x66 >>>>>>> ithread_loop at ithread_loop+0x8e >>>>>>> fork_exit() at fork_exit+0x112 >>>>>>> fork_trampoline() at fork_trampoline+0xe >>>>>>> --- trap 0, rip = 0, rsp = 0xffffff800003ad30, rbp = 0 --- >>>>>> >>>>>> So I've tracked down the line of code where the page fault is occurring: >>>>>> >>>>>> if (dir == PFIL_IN) >>>>>> ss->n_in++; >>>>>> else >>>>>> ss->n_out++; >>>>>> >>>>>> ss is a DPCPU (dynamic per-cpu) variable used to keep a set of stats >>>>>> per-cpu and is initialised at the start of the function like so: >>>>>> >>>>>> ss = DPCPU_PTR(ss); >>>>>> >>>>>> So for ss to be NULL, that implies DPCPU_PTR() is returning NULL on your >>>>>> machine. I know very little about the inner workings of the DPCPU_* >>>>>> macros, but I'm pretty sure the way I use them in SIFTR is correct or at >>>>>> least as intended. >>>>> >>>>> siftr_chkpkt() passes ss to siftr_chkreinject() before dereferencing >>>>> it itself. I think if ss was NULL, the panic should already occur in >>>>> siftr_chkreinject(). >>>> >>>> Yes but siftr_chkreinject() only dereferences ss in the exceptional case >>>> of a malloc failure or duplicate pkt. It's unlikely either case happens >>>> for you and so wouldn't trigger the panic. >>>> >>>>> To be sure I added: >>>>> >>>>> diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c >>>>> index 8bc3498..b9fdfe4 100644 >>>>> --- a/sys/netinet/siftr.c >>>>> +++ b/sys/netinet/siftr.c >>>>> @@ -788,6 +788,16 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, >>>>> if (siftr_chkreinject(*m, dir, ss)) >>>>> goto ret; >>>>> >>>>> + if (ss == NULL) { >>>>> + printf("ss is NULL"); >>>>> + ss = DPCPU_PTR(ss); >>>>> + if (ss == NULL) { >>>>> + printf("ss is still NULL"); >>>>> + goto ret; >>>>> + } >>>>> + } >>>>> + >>>>> + >>>>> if (dir == PFIL_IN) >>>>> ss->n_in++; >>>>> else >>>>> >>>>> which doesn't seem to affect the problem. >>>> >>>> As in it still panics and the "ss is NULL" message is not printed? I >>>> would have expected to at least see "ss is NULL" printed if my >>>> hypothesis was correct... hmm. >>> >>> Yes, it still panics, but no message is printed. >> >> It was just pointed out to me that ss doesn't have to be NULL in order >> to cause the page fault (duh). It could also just be a garbage ptr which >> is why your print statement isn't firing. >> >> Can you trigger the panic again and look for some information along the >> lines of "fault virtual address = ..." as part of the panic info. >> Knowing the faulting address would be useful and may help further diagnosis. > > Fatal trap 12: page fault while in kernel mode > cpuid = 1; apic id = 01 > fault virtual address = 0xffffff7f808f9de8 > fault code = supervisor write data, page not present > instruction pointer = 0x20:0xffffffff8241f800 > stack pointer = 0x28:0xffffff800003a7d0 > frame pointer = 0x28:0xffffff800003a840 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 None of this looks too crazy, but at least one person I've been chatting to about this thinks the faulting address doesn't look quite right for a DPCPU variable. Can you please get the following additional info from DDB: show reg show dpcpu_offset p/x pcpu_entry_modspace And can you also please identify the upstream FreeBSD revision number your kernel source is based on (as opposed to the GIT rev) so we can make sure we're looking at the same base sources you're running. > current process = 12 (swi4: clock) > [ thread pid 12 tid 100006 ] > Stopped at siftr_chkpkt+0xd0: addq $0x1,0x8(%r14) > db> where > Tracing pid 12 tid 100006 td 0xffffff00034037e0 > siftr_chkpt() at siftr_chkpkt+0xd0 > pfil_run_hooks() at pfil_run_hooks+0xb4 > ip_output() at ip_output+0x382 > tcp_output() tcp_output+0xa41 > tcp_timer_rexmt() at tcp_timer_rexmt+0x251 > softclock() at softclock+0x291 > intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > ithread_loop at ithread_loop+0x8e > fork_exit() at fork_exit+0x112 > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip = 0, rsp = 0xffffff800003ad30, rbp = 0 --- > >>>>>> Could you please go ahead and retest using a GENERIC kernel and see if >>>>>> you can reproduce? There could be something in your custom kernel >>>>>> causing the offsets or linker set magic used by the DPCPU bits to break >>>>>> which in turn is triggering this panic in SIFTR. >>>>> >>>>> I'll retry without pf first, and with GENERIC afterwards. >>>> >>>> Sounds good, thanks. >>> >>> Taking pf (and altq) out of the picture doesn't seem to make >>> a difference. >> >> Wouldn't have expected it to. Will be very curious to know if the panic >> is triggered in GENERIC. > > It's not. I, too, get pfil.c related LORs though: Ok good to know. Can you please share your kernel config that panics and the modules you have loaded at the time of the panic? If we could whittle your config down to something that's close to GENERIC and still panics, that would obviously be useful to eliminate some variables. The pfil related LORs are fine and can be ignored in this case. > lock order reversal: > 1st 0xffffffff80e5c568 PFil hook read/write mutex (PFil hook read/write mutex) @ /usr/src/sys/net/pfil.c:77 > 2nd 0xffffffff80e5dd68 udp (udp) @ /usr/src/sys/modules/pf/../../contrib/pf/net/pf.c:3035 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > _witness_debugger() at _witness_debugger+0x2e > witness_checkorder() at witness_checkorder+0x81e > _rw_rlock() at _rw_rlock+0x5f > pf_socket_lookup() at pf_socket_lookup+0x1c5 > pf_test_udp() at pf_test_udp+0x8b0 > pf_test() at pf_test+0x1089 > pf_check_in() at pf_check_in+0x39 > pfil_run_hooks() at pfil_run_hooks+0xcf > ip_input() at ip_input+0x2ae > swi_net() at swi_net+0x151 > intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > ithread_loop() at ithread_loop+0xb2 > fork_exit() at fork_exit+0x12a > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip = 0, rsp = 0xffffff8000044d30, rbp = 0 --- > lock order reversal: > 1st 0xffffffff80e5c568 PFil hook read/write mutex (PFil hook read/write mutex) @ /usr/src/sys/net/pfil.c:77 > 2nd 0xffffffff80e5d788 tcp (tcp) @ /usr/src/sys/modules/siftr/../../netinet/siftr.c:698 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > _witness_debugger() at _witness_debugger+0x2e > witness_checkorder() at witness_checkorder+0x81e > _rw_rlock() at _rw_rlock+0x5f > siftr_chkpkt() at siftr_chkpkt+0x3c4 > pfil_run_hooks() at pfil_run_hooks+0xcf > ip_input() at ip_input+0x2ae > swi_net() at swi_net+0x151 > intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > ithread_loop() at ithread_loop+0xb2 > fork_exit() at fork_exit+0x12a > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip = 0, rsp = 0xffffff8000044d30, rbp = 0 --- > > My custom kernel normally doesn't have INVARIANTS and WITNESS > enabled, so I'll try to enable them next. INVARIANTS and INVARIANT_SUPPORT are the import ones. I don't think WITNESS will help us diagnose this particular problem. Cheers, Lawrence From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 14:12:28 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EBFD1065670; Sun, 20 Jun 2010 14:12:28 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.31.30]) by mx1.freebsd.org (Postfix) with ESMTP id AD5558FC0A; Sun, 20 Jun 2010 14:12:27 +0000 (UTC) Received: from [87.79.248.113] (helo=r500.local) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1OQLG6-0006GG-2T; Sun, 20 Jun 2010 16:12:26 +0200 Date: Sun, 20 Jun 2010 16:12:42 +0200 From: Fabian Keil To: Lawrence Stewart Message-ID: <20100620161242.59381341@r500.local> In-Reply-To: <20100620151554.58e486db@r500.local> References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> <4C1E0E14.3090506@freebsd.org> <20100620151554.58e486db@r500.local> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/74p0_VX6c0YHwozhFI=j1jr"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 14:12:28 -0000 --Sig_/74p0_VX6c0YHwozhFI=j1jr Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Fabian Keil wrote: > Lawrence Stewart wrote: >=20 > > On 06/20/10 22:28, Fabian Keil wrote: > > > Taking pf (and altq) out of the picture doesn't seem to make > > > a difference. > >=20 > > Wouldn't have expected it to. Will be very curious to know if the panic= =20 > > is triggered in GENERIC. >=20 > It's not. I, too, get pfil.c related LORs though: >=20 > lock order reversal: > 1st 0xffffffff80e5c568 PFil hook read/write mutex (PFil hook read/write = mutex) @ /usr/src/sys/net/pfil.c:77 > 2nd 0xffffffff80e5dd68 udp (udp) @ /usr/src/sys/modules/pf/../../contrib= /pf/net/pf.c:3035 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > _witness_debugger() at _witness_debugger+0x2e > witness_checkorder() at witness_checkorder+0x81e > _rw_rlock() at _rw_rlock+0x5f > pf_socket_lookup() at pf_socket_lookup+0x1c5 > pf_test_udp() at pf_test_udp+0x8b0 > pf_test() at pf_test+0x1089 > pf_check_in() at pf_check_in+0x39 > pfil_run_hooks() at pfil_run_hooks+0xcf > ip_input() at ip_input+0x2ae > swi_net() at swi_net+0x151 > intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > ithread_loop() at ithread_loop+0xb2 > fork_exit() at fork_exit+0x12a > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip =3D 0, rsp =3D 0xffffff8000044d30, rbp =3D 0 --- > lock order reversal: > 1st 0xffffffff80e5c568 PFil hook read/write mutex (PFil hook read/write = mutex) @ /usr/src/sys/net/pfil.c:77 > 2nd 0xffffffff80e5d788 tcp (tcp) @ /usr/src/sys/modules/siftr/../../neti= net/siftr.c:698 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > _witness_debugger() at _witness_debugger+0x2e > witness_checkorder() at witness_checkorder+0x81e > _rw_rlock() at _rw_rlock+0x5f > siftr_chkpkt() at siftr_chkpkt+0x3c4 > pfil_run_hooks() at pfil_run_hooks+0xcf > ip_input() at ip_input+0x2ae > swi_net() at swi_net+0x151 > intr_event_execute_handlers() at intr_event_execute_handlers+0x66 > ithread_loop() at ithread_loop+0xb2 > fork_exit() at fork_exit+0x12a > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip =3D 0, rsp =3D 0xffffff8000044d30, rbp =3D 0 --- >=20 > My custom kernel normally doesn't have INVARIANTS and WITNESS > enabled, so I'll try to enable them next. The culprit seem to be non-default KTR settings in the kernel while loading alq as a module. With the following change siftr works with my non-GENERIC kernel, too: commit f43b8b5171c858df7b419f6a695e9e3b53531a8e Author: Fabian Keil Date: Sun Jun 20 15:43:01 2010 +0200 Disable KTR changes. diff --git a/sys/amd64/conf/ZOEY b/sys/amd64/conf/ZOEY index 6fb3480..c584317 100644 --- a/sys/amd64/conf/ZOEY +++ b/sys/amd64/conf/ZOEY @@ -16,11 +16,11 @@ options ATA_CAM device atapicam options SC_KERNEL_CONS_ATTR=3D(FG_GREEN|BG_BLACK) =20 -options KTR -options KTR_ENTRIES=3D262144 -options KTR_COMPILE=3D(KTR_SCHED) -options KTR_MASK=3D(KTR_SCHED) -options KTR_CPUMASK=3D0x3 +#options KTR +#options KTR_ENTRIES=3D262144 +#options KTR_COMPILE=3D(KTR_SCHED) +#options KTR_MASK=3D(KTR_SCHED) +#options KTR_CPUMASK=3D0x3 =20 options ACCEPT_FILTER_HTTP =20 makeoptions WITH_CTF=3Dyes Fabian --Sig_/74p0_VX6c0YHwozhFI=j1jr Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkweId4ACgkQBYqIVf93VJ03hwCfU8NHOF6QJlirAU/YKDftBMts nFMAoL0b9Ai+LJ1IMQKKWKboOJn8yAKL =hDfH -----END PGP SIGNATURE----- --Sig_/74p0_VX6c0YHwozhFI=j1jr-- From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 14:20:07 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 507E91065670; Sun, 20 Jun 2010 14:20:07 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 1E4A48FC19; Sun, 20 Jun 2010 14:20:06 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o5KEK6ju033084; Sun, 20 Jun 2010 10:20:06 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o5KEK6L4033075; Sun, 20 Jun 2010 14:20:06 GMT (envelope-from tinderbox@freebsd.org) Date: Sun, 20 Jun 2010 14:20:06 GMT Message-Id: <201006201420.o5KEK6L4033075@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on powerpc/powerpc X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 14:20:07 -0000 TB --- 2010-06-20 13:55:40 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-06-20 13:55:40 - starting HEAD tinderbox run for powerpc/powerpc TB --- 2010-06-20 13:55:40 - cleaning the object tree TB --- 2010-06-20 13:55:45 - cvsupping the source tree TB --- 2010-06-20 13:55:45 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/powerpc/powerpc/supfile TB --- 2010-06-20 13:56:08 - building world TB --- 2010-06-20 13:56:08 - MAKEOBJDIRPREFIX=/obj TB --- 2010-06-20 13:56:08 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2010-06-20 13:56:08 - TARGET=powerpc TB --- 2010-06-20 13:56:08 - TARGET_ARCH=powerpc TB --- 2010-06-20 13:56:08 - TZ=UTC TB --- 2010-06-20 13:56:08 - __MAKE_CONF=/dev/null TB --- 2010-06-20 13:56:08 - cd /src TB --- 2010-06-20 13:56:08 - /usr/bin/make -B buildworld >>> World build started on Sun Jun 20 13:56:08 UTC 2010 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries [...] cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c dt_grammar.c cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_inttab.c cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c dt_lex.c cc1: warnings being treated as errors /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l: In function 'yylex': /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l:623: warning: comparison is always true due to limited range of data type *** Error code 1 Stop in /src/cddl/lib/libdtrace. *** Error code 1 Stop in /src/cddl/lib. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2010-06-20 14:20:06 - WARNING: /usr/bin/make returned exit code 1 TB --- 2010-06-20 14:20:06 - ERROR: failed to build world TB --- 2010-06-20 14:20:06 - 1038.17 user 237.18 system 1465.90 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-powerpc-powerpc.full From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 14:46:13 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDABA1065670; Sun, 20 Jun 2010 14:46:13 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 775A98FC18; Sun, 20 Jun 2010 14:46:13 +0000 (UTC) Received: by iwn7 with SMTP id 7so3305606iwn.13 for ; Sun, 20 Jun 2010 07:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=uuFrrXNXz0/vR6/rgJgwZSuOMqYfBU8dt3xZAmaVr2Q=; b=lcDicXNMLnsbYrD1z/XNAqbZNVRW5HHCTywZHel30mHFEXrkkwXviRq7ucvzN0/jzy soDA++LiPWUHTdZkdfdYZk/ki3hEUdyy+SmqUJCsGkFyxN5LMplpAT6sYh/xHXLqZBx1 1vm3hq3t2oUZ29F/Pijteo/RrMzJEMxuL6NNA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=xqSVJV+dxySSdOqSCccdH8JkJH5M8vZ4Gbu9natewtTI1H/OrnT7uAv0IejxaL2kFb LtqRb5a9FF9W8FGhEBADjKGsUTC3SWOmmJImTl2FgjLCdxCdtm0hpP2u0O/ySUOTOIdI SGrfwoqRuij8yVRWBgeNcLum3w3VGQc4aaA0o= MIME-Version: 1.0 Received: by 10.231.178.162 with SMTP id bm34mr3833857ibb.86.1277045172594; Sun, 20 Jun 2010 07:46:12 -0700 (PDT) Received: by 10.231.182.212 with HTTP; Sun, 20 Jun 2010 07:46:12 -0700 (PDT) In-Reply-To: <4C1DB296.5040605@FreeBSD.org> References: <4C0C1AE4.8050807@FreeBSD.org> <4C1DB296.5040605@FreeBSD.org> Date: Sun, 20 Jun 2010 09:46:12 -0500 Message-ID: From: Brandon Gooch To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD-Current , freebsd-arch@freebsd.org Subject: Re: RFC: New event timers infrastructure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 14:46:14 -0000 On Sun, Jun 20, 2010 at 1:17 AM, Alexander Motin wrote: > Brandon Gooch wrote: >> I've been testing these patches since the first iteration >> (et.20100606), and I haven't discovered any related issues. > > Thank you! > >> I am unclear about the number of interrupts I should expect from the >> hpet0 device (compared to the 99 from the rtc at 100Hz), so here is >> the output of vmstat -i with and without the "et" patches: >> >> With "et" patches: >> >> interrupt total rate >> irq1: atkbd0 369 3 >> irq9: acpi0 961 8 >> irq12: psm0 1002 9 >> irq18: uhci5 140 1 >> irq19: uhci2 ehci0* 4823 45 >> irq20: hpet0 23893 223 >> irq23: uhci3 ehci1 11 0 >> irq256: vgapci0 1031 9 >> irq257: hdac0 14 0 >> irq258: iwn0 4258 39 >> irq259: bge0 1 0 >> Total 36503 341 >> >> Without "et" patches: >> >> interrupt total rate >> irq1: atkbd0 449 2 >> irq0: clk 17334 99 >> irq9: acpi0 1701 9 >> irq12: psm0 8784 50 >> irq18: uhci5 188 1 >> irq19: uhci2 ehci0* 5828 33 >> irq23: uhci3 ehci1 11 0 >> irq256: vgapci0 1896 10 >> irq257: hdac0 14 0 >> irq258: iwn0 29571 169 >> irq259: bge0 1 0 >> Total 65777 378 >> >> And lastly, the values of the kern.eventtimer sysctls: >> >> $ sysctl kern.eventtimer >> kern.eventtimer.choice: HPET(450) HPET1(440) HPET2(440) HPET3(440) i8254(100) >> kern.eventtimer.timer2: HPET1 >> kern.eventtimer.timer1: HPET >> kern.eventtimer.singlemul: 4 > > I don't see there neither LAPIC, nor RTC timer. I suppose you have > disabled them via device hints. I also suppose you've done it to left > with only 100Hz IRQs of i8254 timer. Now, with the patch, these two are > still disabled, but system got 4 more HPET timers. As they have higher > precedence, two of them were taken (HPET and HPET1). Number if > interrupts can be explained by the line: > > Starting kernel event timers: HPET @ 100Hz, HPET1 @ 128Hz Yes, I had the LAPIC and RTC timers disabled via my /boot/loader.conf, as per your suggestions here: http://wiki.freebsd.org/TuningPowerConsumption > As result, you've got 228Hz IRQs (which then redistributed to every > CPU). As your HPET timer doesn't support FSB interrupts, all it's timers > share same IRQ vector, seen as "hpet0". Understood. > If you wish to get back to 100Hz IRQs as before, you may remove your > previous clock-disabling hints and add instead: > > kern.eventtimer.timer1=HPET > kern.eventtimer.timer2=NONE > kern.eventtimer.singlemul=1 In by /boot/loader.conf, I now have: # Power Saving kern.hz="100" #hint.apic.0.clock="0" #hint.atrtc.0.clock="0" hint.p4tcc.0.disabled="1" hint.p4tcc.1.disabled="1" hint.acpi_throttle.0.disabled="1" hint.acpi_throttle.1.disabled="1" hw.pci.do_power_nodriver="3" In /etc/sysctl.conf, I have as suggested: kern.eventtimer.timer1=HPET kern.eventtimer.timer2=NONE kern.eventtimer.singlemul=1 In my /etc/rc.conf, I'm still using: performance_cpu_freq="NONE" economy_cpu_freq="NONE" performance_cx_lowest="C3" economy_cx_lowest="C3" I'm running powerd: powerd_enable="YES" powerd_flags="-a adaptive -b adaptive -n adaptive" But in my dmesg, I see: # dmesg | grep Starting Starting kernel event timers: LAPIC @ 100Hz, HPET @ 128Hz Starting kernel event timers: LAPIC @ 400Hz, NONE @ 0Hz Starting kernel event timers: HPET @ 200Hz, NONE @ 0Hz So it seems as if the HPET doesn't honor kern.hz setting? Maybe I still need to explicitly disable the apic timers... Would you suggest using LAPIC as opposed to HPET? I have seen power savings being able to use C3 state, but if tickless kernel eventually buys those savings back, perhaps LAPIC would be better... > As result, you will have single timer, running at HZ rate. Instead of > HPET there you may choose any timer: > LAPIC - it is per-CPU, so saves on IPI interrupts, supports one-shot > mode and so suitable for further tickless kernel, but it doesn't work in > C3 state; So if LAPIC is disabled in C3 state, is there a possibility that the "on-the-fly" method of changing clocks could kick in when the CPU enters C3 state, switching to the HPET when it happens? > HPET{x} - on this hardware it can't be used as per-CPU, it supports > one-shot mode, but less suitable for further tickless kernel, as CPUs > can't run independently; Since the HPET supports running while in C3, is there a strategy that could be used to provide a tickless mode with both LAPIC and HPET being used dynamically and interchangebly? I feel as though the questions I'm trying to ask don't make much sense, my apologies :) > i8254 - somewhat faster, as it doesn't needs status reading, but due to > being also a timecounter it can't be used in one-shot mode; > RTC - somewhat slower, has limited set of supported frequencies (powers > of 2), only periodic mode. Anyway, here is a glimpse into the VM interrupts stats using current (stated) configuration: $ vmstat -i interrupt total rate irq1: atkbd0 3968 2 irq9: acpi0 11079 7 irq12: psm0 64878 45 irq18: uhci5 1131 0 irq19: uhci2 ehci0* 7149 5 irq20: hpet0 281935 197 irq23: uhci3 ehci1 11 0 cpu0:timer 4417 3 irq256: vgapci0 31240 21 irq257: hdac0 14 0 irq258: iwn0 39537 27 irq259: bge0 1 0 cpu1:timer 4269 2 Total 449629 315 -Brandon From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 15:16:04 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 353251065673; Sun, 20 Jun 2010 15:16:03 +0000 (UTC) (envelope-from nork@FreeBSD.org) Date: Mon, 21 Jun 2010 00:15:56 +0900 From: Norikatsu Shigemura To: Kristof Provost Message-Id: <20100621001556.7d6d39ce.nork@FreeBSD.org> In-Reply-To: <20100620130100.GB31846@nereid> References: <20100613233723.ed2c3a30.nork@FreeBSD.org> <20100613201331.GA19653@nereid> <20100620210351.e6aa387b.nork@FreeBSD.org> <20100620130100.GB31846@nereid> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; i386-portbld-freebsd8.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-arm@FreeBSD.org, freebsd-current@FreeBSD.org, nork@FreeBSD.org, yongari@FreeBSD.org Subject: Re: [OpenRD Ultimate] e1000phy(88E1149/88E1121) has a initialize issue X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 15:16:04 -0000 Hi Kristof. On Sun, 20 Jun 2010 15:01:00 +0200 Kristof Provost wrote: > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > /* Tell the MAC where to find the PHY so autoneg works */ > > - miisc = LIST_FIRST(&sc->mii->mii_phys); > > - MGE_WRITE(sc, MGE_REG_PHYDEV, miisc->mii_phy); > > + MGE_WRITE(sc, MGE_REG_PHYDEV, sc->phyaddr); > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > I think that's correct, but I haven't been able to test it on my board > yet. Does this work for you on a board with two GbE ports? If so I'll > try to get someone to commit it. Yes, good works well. I reported following: http://lists.freebsd.org/pipermail/freebsd-arm/2010-June/002402.html Thank you. -- Norikatsu Shigemura From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 15:47:44 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 480CA106566C; Sun, 20 Jun 2010 15:47:44 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9C3468FC12; Sun, 20 Jun 2010 15:47:43 +0000 (UTC) Received: by fxm7 with SMTP id 7so1833723fxm.13 for ; Sun, 20 Jun 2010 08:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=j8gugJJTHNUqrKjlX7/5E6lqQc0hBxwN1te/4sMU+ww=; b=JtZ+R7BoiZf84h4z/A5gV4CWv3KkEsW02/lfi2AMzsK0zOmBwjzyF2ooGrqqCXK+9h PPSJ+vbeCRBu/H9xfVTCJF4k7bhgIRdi00KVFh//A+tt/XOL5oljqNX9jdvQ7nKt0gpV QavKm6iaw9hCX/AxXQGISzsZnCBxfm2wLB/p8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=jSZdlzqds3K830EK8XtMyhG9synxQXUhMqT/ataRxIXv56BmOx9F9TaN+DDVhSDAYF v1ZmJ2gAKoMlYJ8OmOoGzpU+xPXhDuiD9GEvO5w/PBAPiUj9bhqbPgEQeQvvfXjX/D3V 9LvTG2yGELGxk2vYl53cgxthdwj7reKIVaBDk= Received: by 10.223.21.22 with SMTP id h22mr3893596fab.106.1277048862389; Sun, 20 Jun 2010 08:47:42 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id p21sm25180531fak.45.2010.06.20.08.47.41 (version=SSLv3 cipher=RC4-MD5); Sun, 20 Jun 2010 08:47:41 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1E381B.30405@FreeBSD.org> Date: Sun, 20 Jun 2010 18:47:39 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Brandon Gooch References: <4C0C1AE4.8050807@FreeBSD.org> <4C1DB296.5040605@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD-Current , freebsd-arch@freebsd.org Subject: Re: RFC: New event timers infrastructure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 15:47:44 -0000 Brandon Gooch wrote: > On Sun, Jun 20, 2010 at 1:17 AM, Alexander Motin wrote: > In by /boot/loader.conf, I now have: > > # Power Saving > kern.hz="100" > #hint.apic.0.clock="0" > #hint.atrtc.0.clock="0" > hint.p4tcc.0.disabled="1" > hint.p4tcc.1.disabled="1" > hint.acpi_throttle.0.disabled="1" > hint.acpi_throttle.1.disabled="1" > hw.pci.do_power_nodriver="3" > > In /etc/sysctl.conf, I have as suggested: > > kern.eventtimer.timer1=HPET > kern.eventtimer.timer2=NONE > kern.eventtimer.singlemul=1 While this can be done in sysctl.conf, it would be better to do it in loader.conf to make it applied from the beginning, without on-the-fly timers change. > But in my dmesg, I see: > > # dmesg | grep Starting > Starting kernel event timers: LAPIC @ 100Hz, HPET @ 128Hz > Starting kernel event timers: LAPIC @ 400Hz, NONE @ 0Hz > Starting kernel event timers: HPET @ 200Hz, NONE @ 0Hz This is result of changing timers during late boot by sysctl.conf. > So it seems as if the HPET doesn't honor kern.hz setting? Maybe I > still need to explicitly disable the apic timers... All timers now equally honor hz. But except hz, stathz also should be honored, which set once during startup. In your case, as second timer was initially present, system was free to choose stathz frequency, and it chosen 128Hz. When you later disabled second timer, system had to rise first timer frequency to emulate declared stathz. If you move timers selection options from sysctl.conf to loader.conf you will get what you want. > Would you suggest using LAPIC as opposed to HPET? I have seen power > savings being able to use C3 state, but if tickless kernel eventually > buys those savings back, perhaps LAPIC would be better... Tickless operation usually effective only together with C-states. It increases their effectiveness (or even applicability). The only case benefit from tickless operation without C3 - is a virtual machines. So if your LAPIC dies on C3 (it seems not to on Core i5 any more) you have no much other options then avoid it. HPET same time never have problems with C-states, as it located in chipset. But not every HPET is equally useful. Except AMD since at least SB700) and latest Intel chipsets, HPET uses regular IRQs, that are often shared with PCI devices and so hardly could be bound to CPU cores to provide separate events for every core. While tickless operation is still possible in that case, it is somewhat limited, as one core will have wake up every time when any other need event. Mentioned chipset's HPETs same time support FSB interrupts (alike to PCI MSI-X), that are never shared and so timers could be dedicated to CPU cores. >> As result, you will have single timer, running at HZ rate. Instead of >> HPET there you may choose any timer: >> LAPIC - it is per-CPU, so saves on IPI interrupts, supports one-shot >> mode and so suitable for further tickless kernel, but it doesn't work in >> C3 state; > > So if LAPIC is disabled in C3 state, is there a possibility that the > "on-the-fly" method of changing clocks could kick in when the CPU > enters C3 state, switching to the HPET when it happens? On-the-fly timers change is possible, as you have already tried with sysctl.conf. But the switch is not so easy because of LAPIC specifics, and it is meaningless to use LAPIC in that case. If you need to run C3 - turn LAPIC off. -- Alexander Motin From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 15:52:25 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C31FE106566B for ; Sun, 20 Jun 2010 15:52:25 +0000 (UTC) (envelope-from oizs@freemail.hu) Received: from fep12.mx.upcmail.net (fep12.mx.upcmail.net [62.179.121.32]) by mx1.freebsd.org (Postfix) with ESMTP id 074348FC0A for ; Sun, 20 Jun 2010 15:52:24 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep12-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100620155223.WCSF20209.viefep12-int.chello.at@edge04.upcmail.net> for ; Sun, 20 Jun 2010 17:52:23 +0200 Received: from [192.168.0.6] ([213.222.167.104]) by edge04.upcmail.net with edge id YFsL1e00x2FUr7104FsNfl; Sun, 20 Jun 2010 17:52:23 +0200 X-SourceIP: 213.222.167.104 Message-ID: <4C1E3932.50706@freemail.hu> Date: Sun, 20 Jun 2010 17:52:18 +0200 From: oizs User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <4C1AB4C0.4020604@freemail.hu> <4C1C88CD.3000506@stillbilde.net> <4C1C94D4.7040302@freemail.hu> <4C1CB76D.8020301@stillbilde.net> In-Reply-To: <4C1CB76D.8020301@stillbilde.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=K3uBg944YaUT+Qsu6bWO0a0V3uPy4DQNslbdoMCD4tw= c=1 sm=0 a=q8OS1GolVHwA:10 a=8nJEP1OIZ-IA:10 a=VeSHaWwbAAAA:8 a=fHl8mHwWxlonfIcnkH0A:9 a=WjAj2Vf5T1wZp-86gB0o1XQQf_wA:4 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 15:52:25 -0000 Could you tell me exactly how did you configure your raid? I mean wb/read-ahead/blocksize/stripe etc. Much appreciated. -zsozso On 2010.06.19. 14:26, Svein Skogen (Listmail Account) wrote: > On 19.06.2010 11:58, oizs wrote: > >> I tried almost everything raid 0 1 5 10 with all kind of stripes >> 32/64/128 and settings direct io/cached/read-ahead/wt/wb/disk-cache but >> nothing seems to work. >> I changed the card to another dell perc 5 which had an older firmware. >> Tried 4 kind of motherboards even tried changing the os to linux and >> windows xp/7. In windows I got some funny results 1.3MB/s with >> write-back and 150MB/s reads with 5 disks in raid0. >> I just wanted to have a hw raid with no problems since the motherboard >> 88sx7042 and bsd did not like eachother. >> > This is from a similar controller running that 8-disk raid5+0 setup: > > -------------------------------------------------- > CrystalDiskMark 2.2 (C) 2007-2008 hiyohiyo > Crystal Dew World : http://crystalmark.info/ > -------------------------------------------------- > > Sequential Read : 665.383 MB/s > Sequential Write : 300.452 MB/s > Random Read 512KB : 616.604 MB/s > Random Write 512KB : 306.306 MB/s > Random Read 4KB : 64.465 MB/s > Random Write 4KB : 7.646 MB/s > > Test Size : 100 MB > Date : 2010/06/19 14:24:12 > > You should be looking at number about half of these. I ran the test with > adaptive readahead enabled, and write-through for cache (since I run > with BBU, I normally use write-back) > > //Svein > > From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 16:51:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2392E106564A for ; Sun, 20 Jun 2010 16:51:52 +0000 (UTC) (envelope-from oizs@freemail.hu) Received: from fep14.mx.upcmail.net (fep14.mx.upcmail.net [62.179.121.34]) by mx1.freebsd.org (Postfix) with ESMTP id 746738FC24 for ; Sun, 20 Jun 2010 16:51:51 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep14-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100620165149.IUZU8381.viefep14-int.chello.at@edge03.upcmail.net> for ; Sun, 20 Jun 2010 18:51:49 +0200 Received: from [192.168.0.6] ([213.222.167.104]) by edge03.upcmail.net with edge id YGrn1e05p2FUr7103GroZK; Sun, 20 Jun 2010 18:51:49 +0200 X-SourceIP: 213.222.167.104 Message-ID: <4C1E4722.3050506@freemail.hu> Date: Sun, 20 Jun 2010 18:51:46 +0200 From: oizs User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <4C1AB4C0.4020604@freemail.hu> <4C1B3792.9000007@freemail.hu> <4C1C0ED9.8090103@freemail.hu> <2F904ED8-BC95-459F-8536-A889ADDA8D31@samsco.org> In-Reply-To: <2F904ED8-BC95-459F-8536-A889ADDA8D31@samsco.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=tsaDvxd5BMYuajhtvJLL+Ppe47iaIgCGP4JcOtoQkcg= c=1 sm=0 a=q8OS1GolVHwA:10 a=8nJEP1OIZ-IA:10 a=cgCS_vDn7Ns6TWvZus8A:9 a=S3DFIPqOtPaDzk4tWSMA:7 a=2Fuk72fgQYclTX9QtUyakTVUea8A:4 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 16:51:52 -0000 I've tried almost everything now. The battery is probably fine: mfiutil show battery mfi0: Battery State: Manufacture Date: 7/25/2009 Serial Number: 3716 Manufacturer: SMP-PA1.9 Model: DLFR463 Chemistry: LION Design Capacity: 1800 mAh Design Voltage: 3700 mV Current Charge: 99% My results: Settings: Raid5: Stripe: 64k mfiutil cache 0 mfi0 volume mfid0 cache settings: I/O caching: writes write caching: write-back read ahead: none drive write cache: default Raid0: Stripe: 64k mfiutil cache 0 mfi0 volume mfid0 cache settings: I/O caching: writes write caching: write-back read ahead: none drive write cache: default Tried to play around with this as well, with almost no difference. Raid5 read: dd if=/dev/mfid0 of=/dev/null bs=10M 1143+0 records in 1143+0 records out 11985223680 bytes transferred in 139.104134 secs (86160083 bytes/sec) write: dd if=/dev/random of=/dev/mfid0 bs=64K 22747+0 records in 22747+0 records out 1490747392 bytes transferred in 23.921103 secs (62319342 bytes/sec) Raid0 read: dd if=/dev/mfid0 of=/dev/null bs=64K 92470+0 records in 92470+0 records out 6060113920 bytes transferred in 47.926007 secs (126447294 bytes/sec) write: dd if=/dev/random of=/dev/mfid0 bs=64K 16441+0 records in 16441+0 records out 1077477376 bytes transferred in 17.232486 secs (62525939 bytes/sec) I'm writing directly to the device so im not sure any slice issues could cause the problems. -zsozso On 2010.06.20. 4:53, Scott Long wrote: > Two big things can affect RAID-5 performance: > > 1. Battery backup. If you don't have a working battery attached to the card, it will turn off the write-back cache, no matter what you do. Check this. If you're unsure, use the mfiutil tool that I added to FreeBSD a few months ago and send me the output. > > 2. Partition alignment. If you're using classic MBR slices, everything gets misaligned by 63 sectors, making it impossible for the controller to optimize both reads and writes. If the array is used for secondary storage, simply don't use an MBR scheme. If it's used for primary storage, try using GPT instead and setting up your partitions so that they are aligned to large power-of-2 boundaries. > > Scott > > On Jun 18, 2010, at 6:27 PM, oizs wrote > From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 18:31:23 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DDE31065679 for ; Sun, 20 Jun 2010 18:31:23 +0000 (UTC) (envelope-from prvs=178778d95a=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id C71338FC17 for ; Sun, 20 Jun 2010 18:31:22 +0000 (UTC) X-MDAV-Processed: mail1.multiplay.co.uk, Sun, 20 Jun 2010 19:20:20 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Sun, 20 Jun 2010 19:20:17 +0100 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail1.multiplay.co.uk X-Spam-Level: X-Spam-Status: No, score=-5.0 required=6.0 tests=USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.2.5 Received: from r2d2 by mail1.multiplay.co.uk (MDaemon PRO v10.0.4) with ESMTP id md50010618723.msg for ; Sun, 20 Jun 2010 19:20:16 +0100 X-Authenticated-Sender: Killing@multiplay.co.uk X-MDRemoteIP: 188.220.16.48 X-Return-Path: prvs=178778d95a=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-current@freebsd.org Message-ID: <0B4F09B43AE84F24954E3B940FA0ECBB@multiplay.co.uk> From: "Steven Hartland" To: "Scott Long" , "oizs" References: <4C1AB4C0.4020604@freemail.hu> <4C1B3792.9000007@freemail.hu><4C1C0ED9.8090103@freemail.hu> <2F904ED8-BC95-459F-8536-A889ADDA8D31@samsco.org> Date: Sun, 20 Jun 2010 19:20:16 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Cc: freebsd-current@freebsd.org Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 18:31:23 -0000 Does anyone know of a nice how to guide for achieving this? ----- Original Message ----- From: "Scott Long" 2. Partition alignment. If you're using classic MBR slices, everything gets misaligned by 63 sectors, making it impossible for the controller to optimize both reads and writes. If the array is used for secondary storage, simply don't use an MBR scheme. If it's used for primary storage, try using GPT instead and setting up your partitions so that they are aligned to large power-of-2 boundaries. ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 18:36:53 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B68E21065670 for ; Sun, 20 Jun 2010 18:36:53 +0000 (UTC) (envelope-from james-freebsd-current@jrv.org) Received: from zimbra.jrv.org (adsl-70-243-84-11.dsl.austtx.swbell.net [70.243.84.11]) by mx1.freebsd.org (Postfix) with ESMTP id 74D308FC12 for ; Sun, 20 Jun 2010 18:36:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.jrv.org (Postfix) with ESMTP id A702916A0AC for ; Sun, 20 Jun 2010 13:36:52 -0500 (CDT) X-Virus-Scanned: amavisd-new at zimbra.housenet.jrv Received: from zimbra.jrv.org ([127.0.0.1]) by localhost (zimbra.housenet.jrv [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G5AFqp+ai1Mx for ; Sun, 20 Jun 2010 13:36:51 -0500 (CDT) Received: from [10.0.2.15] (adsl-70-243-84-14.dsl.austtx.swbell.net [70.243.84.14]) by zimbra.jrv.org (Postfix) with ESMTPSA id AD75716A050 for ; Sun, 20 Jun 2010 13:36:51 -0500 (CDT) Message-ID: <4C1E5FE3.7010907@jrv.org> Date: Sun, 20 Jun 2010 13:37:23 -0500 From: "James R. Van Artsdalen" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: page fault with the following non-sleepable locks held: exclusive sleep mutex ATA state lock X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 18:36:53 -0000 FreeBSD 9.0-CURRENT #1 r209275: Fri Jun 18 08:15:15 CDT 2010 root@CLANK.housenet.jrv:/usr/obj/usr/src/sys/GENERIC amd64 June 17 -CURRENT This panic was seen under VirtualBox on a Windows host. The VM has 2 cores (the host is a Core i7). I this infrequently under a VM. I have yet to see it on real hardware. ... ahcich0: AHCI reset... ahcich0: SATA connect time=0ms status=00000123 ahcich0: ready wait time=0ms ahcich0: AHCI reset done: device found (aprobe0:ahcich0:0:0:0): SIGNATURE: 0000 ugen0.1: at usbus0 uhub0: on usbus0 ugen1.1: at usbus1 uhub1: on usbus1 ahcich1: AHCI reset... Kernel page fault with the following non-sleepable locks held: exclusive sleep mutex ATA state lock (ATA state lock) r = 0 (0xffffff0002a922c0) locked @ /usr/src/sys/dev/ata/ata-all.c:503 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2a _witness_debugger() at _witness_debugger+0x2e witness_warn() at witness_warn+0x2d2 trap() at trap+0x2ee calltrap() at calltrap+0x8 --- trap 0xc, rip = 0xffffffff805d8ef1, rsp = 0xffffff80000f6b30, rbp = 0xffffff80000f6b70 --- device_get_softc() at device_get_softc+0x1 ata_interrupt() at ata_interrupt+0x9d intr_event_execute_handlers() at intr_event_execute_handlers+0x66 ithread_loop() at ithread_loop+0xb2 fork_exit() at fork_exit+0x12a fork_trampoline() at fork_trampoline+0xe --- trap 0, rip = 0, rsp = 0xffffff80000f6d30, rbp = 0 --- Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x80 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff805d8ef1 stack pointer = 0x28:0xffffff80000f6b30 frame pointer = 0x28:0xffffff80000f6b70 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (irq15: ata1) [ thread pid 12 tid 100025 ] Stopped at device_get_softc+0x1: movq 0x80(%rdi),%rax db> From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 18:50:07 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 878BE1065673 for ; Sun, 20 Jun 2010 18:50:07 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 23E438FC0C for ; Sun, 20 Jun 2010 18:50:06 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5KIo38Z011469; Sun, 20 Jun 2010 12:50:03 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long X-Priority: 3 In-Reply-To: <0B4F09B43AE84F24954E3B940FA0ECBB@multiplay.co.uk> Date: Sun, 20 Jun 2010 12:50:03 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <4C1AB4C0.4020604@freemail.hu> <4C1B3792.9000007@freemail.hu><4C1C0ED9.8090103@freemail.hu> <2F904ED8-BC95-459F-8536-A889ADDA8D31@samsco.org> <0B4F09B43AE84F24954E3B940FA0ECBB@multiplay.co.uk> To: "Steven Hartland" X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: oizs , freebsd-current@freebsd.org Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 18:50:07 -0000 I just set up a machine with the following GPT scheme: =3D> 34 5853511613 mfid0 GPT (2.7T) 34 128 1 freebsd-boot (64K) 162 862 - free - (431K) 1024 2097152 2 freebsd-ufs (1.0G) 2098176 4194304 3 freebsd-swap (2.0G) 6292480 2097152 4 freebsd-ufs (1.0G) 8389632 104857600 5 freebsd-ufs (50G) 113247232 5740264414 6 freebsd-ufs (2.7T) 5853511646 1 - free - (512B) After the first partition, I created a deliberate gap for alignment, = reflected in the second line. The third line shows a starting offset of = sector 1024, which is 512KB. This should be a good generic start point = for most RAID geometries with a stripe size <=3D 512KB. The rest are = normal /, swap, /var, /usr and /opt partitions. The single free sector = on the final line is probably a calculation error on my part, there's no = particular reason for it. The gpart man page has good descriptions on how to create partitions and = make the GPT scheme bootable. It's not very automated, you'll need to = have a calculator handy, but it works. Scott On Jun 20, 2010, at 12:20 PM, Steven Hartland wrote: > Does anyone know of a nice how to guide for achieving this? >=20 > ----- Original Message ----- From: "Scott Long" > 2. Partition alignment. If you're using classic MBR slices, = everything gets misaligned by 63 sectors, making it impossible for the = controller to optimize both reads and writes. If the array is used for = secondary storage, simply don't use an MBR scheme. If it's used for = primary storage, try using GPT instead and setting up your partitions so = that they are aligned to large power-of-2 boundaries. >=20 >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > This e.mail is private and confidential between Multiplay (UK) Ltd. = and the person or entity to whom it is addressed. In the event of = misdirection, the recipient is prohibited from using, copying, printing = or otherwise disseminating it or any information contained in it.=20 > In the event of misdirection, illegible or incomplete transmission = please telephone +44 845 868 1337 > or return the E.mail to postmaster@multiplay.co.uk. >=20 From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 19:15:25 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C7CE106564A for ; Sun, 20 Jun 2010 19:15:25 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 296378FC0C for ; Sun, 20 Jun 2010 19:15:24 +0000 (UTC) Received: by vws1 with SMTP id 1so4097vws.13 for ; Sun, 20 Jun 2010 12:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=9joCsnP20sl53caQlHUOIaizA+QM7SVVu6A0e146so4=; b=qsPCS0RfJ/7mYS3nFS3qdK5/xK0ZKqzquqXiACpBFlq007qaJPhPHph2t2X1vNwQWk rAsk3r93q6RDb/C9aRcsVNaiHuwpMs0dcxTBwcgSbKyAfbdFLau+L14XAjqrShRGaK2V 9gwvmE8zGKsyTC8gzXmHPMdWV2S38f/dkI8lE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=abjaCDQ+bVpYW12odrVOFfnPnBuAUMf3HQqx+HekqmBq4ilD9ooekcmRvskrKPMf4H 0ZGgn3kKskBrIwpL/QumIMOvNvYpqDP+a+Ng83ZNhFPCxeWklT2uATL8au0mZOBmq2S4 zK0CXBUQzAH8k0apd6T4ywWw0Q5x0sePp6xbY= MIME-Version: 1.0 Received: by 10.220.63.208 with SMTP id c16mr1461403vci.153.1277060965794; Sun, 20 Jun 2010 12:09:25 -0700 (PDT) Sender: artemb@gmail.com Received: by 10.220.192.2 with HTTP; Sun, 20 Jun 2010 12:09:25 -0700 (PDT) In-Reply-To: <4C1E4722.3050506@freemail.hu> References: <4C1AB4C0.4020604@freemail.hu> <4C1B3792.9000007@freemail.hu> <4C1C0ED9.8090103@freemail.hu> <2F904ED8-BC95-459F-8536-A889ADDA8D31@samsco.org> <4C1E4722.3050506@freemail.hu> Date: Sun, 20 Jun 2010 12:09:25 -0700 X-Google-Sender-Auth: rOJCuA0VS-CNFjbj6KvB4p-C77A Message-ID: From: Artem Belevich To: oizs Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 19:15:25 -0000 /dev/random and /dev/urandom are relatively slow and are not suitable as the source of data for testing modern hard drives' sequential throughput. On my 3GHz dual-core amd63 box both /dev/random and /dev/urandom max out at ~80MB/s while consuming 100% CPU time on one of the processor cores. That would not be enough to saturate single disk with sequential writes. --Artem On Sun, Jun 20, 2010 at 9:51 AM, oizs wrote: > I've tried almost everything now. > The battery is probably fine: > mfiutil show battery > mfi0: Battery State: > =A0Manufacture Date: 7/25/2009 > =A0 =A0Serial Number: 3716 > =A0 =A0 Manufacturer: SMP-PA1.9 > =A0 =A0 =A0 =A0 =A0 =A0Model: DLFR463 > =A0 =A0 =A0 =A0Chemistry: LION > =A0Design Capacity: 1800 mAh > =A0 Design Voltage: 3700 mV > =A0 Current Charge: 99% > > My results: > Settings: > Raid5: > Stripe: 64k > mfiutil cache 0 > mfi0 volume mfid0 cache settings: > =A0 =A0 =A0I/O caching: writes > =A0 =A0write caching: write-back > =A0 =A0 =A0 read ahead: none > drive write cache: default > Raid0: > Stripe: 64k > mfiutil cache 0 > mfi0 volume mfid0 cache settings: > =A0 =A0 =A0I/O caching: writes > =A0 =A0write caching: write-back > =A0 =A0 =A0 read ahead: none > drive write cache: default > > Tried to play around with this as well, with almost no difference. > > Raid5 > read: > dd if=3D/dev/mfid0 of=3D/dev/null bs=3D10M > 1143+0 records in > 1143+0 records out > 11985223680 bytes transferred in 139.104134 secs (86160083 bytes/sec) > write: > dd if=3D/dev/random of=3D/dev/mfid0 bs=3D64K > 22747+0 records in > 22747+0 records out > 1490747392 bytes transferred in 23.921103 secs (62319342 bytes/sec) > > Raid0 > read: > dd if=3D/dev/mfid0 of=3D/dev/null bs=3D64K > 92470+0 records in > 92470+0 records out > 6060113920 bytes transferred in 47.926007 secs (126447294 bytes/sec) > write: > dd if=3D/dev/random of=3D/dev/mfid0 bs=3D64K > 16441+0 records in > 16441+0 records out > 1077477376 bytes transferred in 17.232486 secs (62525939 bytes/sec) > > I'm writing directly to the device so im not sure any slice issues could > cause the problems. > > -zsozso > On 2010.06.20. 4:53, Scott Long wrote: >> >> Two big things =A0can affect RAID-5 performance: >> >> 1. Battery backup. =A0If you don't have a working battery attached to th= e >> card, it will turn off the write-back cache, no matter what you do. =A0C= heck >> this. =A0If you're unsure, use the mfiutil tool that I added to FreeBSD = a few >> months ago and send me the output. >> >> 2. Partition alignment. =A0If you're using classic MBR slices, everythin= g >> gets misaligned by 63 sectors, making it impossible for the controller t= o >> optimize both reads and writes. =A0If the array is used for secondary st= orage, >> simply don't use an MBR scheme. =A0If it's used for primary storage, try= using >> GPT instead and setting up your partitions so that they are aligned to l= arge >> power-of-2 boundaries. >> >> Scott >> >> On Jun 18, 2010, at 6:27 PM, oizs wrote >> > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org= " > From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 19:27:48 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F0D81065670 for ; Sun, 20 Jun 2010 19:27:48 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 2AAEE8FC14 for ; Sun, 20 Jun 2010 19:27:47 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o5KJRhaf011687; Sun, 20 Jun 2010 13:27:43 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: Date: Sun, 20 Jun 2010 13:27:43 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <63849665-E1D3-417F-B6BD-5601E5361315@samsco.org> References: <4C1AB4C0.4020604@freemail.hu> <4C1B3792.9000007@freemail.hu> <4C1C0ED9.8090103@freemail.hu> <2F904ED8-BC95-459F-8536-A889ADDA8D31@samsco.org> <4C1E4722.3050506@freemail.hu> To: Artem Belevich X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: oizs , freebsd-current@freebsd.org Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 19:27:48 -0000 Yeah, there's no value in using the /dev/random devices for testing disk = i/o. Use /dev/zero instead. I've known of hardware RAID engines in the = past that can recognize certain repeating i/o benchmark patterns and = optimize for them, but I have no idea if LSI controllers do this, tho = based on your results it's probably safe to say that they don't. Scott On Jun 20, 2010, at 1:09 PM, Artem Belevich wrote: > /dev/random and /dev/urandom are relatively slow and are not suitable > as the source of data for testing modern hard drives' sequential > throughput. >=20 > On my 3GHz dual-core amd63 box both /dev/random and /dev/urandom max > out at ~80MB/s while consuming 100% CPU time on one of the processor > cores. > That would not be enough to saturate single disk with sequential = writes. >=20 > --Artem >=20 >=20 >=20 > On Sun, Jun 20, 2010 at 9:51 AM, oizs wrote: >> I've tried almost everything now. >> The battery is probably fine: >> mfiutil show battery >> mfi0: Battery State: >> Manufacture Date: 7/25/2009 >> Serial Number: 3716 >> Manufacturer: SMP-PA1.9 >> Model: DLFR463 >> Chemistry: LION >> Design Capacity: 1800 mAh >> Design Voltage: 3700 mV >> Current Charge: 99% >>=20 >> My results: >> Settings: >> Raid5: >> Stripe: 64k >> mfiutil cache 0 >> mfi0 volume mfid0 cache settings: >> I/O caching: writes >> write caching: write-back >> read ahead: none >> drive write cache: default >> Raid0: >> Stripe: 64k >> mfiutil cache 0 >> mfi0 volume mfid0 cache settings: >> I/O caching: writes >> write caching: write-back >> read ahead: none >> drive write cache: default >>=20 >> Tried to play around with this as well, with almost no difference. >>=20 >> Raid5 >> read: >> dd if=3D/dev/mfid0 of=3D/dev/null bs=3D10M >> 1143+0 records in >> 1143+0 records out >> 11985223680 bytes transferred in 139.104134 secs (86160083 bytes/sec) >> write: >> dd if=3D/dev/random of=3D/dev/mfid0 bs=3D64K >> 22747+0 records in >> 22747+0 records out >> 1490747392 bytes transferred in 23.921103 secs (62319342 bytes/sec) >>=20 >> Raid0 >> read: >> dd if=3D/dev/mfid0 of=3D/dev/null bs=3D64K >> 92470+0 records in >> 92470+0 records out >> 6060113920 bytes transferred in 47.926007 secs (126447294 bytes/sec) >> write: >> dd if=3D/dev/random of=3D/dev/mfid0 bs=3D64K >> 16441+0 records in >> 16441+0 records out >> 1077477376 bytes transferred in 17.232486 secs (62525939 bytes/sec) >>=20 >> I'm writing directly to the device so im not sure any slice issues = could >> cause the problems. >>=20 >> -zsozso >> On 2010.06.20. 4:53, Scott Long wrote: >>>=20 >>> Two big things can affect RAID-5 performance: >>>=20 >>> 1. Battery backup. If you don't have a working battery attached to = the >>> card, it will turn off the write-back cache, no matter what you do. = Check >>> this. If you're unsure, use the mfiutil tool that I added to = FreeBSD a few >>> months ago and send me the output. >>>=20 >>> 2. Partition alignment. If you're using classic MBR slices, = everything >>> gets misaligned by 63 sectors, making it impossible for the = controller to >>> optimize both reads and writes. If the array is used for secondary = storage, >>> simply don't use an MBR scheme. If it's used for primary storage, = try using >>> GPT instead and setting up your partitions so that they are aligned = to large >>> power-of-2 boundaries. >>>=20 >>> Scott >>>=20 >>> On Jun 18, 2010, at 6:27 PM, oizs wrote >>>=20 >>=20 >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org" >>=20 > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org" From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 19:35:49 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2275D1065670; Sun, 20 Jun 2010 19:35:49 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.31.31]) by mx1.freebsd.org (Postfix) with ESMTP id CD6988FC0A; Sun, 20 Jun 2010 19:35:48 +0000 (UTC) Received: from [87.79.248.113] (helo=r500.local) by smtprelay04.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1OQQJ1-0005I5-4l; Sun, 20 Jun 2010 21:35:47 +0200 Date: Sun, 20 Jun 2010 21:36:01 +0200 From: Fabian Keil To: Lawrence Stewart Message-ID: <20100620213601.050fcf3e@r500.local> In-Reply-To: <20100620161242.59381341@r500.local> References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> <4C1E0E14.3090506@freebsd.org> <20100620151554.58e486db@r500.local> <20100620161242.59381341@r500.local> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/NBs9bc/dOLoAR_p6_xGyyY9"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 19:35:49 -0000 --Sig_/NBs9bc/dOLoAR_p6_xGyyY9 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Fabian Keil wrote: > Fabian Keil wrote: > > My custom kernel normally doesn't have INVARIANTS and WITNESS > > enabled, so I'll try to enable them next. >=20 > The culprit seem to be non-default KTR settings in the kernel > while loading alq as a module. Actually whether or not alq is loaded as a module doesn't seem to matter, with: options KTR options KTR_ENTRIES=3D262144 options KTR_COMPILE=3D(KTR_SCHED) options KTR_MASK=3D(KTR_SCHED) options KTR_CPUMASK=3D0x3 options ALQ options KTR_ALQ enabling siftr panics the system, too. Fabian --Sig_/NBs9bc/dOLoAR_p6_xGyyY9 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwebaYACgkQBYqIVf93VJ1pZwCgv0bgazwNvVXo/wg/p6lcZZhP CmUAnA+5B217K/6Lp7W3tmw9yvCQgpKG =cohu -----END PGP SIGNATURE----- --Sig_/NBs9bc/dOLoAR_p6_xGyyY9-- From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 19:39:16 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 858831065674 for ; Sun, 20 Jun 2010 19:39:16 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [204.109.60.94]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB738FC15 for ; Sun, 20 Jun 2010 19:39:16 +0000 (UTC) Received: from core.draftnet (87-194-158-129.bethere.co.uk [87.194.158.129]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 66B545D19 for ; Sun, 20 Jun 2010 19:39:14 +0000 (UTC) From: Bruce Cran To: freebsd-current@freebsd.org Date: Sun, 20 Jun 2010 20:38:37 +0100 User-Agent: KMail/1.13.3 (FreeBSD/9.0-CURRENT; KDE/4.4.4; amd64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201006202038.37579.bruce@cran.org.uk> Subject: Bug in debug.ncores sysctl code X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 19:39:16 -0000 I noticed on my i386 router running 9-CURRENT that the "debug.ncores" sysctl appears to get its value from some kernel memory that gets updated frequently: debug.ncores: -936629388 On line 2967 of sys/kern/kern_sig.c should the value of num_cores instead of ncores be getting returned? -- Bruce Cran From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 20:35:57 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AC951065675 for ; Sun, 20 Jun 2010 20:35:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id AC00A8FC0A for ; Sun, 20 Jun 2010 20:35:56 +0000 (UTC) Received: (qmail 19642 invoked by uid 399); 20 Jun 2010 20:35:53 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 20 Jun 2010 20:35:53 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C1E7B89.1030005@FreeBSD.org> Date: Sun, 20 Jun 2010 13:35:21 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Alexander Motin References: <4C0C1AE4.8050807@FreeBSD.org> <4C1DB296.5040605@FreeBSD.org> <4C1E381B.30405@FreeBSD.org> In-Reply-To: <4C1E381B.30405@FreeBSD.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Brandon Gooch , FreeBSD-Current , freebsd-arch@freebsd.org Subject: Re: RFC: New event timers infrastructure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 20:35:57 -0000 On 06/20/10 08:47, Alexander Motin wrote: > While this can be done in sysctl.conf, it would be better to do it in > loader.conf to make it applied from the beginning, without on-the-fly > timers change. You're probably right that for something this fundamental it's better to do it in loader.conf, however I wanted to mention that I recently changed the rcorder for the "early" boot scripts to run sysctl first for very similar reasons. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 19:44:09 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20B371065670 for ; Sun, 20 Jun 2010 19:44:09 +0000 (UTC) (envelope-from rpaulo@lavabit.com) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id AA54E8FC13 for ; Sun, 20 Jun 2010 19:44:08 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id 3C8A416F5C6; Sun, 20 Jun 2010 14:44:07 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id L6HIH7LCNWPC; Sun, 20 Jun 2010 14:44:07 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=r9BEH3OOrTwXQKMFGHX8K7I8kAYUWQCC0tilFOSUBVr0V/KM3CmiVn25hT4hwwRTYJUuuJqBitS89zy4mTct4i927DcT45oMlgV2awlNC0LFgQ4Csq90fOvBfDDwnjS6miHvEzfVSvO1nTG+NbICI4SrhS8xSAD370rqpoywKS8=; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <20100620213601.050fcf3e@r500.local> Date: Sun, 20 Jun 2010 20:44:03 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <6CE5B32B-2C82-436D-82E3-489D2D22C7EA@lavabit.com> References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> <4C1E0E14.3090506@freebsd.org> <20100620151554.58e486db@r500.local> <20100620161242.59381341@r500.local> <20100620213601.050fcf3e@r500.local> To: Fabian Keil X-Mailer: Apple Mail (2.1081) X-Mailman-Approved-At: Sun, 20 Jun 2010 20:37:56 +0000 Cc: Lawrence Stewart , freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 19:44:09 -0000 On 20 Jun 2010, at 20:36, Fabian Keil wrote: > Fabian Keil wrote: >=20 >> Fabian Keil wrote: >=20 >>> My custom kernel normally doesn't have INVARIANTS and WITNESS >>> enabled, so I'll try to enable them next. >>=20 >> The culprit seem to be non-default KTR settings in the kernel >> while loading alq as a module. >=20 > Actually whether or not alq is loaded as a module doesn't > seem to matter, with: >=20 > options KTR > options KTR_ENTRIES=3D262144 > options KTR_COMPILE=3D(KTR_SCHED) > options KTR_MASK=3D(KTR_SCHED) > options KTR_CPUMASK=3D0x3 > options ALQ > options KTR_ALQ >=20 > enabling siftr panics the system, too. That's probably because your module was built with different compile = time options than the ones used in the kernel. These options may change = structure sizes, function parameters, etc. and that easily causes = panics. Regards, -- Rui Paulo From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 20:49:15 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE00B106564A for ; Sun, 20 Jun 2010 20:49:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3DEA38FC22 for ; Sun, 20 Jun 2010 20:49:14 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5KKmqrZ050582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Jun 2010 23:48:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5KKmqph090015; Sun, 20 Jun 2010 23:48:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5KKmp8h090014; Sun, 20 Jun 2010 23:48:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 20 Jun 2010 23:48:51 +0300 From: Kostik Belousov To: Bruce Cran Message-ID: <20100620204851.GA13238@deviant.kiev.zoral.com.ua> References: <201006202038.37579.bruce@cran.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EyIqDK7+GVCmgGrt" Content-Disposition: inline In-Reply-To: <201006202038.37579.bruce@cran.org.uk> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-current@freebsd.org Subject: Re: Bug in debug.ncores sysctl code X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 20:49:15 -0000 --EyIqDK7+GVCmgGrt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 20, 2010 at 08:38:37PM +0100, Bruce Cran wrote: > I noticed on my i386 router running 9-CURRENT that the "debug.ncores" sys= ctl=20 > appears to get its value from some kernel memory that gets updated freque= ntly: >=20 > debug.ncores: -936629388 >=20 > On line 2967 of sys/kern/kern_sig.c should the value of num_cores instead= of=20 > ncores be getting returned? "ncores" at the line 2967 is only the name of mib. The following patch should fix it. diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index d52cedb..63fe81e 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2953,7 +2953,8 @@ sysctl_debug_num_cores_check (SYSCTL_HANDLER_ARGS) { int error; int new_val; -=09 + + new_val =3D num_cores; error =3D sysctl_handle_int(oidp, &new_val, 0, req); if (error !=3D 0 || req->newptr =3D=3D NULL) return (error); --EyIqDK7+GVCmgGrt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwefrMACgkQC3+MBN1Mb4ipigCfSjrr9FPyXbU2EF/LGrojF+EQ ZPYAnRqV6GLgXWeE95OYj0/8L2ipfmFd =ga4a -----END PGP SIGNATURE----- --EyIqDK7+GVCmgGrt-- From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 20:59:05 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EC7E1065676 for ; Sun, 20 Jun 2010 20:59:05 +0000 (UTC) (envelope-from lists@mawer.org) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id C07998FC13 for ; Sun, 20 Jun 2010 20:59:04 +0000 (UTC) Received: by vws1 with SMTP id 1so66944vws.13 for ; Sun, 20 Jun 2010 13:59:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.80.68 with SMTP id s4mr1452810vck.190.1277067543503; Sun, 20 Jun 2010 13:59:03 -0700 (PDT) Received: by 10.220.194.5 with HTTP; Sun, 20 Jun 2010 13:59:03 -0700 (PDT) In-Reply-To: References: <4C1AB4C0.4020604@freemail.hu> <4C1B3792.9000007@freemail.hu> <4C1C0ED9.8090103@freemail.hu> <2F904ED8-BC95-459F-8536-A889ADDA8D31@samsco.org> <0B4F09B43AE84F24954E3B940FA0ECBB@multiplay.co.uk> Date: Mon, 21 Jun 2010 06:59:03 +1000 Message-ID: From: Antony Mawer To: Scott Long Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: oizs , Steven Hartland , freebsd-current@freebsd.org Subject: Re: Dell Perc 5/i Performance issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 20:59:05 -0000 On Mon, Jun 21, 2010 at 4:50 AM, Scott Long wrote: > I just set up a machine with the following GPT scheme: > > =3D> =A0 =A0 =A0 =A034 =A05853511613 =A0mfid0 =A0GPT =A0(2.7T) > =A0 =A0 =A0 =A0 =A034 =A0 =A0 =A0 =A0 128 =A0 =A0 =A01 =A0freebsd-boot = =A0(64K) > =A0 =A0 =A0 =A0 162 =A0 =A0 =A0 =A0 862 =A0 =A0 =A0 =A0 - free - =A0(431K= ) > =A0 =A0 =A0 =A01024 =A0 =A0 2097152 =A0 =A0 =A02 =A0freebsd-ufs =A0(1.0G) > =A0 =A0 2098176 =A0 =A0 4194304 =A0 =A0 =A03 =A0freebsd-swap =A0(2.0G) > =A0 =A0 6292480 =A0 =A0 2097152 =A0 =A0 =A04 =A0freebsd-ufs =A0(1.0G) > =A0 =A0 8389632 =A0 104857600 =A0 =A0 =A05 =A0freebsd-ufs =A0(50G) > =A0 113247232 =A05740264414 =A0 =A0 =A06 =A0freebsd-ufs =A0(2.7T) > =A05853511646 =A0 =A0 =A0 =A0 =A0 1 =A0 =A0 =A0 =A0 - free - =A0(512B) > > After the first partition, I created a deliberate gap for alignment, refl= ected in the second line. =A0The third line shows a starting offset of sect= or 1024, which is 512KB. =A0This should be a good generic start point for m= ost RAID geometries with a stripe size <=3D 512KB. =A0The rest are normal /= , swap, /var, /usr and /opt partitions. =A0The single free sector on the fi= nal line is probably a calculation error on my part, there's no particular = reason for it. > > The gpart man page has good descriptions on how to create partitions and = make the GPT scheme bootable. =A0It's not very automated, you'll need to ha= ve a calculator handy, but it works. I scripted this as part of our custom installer - it uses the same 1MB offset that Vista/Win7 do which should align for anything with a <=3D 1MB stripe size: # Device to partition diskdev=3D"/dev/da0" # First partition offset in 512-byte sectors. This should be aligned wi= th # any RAID stripe size for maximum performance. 2048 aligns the partiti= on # start boundary at the 1MiB, consistent with Vista/Windows 7. This sho= uld # match all common stripe sizes such as 64kb, 128kb and 256kb. root_offset=3D"2048" # Boot partition offset. This sits just before our first root partition= and # stores the boot loader which is used to load the OS. boot_offset=3D"2032" # Initialise the disk with a GPT partition table gpart create -s gpt $diskdev # # System disk partitioning layout # gpart add -l boot -t freebsd-boot -s 16 -b $boot_offset $diskdev # bo= ot p1 gpart add -l root -t freebsd-ufs -s 2G -b $root_offset $diskdev # / = p2 gpart add -l swap -t freebsd-swap -s 4G $diskdev # sw= ap p3 gpart add -l var -t freebsd-ufs -s 4G $diskdev # /v= ar p4 gpart add -l usr -t freebsd-ufs $diskdev # /u= sr p5 # Install the gpt boot code (pmbr into the PMBR, gptboot into our boot partition p1) gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 $diskdev # Make the first partition active # (required for older BIOSes to boot from the GPT PMBR) echo 'a 1' | fdisk -f - $diskdev gpart is smart enough to figure out most of the math for you these days... -- Antony From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 21:26:45 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74831106566B for ; Sun, 20 Jun 2010 21:26:45 +0000 (UTC) (envelope-from pali.gabor@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 099E78FC17 for ; Sun, 20 Jun 2010 21:26:44 +0000 (UTC) Received: by fxm7 with SMTP id 7so1918198fxm.13 for ; Sun, 20 Jun 2010 14:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=MeATj/RK9jSdIXzSfSWdgSYEU0i3NOp5oqxukLSmf/o=; b=RWKOmuvnrnlAzlrgd5Dm65FUcqK46/zzrqYgztds87PAwVLgq7cqmb/gFxmoWBWZMY ypWbUY/XM/zfgfYjnWcKoMWFhmeN5nMcf8aX/Yr7VZT1/esFTo7y4A+8xw+B5H4csXkZ WKAupA27UcenPiCzG6gmKwDS5ugrD9ONMn6BQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=usCnXBvZEjz4BF1VZ3LFlYy8QqpcDXrbcNZLMBiE5h9hevd/rKu8ZGBUCR/ZMDntMJ jbiYQpK8feU3uuHZ4SiZRNMSyPVvAI8M4WbFaB9bMXGiCa4cTelhFlZB6jMDrU5Z+JtD cUFmMaTlpizhBhekht6MbhLu89j5FS5e+pryM= MIME-Version: 1.0 Received: by 10.223.20.216 with SMTP id g24mr4163321fab.63.1277067472901; Sun, 20 Jun 2010 13:57:52 -0700 (PDT) Sender: pali.gabor@googlemail.com Received: by 10.223.104.2 with HTTP; Sun, 20 Jun 2010 13:57:52 -0700 (PDT) Date: Sun, 20 Jun 2010 22:57:52 +0200 X-Google-Sender-Auth: 2nEstN3jPT07mPmDbfp0g-Ad1QI Message-ID: From: Gabor PALI To: current@freebsd.org, hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: [RFC] Changes in stat structures X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 21:26:45 -0000 Hello, I would like to integrate my Google Summer of Code project from the last year [1]. In brief, it was about converting netstat(1) into a library and providing a relatively clean API to access various networking statistics available in the kernel. The project is far from being complete, and it needs review but I decided to split my large patch into smaller pieces and add the results continuously to the FreeBSD src/ repository, otherwise it might vanish. I do not have a src/ commit bit, thus I am also looking for a sponsor for my changes who approves or commits them. My plan of integration is simple: apply the necessary modifications to the kernel, add the sysctl export routines and data structures, add the library (called libnetstat(3)), then adapt and add applications (netstat(1), bsnmpd(1), nettop(1), etc.) to use it. This way I could get some review and continue the development of this library in an interactive style. The first piece of this set is available on my FreeBSD homepage as a separate patch [2], which technically proposes to a "standardization" for the counter values so they could be accessed from both 32-bit and 64-bit environments without problems (via kvm(3) or sysctl(3)). However, I do not know too much about the potential consequences or how such a change should be handled in the tree. For more information (and the complete patch), see the project's wiki page [3]. Any feedback is appreciated. Nothing is carved into stone, I am very open to comments :) Thank you! Cheers, :g [1] http://wiki.freebsd.org/PGJSoC2009 [2] http://people.freebsd.org/~pgj/libnetstat/libnetstat-sys.latest.diff [3] http://wiki.freebsd.org/LibNetstat From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 22:12:49 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3311106566C; Sun, 20 Jun 2010 22:12:49 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5EA8FC25; Sun, 20 Jun 2010 22:12:48 +0000 (UTC) Received: by iwn7 with SMTP id 7so3563360iwn.13 for ; Sun, 20 Jun 2010 15:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=FxFDYMo1DKCQpPu52/IgqPC86AblJBujI8ezIMvIUOg=; b=PVkDmmtoRbWlurDwPLTeq4aysmPTVs1HSDdvgIZ38yt29khCpbhn89EvKSlUu0WSpe LNVqvAuRdKmIGT5c2TPUVHkXrHjkI+aAXwa2ZUjjN1Ynh9JSJBI7Xc16l6knRnrMeTLn xcewbZ45Z3n8o5w2Raklgmr+dXWF0RxPfSeUc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=U/45rxmTXJnPom5w1Ap/onl1kc9uhYxd2HqSCOjbPsYd71YSXw2MbZm//xe3yPgIVN US/XfMO5JbEMTqAlKP08Qo7x2sHqM9Wio+0X2QQgbqC7W/HGk91lKG1vPefHfeZtn/EM iFS6dEULfZ44EOS0gw6WoaeE4tchcBTX5SW9s= MIME-Version: 1.0 Received: by 10.231.157.201 with SMTP id c9mr5051956ibx.116.1277071968498; Sun, 20 Jun 2010 15:12:48 -0700 (PDT) Received: by 10.231.182.212 with HTTP; Sun, 20 Jun 2010 15:12:48 -0700 (PDT) In-Reply-To: <4C1E7B89.1030005@FreeBSD.org> References: <4C0C1AE4.8050807@FreeBSD.org> <4C1DB296.5040605@FreeBSD.org> <4C1E381B.30405@FreeBSD.org> <4C1E7B89.1030005@FreeBSD.org> Date: Sun, 20 Jun 2010 17:12:48 -0500 Message-ID: From: Brandon Gooch To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: Alexander Motin , FreeBSD-Current , freebsd-arch@freebsd.org Subject: Re: RFC: New event timers infrastructure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 22:12:49 -0000 On Sun, Jun 20, 2010 at 3:35 PM, Doug Barton wrote: > On 06/20/10 08:47, Alexander Motin wrote: >> >> While this can be done in sysctl.conf, it would be better to do it in >> loader.conf to make it applied from the beginning, without on-the-fly >> timers change. > > You're probably right that for something this fundamental it's better to do > it in loader.conf, however I wanted to mention that I recently changed the > rcorder for the "early" boot scripts to run sysctl first for very similar > reasons. This is good information, so sorry if I'm being dense: does this mean that it should have worked by applying the changes via /etc/sysctl.conf? No worries though, I've set it in /boot/loader.conf to avoid any possible ambiguity or anomalous behavior, and it's working very well! Alexander, if I haven't said it enough already, thanks! I see that you committed this work, looking forward to wider-spread testing now... -Brandon From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 01:32:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFF1F106566C for ; Mon, 21 Jun 2010 01:32:43 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 7EC068FC12 for ; Mon, 21 Jun 2010 01:32:43 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id E6F1D7E84A; Mon, 21 Jun 2010 11:32:41 +1000 (EST) Message-ID: <4C1EC139.3090903@freebsd.org> Date: Mon, 21 Jun 2010 11:32:41 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Fabian Keil References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> <4C1E0E14.3090506@freebsd.org> <20100620151554.58e486db@r500.local> <20100620161242.59381341@r500.local> In-Reply-To: <20100620161242.59381341@r500.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 01:32:44 -0000 On 06/21/10 00:12, Fabian Keil wrote: > Fabian Keil wrote: > >> Lawrence Stewart wrote: >> >>> On 06/20/10 22:28, Fabian Keil wrote: > >>>> Taking pf (and altq) out of the picture doesn't seem to make >>>> a difference. >>> >>> Wouldn't have expected it to. Will be very curious to know if the panic >>> is triggered in GENERIC. >> >> It's not. I, too, get pfil.c related LORs though: >> >> lock order reversal: >> 1st 0xffffffff80e5c568 PFil hook read/write mutex (PFil hook read/write mutex) @ /usr/src/sys/net/pfil.c:77 >> 2nd 0xffffffff80e5dd68 udp (udp) @ /usr/src/sys/modules/pf/../../contrib/pf/net/pf.c:3035 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2a >> _witness_debugger() at _witness_debugger+0x2e >> witness_checkorder() at witness_checkorder+0x81e >> _rw_rlock() at _rw_rlock+0x5f >> pf_socket_lookup() at pf_socket_lookup+0x1c5 >> pf_test_udp() at pf_test_udp+0x8b0 >> pf_test() at pf_test+0x1089 >> pf_check_in() at pf_check_in+0x39 >> pfil_run_hooks() at pfil_run_hooks+0xcf >> ip_input() at ip_input+0x2ae >> swi_net() at swi_net+0x151 >> intr_event_execute_handlers() at intr_event_execute_handlers+0x66 >> ithread_loop() at ithread_loop+0xb2 >> fork_exit() at fork_exit+0x12a >> fork_trampoline() at fork_trampoline+0xe >> --- trap 0, rip = 0, rsp = 0xffffff8000044d30, rbp = 0 --- >> lock order reversal: >> 1st 0xffffffff80e5c568 PFil hook read/write mutex (PFil hook read/write mutex) @ /usr/src/sys/net/pfil.c:77 >> 2nd 0xffffffff80e5d788 tcp (tcp) @ /usr/src/sys/modules/siftr/../../netinet/siftr.c:698 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2a >> _witness_debugger() at _witness_debugger+0x2e >> witness_checkorder() at witness_checkorder+0x81e >> _rw_rlock() at _rw_rlock+0x5f >> siftr_chkpkt() at siftr_chkpkt+0x3c4 >> pfil_run_hooks() at pfil_run_hooks+0xcf >> ip_input() at ip_input+0x2ae >> swi_net() at swi_net+0x151 >> intr_event_execute_handlers() at intr_event_execute_handlers+0x66 >> ithread_loop() at ithread_loop+0xb2 >> fork_exit() at fork_exit+0x12a >> fork_trampoline() at fork_trampoline+0xe >> --- trap 0, rip = 0, rsp = 0xffffff8000044d30, rbp = 0 --- >> >> My custom kernel normally doesn't have INVARIANTS and WITNESS >> enabled, so I'll try to enable them next. > > The culprit seem to be non-default KTR settings in the kernel > while loading alq as a module. With the following change siftr > works with my non-GENERIC kernel, too: > > commit f43b8b5171c858df7b419f6a695e9e3b53531a8e > Author: Fabian Keil > Date: Sun Jun 20 15:43:01 2010 +0200 > > Disable KTR changes. > > diff --git a/sys/amd64/conf/ZOEY b/sys/amd64/conf/ZOEY > index 6fb3480..c584317 100644 > --- a/sys/amd64/conf/ZOEY > +++ b/sys/amd64/conf/ZOEY > @@ -16,11 +16,11 @@ options ATA_CAM > device atapicam > options SC_KERNEL_CONS_ATTR=(FG_GREEN|BG_BLACK) > > -options KTR > -options KTR_ENTRIES=262144 > -options KTR_COMPILE=(KTR_SCHED) > -options KTR_MASK=(KTR_SCHED) > -options KTR_CPUMASK=0x3 > +#options KTR > +#options KTR_ENTRIES=262144 > +#options KTR_COMPILE=(KTR_SCHED) > +#options KTR_MASK=(KTR_SCHED) > +#options KTR_CPUMASK=0x3 > > options ACCEPT_FILTER_HTTP > makeoptions WITH_CTF=yes This smells very fishy. Without "options KTR_ALQ", KTR shouldn't even care if ALQ exists or not. Not only that, but ALQ isn't even used in siftr_chkpkt and you clearly manage to successfully use ALQ to write the module load message to the log file. Hmmmm... Thanks for taking the time to find the culprit though - I'll see if I can reproduce here. Could you try another thing for me and see if reducing "options KTR_ENTRIES=262144" down to a smaller number (maybe 4096?) and leaving all the other KTR options as they are above (but uncommented) makes any difference? The ktr(4) man page indicates the default is 8192 entries and I'm curious if the your allocation of so many additional entries is making something unhappy. Thanks again for your time helping with this, I really appreciate it. Cheers, Lawrence From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 02:09:16 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB445106566C; Mon, 21 Jun 2010 02:09:16 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 8A80C8FC17; Mon, 21 Jun 2010 02:09:16 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o5L29FVb003441; Sun, 20 Jun 2010 22:09:15 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o5L29Fd5003433; Mon, 21 Jun 2010 02:09:15 GMT (envelope-from tinderbox@freebsd.org) Date: Mon, 21 Jun 2010 02:09:15 GMT Message-Id: <201006210209.o5L29Fd5003433@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on arm/arm X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 02:09:16 -0000 TB --- 2010-06-21 01:50:00 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-06-21 01:50:00 - starting HEAD tinderbox run for arm/arm TB --- 2010-06-21 01:50:00 - cleaning the object tree TB --- 2010-06-21 01:50:07 - cvsupping the source tree TB --- 2010-06-21 01:50:07 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/arm/arm/supfile TB --- 2010-06-21 01:50:30 - building world TB --- 2010-06-21 01:50:30 - MAKEOBJDIRPREFIX=/obj TB --- 2010-06-21 01:50:30 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2010-06-21 01:50:30 - TARGET=arm TB --- 2010-06-21 01:50:30 - TARGET_ARCH=arm TB --- 2010-06-21 01:50:30 - TZ=UTC TB --- 2010-06-21 01:50:30 - __MAKE_CONF=/dev/null TB --- 2010-06-21 01:50:30 - cd /src TB --- 2010-06-21 01:50:30 - /usr/bin/make -B buildworld >>> World build started on Mon Jun 21 01:50:39 UTC 2010 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries [...] cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c dt_grammar.c cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_inttab.c cc -O -pipe -I/obj/arm/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c dt_lex.c cc1: warnings being treated as errors /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l: In function 'yylex': /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l:623: warning: comparison is always true due to limited range of data type *** Error code 1 Stop in /src/cddl/lib/libdtrace. *** Error code 1 Stop in /src/cddl/lib. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2010-06-21 02:09:15 - WARNING: /usr/bin/make returned exit code 1 TB --- 2010-06-21 02:09:15 - ERROR: failed to build world TB --- 2010-06-21 02:09:15 - 883.68 user 227.77 system 1154.57 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-arm-arm.full From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 04:10:47 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DA42106566C for ; Mon, 21 Jun 2010 04:10:47 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id EE2E88FC13 for ; Mon, 21 Jun 2010 04:10:46 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 5F3E37E84A; Mon, 21 Jun 2010 14:10:45 +1000 (EST) Message-ID: <4C1EE644.3070105@freebsd.org> Date: Mon, 21 Jun 2010 14:10:44 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100409 Thunderbird/3.0.4 MIME-Version: 1.0 To: Rui Paulo References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> <4C1E0E14.3090506@freebsd.org> <20100620151554.58e486db@r500.local> <20100620161242.59381341@r500.local> <20100620213601.050fcf3e@r500.local> <6CE5B32B-2C82-436D-82E3-489D2D22C7EA@lavabit.com> In-Reply-To: <6CE5B32B-2C82-436D-82E3-489D2D22C7EA@lavabit.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 04:10:47 -0000 On 06/21/10 05:44, Rui Paulo wrote: > > On 20 Jun 2010, at 20:36, Fabian Keil wrote: > >> Fabian Keil wrote: >> >>> Fabian Keil wrote: >> >>>> My custom kernel normally doesn't have INVARIANTS and WITNESS >>>> enabled, so I'll try to enable them next. >>> >>> The culprit seem to be non-default KTR settings in the kernel >>> while loading alq as a module. >> >> Actually whether or not alq is loaded as a module doesn't >> seem to matter, with: >> >> options KTR >> options KTR_ENTRIES=262144 >> options KTR_COMPILE=(KTR_SCHED) >> options KTR_MASK=(KTR_SCHED) >> options KTR_CPUMASK=0x3 >> options ALQ >> options KTR_ALQ >> >> enabling siftr panics the system, too. > > That's probably because your module was built with different compile time options than the ones used in the kernel. These options may change structure sizes, function parameters, etc. and that easily causes panics. hmm I wonder if my instructions to build SIFTR manually are causing your problems. Fabian, is the siftr.ko module you're loading built as part of a "make buildkernel", or did you follow my instructions and "cd /sys/modules/siftr ; make ; kldload ./siftr.ko"? If the latter is true, perhaps try and explicitly build SIFTR as part of "make buildkernel" and see if loading the module built that way still triggers the panic when enabled (the module will be in /usr/obj//sys//modules//sys/modules/siftr/siftr.ko or if you "make installkernel" it'll be in /boot/kernel/kernel/siftr.ko). Cheers, Lawrence From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 04:45:24 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8692D1065675; Mon, 21 Jun 2010 04:45:24 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 55AD48FC14; Mon, 21 Jun 2010 04:45:23 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o5L4jNrE071830; Mon, 21 Jun 2010 00:45:23 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o5L4jNvB071828; Mon, 21 Jun 2010 04:45:23 GMT (envelope-from tinderbox@freebsd.org) Date: Mon, 21 Jun 2010 04:45:23 GMT Message-Id: <201006210445.o5L4jNvB071828@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on powerpc/powerpc X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 04:45:24 -0000 TB --- 2010-06-21 04:21:31 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-06-21 04:21:31 - starting HEAD tinderbox run for powerpc/powerpc TB --- 2010-06-21 04:21:31 - cleaning the object tree TB --- 2010-06-21 04:21:37 - cvsupping the source tree TB --- 2010-06-21 04:21:37 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/powerpc/powerpc/supfile TB --- 2010-06-21 04:22:06 - building world TB --- 2010-06-21 04:22:06 - MAKEOBJDIRPREFIX=/obj TB --- 2010-06-21 04:22:06 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2010-06-21 04:22:06 - TARGET=powerpc TB --- 2010-06-21 04:22:06 - TARGET_ARCH=powerpc TB --- 2010-06-21 04:22:06 - TZ=UTC TB --- 2010-06-21 04:22:06 - __MAKE_CONF=/dev/null TB --- 2010-06-21 04:22:06 - cd /src TB --- 2010-06-21 04:22:06 - /usr/bin/make -B buildworld >>> World build started on Mon Jun 21 04:22:06 UTC 2010 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries [...] cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c dt_grammar.c cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_inttab.c cc -O2 -pipe -I/obj/powerpc/src/cddl/lib/libdtrace -I/src/cddl/lib/libdtrace/../../../sys/cddl/compat/opensolaris -I/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/head -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libctf/common -I/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/common -I/src/cddl/lib/libdtrace/../../../sys/cddl/contrib/opensolaris/uts/intel -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -c dt_lex.c cc1: warnings being treated as errors /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l: In function 'yylex': /src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l:623: warning: comparison is always true due to limited range of data type *** Error code 1 Stop in /src/cddl/lib/libdtrace. *** Error code 1 Stop in /src/cddl/lib. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2010-06-21 04:45:23 - WARNING: /usr/bin/make returned exit code 1 TB --- 2010-06-21 04:45:23 - ERROR: failed to build world TB --- 2010-06-21 04:45:23 - 1035.60 user 231.05 system 1431.78 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-powerpc-powerpc.full From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 05:33:20 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9926E106566B; Mon, 21 Jun 2010 05:33:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C4E838FC18; Mon, 21 Jun 2010 05:33:19 +0000 (UTC) Received: by fxm7 with SMTP id 7so1990416fxm.13 for ; Sun, 20 Jun 2010 22:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=aODvdZ9To/0laQq0Li3kigSDHSR+CFm2OelmL3XwuVc=; b=u31L6I1AQgHprDWpHOVz8Ygy0tUdhVOBzBAYXWXgU8Cvc4sa5lvvD62jRun/rnavqX cnw8sc3o5Kr4t4xRSCm6FxylY23L8z6OHt/0Rkena3D6RQQ7l1Xpu6rxSBgoQKG1NWZ1 iu2Fc4+P/sIGp7VTpQpCrBVaUbCvzGjQjhAn4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=mBeeamvmvT86+c8ItsT4CkMsK7sKDjbc4opvTethZl2TfgFy99imQt4KgqvOTXYceZ bPFNATrH2BrWjXmTXFujHCzDBRXb8djQCts2+V8BxCAErAPB2MAhy8JnCNBV75brH19Q nJXAjDjF6gFOdIIPTdQzOks0jDKza8armxdeU= Received: by 10.223.18.154 with SMTP id w26mr4448079faa.39.1277098398782; Sun, 20 Jun 2010 22:33:18 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id y12sm32217440faj.5.2010.06.20.22.33.17 (version=SSLv3 cipher=RC4-MD5); Sun, 20 Jun 2010 22:33:18 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1EF99B.5080300@FreeBSD.org> Date: Mon, 21 Jun 2010 08:33:15 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Brandon Gooch References: <4C0C1AE4.8050807@FreeBSD.org> <4C1DB296.5040605@FreeBSD.org> <4C1E381B.30405@FreeBSD.org> <4C1E7B89.1030005@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org, Doug Barton , FreeBSD-Current Subject: Re: RFC: New event timers infrastructure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 05:33:20 -0000 Brandon Gooch wrote: > On Sun, Jun 20, 2010 at 3:35 PM, Doug Barton wrote: >> On 06/20/10 08:47, Alexander Motin wrote: >>> While this can be done in sysctl.conf, it would be better to do it in >>> loader.conf to make it applied from the beginning, without on-the-fly >>> timers change. >> You're probably right that for something this fundamental it's better to do >> it in loader.conf, however I wanted to mention that I recently changed the >> rcorder for the "early" boot scripts to run sysctl first for very similar >> reasons. > > This is good information, so sorry if I'm being dense: does this mean > that it should have worked by applying the changes via > /etc/sysctl.conf? "You are too old. You are already born." (c) Sergey Lukyanenko. stathz set much earlier, just before "Starting kernel event timers" logged first time. It can only be affected from loader.conf. > No worries though, I've set it in /boot/loader.conf to avoid any > possible ambiguity or anomalous behavior, and it's working very well! Nice. BTW, I've successfully tested suspend/resume on my amd64 laptop with all timers. -- Alexander Motin From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 08:41:34 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC35F1065670 for ; Mon, 21 Jun 2010 08:41:33 +0000 (UTC) (envelope-from f0andrey@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6AAD88FC0C for ; Mon, 21 Jun 2010 08:41:32 +0000 (UTC) Received: by bwz8 with SMTP id 8so1448979bwz.13 for ; Mon, 21 Jun 2010 01:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=J2kwbEMfp5gcu8DL5F0KJb49ojWagYMPrdqrk51tmuE=; b=vyceTnCVJq5JonkDXhF1PKDjBoYPpKxpVwyN9PEbOq4dI1mixd92VGJWcgODjhK5Ns 8WPNJ+RuIs9t4GBlP9dJk0fK/zAaSn9gAhsE/x7xb+LLI6t/kTMVqXrE/1m2Jdq0XyKK DYR8UBQCwDI3vqKA869bE17aMpih81bTG0z+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=HjR9H6LnAtuSCmBYt+TQpg8+IH/Gq5yOx7EUUd9RcTMk0S1FU6+DT5E6Bj9IdaPyas g4sDZoq/Tjr/ok9u/TMrdVmRwnKMqXQ7r/LMMlKFd9TtLAjh2p9Nr5H1PfXeQYonNGBg Yb2u0JXgY3sxOmnsprfnfHNiBx5HJowVQOnDs= MIME-Version: 1.0 Received: by 10.204.83.93 with SMTP id e29mr2613287bkl.142.1277109690690; Mon, 21 Jun 2010 01:41:30 -0700 (PDT) Received: by 10.204.163.83 with HTTP; Mon, 21 Jun 2010 01:41:30 -0700 (PDT) In-Reply-To: <4C1D27F9.60709@icyb.net.ua> References: <4C1CFB72.5000806@fgznet.ch> <4C1D27F9.60709@icyb.net.ua> Date: Mon, 21 Jun 2010 12:41:30 +0400 Message-ID: From: Andrey Fesenko To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: Andreas Tobler , freebsd-current Subject: Re: only 3 of 4GB memory available on amd64 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 08:41:34 -0000 On Sun, Jun 20, 2010 at 12:26 AM, Andriy Gapon wrote: > on 19/06/2010 20:16 Andreas Tobler said the following: >> Hi all, >> >> I got my hands on a t60 with 4GB of RAM (BIOS displays it) > > Yes, PAE is for what we call in FreeBSD land "i386". > "x86" we use for both i386 and amd64. > > Now, to the rest. > I recently investigated this topic myself, so I can share what I learned. > The first thing you'd want to have is SMAP information. > You can get it at the loader prompt with 'smap' command. > It is also reported by kernel during a verbose boot, but it is only printed to > console; it is not saved to dmesg, because it is printed before msgbuf is created. >... > That's about all. > I am curious as to what you would discover about your system - please share with us. > > -- > Andriy Gapon > Hello My notebook Toshiba U200-10H Install 4Gb(2+2) bios detect 3,... not all SMAP tipe=01 base=0000000000000000 len=000000000009fc00 tipe=02 base=000000000009fc00 len=0000000000000400 tipe=02 base=00000000000e0000 len=000000000000ee00 tipe=04 base=00000000000eee00 len=0000000000000200 tipe=02 base=00000000000ef000 len=0000000000011000 tipe=01 base=0000000000100000 len=00000000cf690000 tipe=02 base=00000000cf790000 len=0000000000010000 tipe=02 base=00000000cf7a0000 len=0000000000060000 tipe=02 base=00000000cf800000 len=0000000000800000 tipe=02 base=00000000fec00000 len=0000000000018000 tipe=02 base=00000000fec20000 len=0000000000008000 tipe=02 base=00000000fed00000 len=0000000000000400 tipe=02 base=00000000fed14000 len=0000000000006000 tipe=02 base=00000000fed1c000 len=0000000000074000 tipe=02 base=00000000feda0000 len=0000000000020000 tipe=02 base=00000000fee00000 len=0000000000001000 tipe=02 base=00000000ffb00000 len=0000000000100000 tipe=02 base=00000000ffe00000 len=0000000000200000 FreeBSD 9.0-CURRENT #1 r209362: Sun Jun 20 21:44:27 MSD 2010 andrey@my_book:/usr/obj/home/andrey/src_head/sys/MY_BOOK amd64 CPU: Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz (1828.76-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x6f2 Family = 6 Model = f Stepping = 2 Features=0xbfebfbff Features2=0xe3bd AMD Features=0x20100800 AMD Features2=0x1 TSC: P-state invariant real memory = 4294967296 (4096 MB) Physical memory chunk(s): 0x0000000000001000 - 0x000000000009bfff, 634880 bytes (155 pages) 0x000000000126a000 - 0x00000000c95dafff, 3359051776 bytes (820081 pages) avail memory = 3339898880 (3185 MB) full dmesg+debug http://www.suahbsd.org/dmesg.boot.dbg From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 10:04:18 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1703C1065670 for ; Mon, 21 Jun 2010 10:04:18 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A14478FC0A for ; Mon, 21 Jun 2010 10:04:17 +0000 (UTC) Received: by fxm7 with SMTP id 7so2113093fxm.13 for ; Mon, 21 Jun 2010 03:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=X68b03ibW6G8+Eqym5aY/z6geRu07pUCRQhoJcg1PPg=; b=YJvr5EoS5s8IGmHKo4u/B7wPlsv8DEZELugtfNWuDQDvcJssY5oxe6eXeEamHeMXGJ KznK6pROlcLN0XQs2syMxYsLDkJtoMDrUhE1rZb7cm1GOMXg+Ktp2R7Sh9r3xnT6Nlfm ExFKtF5Z0qzMHysZZtyBcD0M18l7Ekn7dpT5s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=lq4sdOTzJbbqD27tsD3oxieLet2HYPPY7aUn2Uga555FD4ZUBBA45/xGjQHzquG3c1 vTakD/NTZCPbau/aMtBv5jA0lGrMT4EuzJOb69dPZoAxoKPD03qGX2ZuijAi4r3Jy2/U Kp0pOKqn3ywW5VT+dcUDvBiWGrOZEhrSx5SLI= MIME-Version: 1.0 Received: by 10.239.189.133 with SMTP id t5mr328443hbh.4.1277114656164; Mon, 21 Jun 2010 03:04:16 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Mon, 21 Jun 2010 03:04:16 -0700 (PDT) Date: Mon, 21 Jun 2010 11:04:16 +0100 Message-ID: From: Tom Evans To: freebsd-current Content-Type: text/plain; charset=UTF-8 Subject: Ports doesnt respect fetch environment settings X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 10:04:18 -0000 My company recently enabled proxy authentication for outgoing connections, and this has stopped ports from working. >From fetch(5), I understand that I can place my proxy authentication in plain text in the environment*, and this will allow fetch to work correctly, and this does work: > # env | grep -i proxy ftp_proxy=http://proxy:3128/ HTTP_PROXY_AUTH=basic:*:tevans@domain.com:password HTTP_PROXY=http://proxy:3128/ > # fetch http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz googlecl-0.9.5.tar.gz 100% of 36 kB 77 MBps However, the ports makefiles seem to do something funky to my environment which hides these environment variables, and so the ports infrastructure stops working: > # make fetch ===> Vulnerability check disabled, database not found ===> License check disabled, port has not defined LICENSE => googlecl-0.9.5.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch from http://googlecl.googlecode.com/files/. fetch: http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz: Proxy Authentication Required => Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/. fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/googlecl-0.9.5.tar.gz: Not Found => Couldn't fetch it - please try to retrieve this => port manually into /usr/ports/distfiles/ and try again. *** Error code 1 Stop in /usr/FreeBSD/CURRENT/ports/net/googlecl. This is on i386 7-STABLE, last updated in mid May, with current ports, last updated yesterday. Cheers Tom * Which, incidently, is completely rubbish. Why is there no option for HTTP like ~/.netrc for FTP? Exposing my passwords in plain text in my environment feels stupid. From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 10:10:47 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9BD7106564A for ; Mon, 21 Jun 2010 10:10:47 +0000 (UTC) (envelope-from erwin@mail.droso.net) Received: from mail.droso.net (koala.droso.net [IPv6:2001:6c8:130:400::6]) by mx1.freebsd.org (Postfix) with ESMTP id 65FA48FC0C for ; Mon, 21 Jun 2010 10:10:47 +0000 (UTC) Received: by mail.droso.net (Postfix, from userid 1001) id 7915B1CC32; Mon, 21 Jun 2010 12:10:46 +0200 (CEST) Date: Mon, 21 Jun 2010 12:10:46 +0200 From: Erwin Lansing To: Tom Evans Message-ID: <20100621101046.GA76036@droso.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S4+Kf2w4CfEO117G" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD/i386 7.2-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current Subject: Re: Ports doesnt respect fetch environment settings X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 10:10:47 -0000 --S4+Kf2w4CfEO117G Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 21, 2010 at 11:04:16AM +0100, Tom Evans wrote: > My company recently enabled proxy authentication for outgoing > connections, and this has stopped ports from working. >=20 > >From fetch(5), I understand that I can place my proxy authentication > in plain text in the environment*, and this will allow fetch to work > correctly, and this does work: >=20 > > # env | grep -i proxy > ftp_proxy=3Dhttp://proxy:3128/ > HTTP_PROXY_AUTH=3Dbasic:*:tevans@domain.com:password > HTTP_PROXY=3Dhttp://proxy:3128/ > > # fetch http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz > googlecl-0.9.5.tar.gz 100% of 36 kB 77 MBps >=20 > However, the ports makefiles seem to do something funky to my > environment which hides these environment variables, and so the ports > infrastructure stops working: >=20 You should use FETCH_ENV or FETCH_ARGS to pass information to fetch(1) from= the ports infrastructure. It is documented in /usr/ports/Mk/bsd.port.mk, search for FETCH_BINARY. Hope that helps. -erwin --=20 Erwin Lansing http://droso.org Prediction is very difficult especially about the future erwin@FreeBSD.org --S4+Kf2w4CfEO117G Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iD8DBQFMHzqlqy9aWxUlaZARAo/UAJ950YVhYi1d/LmWlzIa10x6jfnDVQCgu5LU oVgvCWYcmsRqoUt0G5c0hCU= =iA8N -----END PGP SIGNATURE----- --S4+Kf2w4CfEO117G-- From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 10:34:13 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA159106566B for ; Mon, 21 Jun 2010 10:34:13 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 379F78FC1B for ; Mon, 21 Jun 2010 10:34:12 +0000 (UTC) Received: by fxm7 with SMTP id 7so2131742fxm.13 for ; Mon, 21 Jun 2010 03:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lnkoGvgtLv6przrMQ9UzdTfkXgw11FBclFnNmszZ7Jc=; b=P7sObLkS80jIerWMxx8LSvc5TEdvfngBNH+1SXW4pKVuYluAqS0g/sh5459sIpvQ+J b6fn0Q42TvoSgR6g1TPyPSWiCX04tGo1oavo9Bc1qRI9NAIQIQfEacq72AJT6CY0xMFn Sl3GVGOfxu+HZI+7vvDyHVDzYau1m5xpABrdg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Im2Y/oGQmXWw4EIqw4jmacxr7d+SiZLxQ6Kc3uIl8QJSRuk5Ska3/2vbY8bzHu7nnq uukEQ9NE0kcqhonI4fwxOiupl9uX7oEKZHn7VaYVJi+5IJhyigTEppLziRJHNz1hJNr5 8ZqHFWdNaFzLGQ/UDpnz6y1C0y8npB/HDQvZo= MIME-Version: 1.0 Received: by 10.239.132.145 with SMTP id 17mr288014hbr.177.1277116452187; Mon, 21 Jun 2010 03:34:12 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Mon, 21 Jun 2010 03:34:12 -0700 (PDT) In-Reply-To: <20100621101046.GA76036@droso.net> References: <20100621101046.GA76036@droso.net> Date: Mon, 21 Jun 2010 11:34:12 +0100 Message-ID: From: Tom Evans To: freebsd-current Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Ports doesnt respect fetch environment settings X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 10:34:13 -0000 On Mon, Jun 21, 2010 at 11:10 AM, Erwin Lansing wrote: > On Mon, Jun 21, 2010 at 11:04:16AM +0100, Tom Evans wrote: >> My company recently enabled proxy authentication for outgoing >> connections, and this has stopped ports from working. >> >> >From fetch(5), I understand that I can place my proxy authentication >> in plain text in the environment*, and this will allow fetch to work >> correctly, and this does work: >> >> > # env | grep -i proxy >> ftp_proxy=3Dhttp://proxy:3128/ >> HTTP_PROXY_AUTH=3Dbasic:*:tevans@domain.com:password >> HTTP_PROXY=3Dhttp://proxy:3128/ >> > # fetch http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz >> googlecl-0.9.5.tar.gz =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 100% of =C2=A0 36 kB =C2=A0 77 MBps >> >> However, the ports makefiles seem to do something funky to my >> environment which hides these environment variables, and so the ports >> infrastructure stops working: >> > You should use FETCH_ENV or FETCH_ARGS to pass information to fetch(1) fr= om the > ports infrastructure. =C2=A0It is documented in /usr/ports/Mk/bsd.port.mk= , > search for FETCH_BINARY. =C2=A0Hope that helps. > > -erwin > Er, ok that makes slight sense. In /usr/ports/Mk/bsd.port.mk it says: # FETCH_ENV - Environment to pass to ${FETCH_CMD}. # Default: none So how is it picking up that it needs to go thru a proxy at all, given that this is also only specified in the environment? Also, am I supposed to literally repeat my same environment variables in FETCH_ENV? Meaning I have to place my password in plain text again in my environment? This is horrific... Also, even after doing that, it still doesn't look at the environment variables. I prepended "-v" to FETCH_ENV to show that it is setting the right environment variables, but fetch in ports is still not looking at them: > # export FETCH_ENV=3D"-v HTTP_PROXY=3D$HTTP_PROXY HTTP_PROXY_AUTH=3D$HTTP= _PROXY_AUTH ftp_proxy=3D$ftp_proxy" root@strangepork '11:26:21' '/usr/ports/net/googlecl' > # make fetch =3D=3D=3D> Vulnerability check disabled, database not found =3D=3D=3D> License check disabled, port has not defined LICENSE =3D> googlecl-0.9.5.tar.gz doesn't seem to exist in /usr/ports/distfiles/. =3D> Attempting to fetch from http://googlecl.googlecode.com/files/. #env setenv: HTTP_PROXY=3Dhttp://proxy:3128/ #env setenv: HTTP_PROXY_AUTH=3Dbasic:*:tevans@domain:pass #env setenv: ftp_proxy=3Dhttp://proxy:3128/ #env executing: /usr/bin/fetch #env arg[0]=3D '/usr/bin/fetch' #env arg[1]=3D '-ApRr' #env arg[2]=3D '-S 37867' #env arg[3]=3D 'http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.= gz' fetch: http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz: Proxy Authentication Required =3D> Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distf= iles/. #env setenv: HTTP_PROXY=3Dhttp://proxy:3128/ #env setenv: HTTP_PROXY_AUTH=3Dbasic:*:tevans@domain:pass #env setenv: ftp_proxy=3Dhttp://proxy:3128/ #env executing: /usr/bin/fetch #env arg[0]=3D '/usr/bin/fetch' #env arg[1]=3D '-ApRr' #env arg[2]=3D '-S 37867' #env arg[3]=3D 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/googlecl-0.9.5.tar.gz' fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/googlecl-0.9.5.tar= .gz: Not Found =3D> Couldn't fetch it - please try to retrieve this =3D> port manually into /usr/ports/distfiles/ and try again. *** Error code 1 *.freebsd.org is whitelisted through the proxies, which is why the second fetch gets a 404 and not a 407 Any thoughts? Cheers From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 11:07:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B944B106567C for ; Mon, 21 Jun 2010 11:07:52 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3AEA68FC2E for ; Mon, 21 Jun 2010 11:07:51 +0000 (UTC) Received: by bwz8 with SMTP id 8so1510297bwz.13 for ; Mon, 21 Jun 2010 04:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=Nzfq86K2YW9dZcO6DnEF9K+f18EygHiqZNnW30UTZpQ=; b=IVGHvk5jp4incg+Dek7PvDoaH5Qkbzhr3qXjDC3kfnVS/IcMY7NnttPar9b0ptzouK NHybNp+1CkiM/lA8dP9/jBHzudLkcXamNmAGbFDKiWNkC6teVwj1ykCgtZy3m21FDnSl IrCyMZ52jXp09383QIXTgCbCP1p2Nsd2aawQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=dxTKdyMfmg358pKQhlb0/GudnzHV4a+pVewg/7wdRN9JSb26UKnz0Zgyx9uhax1HVd ZVpoVn50gO1ag0iFxZk9PBT9t/XOHEIIB5mxJcv2AQwWXlGa4OwNiuqm0wB7UhPWO496 AaHR0kEoltyK9O3wO8oIMIkFOJ5O58wo9Msfw= Received: by 10.204.83.197 with SMTP id g5mr1295279bkl.114.1277118466433; Mon, 21 Jun 2010 04:07:46 -0700 (PDT) Received: from ernst.jennejohn.org (p578E1A33.dip.t-dialin.net [87.142.26.51]) by mx.google.com with ESMTPS id w11sm6941175bka.44.2010.06.21.04.07.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 04:07:45 -0700 (PDT) Date: Mon, 21 Jun 2010 13:07:43 +0200 From: Gary Jennejohn To: Tom Evans Message-ID: <20100621130743.4df77343@ernst.jennejohn.org> In-Reply-To: References: <20100621101046.GA76036@droso.net> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-current Subject: Re: Ports doesnt respect fetch environment settings X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 11:07:52 -0000 On Mon, 21 Jun 2010 11:34:12 +0100 Tom Evans wrote: > On Mon, Jun 21, 2010 at 11:10 AM, Erwin Lansing wrote: > > On Mon, Jun 21, 2010 at 11:04:16AM +0100, Tom Evans wrote: > >> My company recently enabled proxy authentication for outgoing > >> connections, and this has stopped ports from working. > >> > >> >From fetch(5), I understand that I can place my proxy authentication > >> in plain text in the environment*, and this will allow fetch to work > >> correctly, and this does work: > >> > >> > # env | grep -i proxy > >> ftp_proxy=http://proxy:3128/ > >> HTTP_PROXY_AUTH=basic:*:tevans@domain.com:password > >> HTTP_PROXY=http://proxy:3128/ > >> > # fetch http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz > >> googlecl-0.9.5.tar.gz __ __ __ __ __ __ __ __ __ __ __ __ 100% of __ 36 kB __ 77 MBps > >> > >> However, the ports makefiles seem to do something funky to my > >> environment which hides these environment variables, and so the ports > >> infrastructure stops working: > >> > > You should use FETCH_ENV or FETCH_ARGS to pass information to fetch(1) from the > > ports infrastructure. __It is documented in /usr/ports/Mk/bsd.port.mk, > > search for FETCH_BINARY. __Hope that helps. > > > > -erwin > > > Er, ok that makes slight sense. In /usr/ports/Mk/bsd.port.mk it says: > > # FETCH_ENV - Environment to pass to ${FETCH_CMD}. > # Default: none > > So how is it picking up that it needs to go thru a proxy at all, given > that this is also only specified in the environment? > > Also, am I supposed to literally repeat my same environment variables > in FETCH_ENV? Meaning I have to place my password in plain text again > in my environment? This is horrific... > > Also, even after doing that, it still doesn't look at the environment > variables. I prepended "-v" to FETCH_ENV to show that it is setting > the right environment variables, but fetch in ports is still not > looking at them: > > > # export FETCH_ENV="-v HTTP_PROXY=$HTTP_PROXY HTTP_PROXY_AUTH=$HTTP_PROXY_AUTH ftp_proxy=$ftp_proxy" > root@strangepork '11:26:21' '/usr/ports/net/googlecl' > > # make fetch > ===> Vulnerability check disabled, database not found > ===> License check disabled, port has not defined LICENSE > => googlecl-0.9.5.tar.gz doesn't seem to exist in /usr/ports/distfiles/. > => Attempting to fetch from http://googlecl.googlecode.com/files/. > #env setenv: HTTP_PROXY=http://proxy:3128/ > #env setenv: HTTP_PROXY_AUTH=basic:*:tevans@domain:pass > #env setenv: ftp_proxy=http://proxy:3128/ > #env executing: /usr/bin/fetch > #env arg[0]= '/usr/bin/fetch' > #env arg[1]= '-ApRr' > #env arg[2]= '-S 37867' > #env arg[3]= 'http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz' > fetch: http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz: > Proxy Authentication Required > => Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/. > #env setenv: HTTP_PROXY=http://proxy:3128/ > #env setenv: HTTP_PROXY_AUTH=basic:*:tevans@domain:pass > #env setenv: ftp_proxy=http://proxy:3128/ > #env executing: /usr/bin/fetch > #env arg[0]= '/usr/bin/fetch' > #env arg[1]= '-ApRr' > #env arg[2]= '-S 37867' > #env arg[3]= > 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/googlecl-0.9.5.tar.gz' > fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/googlecl-0.9.5.tar.gz: > Not Found > => Couldn't fetch it - please try to retrieve this > => port manually into /usr/ports/distfiles/ and try again. > *** Error code 1 > > *.freebsd.org is whitelisted through the proxies, which is why the > second fetch gets a 404 and not a 407 > > Any thoughts? > Yes. When you ran fetch by hand you didn't have the -ApRr on the CL. Could it be that the 'p' flag is causing problems? Try running fetch by hand again with those flags and see what happens. If it fails, try removing the 'p' flag. -- Gary Jennejohn From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 11:38:48 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A42941065674 for ; Mon, 21 Jun 2010 11:38:48 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2FD498FC25 for ; Mon, 21 Jun 2010 11:38:47 +0000 (UTC) Received: by fxm7 with SMTP id 7so2170876fxm.13 for ; Mon, 21 Jun 2010 04:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=i5yJf+gMDmMjZlWjyeVa04peEMrRtem+NJZ1jBcrYN4=; b=rEpcOv9AZ7bG39mKaklfwqkhKWefkq+WRUsCAdp9JzGs1YlxuFT6tzh2ZGyX1USJDH iP3zDfaHhovC9bNGQp8l0ZWBnCN4/qwgRhOhCweqHuts+30P+LEiQ1Gn/K6YlHyc3ror fxXKVJV6XSHWqqFE3/uL+1VuXfTBQPep7J8kI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=HlE4v93qpnbL/hopbvHl/jqARWUbGaxxVh2vSSTcPh8LK5Ji4dNZSz0f1+/fHtsO8m 0As6fOEe+J4UoHEBdjHAnmonhySS7+O7zjj5WOrQCOfHCyZwZDcWLz0B01dvAe4YbR3u Ya+jlxQ/s6giVLEpQEDkpT5PxZP6rCmQa8CuY= MIME-Version: 1.0 Received: by 10.239.183.146 with SMTP id u18mr342910hbg.163.1277120326921; Mon, 21 Jun 2010 04:38:46 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Mon, 21 Jun 2010 04:38:46 -0700 (PDT) In-Reply-To: <20100621130743.4df77343@ernst.jennejohn.org> References: <20100621101046.GA76036@droso.net> <20100621130743.4df77343@ernst.jennejohn.org> Date: Mon, 21 Jun 2010 12:38:46 +0100 Message-ID: From: Tom Evans To: gljennjohn@googlemail.com, des@des.no Content-Type: multipart/mixed; boundary=001485f428486bede1048988bf37 Cc: freebsd-current Subject: Re: Ports doesnt respect fetch environment settings X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 11:38:48 -0000 --001485f428486bede1048988bf37 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jun 21, 2010 at 12:07 PM, Gary Jennejohn wrote: > Yes. =C2=A0When you ran fetch by hand you didn't have the -ApRr on the CL= . > Could it be that the 'p' flag is causing problems? > > Try running fetch by hand again with those flags and see what happens. > If it fails, try removing the 'p' flag. > > -- > Gary Jennejohn > Yes, I went through the same logic - its not the 'p' flag, its the 'A' flag, which is supposed to prevent it following 302 redirects. In this case, it refuses to retry the request when it receives a 407. > # /usr/bin/fetch -ApRr -v -S 37867 http://googlecl.googlecode.com/files/g= ooglecl-0.9.5.tar.gz looking up proxy connecting to proxy:3128 requesting http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz proxy requires authorization fetch: http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz: Proxy Authentication Required root@strangepork '12:13:28' '/usr/ports/net/googlecl' > # /usr/bin/fetch -pRr -v -S 37867 http://googlecl.googlecode.com/files/go= oglecl-0.9.5.tar.gz looking up proxy connecting to proxy:3128 requesting http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz proxy requires authorization looking up proxy connecting to proxy:3128 requesting http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz local size / mtime: 37867 / 1276839258 remote size / mtime: 37867 / 1276839258 That doesn't seem right! Looking in lib/libfetch/http.c it tries to fetch the file in a loop. libfetch first tries without proxy authentication, even if you specify it in your environment. If the request fails due to proxy authentication being required, it sets a flag to add proxy auth details next time through the loop, and continues. If the '-A' flag is set however, it will only go through this loop one time, and so does not attempt to use the supplied proxy authentication. Comments in the source code imply that this is a change in behaviour introduced at the start of the year to support digest authentication; prior to that it would have attempted proxy auth on the first request. The flag for '-A' is documented as: -A Do not automatically follow =E2=80=98=E2=80=98temporary=E2=80= =99=E2=80=99 (302) redirects. Some broken Web sites will return a redirect instead of a not=E2=80=90found error when the requested object does not exist. where as the behaviour is: Do not attempt to download this file more than once, for any reason. Having seen this, the bug is that we wish to go thru the loop one more time to retry with proxy authentication added, but the loop may exit on the next iteration. This diff allows it to go through the loop one more time, and now fetches the file correctly. Incidentally, having fixed fetch to work with '-A' thru a proxy that requires proxy auth, I now dont require anything in FETCH_ENV or FETCH_*_ARGS, it works correctly with the PROXY_* environment variables. Patch attached. Cheers Tom --001485f428486bede1048988bf37 Content-Type: text/plain; charset=US-ASCII; name="lib::libfetch::http.c.diff.txt" Content-Disposition: attachment; filename="lib::libfetch::http.c.diff.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gap8fppp0 SW5kZXg6IC91c3Ivc3JjL2xpYi9saWJmZXRjaC9odHRwLmMKPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTog L2hvbWUvbmN2cy9zcmMvbGliL2xpYmZldGNoL2h0dHAuYyx2CnJldHJpZXZpbmcgcmV2aXNpb24g MS43OC4yLjUKZGlmZiAtdSAtcjEuNzguMi41IGh0dHAuYwotLS0gL3Vzci9zcmMvbGliL2xpYmZl dGNoL2h0dHAuYwkyNyBKYW4gMjAxMCAxNDo1NDo0OCAtMDAwMAkxLjc4LjIuNQorKysgL3Vzci9z cmMvbGliL2xpYmZldGNoL2h0dHAuYwkyMSBKdW4gMjAxMCAxMTozMDozMiAtMDAwMApAQCAtMTcx MCw2ICsxNzEwLDcgQEAKIAkJCQlnb3RvIG91Y2g7CiAJCQl9CiAJCQkvKiB0cnkgYWdhaW4sIGJ1 dCBzZW5kIHRoZSBwYXNzd29yZCB0aGlzIHRpbWUgKi8KKwkJCSsrbjsKIAkJCWlmICh2ZXJib3Nl KQogCQkJCWZldGNoX2luZm8oInByb3h5IHJlcXVpcmVzIGF1dGhvcml6YXRpb24iKTsKIAkJCWJy ZWFrOwo= --001485f428486bede1048988bf37-- From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 12:13:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD105106564A for ; Mon, 21 Jun 2010 12:13:43 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 33B4A8FC13 for ; Mon, 21 Jun 2010 12:13:42 +0000 (UTC) Received: by iwn7 with SMTP id 7so4220170iwn.13 for ; Mon, 21 Jun 2010 05:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type; bh=cpJK8AlYenGeaK2wBUQwGT9GLGKMcjFc/W1wLGFR6BQ=; b=Wgw54MdWO6sQi61TtdEj1ZMO9C0Uxfja6OoZY6agxby5Abry7H5J7W8y1M8L3B4Ycr 6Inqxp6oXK2EeZ8G4xHGQ1xUPV0tkEbrkJgSBxVZWYmv0dLyDu9Bw2kU2vpXPNMMxY2D CwR4p9KQsMkew4Qs0kq/RELtxRFQUlYZoWeoI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:openpgp:content-type; b=hBF3+5VL2VNizTpVrqPcVFhYhEEGR76FCYF4m1dHxEgtUXsvZVqsLOQRb9xgfS6m/8 pFgNURPyahuYz4PoV4y4H560VKsRgfPh+ZPEIxhz8HZezxdO22glLhFqd4XkWCdg1TkP yjG3GDJnLhYyuCwUJfmJRkP/lcJ+8w33ExVbY= Received: by 10.231.124.5 with SMTP id s5mr5501639ibr.195.1277122422402; Mon, 21 Jun 2010 05:13:42 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-128-180.dsl.klmzmi.sbcglobal.net [99.181.128.180]) by mx.google.com with ESMTPS id a8sm16658003ibi.5.2010.06.21.05.13.36 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 05:13:39 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C1F576F.9090901@dataix.net> Date: Mon, 21 Jun 2010 08:13:35 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100620 Thunderbird MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <4C18304A.1080601@dataix.net> <4C18322A.6050007@dataix.net> <86wrtz5mk6.fsf@ds4.des.no> In-Reply-To: <86wrtz5mk6.fsf@ds4.des.no> X-Enigmail-Version: 1.0.1 OpenPGP: id=89D8547E Content-Type: multipart/mixed; boundary="------------020203000205020600080704" Cc: "Sam Fourman Jr." , Brandon Gooch , FreeBSD Current , jilles@stack.nl Subject: Re: [MFC REQUEST] Filename completion in sh(1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 12:13:43 -0000 This is a multi-part message in MIME format. --------------020203000205020600080704 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 06/16/2010 05:55, Dag-Erling Smørgrav wrote: > "Sam Fourman Jr." writes: >> I would be very interested in a diff for FreeBSD 8.1 > > See attached patch. > > DES > Because SVN in both our patches for tab completion missed filecomplete.h and filecomplete.c I generated a new patch using ( diff -urN ) since these files do not exist on stable/8. Since the above files do not exist, the previous patches from des@ & myself will break world builds. This is the full patch: sh-tab-complete-stable8.diff These are the individual patches: head_lib_libedit_filecomplete.c head_lib_libedit_filecomplete.h Again, apply these with: cd /usr/src && patch -p1 -__FBSDID("$FreeBSD: stable/8/bin/sh/alias.c 193221 2009-06-01 10:50:17Z rse $"); +__FBSDID("$FreeBSD: head/bin/sh/alias.c 200956 2009-12-24 18:41:14Z jilles $"); #include #include "shell.h" @@ -52,13 +52,13 @@ STATIC struct alias *atab[ATABSIZE]; STATIC int aliases; -STATIC void setalias(char *, char *); +STATIC void setalias(const char *, const char *); STATIC int unalias(const char *); STATIC struct alias **hashalias(const char *); STATIC void -setalias(char *name, char *val) +setalias(const char *name, const char *val) { struct alias *ap, **app; @@ -176,7 +176,7 @@ } struct alias * -lookupalias(char *name, int check) +lookupalias(const char *name, int check) { struct alias *ap = *hashalias(name); diff -urN stable/8/bin/sh/alias.h head/bin/sh/alias.h --- stable/8/bin/sh/alias.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/alias.h 2009-12-24 13:41:14.411055000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)alias.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/alias.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/alias.h 200956 2009-12-24 18:41:14Z jilles $ */ #define ALIASINUSE 1 @@ -42,7 +42,7 @@ int flag; }; -struct alias *lookupalias(char *, int); +struct alias *lookupalias(const char *, int); int aliascmd(int, char **); int unaliascmd(int, char **); void rmaliases(void); diff -urN stable/8/bin/sh/arith.h head/bin/sh/arith.h --- stable/8/bin/sh/arith.h 2008-04-27 16:46:45.000000000 -0400 +++ head/bin/sh/arith.h 2009-12-24 13:41:14.411055000 -0500 @@ -27,15 +27,15 @@ * SUCH DAMAGE. * * @(#)arith.h 1.1 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/arith.h 178625 2008-04-27 20:46:45Z stefanf $ + * $FreeBSD: head/bin/sh/arith.h 200956 2009-12-24 18:41:14Z jilles $ */ #include "shell.h" #define DIGITS(var) (3 + (2 + CHAR_BIT * sizeof((var))) / 3) -extern char *arith_buf, *arith_startbuf; +extern const char *arith_buf, *arith_startbuf; -arith_t arith(char *); +arith_t arith(const char *); void arith_lex_reset(void); int expcmd(int, char **); diff -urN stable/8/bin/sh/arith.y head/bin/sh/arith.y --- stable/8/bin/sh/arith.y 2008-04-27 16:46:45.000000000 -0400 +++ head/bin/sh/arith.y 2010-04-25 16:43:19.108643000 -0400 @@ -38,7 +38,7 @@ #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/arith.y 178625 2008-04-27 20:46:45Z stefanf $"); +__FBSDID("$FreeBSD: head/bin/sh/arith.y 207206 2010-04-25 20:43:19Z jilles $"); #include #include @@ -85,9 +85,9 @@ ARITH_LPAREN expr ARITH_RPAREN { $$ = $2; } | expr ARITH_OR expr - { $$ = $1 ? $1 : $3 ? $3 : 0; } | + { $$ = $1 || $3; } | expr ARITH_AND expr - { $$ = $1 ? ( $3 ? $3 : 0 ) : 0; } | + { $$ = $1 && $3; } | expr ARITH_BOR expr { $$ = $1 | $3; } | expr ARITH_BXOR expr @@ -265,7 +265,7 @@ #define YYPARSE_PARAM_TYPE arith_t * #define YYPARSE_PARAM result -char *arith_buf, *arith_startbuf; +const char *arith_buf, *arith_startbuf; int yylex(void); int yyparse(YYPARSE_PARAM_TYPE); @@ -284,10 +284,12 @@ } arith_t -arith(char *s) +arith(const char *s) { arith_t result; + struct stackmark smark; + setstackmark(&smark); arith_buf = arith_startbuf = s; INTOFF; @@ -295,11 +297,13 @@ arith_lex_reset(); /* Reprime lex. */ INTON; + popstackmark(&smark); + return result; } static void -yyerror(char *s) +yyerror(const char *s) { yyerrok; @@ -314,7 +318,7 @@ int expcmd(int argc, char **argv) { - char *p; + const char *p; char *concat; char **ap; arith_t i; @@ -354,7 +358,7 @@ printf("%d\n", exp(argv[1])); } -error(char *s) +error(const char *s) { fprintf(stderr, "exp: %s\n", s); exit(1); diff -urN stable/8/bin/sh/arith_lex.l head/bin/sh/arith_lex.l --- stable/8/bin/sh/arith_lex.l 2009-12-06 17:01:45.088880000 -0500 +++ head/bin/sh/arith_lex.l 2010-04-25 16:43:19.108643000 -0400 @@ -38,7 +38,7 @@ #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/arith_lex.l 200188 2009-12-06 22:01:45Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/arith_lex.l 207206 2010-04-25 20:43:19Z jilles $"); #include @@ -51,13 +51,6 @@ int yylex(void); -struct varname -{ - struct varname *next; - char name[1]; -}; -static struct varname *varnames; - #undef YY_INPUT #define YY_INPUT(buf,result,max) \ result = (*buf = *arith_buf++) ? 1 : YY_NULL; @@ -87,14 +80,11 @@ * If variable doesn't exist, we should initialize * it to zero. */ - struct varname *temp; + char *temp; if (lookupvar(yytext) == NULL) setvarsafe(yytext, "0", 0); - temp = ckmalloc(sizeof(struct varname) + - strlen(yytext)); - temp->next = varnames; - varnames = temp; - yylval.s_value = strcpy(temp->name, yytext); + temp = stalloc(strlen(yytext) + 1); + yylval.s_value = strcpy(temp, yytext); return ARITH_VAR; } @@ -140,15 +130,5 @@ void arith_lex_reset(void) { - struct varname *name, *next; - YY_NEW_FILE; - - name = varnames; - while (name != NULL) { - next = name->next; - ckfree(name); - name = next; - } - varnames = NULL; } diff -urN stable/8/bin/sh/bltin/bltin.h head/bin/sh/bltin/bltin.h --- stable/8/bin/sh/bltin/bltin.h 2005-08-13 11:04:30.000000000 -0400 +++ head/bin/sh/bltin/bltin.h 2005-08-13 11:04:30.000000000 -0400 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)bltin.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/bltin/bltin.h 149025 2005-08-13 15:04:30Z stefanf $ + * $FreeBSD: head/bin/sh/bltin/bltin.h 149025 2005-08-13 15:04:30Z stefanf $ */ /* diff -urN stable/8/bin/sh/bltin/echo.1 head/bin/sh/bltin/echo.1 --- stable/8/bin/sh/bltin/echo.1 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/bltin/echo.1 2005-01-10 03:39:26.000000000 -0500 @@ -31,7 +31,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)echo.1 8.2 (Berkeley) 5/4/95 -.\" $FreeBSD: stable/8/bin/sh/bltin/echo.1 139969 2005-01-10 08:39:26Z imp $ +.\" $FreeBSD: head/bin/sh/bltin/echo.1 139969 2005-01-10 08:39:26Z imp $ .\" .Dd May 4, 1995 .Dt ECHO 1 diff -urN stable/8/bin/sh/bltin/echo.c head/bin/sh/bltin/echo.c --- stable/8/bin/sh/bltin/echo.c 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/bltin/echo.c 2004-04-06 16:06:54.000000000 -0400 @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/bltin/echo.c 127958 2004-04-06 20:06:54Z markm $"); +__FBSDID("$FreeBSD: head/bin/sh/bltin/echo.c 127958 2004-04-06 20:06:54Z markm $"); /* * Echo command. diff -urN stable/8/bin/sh/builtins.def head/bin/sh/builtins.def --- stable/8/bin/sh/builtins.def 2006-04-02 14:43:33.000000000 -0400 +++ head/bin/sh/builtins.def 2006-04-02 14:43:33.000000000 -0400 @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)builtins.def 8.4 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/builtins.def 157413 2006-04-02 18:43:33Z stefanf $ +# $FreeBSD: head/bin/sh/builtins.def 157413 2006-04-02 18:43:33Z stefanf $ # # This file lists all the builtin commands. The first column is the name diff -urN stable/8/bin/sh/cd.c head/bin/sh/cd.c --- stable/8/bin/sh/cd.c 2010-05-16 06:01:06.549498000 -0400 +++ head/bin/sh/cd.c 2010-04-17 10:35:46.799348000 -0400 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/cd.c 208134 2010-05-16 10:01:06Z stefanf $"); +__FBSDID("$FreeBSD: head/bin/sh/cd.c 206759 2010-04-17 14:35:46Z jilles $"); #include #include @@ -70,6 +70,7 @@ STATIC char *getcomponent(void); STATIC char *findcwd(char *); STATIC void updatepwd(char *); +STATIC char *getpwd(void); STATIC char *getpwd2(void); STATIC char *curdir = NULL; /* current working directory */ @@ -79,8 +80,8 @@ int cdcmd(int argc, char **argv) { - char *dest; - char *path; + const char *dest; + const char *path; char *p; struct stat statb; int ch, phys, print = 0; @@ -351,7 +352,7 @@ /* * Get the current directory and cache the result in curdir. */ -char * +STATIC char * getpwd(void) { char *p; @@ -374,7 +375,6 @@ STATIC char * getpwd2(void) { - struct stat stdot, stpwd; char *pwd; int i; @@ -387,12 +387,29 @@ break; } - pwd = getenv("PWD"); + return NULL; +} + +/* + * Initialize PWD in a new shell. + * If the shell is interactive, we need to warn if this fails. + */ +void +pwd_init(int warn) +{ + char *pwd; + struct stat stdot, stpwd; + + pwd = lookupvar("PWD"); if (pwd && *pwd == '/' && stat(".", &stdot) != -1 && stat(pwd, &stpwd) != -1 && stdot.st_dev == stpwd.st_dev && stdot.st_ino == stpwd.st_ino) { - return pwd; + if (curdir) + ckfree(curdir); + curdir = savestr(pwd); } - return NULL; + if (getpwd() == NULL && warn) + out2fmt_flush("sh: cannot determine working directory\n"); + setvar("PWD", curdir, VEXPORT); } diff -urN stable/8/bin/sh/cd.h head/bin/sh/cd.h --- stable/8/bin/sh/cd.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/cd.h 2010-04-17 10:35:46.799348000 -0400 @@ -26,9 +26,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: stable/8/bin/sh/cd.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/cd.h 206759 2010-04-17 14:35:46Z jilles $ */ -char *getpwd(void); +void pwd_init(int); int cdcmd (int, char **); int pwdcmd(int, char **); diff -urN stable/8/bin/sh/error.c head/bin/sh/error.c --- stable/8/bin/sh/error.c 2006-02-04 09:37:50.000000000 -0500 +++ head/bin/sh/error.c 2010-01-01 13:17:46.488302000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/error.c 155301 2006-02-04 14:37:50Z schweikh $"); +__FBSDID("$FreeBSD: head/bin/sh/error.c 201366 2010-01-01 18:17:46Z jilles $"); /* * Errors and exceptions. @@ -67,17 +67,21 @@ char *commandname; -static void exverror(int, const char *, va_list) __printf0like(2, 0); +static void exverror(int, const char *, va_list) __printf0like(2, 0) __dead2; /* * Called to raise an exception. Since C doesn't include exceptions, we * just do a longjmp to the exception handler. The type of exception is * stored in the global variable "exception". + * + * Interrupts are disabled; they should be reenabled when the exception is + * caught. */ void exraise(int e) { + INTOFF; if (handler == NULL) abort(); exception = e; @@ -138,8 +142,15 @@ static void exverror(int cond, const char *msg, va_list ap) { - CLEAR_PENDING_INT; - INTOFF; + /* + * An interrupt trumps an error. Certain places catch error + * exceptions or transform them to a plain nonzero exit code + * in child processes, and if an error exception can be handled, + * an interrupt can be handled as well. + * + * exraise() will disable interrupts for the exception handler. + */ + FORCEINTON; #ifdef DEBUG if (msg) @@ -149,8 +160,8 @@ #endif if (msg) { if (commandname) - outfmt(&errout, "%s: ", commandname); - doformat(&errout, msg, ap); + outfmt(out2, "%s: ", commandname); + doformat(out2, msg, ap); out2c('\n'); } flushall(); diff -urN stable/8/bin/sh/error.h head/bin/sh/error.h --- stable/8/bin/sh/error.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/error.h 2009-12-24 15:55:14.498557000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)error.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/error.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/error.h 200967 2009-12-24 20:55:14Z jilles $ */ /* @@ -72,14 +72,16 @@ #define INTOFF suppressint++ #define INTON { if (--suppressint == 0 && intpending) onint(); } +#define is_int_on() suppressint +#define SETINTON(s) suppressint = (s) #define FORCEINTON {suppressint = 0; if (intpending) onint();} #define CLEAR_PENDING_INT intpending = 0 #define int_pending() intpending -void exraise(int); +void exraise(int) __dead2; void onint(void); -void error(const char *, ...) __printf0like(1, 2); -void exerror(int, const char *, ...) __printf0like(2, 3); +void error(const char *, ...) __printf0like(1, 2) __dead2; +void exerror(int, const char *, ...) __printf0like(2, 3) __dead2; /* diff -urN stable/8/bin/sh/eval.c head/bin/sh/eval.c --- stable/8/bin/sh/eval.c 2009-10-11 12:35:12.561852000 -0400 +++ head/bin/sh/eval.c 2010-05-28 18:40:24.781829000 -0400 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/eval.c 197959 2009-10-11 16:35:12Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/eval.c 208630 2010-05-28 22:40:24Z jilles $"); #include #include @@ -74,7 +74,7 @@ #endif -MKINIT int evalskip; /* set if we are skipping commands */ +int evalskip; /* set if we are skipping commands */ STATIC int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ @@ -91,6 +91,7 @@ STATIC void evalfor(union node *, int); STATIC void evalcase(union node *, int); STATIC void evalsubshell(union node *, int); +STATIC void evalredir(union node *, int); STATIC void expredir(union node *); STATIC void evalpipe(union node *); STATIC void evalcommand(union node *, int, struct backcmd *); @@ -221,10 +222,7 @@ evaltree(n->nbinary.ch2, flags); break; case NREDIR: - expredir(n->nredir.redirect); - redirect(n->nredir.redirect, REDIR_PUSH); - evaltree(n->nredir.n, flags); - popredir(); + evalredir(n, flags); break; case NSUBSHELL: evalsubshell(n, flags); @@ -407,8 +405,7 @@ flags &=~ EV_TESTED; redirect(n->nredir.redirect, 0); evaltree(n->nredir.n, flags | EV_EXIT); /* never returns */ - } - if (! backgnd) { + } else if (! backgnd) { INTOFF; exitstatus = waitforjob(jp, (int *)NULL); INTON; @@ -416,6 +413,46 @@ } +/* + * Evaluate a redirected compound command. + */ + +STATIC void +evalredir(union node *n, int flags) +{ + struct jmploc jmploc; + struct jmploc *savehandler; + volatile int in_redirect = 1; + + expredir(n->nredir.redirect); + savehandler = handler; + if (setjmp(jmploc.loc)) { + int e; + + handler = savehandler; + e = exception; + if (e == EXERROR || e == EXEXEC) { + popredir(); + if (in_redirect) { + exitstatus = 2; + return; + } + } + longjmp(handler->loc, 1); + } else { + INTOFF; + handler = &jmploc; + redirect(n->nredir.redirect, REDIR_PUSH); + in_redirect = 0; + INTON; + evaltree(n->nredir.n, flags); + } + INTOFF; + handler = savehandler; + popredir(); + INTON; +} + /* * Compute the names of the files in a redirection list. @@ -593,10 +630,12 @@ char *savecmdname; struct shparam saveparam; struct localvar *savelocalvars; + struct parsefile *savetopfile; volatile int e; char *lastarg; int realstatus; int do_clearcmdentry; + char *path = pathval(); /* First expand the arguments. */ TRACE(("evalcommand(%p, %d) called\n", (void *)cmd, flags)); @@ -646,7 +685,7 @@ out2str(ps4val()); for (sp = varlist.list ; sp ; sp = sp->next) { if (sep != 0) - outc(' ', &errout); + out2c(' '); p = sp->text; while (*p != '=' && *p != '\0') out2c(*p++); @@ -658,7 +697,7 @@ } for (sp = arglist.list ; sp ; sp = sp->next) { if (sep != 0) - outc(' ', &errout); + out2c(' '); /* Disambiguate command looking like assignment. */ if (sp == arglist.list && strchr(sp->text, '=') != NULL && @@ -670,7 +709,7 @@ out2qstr(sp->text); sep = ' '; } - outc('\n', &errout); + out2c('\n'); flushout(&errout); } @@ -679,10 +718,10 @@ /* Variable assignment(s) without command */ cmdentry.cmdtype = CMDBUILTIN; cmdentry.u.index = BLTINCMD; - cmdentry.special = 1; + cmdentry.special = 0; } else { static const char PATH[] = "PATH="; - char *path = pathval(); + int cmd_flags = 0, bltinonly = 0; /* * Modify the command lookup path, if a PATH= assignment @@ -713,42 +752,79 @@ do_clearcmdentry = 1; } - find_command(argv[0], &cmdentry, 1, path); - if (cmdentry.cmdtype == CMDUNKNOWN) { /* command not found */ - exitstatus = 127; - flushout(&errout); - return; - } - /* implement the bltin builtin here */ - if (cmdentry.cmdtype == CMDBUILTIN && cmdentry.u.index == BLTINCMD) { - for (;;) { - argv++; - if (--argc == 0) + for (;;) { + if (bltinonly) { + cmdentry.u.index = find_builtin(*argv, &cmdentry.special); + if (cmdentry.u.index < 0) { + cmdentry.u.index = BLTINCMD; + argv--; + argc++; break; - if ((cmdentry.u.index = find_builtin(*argv, - &cmdentry.special)) < 0) { - outfmt(&errout, "%s: not found\n", *argv); - exitstatus = 127; - flushout(&errout); - return; } - if (cmdentry.u.index != BLTINCMD) + } else + find_command(argv[0], &cmdentry, cmd_flags, path); + /* implement the bltin and command builtins here */ + if (cmdentry.cmdtype != CMDBUILTIN) + break; + if (cmdentry.u.index == BLTINCMD) { + if (argc == 1) break; - } + argv++; + argc--; + bltinonly = 1; + } else if (cmdentry.u.index == COMMANDCMD) { + if (argc == 1) + break; + if (!strcmp(argv[1], "-p")) { + if (argc == 2) + break; + if (argv[2][0] == '-') { + if (strcmp(argv[2], "--")) + break; + if (argc == 3) + break; + argv += 3; + argc -= 3; + } else { + argv += 2; + argc -= 2; + } + path = _PATH_STDPATH; + clearcmdentry(0); + do_clearcmdentry = 1; + } else if (!strcmp(argv[1], "--")) { + if (argc == 2) + break; + argv += 2; + argc -= 2; + } else if (argv[1][0] == '-') + break; + else { + argv++; + argc--; + } + cmd_flags |= DO_NOFUNC; + bltinonly = 0; + } else + break; } + /* + * Special builtins lose their special properties when + * called via 'command'. + */ + if (cmd_flags & DO_NOFUNC) + cmdentry.special = 0; } /* Fork off a child process if necessary. */ if (cmd->ncmd.backgnd - || (cmdentry.cmdtype == CMDNORMAL + || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 && (cmdentry.cmdtype != CMDBUILTIN || cmdentry.u.index == CDCMD || cmdentry.u.index == DOTCMD - || cmdentry.u.index == EVALCMD)) - || (cmdentry.cmdtype == CMDBUILTIN && - cmdentry.u.index == COMMANDCMD)) { + || cmdentry.u.index == EVALCMD))) { jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; if (flags & EV_BACKCMD) { @@ -775,7 +851,6 @@ #ifdef DEBUG trputs("Shell function: "); trargs(argv); #endif - redirect(cmd->ncmd.redirect, REDIR_PUSH); saveparam = shellparam; shellparam.malloc = 0; shellparam.reset = 1; @@ -786,7 +861,6 @@ savelocalvars = localvars; localvars = NULL; reffunc(cmdentry.u.func); - INTON; savehandler = handler; if (setjmp(jmploc.loc)) { if (exception == EXSHELLPROC) @@ -794,23 +868,27 @@ else { freeparam(&shellparam); shellparam = saveparam; + if (exception == EXERROR || exception == EXEXEC) + popredir(); } unreffunc(cmdentry.u.func); poplocalvars(); localvars = savelocalvars; + funcnest--; handler = savehandler; longjmp(handler->loc, 1); } handler = &jmploc; + funcnest++; + redirect(cmd->ncmd.redirect, REDIR_PUSH); + INTON; for (sp = varlist.list ; sp ; sp = sp->next) mklocal(sp->text); - funcnest++; exitstatus = oexitstatus; if (flags & EV_TESTED) evaltree(getfuncnode(cmdentry.u.func), EV_TESTED); else evaltree(getfuncnode(cmdentry.u.func), 0); - funcnest--; INTOFF; unreffunc(cmdentry.u.func); poplocalvars(); @@ -818,6 +896,7 @@ freeparam(&shellparam); shellparam = saveparam; handler = savehandler; + funcnest--; popredir(); INTON; if (evalskip == SKIPFUNC) { @@ -836,8 +915,10 @@ memout.nextc = memout.buf; memout.bufsize = 64; mode |= REDIR_BACKQ; + cmdentry.special = 0; } savecmdname = commandname; + savetopfile = getcurrentfile(); cmdenviron = varlist.list; e = -1; savehandler = handler; @@ -848,15 +929,25 @@ } handler = &jmploc; redirect(cmd->ncmd.redirect, mode); + /* + * If there is no command word, redirection errors should + * not be fatal but assignment errors should. + */ + if (argc == 0 && !(flags & EV_BACKCMD)) + cmdentry.special = 1; if (cmdentry.special) listsetvar(cmdenviron); + if (argc > 0) + bltinsetlocale(); commandname = argv[0]; argptr = argv + 1; - optptr = NULL; /* initialize nextopt */ + nextopt_optptr = NULL; /* initialize nextopt */ builtin_flags = flags; exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv); flushall(); cmddone: + if (argc > 0) + bltinunsetlocale(); cmdenviron = NULL; out1 = &output; out2 = &errout; @@ -868,29 +959,31 @@ } } handler = savehandler; - if (e != -1) { - if ((e != EXERROR && e != EXEXEC) - || cmdentry.special) - exraise(e); - FORCEINTON; - } - if (cmdentry.u.index != EXECCMD) - popredir(); if (flags == EV_BACKCMD) { backcmd->buf = memout.buf; backcmd->nleft = memout.nextc - memout.buf; memout.buf = NULL; } + if (cmdentry.u.index != EXECCMD && + (e == -1 || e == EXERROR || e == EXEXEC)) + popredir(); + if (e != -1) { + if ((e != EXERROR && e != EXEXEC) + || cmdentry.special) + exraise(e); + popfilesupto(savetopfile); + if (flags != EV_BACKCMD) + FORCEINTON; + } } else { #ifdef DEBUG trputs("normal command: "); trargs(argv); #endif - clearredir(); redirect(cmd->ncmd.redirect, 0); for (sp = varlist.list ; sp ; sp = sp->next) setvareq(sp->text, VEXPORT|VSTACK); envp = environment(); - shellexec(argv, envp, pathval(), cmdentry.u.index); + shellexec(argv, envp, path, cmdentry.u.index); /*NOTREACHED*/ } goto out; @@ -946,12 +1039,17 @@ */ /* - * No command given, or a bltin command with no arguments. + * No command given, a bltin command with no arguments, or a bltin command + * with an invalid name. */ int -bltincmd(int argc __unused, char **argv __unused) +bltincmd(int argc, char **argv) { + if (argc > 1) { + out2fmt_flush("%s: not found\n", argv[1]); + return 127; + } /* * Preserve exitstatus of a previous possible redirection * as POSIX mandates @@ -991,23 +1089,18 @@ int commandcmd(int argc, char **argv) { - static char stdpath[] = _PATH_STDPATH; - struct jmploc loc, *old; - struct strlist *sp; - char *path; + const char *path; int ch; int cmd = -1; - for (sp = cmdenviron; sp ; sp = sp->next) - setvareq(sp->text, VEXPORT|VSTACK); - path = pathval(); + path = bltinlookup("PATH", 1); optind = optreset = 1; opterr = 0; while ((ch = getopt(argc, argv, "pvV")) != -1) { switch (ch) { case 'p': - path = stdpath; + path = _PATH_STDPATH; break; case 'v': cmd = TYPECMD_SMALLV; @@ -1026,24 +1119,16 @@ if (cmd != -1) { if (argc != 1) error("wrong number of arguments"); - return typecmd_impl(2, argv - 1, cmd); - } - if (argc != 0) { - old = handler; - handler = &loc; - if (setjmp(handler->loc) == 0) - shellexec(argv, environment(), path, 0); - handler = old; - if (exception == EXEXEC) - exit(exerrno); - exraise(exception); + return typecmd_impl(2, argv - 1, cmd, path); } + if (argc != 0) + error("commandcmd() called while it should not be"); /* * Do nothing successfully if no command was specified; * ksh also does this. */ - exit(0); + return 0; } @@ -1085,6 +1170,12 @@ int execcmd(int argc, char **argv) { + /* + * Because we have historically not supported any options, + * only treat "--" specially. + */ + if (argc > 1 && strcmp(argv[1], "--") == 0) + argc--, argv++; if (argc > 1) { struct strlist *sp; diff -urN stable/8/bin/sh/eval.h head/bin/sh/eval.h --- stable/8/bin/sh/eval.h 2009-06-13 17:17:45.691358000 -0400 +++ head/bin/sh/eval.h 2009-12-27 13:04:05.764326000 -0500 @@ -30,11 +30,12 @@ * SUCH DAMAGE. * * @(#)eval.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/eval.h 194128 2009-06-13 21:17:45Z jilles $ + * $FreeBSD: head/bin/sh/eval.h 201053 2009-12-27 18:04:05Z jilles $ */ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ +extern int oexitstatus; /* saved exit status */ extern struct strlist *cmdenviron; /* environment for builtin command */ diff -urN stable/8/bin/sh/exec.c head/bin/sh/exec.c --- stable/8/bin/sh/exec.c 2009-10-11 12:35:12.561852000 -0400 +++ head/bin/sh/exec.c 2010-03-06 11:57:53.405454000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/exec.c 197959 2009-10-11 16:35:12Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/exec.c 204800 2010-03-06 16:57:53Z jilles $"); #include #include @@ -98,7 +98,7 @@ STATIC void tryexec(char *, char **, char **); STATIC void printentry(struct tblentry *, int); -STATIC struct tblentry *cmdlookup(char *, int); +STATIC struct tblentry *cmdlookup(const char *, int); STATIC void delete_cmd_entry(void); @@ -109,7 +109,7 @@ */ void -shellexec(char **argv, char **envp, char *path, int index) +shellexec(char **argv, char **envp, const char *path, int idx) { char *cmdname; int e; @@ -120,7 +120,7 @@ } else { e = ENOENT; while ((cmdname = padvance(&path, argv[0])) != NULL) { - if (--index < 0 && pathopt == NULL) { + if (--idx < 0 && pathopt == NULL) { tryexec(cmdname, argv, envp); if (errno != ENOENT && errno != ENOTDIR) e = errno; @@ -175,13 +175,13 @@ * NULL. */ -char *pathopt; +const char *pathopt; char * -padvance(char **path, char *name) +padvance(const char **path, const char *name) { - char *p, *q; - char *start; + const char *p, *start; + char *q; int len; if (*path == NULL) @@ -248,14 +248,14 @@ && (cmdp->cmdtype == CMDNORMAL || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0))) delete_cmd_entry(); - find_command(name, &entry, 1, pathval()); + find_command(name, &entry, DO_ERR, pathval()); if (verbose) { if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ cmdp = cmdlookup(name, 0); if (cmdp != NULL) printentry(cmdp, verbose); else - outfmt(&errout, "%s: not found\n", name); + outfmt(out2, "%s: not found\n", name); } flushall(); } @@ -268,17 +268,17 @@ STATIC void printentry(struct tblentry *cmdp, int verbose) { - int index; - char *path; + int idx; + const char *path; char *name; if (cmdp->cmdtype == CMDNORMAL) { - index = cmdp->param.index; + idx = cmdp->param.index; path = pathval(); do { name = padvance(&path, cmdp->cmdname); stunalloc(name); - } while (--index >= 0); + } while (--idx >= 0); out1str(name); } else if (cmdp->cmdtype == CMDBUILTIN) { out1fmt("builtin %s", cmdp->cmdname); @@ -310,10 +310,11 @@ */ void -find_command(char *name, struct cmdentry *entry, int printerr, char *path) +find_command(const char *name, struct cmdentry *entry, int act, + const char *path) { - struct tblentry *cmdp; - int index; + struct tblentry *cmdp, loc_cmd; + int idx; int prev; char *fullname; struct stat statb; @@ -329,13 +330,19 @@ } /* If name is in the table, and not invalidated by cd, we're done */ - if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) - goto success; + if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) { + if (cmdp->cmdtype == CMDFUNCTION && act & DO_NOFUNC) + cmdp = NULL; + else + goto success; + } /* If %builtin not in path, check for builtin next */ if (builtinloc < 0 && (i = find_builtin(name, &spec)) >= 0) { INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDBUILTIN; cmdp->param.index = i; cmdp->special = spec; @@ -353,17 +360,19 @@ } e = ENOENT; - index = -1; + idx = -1; loop: while ((fullname = padvance(&path, name)) != NULL) { stunalloc(fullname); - index++; + idx++; if (pathopt) { if (prefix("builtin", pathopt)) { if ((i = find_builtin(name, &spec)) < 0) goto loop; INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDBUILTIN; cmdp->param.index = i; cmdp->special = spec; @@ -376,8 +385,8 @@ } } /* if rehash, don't redo absolute path names */ - if (fullname[0] == '/' && index <= prev) { - if (index < prev) + if (fullname[0] == '/' && idx <= prev) { + if (idx < prev) goto loop; TRACE(("searchexec \"%s\": no change\n", name)); goto success; @@ -413,22 +422,25 @@ TRACE(("searchexec \"%s\" returns \"%s\"\n", name, fullname)); INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDNORMAL; - cmdp->param.index = index; + cmdp->param.index = idx; INTON; goto success; } /* We failed. If there was an entry for this command, delete it */ - if (cmdp) + if (cmdp && cmdp->cmdtype != CMDFUNCTION) delete_cmd_entry(); - if (printerr) { + if (act & DO_ERR) { if (e == ENOENT || e == ENOTDIR) outfmt(out2, "%s: not found\n", name); else outfmt(out2, "%s: %s\n", name, strerror(e)); } entry->cmdtype = CMDUNKNOWN; + entry->u.index = 0; return; success: @@ -445,7 +457,7 @@ */ int -find_builtin(char *name, int *special) +find_builtin(const char *name, int *special) { const struct builtincmd *bp; @@ -492,18 +504,18 @@ changepath(const char *newval) { const char *old, *new; - int index; + int idx; int firstchange; int bltin; old = pathval(); new = newval; firstchange = 9999; /* assume no change */ - index = 0; + idx = 0; bltin = -1; for (;;) { if (*old != *new) { - firstchange = index; + firstchange = idx; if ((*old == '\0' && *new == ':') || (*old == ':' && *new == '\0')) firstchange++; @@ -512,9 +524,9 @@ if (*new == '\0') break; if (*new == '%' && bltin < 0 && prefix("builtin", new + 1)) - bltin = index; + bltin = idx; if (*new == ':') { - index++; + idx++; } new++, old++; } @@ -607,10 +619,10 @@ STATIC struct tblentry * -cmdlookup(char *name, int add) +cmdlookup(const char *name, int add) { int hashval; - char *p; + const char *p; struct tblentry *cmdp; struct tblentry **pp; @@ -663,7 +675,7 @@ */ void -addcmdentry(char *name, struct cmdentry *entry) +addcmdentry(const char *name, struct cmdentry *entry) { struct tblentry *cmdp; @@ -683,7 +695,7 @@ */ void -defun(char *name, union node *func) +defun(const char *name, union node *func) { struct cmdentry entry; @@ -700,7 +712,7 @@ */ int -unsetfunc(char *name) +unsetfunc(const char *name) { struct tblentry *cmdp; @@ -718,19 +730,21 @@ */ int -typecmd_impl(int argc, char **argv, int cmd) +typecmd_impl(int argc, char **argv, int cmd, const char *path) { struct cmdentry entry; struct tblentry *cmdp; - char **pp; + const char *const *pp; struct alias *ap; int i; - int error = 0; - extern char *const parsekwd[]; + int error1 = 0; + + if (path != pathval()) + clearcmdentry(0); for (i = 1; i < argc; i++) { /* First look at the keywords */ - for (pp = (char **)parsekwd; *pp; pp++) + for (pp = parsekwd; *pp; pp++) if (**pp == *argv[i] && equal(*pp, argv[i])) break; @@ -760,16 +774,17 @@ } else { /* Finally use brute force */ - find_command(argv[i], &entry, 0, pathval()); + find_command(argv[i], &entry, 0, path); } switch (entry.cmdtype) { case CMDNORMAL: { if (strchr(argv[i], '/') == NULL) { - char *path = pathval(), *name; + const char *path2 = path; + char *name; int j = entry.u.index; do { - name = padvance(&path, argv[i]); + name = padvance(&path2, argv[i]); stunalloc(name); } while (--j >= 0); if (cmd == TYPECMD_SMALLV) @@ -790,7 +805,7 @@ if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: %s\n", argv[i], strerror(errno)); - error |= 127; + error1 |= 127; } } break; @@ -815,11 +830,15 @@ default: if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: not found\n", argv[i]); - error |= 127; + error1 |= 127; break; } } - return error; + + if (path != pathval()) + clearcmdentry(0); + + return error1; } /* @@ -829,5 +848,5 @@ int typecmd(int argc, char **argv) { - return typecmd_impl(argc, argv, TYPECMD_TYPE); + return typecmd_impl(argc, argv, TYPECMD_TYPE, bltinlookup("PATH", 1)); } diff -urN stable/8/bin/sh/exec.h head/bin/sh/exec.h --- stable/8/bin/sh/exec.h 2009-10-11 12:35:12.561852000 -0400 +++ head/bin/sh/exec.h 2010-03-06 11:57:53.405454000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)exec.h 8.3 (Berkeley) 6/8/95 - * $FreeBSD: stable/8/bin/sh/exec.h 197959 2009-10-11 16:35:12Z jilles $ + * $FreeBSD: head/bin/sh/exec.h 204800 2010-03-06 16:57:53Z jilles $ */ /* values of cmdtype */ @@ -57,20 +57,24 @@ }; -extern char *pathopt; /* set by padvance */ +/* action to find_command() */ +#define DO_ERR 0x01 /* prints errors */ +#define DO_NOFUNC 0x02 /* don't return shell functions, for command */ + +extern const char *pathopt; /* set by padvance */ extern int exerrno; /* last exec error */ -void shellexec(char **, char **, char *, int); -char *padvance(char **, char *); +void shellexec(char **, char **, const char *, int) __dead2; +char *padvance(const char **, const char *); int hashcmd(int, char **); -void find_command(char *, struct cmdentry *, int, char *); -int find_builtin(char *, int *); +void find_command(const char *, struct cmdentry *, int, const char *); +int find_builtin(const char *, int *); void hashcd(void); void changepath(const char *); void deletefuncs(void); -void addcmdentry(char *, struct cmdentry *); -void defun(char *, union node *); -int unsetfunc(char *); -int typecmd_impl(int, char **, int); +void addcmdentry(const char *, struct cmdentry *); +void defun(const char *, union node *); +int unsetfunc(const char *); +int typecmd_impl(int, char **, int, const char *); int typecmd(int, char **); void clearcmdentry(int); diff -urN stable/8/bin/sh/expand.c head/bin/sh/expand.c --- stable/8/bin/sh/expand.c 2010-05-16 18:52:51.682053000 -0400 +++ head/bin/sh/expand.c 2010-05-11 19:19:28.413799000 -0400 @@ -38,7 +38,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/expand.c 208174 2010-05-16 22:52:51Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/expand.c 207944 2010-05-11 23:19:28Z jilles $"); #include #include @@ -109,7 +109,7 @@ STATIC void addfname(char *); STATIC struct strlist *expsort(struct strlist *); STATIC struct strlist *msort(struct strlist *, int); -STATIC int pmatch(char *, char *, int); +STATIC int pmatch(const char *, const char *, int); STATIC char *cvtnum(int, char *); STATIC int collate_range_cmp(int, int); @@ -273,8 +273,12 @@ while ((c = *p) != '\0') { switch(c) { - case CTLESC: - return (startp); + case CTLESC: /* This means CTL* are always considered quoted. */ + case CTLVAR: + case CTLBACKQ: + case CTLBACKQ | CTLQUOTE: + case CTLARI: + case CTLENDARI: case CTLQUOTEMARK: return (startp); case ':': @@ -282,6 +286,7 @@ goto done; break; case '/': + case CTLENDVAR: goto done; } p++; @@ -357,7 +362,7 @@ void expari(int flag) { - char *p, *start; + char *p, *q, *start; arith_t result; int begoff; int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); @@ -395,7 +400,9 @@ removerecordregions(begoff); if (quotes) rmescapes(p+2); + q = grabstackstr(expdest); result = arith(p+2); + ungrabstackstr(q, expdest); fmtstr(p, DIGITS(result), ARITH_FORMAT_STR, result); while (*p++) ; @@ -503,7 +510,9 @@ int amount; herefd = -1; - argstr(p, 0); + argstr(p, (subtype == VSTRIMLEFT || subtype == VSTRIMLEFTMAX || + subtype == VSTRIMRIGHT || subtype == VSTRIMRIGHTMAX ? + EXP_CASE : 0) | EXP_TILDE); STACKSTRNUL(expdest); herefd = saveherefd; argbackq = saveargbackq; @@ -523,7 +532,7 @@ case VSQUESTION: if (*p != CTLENDVAR) { - outfmt(&errout, "%s\n", startp); + outfmt(out2, "%s\n", startp); error((char *)NULL); } error("%.*s: parameter %snot set", (int)(p - str - 1), @@ -659,7 +668,7 @@ } varlen = 0; startloc = expdest - stackblock(); - if (!set && uflag) { + if (!set && uflag && *var != '@' && *var != '*') { switch (subtype) { case VSNORMAL: case VSTRIMLEFT: @@ -852,7 +861,6 @@ int num; char *p; int i; - extern int oexitstatus; char sep; char **ap; char const *syntax; @@ -976,7 +984,7 @@ char *start; char *p; char *q; - char *ifs; + const char *ifs; const char *ifsspc; int had_param_ch = 0; @@ -1344,7 +1352,7 @@ */ int -patmatch(char *pattern, char *string, int squoted) +patmatch(const char *pattern, const char *string, int squoted) { #ifdef notdef if (pattern[0] == '!' && pattern[1] == '!') @@ -1356,9 +1364,9 @@ STATIC int -pmatch(char *pattern, char *string, int squoted) +pmatch(const char *pattern, const char *string, int squoted) { - char *p, *q; + const char *p, *q; char c; p = pattern; @@ -1406,7 +1414,7 @@ } while (*q++ != '\0'); return 0; case '[': { - char *endp; + const char *endp; int invert, found; char chr; @@ -1510,7 +1518,7 @@ */ int -casematch(union node *pattern, char *val) +casematch(union node *pattern, const char *val) { struct stackmark smark; int result; diff -urN stable/8/bin/sh/expand.h head/bin/sh/expand.h --- stable/8/bin/sh/expand.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/expand.h 2009-12-24 13:41:14.411055000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)expand.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/expand.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/expand.h 200956 2009-12-24 18:41:14Z jilles $ */ struct strlist { @@ -58,7 +58,7 @@ void expandhere(union node *, int); void expandarg(union node *, struct arglist *, int); void expari(int); -int patmatch(char *, char *, int); +int patmatch(const char *, const char *, int); void rmescapes(char *); -int casematch(union node *, char *); +int casematch(union node *, const char *); int wordexpcmd(int, char **); diff -urN stable/8/bin/sh/funcs/cmv head/bin/sh/funcs/cmv --- stable/8/bin/sh/funcs/cmv 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/funcs/cmv 2005-01-10 03:39:26.000000000 -0500 @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)cmv 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/funcs/cmv 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/funcs/cmv 139969 2005-01-10 08:39:26Z imp $ # Conditional move--don't replace an existing file. diff -urN stable/8/bin/sh/funcs/dirs head/bin/sh/funcs/dirs --- stable/8/bin/sh/funcs/dirs 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/funcs/dirs 2005-01-10 03:39:26.000000000 -0500 @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)dirs 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/funcs/dirs 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/funcs/dirs 139969 2005-01-10 08:39:26Z imp $ # pushd, popd, and dirs --- written by Chris Bertin # Pixel Computer Inc. ...!wjh12!pixel!pixutl!chris diff -urN stable/8/bin/sh/funcs/kill head/bin/sh/funcs/kill --- stable/8/bin/sh/funcs/kill 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/funcs/kill 2005-01-10 03:39:26.000000000 -0500 @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)kill 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/funcs/kill 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/funcs/kill 139969 2005-01-10 08:39:26Z imp $ # Convert job names to process ids and then run /bin/kill. diff -urN stable/8/bin/sh/funcs/login head/bin/sh/funcs/login --- stable/8/bin/sh/funcs/login 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/funcs/login 2005-01-10 03:39:26.000000000 -0500 @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)login 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/funcs/login 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/funcs/login 139969 2005-01-10 08:39:26Z imp $ # replaces the login builtin in the BSD shell login () exec login "$@" diff -urN stable/8/bin/sh/funcs/newgrp head/bin/sh/funcs/newgrp --- stable/8/bin/sh/funcs/newgrp 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/funcs/newgrp 2005-01-10 03:39:26.000000000 -0500 @@ -32,6 +32,6 @@ # SUCH DAMAGE. # # @(#)newgrp 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/funcs/newgrp 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/funcs/newgrp 139969 2005-01-10 08:39:26Z imp $ newgrp() exec newgrp "$@" diff -urN stable/8/bin/sh/funcs/popd head/bin/sh/funcs/popd --- stable/8/bin/sh/funcs/popd 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/funcs/popd 2005-01-10 03:39:26.000000000 -0500 @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)popd 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/funcs/popd 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/funcs/popd 139969 2005-01-10 08:39:26Z imp $ # pushd, popd, and dirs --- written by Chris Bertin # Pixel Computer Inc. ...!wjh12!pixel!pixutl!chris diff -urN stable/8/bin/sh/funcs/pushd head/bin/sh/funcs/pushd --- stable/8/bin/sh/funcs/pushd 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/funcs/pushd 2005-01-10 03:39:26.000000000 -0500 @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)pushd 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/funcs/pushd 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/funcs/pushd 139969 2005-01-10 08:39:26Z imp $ # pushd, popd, and dirs --- written by Chris Bertin # Pixel Computer Inc. ...!wjh12!pixel!pixutl!chris diff -urN stable/8/bin/sh/funcs/suspend head/bin/sh/funcs/suspend --- stable/8/bin/sh/funcs/suspend 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/funcs/suspend 2005-01-10 03:39:26.000000000 -0500 @@ -30,7 +30,7 @@ # SUCH DAMAGE. # # @(#)suspend 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/funcs/suspend 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/funcs/suspend 139969 2005-01-10 08:39:26Z imp $ suspend() { local - diff -urN stable/8/bin/sh/histedit.c head/bin/sh/histedit.c --- stable/8/bin/sh/histedit.c 2009-06-23 16:45:12.009544000 -0400 +++ head/bin/sh/histedit.c 2010-06-15 17:58:40.504446000 -0400 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/histedit.c 194765 2009-06-23 20:45:12Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/histedit.c 209221 2010-06-15 21:58:40Z jilles $"); #include #include @@ -92,12 +92,14 @@ if (hist != NULL) sethistsize(histsizeval()); else - out2str("sh: can't initialize history\n"); + out2fmt_flush("sh: can't initialize history\n"); } if (editing && !el && isatty(0)) { /* && isatty(2) ??? */ /* * turn editing on */ + char *term; + INTOFF; if (el_in == NULL) el_in = fdopen(0, "r"); @@ -107,14 +109,22 @@ el_out = fdopen(2, "w"); if (el_in == NULL || el_err == NULL || el_out == NULL) goto bad; + term = lookupvar("TERM"); + if (term) + setenv("TERM", term, 1); + else + unsetenv("TERM"); el = el_init(arg0, el_in, el_out, el_err); if (el != NULL) { if (hist) el_set(el, EL_HIST, history, hist); el_set(el, EL_PROMPT, getprompt); + el_set(el, EL_ADDFN, "sh-complete", + "Filename completion", + _el_fn_sh_complete); } else { bad: - out2str("sh: can't initialize editing\n"); + out2fmt_flush("sh: can't initialize editing\n"); } INTON; } else if (!editing && el) { @@ -128,6 +138,7 @@ el_set(el, EL_EDITOR, "vi"); else if (Eflag) el_set(el, EL_EDITOR, "emacs"); + el_set(el, EL_BIND, "^I", "sh-complete", NULL); el_source(el, NULL); } } else { @@ -160,23 +171,30 @@ } } +void +setterm(const char *term) +{ + if (rootshell && el != NULL && term != NULL) + el_set(el, EL_TERMINAL, term); +} + int histcmd(int argc, char **argv) { int ch; - char *editor = NULL; + const char *editor = NULL; HistEvent he; int lflg = 0, nflg = 0, rflg = 0, sflg = 0; int i, retval; - char *firststr, *laststr; + const char *firststr, *laststr; int first, last, direction; - char *pat = NULL, *repl; + char *pat = NULL, *repl = NULL; static int active = 0; struct jmploc jmploc; struct jmploc *savehandler; char editfilestr[PATH_MAX]; char *volatile editfile; - FILE *efp; + FILE *efp = NULL; int oldhistnum; if (hist == NULL) @@ -336,6 +354,7 @@ if (sflg) { if (displayhist) { out2str(s); + flushout(out2); } evalstring(s, 0); if (displayhist && hist) { @@ -405,7 +424,7 @@ } int -not_fcnumber(char *s) +not_fcnumber(const char *s) { if (s == NULL) return (0); @@ -415,10 +434,10 @@ } int -str_to_event(char *str, int last) +str_to_event(const char *str, int last) { HistEvent he; - char *s = str; + const char *s = str; int relative = 0; int i, retval; diff -urN stable/8/bin/sh/init.h head/bin/sh/init.h --- stable/8/bin/sh/init.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/init.h 2004-04-06 16:06:54.000000000 -0400 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)init.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/init.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/init.h 127958 2004-04-06 20:06:54Z markm $ */ void init(void); diff -urN stable/8/bin/sh/input.c head/bin/sh/input.c --- stable/8/bin/sh/input.c 2009-06-17 17:58:32.143624000 -0400 +++ head/bin/sh/input.c 2009-12-27 13:04:05.764326000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/input.c 194406 2009-06-17 21:58:32Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/input.c 201053 2009-12-27 18:04:05Z jilles $"); #include /* defines BUFSIZ */ #include @@ -93,7 +93,7 @@ int plinno = 1; /* input line number */ -MKINIT int parsenleft; /* copy of parsefile->nleft */ +int parsenleft; /* copy of parsefile->nleft */ MKINIT int parselleft; /* copy of parsefile->lleft */ char *parsenextc; /* copy of parsefile->nextc */ MKINIT struct parsefile basepf; /* top level input file */ @@ -111,9 +111,9 @@ INCLUDE "input.h" INCLUDE "error.h" -INIT { - extern char basebuf[]; +MKINIT char basebuf[]; +INIT { basepf.nextc = basepf.buf = basebuf; } @@ -215,7 +215,7 @@ if (flags >= 0 && flags & O_NONBLOCK) { flags &=~ O_NONBLOCK; if (fcntl(0, F_SETFL, flags) >= 0) { - out2str("sh: turning off NDELAY mode\n"); + out2fmt_flush("sh: turning off NDELAY mode\n"); goto retry; } } @@ -359,7 +359,7 @@ struct strpush *sp; INTOFF; -/*dprintf("*** calling pushstring: %s, %d\n", s, len);*/ +/*out2fmt_flush("*** calling pushstring: %s, %d\n", s, len);*/ if (parsefile->strpush) { sp = ckmalloc(sizeof (struct strpush)); sp->prev = parsefile->strpush; @@ -386,7 +386,7 @@ parsenextc = sp->prevstring; parsenleft = sp->prevnleft; parselleft = sp->prevlleft; -/*dprintf("*** calling popstring: restoring to '%s'\n", parsenextc);*/ +/*out2fmt_flush("*** calling popstring: restoring to '%s'\n", parsenextc);*/ if (sp->ap) sp->ap->flag &= ~ALIASINUSE; parsefile->strpush = sp->prev; @@ -401,7 +401,7 @@ */ void -setinputfile(char *fname, int push) +setinputfile(const char *fname, int push) { int fd; int fd2; @@ -509,6 +509,32 @@ /* + * Return current file (to go back to it later using popfilesupto()). + */ + +struct parsefile * +getcurrentfile(void) +{ + return parsefile; +} + + +/* + * Pop files until the given file is on top again. Useful for regular + * builtins that read shell commands from files or strings. + * If the given file is not an active file, an error is raised. + */ + +void +popfilesupto(struct parsefile *file) +{ + while (parsefile != file && parsefile != &basepf) + popfile(); + if (parsefile != file) + error("popfilesupto() misused"); +} + +/* * Return to top level. */ diff -urN stable/8/bin/sh/input.h head/bin/sh/input.h --- stable/8/bin/sh/input.h 2009-06-13 17:17:45.691358000 -0400 +++ head/bin/sh/input.h 2009-12-24 13:41:14.411055000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)input.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/input.h 194128 2009-06-13 21:17:45Z jilles $ + * $FreeBSD: head/bin/sh/input.h 200956 2009-12-24 18:41:14Z jilles $ */ /* PEOF (the end of file marker) is defined in syntax.h */ @@ -45,6 +45,8 @@ extern char *parsenextc; /* next character in input buffer */ extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */ +struct parsefile; + char *pfgets(char *, int); int pgetc(void); int preadbuffer(void); @@ -52,10 +54,12 @@ void pungetc(void); void pushstring(char *, int, void *); void popstring(void); -void setinputfile(char *, int); +void setinputfile(const char *, int); void setinputfd(int, int); void setinputstring(char *, int); void popfile(void); +struct parsefile *getcurrentfile(void); +void popfilesupto(struct parsefile *); void popallfiles(void); void closescript(void); diff -urN stable/8/bin/sh/jobs.c head/bin/sh/jobs.c --- stable/8/bin/sh/jobs.c 2006-10-07 12:51:16.000000000 -0400 +++ head/bin/sh/jobs.c 2010-06-06 18:27:32.647903000 -0400 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/jobs.c 163085 2006-10-07 16:51:16Z stefanf $"); +__FBSDID("$FreeBSD: head/bin/sh/jobs.c 208881 2010-06-06 22:27:32Z jilles $"); #include #include @@ -91,8 +91,9 @@ STATIC struct job *getjob(char *); STATIC pid_t dowait(int, struct job *); STATIC pid_t waitproc(int, int *); +STATIC void checkzombies(void); STATIC void cmdtxt(union node *); -STATIC void cmdputs(char *); +STATIC void cmdputs(const char *); #if JOBS STATIC void setcurjob(struct job *); STATIC void deljob(struct job *); @@ -146,7 +147,7 @@ do { /* while we are in the background */ initialpgrp = tcgetpgrp(ttyfd); if (initialpgrp < 0) { -out: out2str("sh: can't access tty; job control turned off\n"); +out: out2fmt_flush("sh: can't access tty; job control turned off\n"); mflag = 0; return; } @@ -400,7 +401,7 @@ struct job *jp; TRACE(("showjobs(%d) called\n", change)); - while (dowait(0, (struct job *)NULL) > 0); + checkzombies(); for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) { if (! jp->used) continue; @@ -742,6 +743,8 @@ TRACE(("forkshell(%%%d, %p, %d) called\n", jp - jobtab, (void *)n, mode)); INTOFF; + if (mode == FORK_BG) + checkzombies(); flushall(); pid = fork(); if (pid == -1) { @@ -757,6 +760,7 @@ TRACE(("Child shell %d\n", (int)getpid())); wasroot = rootshell; rootshell = 0; + handler = &main_handler; closescript(); INTON; clear_traps(); @@ -862,6 +866,7 @@ { #if JOBS pid_t mypgrp = getpgrp(); + int propagate_int = jp->jobctl && jp->foreground; #endif int status; int st; @@ -899,6 +904,11 @@ else CLEAR_PENDING_INT; } +#if JOBS + else if (rootshell && iflag && propagate_int && + WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) + kill(getpid(), SIGINT); +#endif INTON; return st; } @@ -1046,7 +1056,7 @@ if (jp->used == 0) continue; if (jp->state == JOBSTOPPED) { - out2str("You have stopped jobs.\n"); + out2fmt_flush("You have stopped jobs.\n"); job_warning = 2; return (1); } @@ -1055,6 +1065,15 @@ return (0); } + +STATIC void +checkzombies(void) +{ + while (njobs > 0 && dowait(0, NULL) > 0) + ; +} + + /* * Return a string identifying a command (to be printed by the * jobs command. @@ -1082,7 +1101,7 @@ { union node *np; struct nodelist *lp; - char *p; + const char *p; int i; char s[2]; @@ -1211,9 +1230,10 @@ STATIC void -cmdputs(char *s) +cmdputs(const char *s) { - char *p, *q; + const char *p; + char *q; char c; int subtype = 0; diff -urN stable/8/bin/sh/jobs.h head/bin/sh/jobs.h --- stable/8/bin/sh/jobs.h 2006-10-07 12:51:16.000000000 -0400 +++ head/bin/sh/jobs.h 2006-10-07 12:51:16.000000000 -0400 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)jobs.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/jobs.h 163085 2006-10-07 16:51:16Z stefanf $ + * $FreeBSD: head/bin/sh/jobs.h 163085 2006-10-07 16:51:16Z stefanf $ */ /* Mode argument to forkshell. Don't change FORK_FG or FORK_BG. */ diff -urN stable/8/bin/sh/mail.c head/bin/sh/mail.c --- stable/8/bin/sh/mail.c 2005-08-13 04:26:58.000000000 -0400 +++ head/bin/sh/mail.c 2009-12-24 13:41:14.411055000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/mail.c 149017 2005-08-13 08:26:58Z stefanf $"); +__FBSDID("$FreeBSD: head/bin/sh/mail.c 200956 2009-12-24 18:41:14Z jilles $"); /* * Routines to check for mail. (Perhaps make part of main.c?) @@ -72,7 +72,7 @@ chkmail(int silent) { int i; - char *mpath; + const char *mpath; char *p; char *q; struct stackmark smark; diff -urN stable/8/bin/sh/mail.h head/bin/sh/mail.h --- stable/8/bin/sh/mail.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/mail.h 2004-04-06 16:06:54.000000000 -0400 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)mail.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/mail.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/mail.h 127958 2004-04-06 20:06:54Z markm $ */ void chkmail(int); diff -urN stable/8/bin/sh/main.c head/bin/sh/main.c --- stable/8/bin/sh/main.c 2010-04-20 18:52:28.965483000 -0400 +++ head/bin/sh/main.c 2010-05-28 18:40:24.781829000 -0400 @@ -42,7 +42,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/main.c 206950 2010-04-20 22:52:28Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/main.c 208630 2010-05-28 22:40:24Z jilles $"); #include #include @@ -75,8 +75,9 @@ int rootpid; int rootshell; +struct jmploc main_handler; -STATIC void read_profile(char *); +STATIC void read_profile(const char *); STATIC char *find_dot_file(char *); /* @@ -90,14 +91,13 @@ int main(int argc, char *argv[]) { - struct jmploc jmploc; struct stackmark smark; volatile int state; char *shinit; (void) setlocale(LC_ALL, ""); state = 0; - if (setjmp(jmploc.loc)) { + if (setjmp(main_handler.loc)) { /* * When a shell procedure is executed, we raise the * exception EXSHELLPROC to clean up before executing @@ -143,7 +143,7 @@ else goto state4; } - handler = &jmploc; + handler = &main_handler; #ifdef DEBUG opentrace(); trputs("Shell args: "); trargs(argv); @@ -153,10 +153,7 @@ init(); setstackmark(&smark); procargs(argc, argv); - if (getpwd() == NULL && iflag) - out2str("sh: cannot determine working directory\n"); - if (getpwd() != NULL) - setvar ("PWD", getpwd(), VEXPORT); + pwd_init(iflag); if (iflag) chkmail(1); if (argv[0] && argv[0][0] == '-') { @@ -225,7 +222,7 @@ if (!stoppedjobs()) { if (!Iflag) break; - out2str("\nUse \"exit\" to leave shell.\n"); + out2fmt_flush("\nUse \"exit\" to leave shell.\n"); } numeof++; } else if (n != NULL && nflag == 0) { @@ -250,7 +247,7 @@ */ STATIC void -read_profile(char *name) +read_profile(const char *name) { int fd; @@ -271,7 +268,7 @@ */ void -readcmdfile(char *name) +readcmdfile(const char *name) { int fd; @@ -298,7 +295,7 @@ { static char localname[FILENAME_MAX+1]; char *fullname; - char *path = pathval(); + const char *path = pathval(); struct stat statb; /* don't try this for absolute or relative paths */ @@ -317,14 +314,20 @@ int dotcmd(int argc, char **argv) { - char *fullname; + char *filename, *fullname; if (argc < 2) error("missing filename"); exitstatus = 0; - fullname = find_dot_file(argv[1]); + /* + * Because we have historically not supported any options, + * only treat "--" specially. + */ + filename = argc > 2 && strcmp(argv[1], "--") == 0 ? argv[2] : argv[1]; + + fullname = find_dot_file(filename); setinputfile(fullname, 1); commandname = fullname; cmdloop(0); @@ -336,8 +339,6 @@ int exitcmd(int argc, char **argv) { - extern int oexitstatus; - if (stoppedjobs()) return 0; if (argc > 1) diff -urN stable/8/bin/sh/main.h head/bin/sh/main.h --- stable/8/bin/sh/main.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/main.h 2009-12-25 15:21:35.175590000 -0500 @@ -30,13 +30,14 @@ * SUCH DAMAGE. * * @(#)main.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/main.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/main.h 200998 2009-12-25 20:21:35Z jilles $ */ extern int rootpid; /* pid of main shell */ extern int rootshell; /* true if we aren't a child of the main shell */ +extern struct jmploc main_handler; /* top level exception handler */ -void readcmdfile(char *); +void readcmdfile(const char *); void cmdloop(int); int dotcmd(int, char **); int exitcmd(int, char **); diff -urN stable/8/bin/sh/memalloc.c head/bin/sh/memalloc.c --- stable/8/bin/sh/memalloc.c 2009-06-01 06:50:17.801753000 -0400 +++ head/bin/sh/memalloc.c 2009-12-24 13:41:14.411055000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/memalloc.c 193221 2009-06-01 10:50:17Z rse $"); +__FBSDID("$FreeBSD: head/bin/sh/memalloc.c 200956 2009-12-24 18:41:14Z jilles $"); #include #include "shell.h" @@ -95,7 +95,7 @@ */ char * -savestr(char *s) +savestr(const char *s) { char *p; diff -urN stable/8/bin/sh/memalloc.h head/bin/sh/memalloc.h --- stable/8/bin/sh/memalloc.h 2009-06-01 06:50:17.801753000 -0400 +++ head/bin/sh/memalloc.h 2009-12-24 13:41:14.411055000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)memalloc.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/memalloc.h 193221 2009-06-01 10:50:17Z rse $ + * $FreeBSD: head/bin/sh/memalloc.h 200956 2009-12-24 18:41:14Z jilles $ */ #include @@ -51,7 +51,7 @@ pointer ckmalloc(size_t); pointer ckrealloc(pointer, int); void ckfree(pointer); -char *savestr(char *); +char *savestr(const char *); pointer stalloc(int); void stunalloc(pointer); void setstackmark(struct stackmark *); diff -urN stable/8/bin/sh/miscbltin.c head/bin/sh/miscbltin.c --- stable/8/bin/sh/miscbltin.c 2009-06-23 16:57:27.407248000 -0400 +++ head/bin/sh/miscbltin.c 2009-12-27 13:04:05.764326000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/miscbltin.c 194767 2009-06-23 20:57:27Z kib $"); +__FBSDID("$FreeBSD: head/bin/sh/miscbltin.c 201053 2009-12-27 18:04:05Z jilles $"); /* * Miscellaneous builtins. @@ -93,7 +93,7 @@ char c; int rflag; char *prompt; - char *ifs; + const char *ifs; char *p; int startword; int status; @@ -254,7 +254,7 @@ int -umaskcmd(int argc __unused, char **argv) +umaskcmd(int argc __unused, char **argv __unused) { char *ap; int mask; diff -urN stable/8/bin/sh/mkbuiltins head/bin/sh/mkbuiltins --- stable/8/bin/sh/mkbuiltins 2006-04-02 14:43:33.000000000 -0400 +++ head/bin/sh/mkbuiltins 2009-12-27 13:04:05.764326000 -0500 @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)mkbuiltins 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/mkbuiltins 157413 2006-04-02 18:43:33Z stefanf $ +# $FreeBSD: head/bin/sh/mkbuiltins 201053 2009-12-27 18:04:05Z jilles $ temp=`/usr/bin/mktemp -t ka` havejobs=0 @@ -88,7 +88,7 @@ awk '{ printf "#define %s %d\n", $1, NR-1}' echo ' struct builtincmd { - char *name; + const char *name; int code; int special; }; diff -urN stable/8/bin/sh/mkinit.c head/bin/sh/mkinit.c --- stable/8/bin/sh/mkinit.c 2009-06-01 06:50:17.801753000 -0400 +++ head/bin/sh/mkinit.c 2009-12-27 13:04:05.764326000 -0500 @@ -42,7 +42,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/mkinit.c 193221 2009-06-01 10:50:17Z rse $"); +__FBSDID("$FreeBSD: head/bin/sh/mkinit.c 201053 2009-12-27 18:04:05Z jilles $"); /* * This program scans all the source files for code to handle various @@ -102,9 +102,9 @@ */ struct event { - char *name; /* name of event (e.g. INIT) */ - char *routine; /* name of routine called on event */ - char *comment; /* comment describing routine */ + const char *name; /* name of event (e.g. INIT) */ + const char *routine; /* name of routine called on event */ + const char *comment; /* comment describing routine */ struct text code; /* code for handling event */ }; @@ -140,7 +140,7 @@ }; -char *curfile; /* current file */ +const char *curfile; /* current file */ int linno; /* current line */ char *header_files[200]; /* list of header files */ struct text defines; /* #define statements */ @@ -148,20 +148,20 @@ int amiddecls; /* for formatting */ -void readfile(char *); -int match(char *, char *); -int gooddefine(char *); -void doevent(struct event *, FILE *, char *); +void readfile(const char *); +int match(const char *, const char *); +int gooddefine(const char *); +void doevent(struct event *, FILE *, const char *); void doinclude(char *); void dodecl(char *, FILE *); void output(void); -void addstr(char *, struct text *); +void addstr(const char *, struct text *); void addchar(int, struct text *); void writetext(struct text *, FILE *); -FILE *ckfopen(char *, char *); +FILE *ckfopen(const char *, const char *); void *ckmalloc(size_t); -char *savestr(char *); -void error(char *); +char *savestr(const char *); +void error(const char *); #define equal(s1, s2) (strcmp(s1, s2) == 0) @@ -170,9 +170,9 @@ { char **ap; - header_files[0] = "\"shell.h\""; - header_files[1] = "\"mystring.h\""; - header_files[2] = "\"init.h\""; + header_files[0] = savestr("\"shell.h\""); + header_files[1] = savestr("\"mystring.h\""); + header_files[2] = savestr("\"init.h\""); for (ap = argv + 1 ; *ap ; ap++) readfile(*ap); output(); @@ -186,7 +186,7 @@ */ void -readfile(char *fname) +readfile(const char *fname) { FILE *fp; char line[1024]; @@ -230,9 +230,9 @@ int -match(char *name, char *line) +match(const char *name, const char *line) { - char *p, *q; + const char *p, *q; p = name, q = line; while (*p) { @@ -246,9 +246,9 @@ int -gooddefine(char *line) +gooddefine(const char *line) { - char *p; + const char *p; if (! match("#define", line)) return 0; /* not a define */ @@ -269,11 +269,11 @@ void -doevent(struct event *ep, FILE *fp, char *fname) +doevent(struct event *ep, FILE *fp, const char *fname) { char line[1024]; int indent; - char *p; + const char *p; sprintf(line, "\n /* from %s: */\n", fname); addstr(line, &ep->code); @@ -407,7 +407,7 @@ */ void -addstr(char *s, struct text *text) +addstr(const char *s, struct text *text) { while (*s) { if (--text->nleft < 0) @@ -452,7 +452,7 @@ } FILE * -ckfopen(char *file, char *mode) +ckfopen(const char *file, const char *mode) { FILE *fp; @@ -474,7 +474,7 @@ } char * -savestr(char *s) +savestr(const char *s) { char *p; @@ -484,7 +484,7 @@ } void -error(char *msg) +error(const char *msg) { if (curfile != NULL) fprintf(stderr, "%s:%d: ", curfile, linno); diff -urN stable/8/bin/sh/mknodes.c head/bin/sh/mknodes.c --- stable/8/bin/sh/mknodes.c 2009-10-11 12:35:12.561852000 -0400 +++ head/bin/sh/mknodes.c 2009-08-28 18:41:25.158935000 -0400 @@ -42,7 +42,7 @@ #endif /* not lint */ #endif #include -__FBSDID("$FreeBSD: stable/8/bin/sh/mknodes.c 197959 2009-10-11 16:35:12Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/mknodes.c 196634 2009-08-28 22:41:25Z jilles $"); /* * This program reads the nodetypes file and nodes.c.pat file. It generates diff -urN stable/8/bin/sh/mksyntax.c head/bin/sh/mksyntax.c --- stable/8/bin/sh/mksyntax.c 2009-06-01 07:38:38.880711000 -0400 +++ head/bin/sh/mksyntax.c 2010-04-11 08:24:47.653720000 -0400 @@ -42,7 +42,7 @@ #endif /* not lint */ #endif #include -__FBSDID("$FreeBSD: stable/8/bin/sh/mksyntax.c 193225 2009-06-01 11:38:38Z rse $"); +__FBSDID("$FreeBSD: head/bin/sh/mksyntax.c 206473 2010-04-11 12:24:47Z jilles $"); /* * This program creates syntax.h and syntax.c. @@ -55,8 +55,8 @@ struct synclass { - char *name; - char *comment; + const char *name; + const char *comment; }; /* Syntax classes */ @@ -101,16 +101,16 @@ static FILE *cfile; static FILE *hfile; -static char *syntax[513]; +static const char *syntax[513]; static int base; static int size; /* number of values which a char variable can have */ static int nbits; /* number of bits in a character */ static int digit_contig;/* true if digits are contiguous */ -static void filltable(char *); +static void filltable(const char *); static void init(void); -static void add(char *, char *); -static void print(char *); +static void add(const char *, const char *); +static void print(const char *); static void output_type_macros(void); static void digit_convert(void); @@ -232,7 +232,6 @@ add("\n", "CNL"); add("\\", "CBACK"); add("`", "CBQUOTE"); - add("'", "CSQUOTE"); add("\"", "CDQUOTE"); add("$", "CVAR"); add("}", "CENDVAR"); @@ -259,7 +258,7 @@ */ static void -filltable(char *dftval) +filltable(const char *dftval) { int i; @@ -293,7 +292,7 @@ */ static void -add(char *p, char *type) +add(const char *p, const char *type) { while (*p) syntax[*p++ + base] = type; @@ -306,7 +305,7 @@ */ static void -print(char *name) +print(const char *name) { int i; int col; @@ -338,7 +337,7 @@ * contiguous, we can test for them quickly. */ -static char *macro[] = { +static const char *macro[] = { "#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)", "#define is_eof(c)\t((c) == PEOF)", "#define is_alpha(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))", @@ -351,7 +350,7 @@ static void output_type_macros(void) { - char **pp; + const char **pp; if (digit_contig) macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)"; diff -urN stable/8/bin/sh/mktokens head/bin/sh/mktokens --- stable/8/bin/sh/mktokens 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/mktokens 2005-01-10 03:39:26.000000000 -0500 @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)mktokens 8.1 (Berkeley) 5/31/93 -# $FreeBSD: stable/8/bin/sh/mktokens 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/mktokens 139969 2005-01-10 08:39:26Z imp $ # The following is a list of tokens. The second column is nonzero if the # token marks the end of a list. The third column is the name to print in diff -urN stable/8/bin/sh/myhistedit.h head/bin/sh/myhistedit.h --- stable/8/bin/sh/myhistedit.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/myhistedit.h 2010-06-02 15:16:58.408982000 -0400 @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)myhistedit.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/myhistedit.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/myhistedit.h 208755 2010-06-02 19:16:58Z jilles $ */ #include @@ -38,8 +38,9 @@ void histedit(void); void sethistsize(const char *); +void setterm(const char *); int histcmd(int, char **); -int not_fcnumber(char *); -int str_to_event(char *, int); +int not_fcnumber(const char *); +int str_to_event(const char *, int); int bindcmd(int, char **); diff -urN stable/8/bin/sh/mystring.c head/bin/sh/mystring.c --- stable/8/bin/sh/mystring.c 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/mystring.c 2009-12-27 13:04:05.764326000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/mystring.c 127958 2004-04-06 20:06:54Z markm $"); +__FBSDID("$FreeBSD: head/bin/sh/mystring.c 201053 2009-12-27 18:04:05Z jilles $"); /* * String functions. @@ -108,7 +108,7 @@ number(const char *s) { if (! is_number(s)) - error("Illegal number: %s", (char *)s); + error("Illegal number: %s", s); return atoi(s); } diff -urN stable/8/bin/sh/mystring.h head/bin/sh/mystring.h --- stable/8/bin/sh/mystring.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/mystring.h 2004-04-06 16:06:54.000000000 -0400 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)mystring.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/mystring.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/mystring.h 127958 2004-04-06 20:06:54Z markm $ */ #include diff -urN stable/8/bin/sh/nodes.c.pat head/bin/sh/nodes.c.pat --- stable/8/bin/sh/nodes.c.pat 2009-10-11 12:35:12.561852000 -0400 +++ head/bin/sh/nodes.c.pat 2009-08-28 18:41:25.158935000 -0400 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)nodes.c.pat 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/nodes.c.pat 197959 2009-10-11 16:35:12Z jilles $ + * $FreeBSD: head/bin/sh/nodes.c.pat 196634 2009-08-28 22:41:25Z jilles $ */ #include diff -urN stable/8/bin/sh/nodetypes head/bin/sh/nodetypes --- stable/8/bin/sh/nodetypes 2005-01-10 03:39:26.000000000 -0500 +++ head/bin/sh/nodetypes 2005-01-10 03:39:26.000000000 -0500 @@ -30,7 +30,7 @@ # SUCH DAMAGE. # # @(#)nodetypes 8.2 (Berkeley) 5/4/95 -# $FreeBSD: stable/8/bin/sh/nodetypes 139969 2005-01-10 08:39:26Z imp $ +# $FreeBSD: head/bin/sh/nodetypes 139969 2005-01-10 08:39:26Z imp $ # This file describes the nodes used in parse trees. Unindented lines # contain a node type followed by a structure tag. Subsequent indented diff -urN stable/8/bin/sh/options.c head/bin/sh/options.c --- stable/8/bin/sh/options.c 2008-08-27 16:16:06.461092000 -0400 +++ head/bin/sh/options.c 2010-04-05 10:15:51.345103000 -0400 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/options.c 182300 2008-08-27 20:16:06Z stefanf $"); +__FBSDID("$FreeBSD: head/bin/sh/options.c 206182 2010-04-05 14:15:51Z jilles $"); #include #include @@ -64,7 +64,7 @@ struct shparam shellparam; /* current positional parameters */ char **argptr; /* argument list for builtin commands */ char *shoptarg; /* set by nextopt (like getopt) */ -char *optptr; /* used by nextopt */ +char *nextopt_optptr; /* used by nextopt */ char *minusc; /* argument to -c option */ @@ -93,8 +93,11 @@ options(1); if (*argptr == NULL && minusc == NULL) sflag = 1; - if (iflag == 2 && sflag == 1 && isatty(0) && isatty(1)) + if (iflag != 0 && sflag == 1 && isatty(0) && isatty(1)) { iflag = 1; + if (Eflag == 2) + Eflag = 1; + } if (mflag == 2) mflag = iflag; for (i = 0; i < NOPTS; i++) @@ -554,12 +557,13 @@ */ int -nextopt(char *optstring) +nextopt(const char *optstring) { - char *p, *q; + char *p; + const char *q; char c; - if ((p = optptr) == NULL || *p == '\0') { + if ((p = nextopt_optptr) == NULL || *p == '\0') { p = *argptr; if (p == NULL || *p != '-' || *++p == '\0') return '\0'; @@ -580,6 +584,6 @@ shoptarg = p; p = NULL; } - optptr = p; + nextopt_optptr = p; return c; } diff -urN stable/8/bin/sh/options.h head/bin/sh/options.h --- stable/8/bin/sh/options.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/options.h 2009-12-27 13:04:05.764326000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)options.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/options.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/options.h 201053 2009-12-27 18:04:05Z jilles $ */ struct shparam { @@ -102,7 +102,7 @@ extern struct shparam shellparam; /* $@ */ extern char **argptr; /* argument list for builtin commands */ extern char *shoptarg; /* set by nextopt */ -extern char *optptr; /* used by nextopt */ +extern char *nextopt_optptr; /* used by nextopt */ void procargs(int, char **); void optschanged(void); @@ -111,5 +111,5 @@ int shiftcmd(int, char **); int setcmd(int, char **); int getoptscmd(int, char **); -int nextopt(char *); +int nextopt(const char *); void getoptsreset(const char *); diff -urN stable/8/bin/sh/output.c head/bin/sh/output.c --- stable/8/bin/sh/output.c 2009-06-19 18:09:55.177892000 -0400 +++ head/bin/sh/output.c 2009-12-24 13:41:14.411055000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/output.c 194516 2009-06-19 22:09:55Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/output.c 200956 2009-12-24 18:41:14Z jilles $"); /* * Shell output routines. We use our own output routines because: @@ -71,7 +71,7 @@ static int doformat_wr(void *, const char *, int); struct output output = {NULL, 0, NULL, OUTBUFSIZ, 1, 0}; -struct output errout = {NULL, 0, NULL, 100, 2, 0}; +struct output errout = {NULL, 0, NULL, 256, 2, 0}; struct output memout = {NULL, 0, NULL, 0, MEM_OUT, 0}; struct output *out1 = &output; struct output *out2 = &errout; @@ -124,8 +124,6 @@ { while (*p) outc(*p++, file); - if (file == out2) - flushout(file); } /* Like outstr(), but quote for re-input into the shell. */ @@ -255,7 +253,7 @@ } void -dprintf(const char *fmt, ...) +out2fmt_flush(const char *fmt, ...) { va_list ap; @@ -316,7 +314,7 @@ */ int -xwrite(int fd, char *buf, int nbytes) +xwrite(int fd, const char *buf, int nbytes) { int ntry; int i; diff -urN stable/8/bin/sh/output.h head/bin/sh/output.h --- stable/8/bin/sh/output.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/output.h 2010-01-01 13:17:46.488302000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)output.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/output.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/output.h 201366 2010-01-01 18:17:46Z jilles $ */ #ifndef OUTPUT_INCL @@ -46,13 +46,13 @@ short flags; }; -extern struct output output; -extern struct output errout; +extern struct output output; /* to fd 1 */ +extern struct output errout; /* to fd 2 */ extern struct output memout; -extern struct output *out1; -extern struct output *out2; +extern struct output *out1; /* &memout if backquote, otherwise &output */ +extern struct output *out2; /* &memout if backquote with 2>&1, otherwise + &errout */ -void open_mem(char *, int, struct output *); void out1str(const char *); void out1qstr(const char *); void out2str(const char *); @@ -65,10 +65,10 @@ void freestdout(void); void outfmt(struct output *, const char *, ...) __printflike(2, 3); void out1fmt(const char *, ...) __printflike(1, 2); -void dprintf(const char *, ...) __printflike(1, 2); +void out2fmt_flush(const char *, ...) __printflike(1, 2); void fmtstr(char *, int, const char *, ...) __printflike(3, 4); void doformat(struct output *, const char *, va_list) __printflike(2, 0); -int xwrite(int, char *, int); +int xwrite(int, const char *, int); #define outc(c, file) (--(file)->nleft < 0? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c))) #define out1c(c) outc(c, out1); diff -urN stable/8/bin/sh/parser.c head/bin/sh/parser.c --- stable/8/bin/sh/parser.c 2010-04-20 18:20:31.838359000 -0400 +++ head/bin/sh/parser.c 2010-06-19 06:33:04.993394000 -0400 @@ -36,10 +36,11 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/parser.c 206942 2010-04-20 22:20:31Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/parser.c 209337 2010-06-19 10:33:04Z jilles $"); #include #include +#include #include "shell.h" #include "parser.h" @@ -79,10 +80,13 @@ int striptabs; /* if set, strip leading tabs */ }; +struct parser_temp { + struct parser_temp *next; + void *data; +}; STATIC struct heredoc *heredoclist; /* list of here documents to read */ -STATIC int parsebackquote; /* nonzero if we are inside backquotes */ STATIC int doprompt; /* if set, prompt the user */ STATIC int needprompt; /* true if interactive and at start of line */ STATIC int lasttoken; /* last token read */ @@ -95,6 +99,7 @@ STATIC int quoteflag; /* set if (part of) last token was quoted */ STATIC int startlinno; /* line # where last token started */ STATIC int funclinno; /* line # where the current function started */ +STATIC struct parser_temp *parser_temp; /* XXX When 'noaliases' is set to one, no alias expansion takes place. */ static int noaliases = 0; @@ -114,10 +119,77 @@ STATIC int readtoken1(int, char const *, char *, int); STATIC int noexpand(char *); STATIC void synexpect(int); -STATIC void synerror(char *); +STATIC void synerror(const char *); STATIC void setprompt(int); +STATIC void * +parser_temp_alloc(size_t len) +{ + struct parser_temp *t; + + INTOFF; + t = ckmalloc(sizeof(*t)); + t->data = NULL; + t->next = parser_temp; + parser_temp = t; + t->data = ckmalloc(len); + INTON; + return t->data; +} + + +STATIC void * +parser_temp_realloc(void *ptr, size_t len) +{ + struct parser_temp *t; + + INTOFF; + t = parser_temp; + if (ptr != t->data) + error("bug: parser_temp_realloc misused"); + t->data = ckrealloc(t->data, len); + INTON; + return t->data; +} + + +STATIC void +parser_temp_free_upto(void *ptr) +{ + struct parser_temp *t; + int done = 0; + + INTOFF; + while (parser_temp != NULL && !done) { + t = parser_temp; + parser_temp = t->next; + done = t->data == ptr; + ckfree(t->data); + ckfree(t); + } + INTON; + if (!done) + error("bug: parser_temp_free_upto misused"); +} + + +STATIC void +parser_temp_free_all(void) +{ + struct parser_temp *t; + + INTOFF; + while (parser_temp != NULL) { + t = parser_temp; + parser_temp = t->next; + ckfree(t->data); + ckfree(t); + } + INTON; +} + + /* * Read and parse a command. Returns NEOF on end of file. (NULL is a * valid parse tree indicating a blank line.) @@ -128,6 +200,12 @@ { int t; + /* This assumes the parser is not re-entered, + * which could happen if we add command substitution on PS1/PS2. + */ + parser_temp_free_all(); + heredoclist = NULL; + tokpushback = 0; doprompt = interact; if (doprompt) @@ -864,6 +942,188 @@ } +#define MAXNEST_STATIC 8 +struct tokenstate +{ + const char *syntax; /* *SYNTAX */ + int parenlevel; /* levels of parentheses in arithmetic */ + enum tokenstate_category + { + TSTATE_TOP, + TSTATE_VAR_OLD, /* ${var+-=?}, inherits dquotes */ + TSTATE_VAR_NEW, /* other ${var...}, own dquote state */ + TSTATE_ARITH + } category; +}; + + +/* + * Called to parse command substitutions. + */ + +STATIC char * +parsebackq(char *out, struct nodelist **pbqlist, + int oldstyle, int dblquote, int quoted) +{ + struct nodelist **nlpp; + union node *n; + char *volatile str; + struct jmploc jmploc; + struct jmploc *const savehandler = handler; + int savelen; + int saveprompt; + const int bq_startlinno = plinno; + char *volatile ostr = NULL; + struct parsefile *const savetopfile = getcurrentfile(); + struct heredoc *const saveheredoclist = heredoclist; + struct heredoc *here; + + str = NULL; + if (setjmp(jmploc.loc)) { + popfilesupto(savetopfile); + if (str) + ckfree(str); + if (ostr) + ckfree(ostr); + heredoclist = saveheredoclist; + handler = savehandler; + if (exception == EXERROR) { + startlinno = bq_startlinno; + synerror("Error in command substitution"); + } + longjmp(handler->loc, 1); + } + INTOFF; + savelen = out - stackblock(); + if (savelen > 0) { + str = ckmalloc(savelen); + memcpy(str, stackblock(), savelen); + } + handler = &jmploc; + heredoclist = NULL; + INTON; + if (oldstyle) { + /* We must read until the closing backquote, giving special + treatment to some slashes, and then push the string and + reread it as input, interpreting it normally. */ + char *oout; + int c; + int olen; + + + STARTSTACKSTR(oout); + for (;;) { + if (needprompt) { + setprompt(2); + needprompt = 0; + } + switch (c = pgetc()) { + case '`': + goto done; + + case '\\': + if ((c = pgetc()) == '\n') { + plinno++; + if (doprompt) + setprompt(2); + else + setprompt(0); + /* + * If eating a newline, avoid putting + * the newline into the new character + * stream (via the STPUTC after the + * switch). + */ + continue; + } + if (c != '\\' && c != '`' && c != '$' + && (!dblquote || c != '"')) + STPUTC('\\', oout); + break; + + case '\n': + plinno++; + needprompt = doprompt; + break; + + case PEOF: + startlinno = plinno; + synerror("EOF in backquote substitution"); + break; + + default: + break; + } + STPUTC(c, oout); + } +done: + STPUTC('\0', oout); + olen = oout - stackblock(); + INTOFF; + ostr = ckmalloc(olen); + memcpy(ostr, stackblock(), olen); + setinputstring(ostr, 1); + INTON; + } + nlpp = pbqlist; + while (*nlpp) + nlpp = &(*nlpp)->next; + *nlpp = (struct nodelist *)stalloc(sizeof (struct nodelist)); + (*nlpp)->next = NULL; + + if (oldstyle) { + saveprompt = doprompt; + doprompt = 0; + } + + n = list(0); + + if (oldstyle) + doprompt = saveprompt; + else { + if (readtoken() != TRP) + synexpect(TRP); + } + + (*nlpp)->n = n; + if (oldstyle) { + /* + * Start reading from old file again, ignoring any pushed back + * tokens left from the backquote parsing + */ + popfile(); + tokpushback = 0; + } + while (stackblocksize() <= savelen) + growstackblock(); + STARTSTACKSTR(out); + INTOFF; + if (str) { + memcpy(out, str, savelen); + STADJUST(savelen, out); + ckfree(str); + str = NULL; + } + if (ostr) { + ckfree(ostr); + ostr = NULL; + } + here = saveheredoclist; + if (here != NULL) { + while (here->next != NULL) + here = here->next; + here->next = heredoclist; + heredoclist = saveheredoclist; + } + handler = savehandler; + INTON; + if (quoted) + USTPUTC(CTLBACKQ | CTLQUOTE, out); + else + USTPUTC(CTLBACKQ, out); + return out; +} + /* * If eofmark is NULL, read a word or a redirection symbol. If eofmark @@ -880,12 +1140,10 @@ #define CHECKEND() {goto checkend; checkend_return:;} #define PARSEREDIR() {goto parseredir; parseredir_return:;} #define PARSESUB() {goto parsesub; parsesub_return:;} -#define PARSEBACKQOLD() {oldstyle = 1; goto parsebackq; parsebackq_oldreturn:;} -#define PARSEBACKQNEW() {oldstyle = 0; goto parsebackq; parsebackq_newreturn:;} #define PARSEARITH() {goto parsearith; parsearith_return:;} STATIC int -readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) +readtoken1(int firstc, char const *initialsyntax, char *eofmark, int striptabs) { int c = firstc; char *out; @@ -893,23 +1151,21 @@ char line[EOFMARKLEN + 1]; struct nodelist *bqlist; int quotef; - int dblquote; - int varnest; /* levels of variables expansion */ - int arinest; /* levels of arithmetic expansion */ - int parenlevel; /* levels of parens in arithmetic */ - int oldstyle; - char const *prevsyntax; /* syntax before arithmetic */ + int newvarnest; + int level; int synentry; + struct tokenstate state_static[MAXNEST_STATIC]; + int maxnest = MAXNEST_STATIC; + struct tokenstate *state = state_static; startlinno = plinno; - dblquote = 0; - if (syntax == DQSYNTAX) - dblquote = 1; quotef = 0; bqlist = NULL; - varnest = 0; - arinest = 0; - parenlevel = 0; + newvarnest = 0; + level = 0; + state[level].syntax = initialsyntax; + state[level].parenlevel = 0; + state[level].category = TSTATE_TOP; STARTSTACKSTR(out); loop: { /* for each line, until end of word */ @@ -917,11 +1173,11 @@ for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(3, out); /* permit 3 calls to USTPUTC */ - synentry = syntax[c]; + synentry = state[level].syntax[c]; switch(synentry) { case CNL: /* '\n' */ - if (syntax == BASESYNTAX) + if (state[level].syntax == BASESYNTAX) goto endword; /* exit outer loop */ USTPUTC(c, out); plinno++; @@ -935,7 +1191,7 @@ USTPUTC(c, out); break; case CCTL: - if (eofmark == NULL || dblquote) + if (eofmark == NULL || initialsyntax != SQSYNTAX) USTPUTC(CTLESC, out); USTPUTC(c, out); break; @@ -951,41 +1207,37 @@ else setprompt(0); } else { - if (dblquote && c != '\\' && - c != '`' && c != '$' && - (c != '"' || eofmark != NULL)) + if (state[level].syntax == DQSYNTAX && + c != '\\' && c != '`' && c != '$' && + (c != '"' || (eofmark != NULL && + newvarnest == 0)) && + (c != '}' || state[level].category != TSTATE_VAR_OLD)) USTPUTC('\\', out); if (SQSYNTAX[c] == CCTL) USTPUTC(CTLESC, out); - else if (eofmark == NULL) + else if (eofmark == NULL || + newvarnest > 0) USTPUTC(CTLQUOTEMARK, out); USTPUTC(c, out); quotef++; } break; case CSQUOTE: - if (eofmark == NULL) - USTPUTC(CTLQUOTEMARK, out); - syntax = SQSYNTAX; + USTPUTC(CTLQUOTEMARK, out); + state[level].syntax = SQSYNTAX; break; case CDQUOTE: - if (eofmark == NULL) - USTPUTC(CTLQUOTEMARK, out); - syntax = DQSYNTAX; - dblquote = 1; + USTPUTC(CTLQUOTEMARK, out); + state[level].syntax = DQSYNTAX; break; case CENDQUOTE: - if (eofmark != NULL && arinest == 0 && - varnest == 0) { + if (eofmark != NULL && newvarnest == 0) USTPUTC(c, out); - } else { - if (arinest) { - syntax = ARISYNTAX; - dblquote = 0; - } else if (eofmark == NULL) { - syntax = BASESYNTAX; - dblquote = 0; - } + else { + if (state[level].category == TSTATE_ARITH) + state[level].syntax = ARISYNTAX; + else + state[level].syntax = BASESYNTAX; quotef++; } break; @@ -993,30 +1245,33 @@ PARSESUB(); /* parse substitution */ break; case CENDVAR: /* '}' */ - if (varnest > 0) { - varnest--; + if (level > 0 && + (state[level].category == TSTATE_VAR_OLD || + state[level].category == TSTATE_VAR_NEW)) { + if (state[level].category == TSTATE_VAR_OLD) + state[level - 1].syntax = state[level].syntax; + else + newvarnest--; + level--; USTPUTC(CTLENDVAR, out); } else { USTPUTC(c, out); } break; case CLP: /* '(' in arithmetic */ - parenlevel++; + state[level].parenlevel++; USTPUTC(c, out); break; case CRP: /* ')' in arithmetic */ - if (parenlevel > 0) { + if (state[level].parenlevel > 0) { USTPUTC(c, out); - --parenlevel; + --state[level].parenlevel; } else { if (pgetc() == ')') { - if (--arinest == 0) { + if (level > 0 && + state[level].category == TSTATE_ARITH) { + level--; USTPUTC(CTLENDARI, out); - syntax = prevsyntax; - if (syntax == DQSYNTAX) - dblquote = 1; - else - dblquote = 0; } else USTPUTC(')', out); } else { @@ -1030,12 +1285,15 @@ } break; case CBQUOTE: /* '`' */ - PARSEBACKQOLD(); + out = parsebackq(out, &bqlist, 1, + state[level].syntax == DQSYNTAX && + (eofmark == NULL || newvarnest > 0), + state[level].syntax == DQSYNTAX || state[level].syntax == ARISYNTAX); break; case CEOF: goto endword; /* exit outer loop */ default: - if (varnest == 0) + if (level == 0) goto endword; /* exit outer loop */ USTPUTC(c, out); } @@ -1043,14 +1301,17 @@ } } endword: - if (syntax == ARISYNTAX) + if (state[level].syntax == ARISYNTAX) synerror("Missing '))'"); - if (syntax != BASESYNTAX && ! parsebackquote && eofmark == NULL) + if (state[level].syntax != BASESYNTAX && eofmark == NULL) synerror("Unterminated quoted string"); - if (varnest != 0) { + if (state[level].category == TSTATE_VAR_OLD || + state[level].category == TSTATE_VAR_NEW) { startlinno = plinno; synerror("Missing '}'"); } + if (state != state_static) + parser_temp_free_upto(state); USTPUTC('\0', out); len = out - stackblock(); out = stackblock(); @@ -1073,7 +1334,6 @@ /* end of readtoken routine */ - /* * Check to see whether we are at the end of the here document. When this * is called, c is set to the first character of the next input line. If @@ -1190,7 +1450,11 @@ PARSEARITH(); } else { pungetc(); - PARSEBACKQNEW(); + out = parsebackq(out, &bqlist, 0, + state[level].syntax == DQSYNTAX && + (eofmark == NULL || newvarnest > 0), + state[level].syntax == DQSYNTAX || + state[level].syntax == ARISYNTAX); } } else { USTPUTC(CTLVAR, out); @@ -1245,6 +1509,8 @@ subtype = VSERROR; if (c == '}') pungetc(); + else if (c == '\n' || c == PEOF) + synerror("Unexpected end of line in substitution"); else USTPUTC(c, out); } else { @@ -1261,6 +1527,8 @@ default: p = strchr(types, c); if (p == NULL) { + if (c == '\n' || c == PEOF) + synerror("Unexpected end of line in substitution"); if (flags == VSNUL) STPUTC(':', out); STPUTC(c, out); @@ -1286,192 +1554,74 @@ pungetc(); } STPUTC('=', out); - if (subtype != VSLENGTH && (dblquote || arinest)) + if (subtype != VSLENGTH && (state[level].syntax == DQSYNTAX || + state[level].syntax == ARISYNTAX)) flags |= VSQUOTE; *(stackblock() + typeloc) = subtype | flags; - if (subtype != VSNORMAL) - varnest++; - } - goto parsesub_return; -} - - -/* - * Called to parse command substitutions. Newstyle is set if the command - * is enclosed inside $(...); nlpp is a pointer to the head of the linked - * list of commands (passed by reference), and savelen is the number of - * characters on the top of the stack which must be preserved. - */ - -parsebackq: { - struct nodelist **nlpp; - int savepbq; - union node *n; - char *volatile str; - struct jmploc jmploc; - struct jmploc *const savehandler = handler; - int savelen; - int saveprompt; - const int bq_startlinno = plinno; - - savepbq = parsebackquote; - if (setjmp(jmploc.loc)) { - if (str) - ckfree(str); - parsebackquote = 0; - handler = savehandler; - if (exception == EXERROR) { - startlinno = bq_startlinno; - synerror("Error in command substitution"); - } - longjmp(handler->loc, 1); - } - INTOFF; - str = NULL; - savelen = out - stackblock(); - if (savelen > 0) { - str = ckmalloc(savelen); - memcpy(str, stackblock(), savelen); - } - handler = &jmploc; - INTON; - if (oldstyle) { - /* We must read until the closing backquote, giving special - treatment to some slashes, and then push the string and - reread it as input, interpreting it normally. */ - char *out; - int c; - int savelen; - char *str; - - - STARTSTACKSTR(out); - for (;;) { - if (needprompt) { - setprompt(2); - needprompt = 0; + if (subtype != VSNORMAL) { + if (level + 1 >= maxnest) { + maxnest *= 2; + if (state == state_static) { + state = parser_temp_alloc( + maxnest * sizeof(*state)); + memcpy(state, state_static, + MAXNEST_STATIC * sizeof(*state)); + } else + state = parser_temp_realloc(state, + maxnest * sizeof(*state)); } - switch (c = pgetc()) { - case '`': - goto done; - - case '\\': - if ((c = pgetc()) == '\n') { - plinno++; - if (doprompt) - setprompt(2); - else - setprompt(0); - /* - * If eating a newline, avoid putting - * the newline into the new character - * stream (via the STPUTC after the - * switch). - */ - continue; - } - if (c != '\\' && c != '`' && c != '$' - && (!dblquote || c != '"')) - STPUTC('\\', out); - break; - - case '\n': - plinno++; - needprompt = doprompt; - break; - - case PEOF: - startlinno = plinno; - synerror("EOF in backquote substitution"); - break; - - default: - break; + level++; + state[level].parenlevel = 0; + if (subtype == VSMINUS || subtype == VSPLUS || + subtype == VSQUESTION || subtype == VSASSIGN) { + /* + * For operators that were in the Bourne shell, + * inherit the double-quote state. + */ + state[level].syntax = state[level - 1].syntax; + state[level].category = TSTATE_VAR_OLD; + } else { + /* + * The other operators take a pattern, + * so go to BASESYNTAX. + * Also, ' and " are now special, even + * in here documents. + */ + state[level].syntax = BASESYNTAX; + state[level].category = TSTATE_VAR_NEW; + newvarnest++; } - STPUTC(c, out); - } -done: - STPUTC('\0', out); - savelen = out - stackblock(); - if (savelen > 0) { - str = ckmalloc(savelen); - memcpy(str, stackblock(), savelen); - setinputstring(str, 1); - } - } - nlpp = &bqlist; - while (*nlpp) - nlpp = &(*nlpp)->next; - *nlpp = (struct nodelist *)stalloc(sizeof (struct nodelist)); - (*nlpp)->next = NULL; - parsebackquote = oldstyle; - - if (oldstyle) { - saveprompt = doprompt; - doprompt = 0; - } - - n = list(0); - - if (oldstyle) - doprompt = saveprompt; - else { - if (readtoken() != TRP) - synexpect(TRP); - } - - (*nlpp)->n = n; - if (oldstyle) { - /* - * Start reading from old file again, ignoring any pushed back - * tokens left from the backquote parsing - */ - popfile(); - tokpushback = 0; - } - while (stackblocksize() <= savelen) - growstackblock(); - STARTSTACKSTR(out); - if (str) { - memcpy(out, str, savelen); - STADJUST(savelen, out); - INTOFF; - ckfree(str); - str = NULL; - INTON; + } } - parsebackquote = savepbq; - handler = savehandler; - if (arinest || dblquote) - USTPUTC(CTLBACKQ | CTLQUOTE, out); - else - USTPUTC(CTLBACKQ, out); - if (oldstyle) - goto parsebackq_oldreturn; - else - goto parsebackq_newreturn; + goto parsesub_return; } + /* * Parse an arithmetic expansion (indicate start of one and set state) */ parsearith: { - if (++arinest == 1) { - prevsyntax = syntax; - syntax = ARISYNTAX; - USTPUTC(CTLARI, out); - if (dblquote) - USTPUTC('"',out); - else - USTPUTC(' ',out); - } else { - /* - * we collapse embedded arithmetic expansion to - * parenthesis, which should be equivalent - */ - USTPUTC('(', out); + if (level + 1 >= maxnest) { + maxnest *= 2; + if (state == state_static) { + state = parser_temp_alloc( + maxnest * sizeof(*state)); + memcpy(state, state_static, + MAXNEST_STATIC * sizeof(*state)); + } else + state = parser_temp_realloc(state, + maxnest * sizeof(*state)); } + level++; + state[level].syntax = ARISYNTAX; + state[level].parenlevel = 0; + state[level].category = TSTATE_ARITH; + USTPUTC(CTLARI, out); + if (state[level - 1].syntax == DQSYNTAX) + USTPUTC('"',out); + else + USTPUTC(' ',out); goto parsearith_return; } @@ -1516,9 +1666,9 @@ */ int -goodname(char *name) +goodname(const char *name) { - char *p; + const char *p; p = name; if (! is_name(*p)) @@ -1553,11 +1703,11 @@ STATIC void -synerror(char *msg) +synerror(const char *msg) { if (commandname) - outfmt(&errout, "%s: %d: ", commandname, startlinno); - outfmt(&errout, "Syntax error: %s\n", msg); + outfmt(out2, "%s: %d: ", commandname, startlinno); + outfmt(out2, "Syntax error: %s\n", msg); error((char *)NULL); } @@ -1569,7 +1719,10 @@ #ifndef NO_HISTORY if (!el) #endif + { out2str(getprompt(NULL)); + flushout(out2); + } } /* @@ -1582,13 +1735,14 @@ static char ps[PROMPTLEN]; char *fmt; int i, j, trim; + static char internal_error[] = ""; /* * Select prompt format. */ switch (whichprompt) { case 0: - fmt = ""; + fmt = nullstr; break; case 1: fmt = ps1val(); @@ -1597,7 +1751,7 @@ fmt = ps2val(); break; default: - return ""; + return internal_error; } /* diff -urN stable/8/bin/sh/parser.h head/bin/sh/parser.h --- stable/8/bin/sh/parser.h 2008-05-15 15:55:27.000000000 -0400 +++ head/bin/sh/parser.h 2009-12-27 13:04:05.764326000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)parser.h 8.3 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/parser.h 179022 2008-05-15 19:55:27Z stefanf $ + * $FreeBSD: head/bin/sh/parser.h 201053 2009-12-27 18:04:05Z jilles $ */ /* control characters in argument strings */ @@ -73,9 +73,10 @@ extern int tokpushback; #define NEOF ((union node *)&tokpushback) extern int whichprompt; /* 1 == PS1, 2 == PS2 */ +extern const char *const parsekwd[]; union node *parsecmd(int); void fixredir(union node *, const char *, int); -int goodname(char *); +int goodname(const char *); char *getprompt(void *); diff -urN stable/8/bin/sh/redir.c head/bin/sh/redir.c --- stable/8/bin/sh/redir.c 2009-06-20 16:44:27.958917000 -0400 +++ head/bin/sh/redir.c 2009-11-29 17:33:59.045137000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/redir.c 194560 2009-06-20 20:44:27Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/redir.c 199953 2009-11-29 22:33:59Z jilles $"); #include #include @@ -63,6 +63,7 @@ #define EMPTY -2 /* marks an unused slot in redirtab */ +#define CLOSED -1 /* fd was not open before redir */ #define PIPESIZE 4096 /* amount of buffering in a pipe */ @@ -101,7 +102,6 @@ struct redirtab *sv = NULL; int i; int fd; - int try; char memory[10]; /* file descriptors to write to memory */ for (i = 10 ; --i >= 0 ; ) @@ -116,38 +116,30 @@ } for (n = redir ; n ; n = n->nfile.next) { fd = n->nfile.fd; - try = 0; if ((n->nfile.type == NTOFD || n->nfile.type == NFROMFD) && n->ndup.dupfd == fd) continue; /* redirect from/to same file descriptor */ if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) { INTOFF; -again: if ((i = fcntl(fd, F_DUPFD, 10)) == -1) { switch (errno) { case EBADF: - if (!try) { - openredirect(n, memory); - try++; - goto again; - } - /* FALLTHROUGH*/ + i = CLOSED; + break; default: INTON; error("%d: %s", fd, strerror(errno)); break; } - } - if (!try) { - sv->renamed[fd] = i; - } + } else + (void)fcntl(i, F_SETFD, FD_CLOEXEC); + sv->renamed[fd] = i; INTON; } if (fd == 0) fd0_redirected++; - if (!try) - openredirect(n, memory); + openredirect(n, memory); } if (memory[1]) out1 = &memout; @@ -166,8 +158,11 @@ /* * We suppress interrupts so that we won't leave open file - * descriptors around. This may not be such a good idea because - * an open of a device or a fifo can block indefinitely. + * descriptors around. Because the signal handler remains + * installed and we do not use system call restart, interrupts + * will still abort blocking opens such as fifos (they will fail + * with EINTR). There is, however, a race condition if an interrupt + * arrives after INTOFF and before open blocks. */ INTOFF; memory[fd] = 0; diff -urN stable/8/bin/sh/redir.h head/bin/sh/redir.h --- stable/8/bin/sh/redir.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/redir.h 2004-04-06 16:06:54.000000000 -0400 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)redir.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/redir.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/redir.h 127958 2004-04-06 20:06:54Z markm $ */ /* flags passed to redirect */ diff -urN stable/8/bin/sh/sh.1 head/bin/sh/sh.1 --- stable/8/bin/sh/sh.1 2010-04-23 15:26:03.997203000 -0400 +++ head/bin/sh/sh.1 2010-05-24 11:12:12.326105000 -0400 @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 -.\" $FreeBSD: stable/8/bin/sh/sh.1 207132 2010-04-23 19:26:03Z jilles $ +.\" $FreeBSD: head/bin/sh/sh.1 208505 2010-05-24 15:12:12Z jilles $ .\" -.Dd January 8, 2010 +.Dd May 24, 2010 .Dt SH 1 .Os .Sh NAME @@ -210,7 +210,8 @@ .Xr emacs 1 command line editor (disables the .Fl V -option if it has been set). +option if it has been set; +set automatically when interactive on terminals). .It Fl e Li errexit Exit immediately if any untested command fails in non-interactive mode. The exit status of a command is considered to be @@ -296,7 +297,10 @@ .Ed .It Fl u Li nounset Write a message to standard error when attempting -to expand a variable that is not set, and if the +to expand a variable, a positional parameter or +the special parameter +.Va \&! +that is not set, and if the shell is not interactive, exit immediately. .It Fl V Li vi Enable the built-in @@ -411,11 +415,11 @@ .Pq Ql \en . A backslash preceding a newline is treated as a line continuation. .El -.Ss Reserved Words -Reserved words are words that have special meaning to the +.Ss Keywords +Keywords or reserved words are words that have special meaning to the shell and are recognized at the beginning of a line and after a control operator. -The following are reserved words: +The following are keywords: .Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center .It Li \&! Ta { Ta } Ta Ic case Ta Ic do .It Ic done Ta Ic elif Ta Ic else Ta Ic esac Ta Ic fi @@ -425,8 +429,8 @@ An alias is a name and corresponding value set using the .Ic alias built-in command. -Whenever a reserved word may occur (see above), -and after checking for reserved words, the shell +Whenever a keyword may occur (see above), +and after checking for keywords, the shell checks the word to see if it matches an alias. If it does, it replaces it in the input stream with its value. For example, if there is an alias called @@ -465,7 +469,7 @@ document). Essentially though, a line is read and if the first word of the line (or after a control operator) -is not a reserved word, then the shell has recognized a +is not a keyword, then the shell has recognized a simple command. Otherwise, a complex command or some other special construct may have been recognized. @@ -661,11 +665,11 @@ performing any searches. .It The shell searches each entry in the -.Ev PATH -environment variable +.Va PATH +variable in turn for the command. The value of the -.Ev PATH +.Va PATH variable should be a series of entries separated by colons. Each entry consists of a @@ -691,7 +695,7 @@ .In sys/signal.h . .Ss Complex Commands Complex commands are combinations of simple commands -with control operators or reserved words, together creating a larger complex +with control operators or keywords, together creating a larger complex command. More generally, a command is one of the following: .Bl -item -offset indent @@ -735,7 +739,7 @@ If the pipeline is not in the background (discussed later), the shell waits for all commands to complete. .Pp -If the reserved word +If the keyword .Ic !\& does not precede the pipeline, the exit status is the exit status of the last command specified @@ -1036,13 +1040,9 @@ .Ic set built-in command can also be used to set or reset them. .Ss Special Parameters -A special parameter is a parameter denoted by a special one-character -name. -The special parameters recognized by the -.Nm -shell of -.Fx -are shown in the following list, exactly as they would appear in input +Special parameters are parameters denoted by a single special character +or the digit zero. +They are shown in the following list, exactly as they would appear in input typed by the user or in the source of a shell script. .Bl -hang .It Li $* @@ -1109,6 +1109,84 @@ .It Li $0 (zero) Expands to the name of the shell or shell script. .El +.Ss Special Variables +The following variables are set by the shell or +have special meaning to it: +.Bl -tag -width ".Va HISTSIZE" +.It Va CDPATH +The search path used with the +.Ic cd +built-in. +.It Va EDITOR +The fallback editor used with the +.Ic fc +built-in. +If not set, the default editor is +.Xr ed 1 . +.It Va FCEDIT +The default editor used with the +.Ic fc +built-in. +.It Va HISTSIZE +The number of previous commands that are accessible. +.It Va HOME +The user's home directory, +used in tilde expansion and as a default directory for the +.Ic cd +built-in. +.It Va IFS +Input Field Separators. +This is normally set to +.Aq space , +.Aq tab , +and +.Aq newline . +See the +.Sx White Space Splitting +section for more details. +.It Va LINENO +The current line number in the script or function. +.It Va MAIL +The name of a mail file, that will be checked for the arrival of new +mail. +Overridden by +.Va MAILPATH . +.It Va MAILPATH +A colon +.Pq Ql \&: +separated list of file names, for the shell to check for incoming +mail. +This variable overrides the +.Va MAIL +setting. +There is a maximum of 10 mailboxes that can be monitored at once. +.It Va PATH +The default search path for executables. +See the +.Sx Path Search +section for details. +.It Va PPID +The parent process ID of the invoked shell. +This is set at startup +unless this variable is in the environment. +A later change of parent process ID is not reflected. +A subshell retains the same value of +.Va PPID . +.It Va PS1 +The primary prompt string, which defaults to +.Dq Li "$ " , +unless you are the superuser, in which case it defaults to +.Dq Li "# " . +.It Va PS2 +The secondary prompt string, which defaults to +.Dq Li "> " . +.It Va PS4 +The prefix for the trace output (if +.Fl x +is active). +The default is +.Dq Li "+ " . +.El .Ss Word Expansions This clause describes the various expansions that are performed on words. @@ -1162,7 +1240,7 @@ username is missing (as in .Pa ~/foobar ) , the tilde is replaced with the value of the -.Ev HOME +.Va HOME variable (the current user's home directory). .Ss Parameter Expansion The format for parameter expansion is as follows: @@ -1175,10 +1253,20 @@ .Ql } . Any .Ql } -escaped by a backslash or within a quoted string, and characters in +escaped by a backslash or within a single-quoted string, and characters in embedded arithmetic expansions, command substitutions, and variable expansions, are not examined in determining the matching .Ql } . +Except for the variants with +.Ql + , +.Ql - , +.Ql = +or +.Ql ?\& , +any +.Ql } +within a double-quoted string is also not examined in determining the matching +.Ql } . .Pp The simplest form for parameter expansion is: .Pp @@ -1262,6 +1350,14 @@ In the parameter expansions shown previously, use of the colon in the format results in a test for a parameter that is unset or null; omission of the colon results in a test for a parameter that is only unset. +.Pp +The +.Ar word +inherits the type of quoting +(unquoted, double-quoted or here-document) +from the surroundings, +with the exception that a backslash that quotes a closing brace is removed +during quote removal. .Bl -tag -width indent .It Li ${# Ns Ar parameter Ns Li } String Length. @@ -1469,10 +1565,10 @@ .Ql / characters, it is used as is. Otherwise, the shell searches the -.Ev PATH +.Va PATH for the file. If it is not found in the -.Ev PATH , +.Va PATH , it is sought in the current working directory. .It Ic \&[ A built-in equivalent of @@ -1516,7 +1612,7 @@ Switch to the specified .Ar directory , or to the directory specified in the -.Ev HOME +.Va HOME environment variable if no .Ar directory is specified. @@ -1527,17 +1623,17 @@ or .Pa .. , then the directories listed in the -.Ev CDPATH +.Va CDPATH variable will be searched for the specified .Ar directory . If -.Ev CDPATH +.Va CDPATH is unset, the current directory is searched. The format of -.Ev CDPATH +.Va CDPATH is the same as that of -.Ev PATH . +.Va PATH . In an interactive shell, the .Ic cd @@ -1545,7 +1641,7 @@ that it actually switched to if this is different from the name that the user gave. These may be different either because the -.Ev CDPATH +.Va CDPATH mechanism was used or because a symbolic link was crossed. .Pp If the @@ -1568,16 +1664,18 @@ .It Ic command Oo Fl p Oc Op Ar utility Op Ar argument ... .It Ic command Oo Fl v | V Oc Op Ar utility The first form of invocation executes the specified +.Ar utility , +ignoring shell functions in the search. +If .Ar utility -as a simple command (see the -.Sx Simple Commands -section). +is a special builtin, +it is executed as if it were a regular builtin. .Pp If the .Fl p option is specified, the command search is performed using a default value of -.Ev PATH +.Va PATH that is guaranteed to find all of the standard utilities. .Pp If the @@ -1736,20 +1834,20 @@ .Ar editor string is a command name, subject to search via the -.Ev PATH +.Va PATH variable. The value in the -.Ev FCEDIT +.Va FCEDIT variable is used as a default when .Fl e is not specified. If -.Ev FCEDIT +.Va FCEDIT is null or unset, the value of the -.Ev EDITOR +.Va EDITOR variable is used. If -.Ev EDITOR +.Va EDITOR is null or unset, .Xr ed 1 is used as the editor. @@ -1783,7 +1881,7 @@ Select the commands to list or edit. The number of previous commands that can be accessed are determined by the value of the -.Ev HISTSIZE +.Va HISTSIZE variable. The value of .Ar first @@ -1814,12 +1912,12 @@ .El .El .Pp -The following environment variables affect the execution of +The following variables affect the execution of .Ic fc : -.Bl -tag -width ".Ev HISTSIZE" -.It Ev FCEDIT +.Bl -tag -width ".Va HISTSIZE" +.It Va FCEDIT Name of the editor to use for history editing. -.It Ev HISTSIZE +.It Va HISTSIZE The number of previous commands that are accessible. .El .It Ic fg Op Ar job @@ -2285,74 +2383,27 @@ .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev HISTSIZE" -.It Ev CDPATH -The search path used with the -.Ic cd -built-in. -.It Ev EDITOR -The fallback editor used with the -.Ic fc -built-in. -If not set, the default editor is -.Xr ed 1 . -.It Ev FCEDIT -The default editor used with the -.Ic fc -built-in. -.It Ev HISTSIZE -The number of previous commands that are accessible. -.It Ev HOME -The starting directory of -.Nm . -.It Ev IFS -Input Field Separators. -This is normally set to -.Aq space , -.Aq tab , -and -.Aq newline . -See the -.Sx White Space Splitting -section for more details. -.It Ev MAIL -The name of a mail file, that will be checked for the arrival of new -mail. -Overridden by -.Ev MAILPATH . -.It Ev MAILPATH -A colon -.Pq Ql \&: -separated list of file names, for the shell to check for incoming -mail. -This environment setting overrides the -.Ev MAIL -setting. -There is a maximum of 10 mailboxes that can be monitored at once. -.It Ev PATH -The default search path for executables. -See the -.Sx Path Search -section for details. -.It Ev PS1 -The primary prompt string, which defaults to -.Dq Li "$ " , -unless you are the superuser, in which case it defaults to -.Dq Li "# " . -.It Ev PS2 -The secondary prompt string, which defaults to -.Dq Li "> " . -.It Ev PS4 -The prefix for the trace output (if -.Fl x -is active). -The default is -.Dq Li "+ " . +.Bl -tag -width ".Ev LANGXXXXXX" +.It Ev ENV +Initialization file for interactive shells. +.It Ev LANG , Ev LC_* +Locale settings. +These are inherited by children of the shell, +and is used in a limited manner by the shell itself. +.It Ev PWD +An absolute pathname for the current directory, +possibly containing symbolic links. +This is used and updated by the shell. .It Ev TERM The default terminal setting for the shell. This is inherited by children of the shell, and is used in the history editing modes. .El +.Pp +Additionally, all environment variables are turned into shell variables +at startup, +which may affect the shell as described under +.Sx Special Variables . .Sh EXIT STATUS Errors that are detected by the shell, such as a syntax error, will cause the shell to exit with a non-zero exit status. diff -urN stable/8/bin/sh/shell.h head/bin/sh/shell.h --- stable/8/bin/sh/shell.h 2008-04-27 16:46:45.000000000 -0400 +++ head/bin/sh/shell.h 2008-04-27 16:46:45.000000000 -0400 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)shell.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/shell.h 178625 2008-04-27 20:46:45Z stefanf $ + * $FreeBSD: head/bin/sh/shell.h 178625 2008-04-27 20:46:45Z stefanf $ */ #ifndef SHELL_H_ diff -urN stable/8/bin/sh/show.c head/bin/sh/show.c --- stable/8/bin/sh/show.c 2006-04-14 09:59:03.000000000 -0400 +++ head/bin/sh/show.c 2009-12-24 13:41:14.411055000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/show.c 157750 2006-04-14 13:59:03Z schweikh $"); +__FBSDID("$FreeBSD: head/bin/sh/show.c 200956 2009-12-24 18:41:14Z jilles $"); #include #include @@ -307,7 +307,7 @@ void -trputs(char *s) +trputs(const char *s) { if (tracefile == NULL) return; diff -urN stable/8/bin/sh/show.h head/bin/sh/show.h --- stable/8/bin/sh/show.h 2004-04-06 16:06:54.000000000 -0400 +++ head/bin/sh/show.h 2009-12-24 13:41:14.411055000 -0500 @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)show.h 1.1 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/show.h 127958 2004-04-06 20:06:54Z markm $ + * $FreeBSD: head/bin/sh/show.h 200956 2009-12-24 18:41:14Z jilles $ */ void showtree(union node *); @@ -35,6 +35,6 @@ void sh_trace(const char *, ...) __printflike(1, 2); void trargs(char **); void trputc(int); -void trputs(char *); +void trputs(const char *); void opentrace(void); #endif diff -urN stable/8/bin/sh/trap.c head/bin/sh/trap.c --- stable/8/bin/sh/trap.c 2009-06-13 17:10:41.755841000 -0400 +++ head/bin/sh/trap.c 2009-11-21 15:44:34.304188000 -0500 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/trap.c 194127 2009-06-13 21:10:41Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/trap.c 199641 2009-11-21 20:44:34Z jilles $"); #include #include @@ -149,6 +149,7 @@ { char *action; int signo; + int errors = 0; if (argc <= 1) { for (signo = 0 ; signo < sys_nsig ; signo++) { @@ -183,8 +184,10 @@ } } while (*argv) { - if ((signo = sigstring_to_signum(*argv)) == -1) - error("bad signal %s", *argv); + if ((signo = sigstring_to_signum(*argv)) == -1) { + out2fmt_flush("trap: bad signal %s\n", *argv); + errors = 1; + } INTOFF; if (action) action = savestr(action); @@ -196,7 +199,7 @@ INTON; argv++; } - return 0; + return errors; } @@ -244,7 +247,8 @@ setsignal(int signo) { int action; - sig_t sig, sigact = SIG_DFL; + sig_t sigact = SIG_DFL; + struct sigaction sa; char *t; if ((t = trap[signo]) == NULL) @@ -320,9 +324,10 @@ case S_IGN: sigact = SIG_IGN; break; } *t = action; - sig = signal(signo, sigact); - if (sig != SIG_ERR && action == S_CATCH) - siginterrupt(signo, 1); + sa.sa_handler = sigact; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(signo, &sa, NULL); } diff -urN stable/8/bin/sh/trap.h head/bin/sh/trap.h --- stable/8/bin/sh/trap.h 2009-06-13 17:10:41.755841000 -0400 +++ head/bin/sh/trap.h 2009-12-24 15:55:14.498557000 -0500 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)trap.h 8.3 (Berkeley) 6/5/95 - * $FreeBSD: stable/8/bin/sh/trap.h 194127 2009-06-13 21:10:41Z jilles $ + * $FreeBSD: head/bin/sh/trap.h 200967 2009-12-24 20:55:14Z jilles $ */ extern int pendingsigs; @@ -45,4 +45,4 @@ void onsig(int); void dotrap(void); void setinteractive(int); -void exitshell(int); +void exitshell(int) __dead2; diff -urN stable/8/bin/sh/var.c head/bin/sh/var.c --- stable/8/bin/sh/var.c 2010-04-20 18:52:28.965483000 -0400 +++ head/bin/sh/var.c 2010-06-02 15:16:58.408982000 -0400 @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: stable/8/bin/sh/var.c 206950 2010-04-20 22:52:28Z jilles $"); +__FBSDID("$FreeBSD: head/bin/sh/var.c 208755 2010-06-02 19:16:58Z jilles $"); #include #include @@ -73,13 +73,14 @@ struct varinit { struct var *var; int flags; - char *text; + const char *text; void (*func)(const char *); }; #ifndef NO_HISTORY struct var vhistsize; +struct var vterm; #endif struct var vifs; struct var vmail; @@ -94,27 +95,31 @@ STATIC const struct varinit varinit[] = { #ifndef NO_HISTORY - { &vhistsize, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE=", + { &vhistsize, VUNSET, "HISTSIZE=", sethistsize }, #endif - { &vifs, VSTRFIXED|VTEXTFIXED, "IFS= \t\n", + { &vifs, 0, "IFS= \t\n", NULL }, - { &vmail, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL=", + { &vmail, VUNSET, "MAIL=", NULL }, - { &vmpath, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH=", + { &vmpath, VUNSET, "MAILPATH=", NULL }, - { &vpath, VSTRFIXED|VTEXTFIXED, "PATH=" _PATH_DEFPATH, + { &vpath, 0, "PATH=" _PATH_DEFPATH, changepath }, - { &vppid, VSTRFIXED|VTEXTFIXED|VUNSET, "PPID=", + { &vppid, VUNSET, "PPID=", NULL }, /* * vps1 depends on uid */ - { &vps2, VSTRFIXED|VTEXTFIXED, "PS2=> ", + { &vps2, 0, "PS2=> ", NULL }, - { &vps4, VSTRFIXED|VTEXTFIXED, "PS4=+ ", + { &vps4, 0, "PS4=+ ", NULL }, - { &voptind, VSTRFIXED|VTEXTFIXED, "OPTIND=1", +#ifndef NO_HISTORY + { &vterm, VUNSET, "TERM=", + setterm }, +#endif + { &voptind, 0, "OPTIND=1", getoptsreset }, { NULL, 0, NULL, NULL } @@ -122,9 +127,17 @@ STATIC struct var *vartab[VTABSIZE]; -STATIC struct var **hashvar(char *); -STATIC int varequal(char *, char *); -STATIC int localevar(char *); +STATIC const char *const locale_names[7] = { + "LC_COLLATE", "LC_CTYPE", "LC_MONETARY", + "LC_NUMERIC", "LC_TIME", "LC_MESSAGES", NULL +}; +STATIC const int locale_categories[7] = { + LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, LC_MESSAGES, 0 +}; + +STATIC struct var **hashvar(const char *); +STATIC int varequal(const char *, const char *); +STATIC int localevar(const char *); /* * Initialize the variable symbol tables and import the environment. @@ -132,9 +145,9 @@ #ifdef mkinit INCLUDE "var.h" +MKINIT char **environ; INIT { char **envp; - extern char **environ; initvar(); for (envp = environ ; *envp ; envp++) { @@ -164,8 +177,8 @@ vpp = hashvar(ip->text); vp->next = *vpp; *vpp = vp; - vp->text = ip->text; - vp->flags = ip->flags; + vp->text = __DECONST(char *, ip->text); + vp->flags = ip->flags | VSTRFIXED | VTEXTFIXED; vp->func = ip->func; } } @@ -176,7 +189,7 @@ vpp = hashvar("PS1="); vps1.next = *vpp; *vpp = &vps1; - vps1.text = geteuid() ? "PS1=$ " : "PS1=# "; + vps1.text = __DECONST(char *, geteuid() ? "PS1=$ " : "PS1=# "); vps1.flags = VSTRFIXED|VTEXTFIXED; } if ((vppid.flags & VEXPORT) == 0) { @@ -190,12 +203,14 @@ */ int -setvarsafe(char *name, char *val, int flags) +setvarsafe(const char *name, const char *val, int flags) { struct jmploc jmploc; struct jmploc *const savehandler = handler; int err = 0; + int inton; + inton = is_int_on(); if (setjmp(jmploc.loc)) err = 1; else { @@ -203,6 +218,7 @@ setvar(name, val, flags); } handler = savehandler; + SETINTON(inton); return err; } @@ -212,9 +228,9 @@ */ void -setvar(char *name, char *val, int flags) +setvar(const char *name, const char *val, int flags) { - char *p, *q; + const char *p; int len; int namelen; char *nameeq; @@ -242,25 +258,20 @@ } else { len += strlen(val); } - p = nameeq = ckmalloc(len); - q = name; - while (--namelen >= 0) - *p++ = *q++; - *p++ = '='; - *p = '\0'; + nameeq = ckmalloc(len); + memcpy(nameeq, name, namelen); + nameeq[namelen] = '='; if (val) - scopy(val, p); + scopy(val, nameeq + namelen + 1); + else + nameeq[namelen + 1] = '\0'; setvareq(nameeq, flags); } STATIC int -localevar(char *s) +localevar(const char *s) { - static char *lnames[7] = { - "ALL", "COLLATE", "CTYPE", "MONETARY", - "NUMERIC", "TIME", NULL - }; - char **ss; + const char *const *ss; if (*s != 'L') return 0; @@ -268,8 +279,10 @@ return 1; if (strncmp(s + 1, "C_", 2) != 0) return 0; - for (ss = lnames; *ss ; ss++) - if (varequal(s + 3, *ss)) + if (varequal(s + 3, "ALL")) + return 1; + for (ss = locale_names; *ss ; ss++) + if (varequal(s + 3, *ss + 3)) return 1; return 0; } @@ -280,7 +293,7 @@ * pointer into environ where the string should not be manipulated. */ static void -change_env(char *s, int set) +change_env(const char *s, int set) { char *eqp; char *ss; @@ -391,7 +404,7 @@ */ char * -lookupvar(char *name) +lookupvar(const char *name) { struct var *v; @@ -414,7 +427,7 @@ */ char * -bltinlookup(char *name, int doall) +bltinlookup(const char *name, int doall) { struct strlist *sp; struct var *v; @@ -435,6 +448,61 @@ } +/* + * Set up locale for a builtin (LANG/LC_* assignments). + */ +void +bltinsetlocale(void) +{ + struct strlist *lp; + int act = 0; + char *loc, *locdef; + int i; + + for (lp = cmdenviron ; lp ; lp = lp->next) { + if (localevar(lp->text)) { + act = 1; + break; + } + } + if (!act) + return; + loc = bltinlookup("LC_ALL", 0); + INTOFF; + if (loc != NULL) { + setlocale(LC_ALL, loc); + INTON; + return; + } + locdef = bltinlookup("LANG", 0); + for (i = 0; locale_names[i] != NULL; i++) { + loc = bltinlookup(locale_names[i], 0); + if (loc == NULL) + loc = locdef; + if (loc != NULL) + setlocale(locale_categories[i], loc); + } + INTON; +} + +/* + * Undo the effect of bltinlocaleset(). + */ +void +bltinunsetlocale(void) +{ + struct strlist *lp; + + INTOFF; + for (lp = cmdenviron ; lp ; lp = lp->next) { + if (localevar(lp->text)) { + setlocale(LC_ALL, ""); + return; + } + } + INTON; +} + /* * Generate a list of exported variables. This routine is used to construct @@ -472,9 +540,9 @@ * VSTACK set since these are currently allocated on the stack. */ -#ifdef mkinit MKINIT void shprocvar(void); +#ifdef mkinit SHELLPROC { shprocvar(); } @@ -798,7 +866,7 @@ */ int -unsetvar(char *s) +unsetvar(const char *s) { struct var **vpp; struct var *vp; @@ -838,7 +906,7 @@ */ STATIC struct var ** -hashvar(char *p) +hashvar(const char *p) { unsigned int hashval; @@ -857,7 +925,7 @@ */ STATIC int -varequal(char *p, char *q) +varequal(const char *p, const char *q) { while (*p == *q++) { if (*p++ == '=') diff -urN stable/8/bin/sh/var.h head/bin/sh/var.h --- stable/8/bin/sh/var.h 2006-06-15 03:00:49.000000000 -0400 +++ head/bin/sh/var.h 2010-06-02 15:16:58.408982000 -0400 @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)var.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: stable/8/bin/sh/var.h 159632 2006-06-15 07:00:49Z stefanf $ + * $FreeBSD: head/bin/sh/var.h 208755 2010-06-02 19:16:58Z jilles $ */ /* @@ -77,6 +77,7 @@ extern struct var vps4; #ifndef NO_HISTORY extern struct var vhistsize; +extern struct var vterm; #endif /* @@ -96,19 +97,21 @@ #define optindval() (voptind.text + 7) #ifndef NO_HISTORY #define histsizeval() (vhistsize.text + 9) +#define termval() (vterm.text + 5) #endif #define mpathset() ((vmpath.flags & VUNSET) == 0) void initvar(void); -void setvar(char *, char *, int); +void setvar(const char *, const char *, int); void setvareq(char *, int); struct strlist; void listsetvar(struct strlist *); -char *lookupvar(char *); -char *bltinlookup(char *, int); +char *lookupvar(const char *); +char *bltinlookup(const char *, int); +void bltinsetlocale(void); +void bltinunsetlocale(void); char **environment(void); -void shprocvar(void); int showvarscmd(int, char **); int exportcmd(int, char **); int localcmd(int, char **); @@ -116,5 +119,5 @@ void poplocalvars(void); int setvarcmd(int, char **); int unsetcmd(int, char **); -int unsetvar(char *); -int setvarsafe(char *, char *, int); +int unsetvar(const char *); +int setvarsafe(const char *, const char *, int); diff -urN stable/8/include/histedit.h head/include/histedit.h --- stable/8/include/histedit.h 2007-06-11 02:25:19.000000000 -0400 +++ head/include/histedit.h 2010-06-15 17:34:57.534333000 -0400 @@ -31,7 +31,7 @@ * * @(#)histedit.h 8.2 (Berkeley) 1/3/94 * $NetBSD: histedit.h,v 1.32 2007/06/10 20:20:28 christos Exp $ - * $FreeBSD: stable/8/include/histedit.h 170547 2007-06-11 06:25:19Z stefanf $ + * $FreeBSD: head/include/histedit.h 209219 2010-06-15 21:34:57Z jilles $ */ /* @@ -105,9 +105,8 @@ */ int el_set(EditLine *, int, ...); int el_get(EditLine *, int, ...); -#if 0 unsigned char _el_fn_complete(EditLine *, int); -#endif +unsigned char _el_fn_sh_complete(EditLine *, int); /* * el_set/el_get parameters diff -urN stable/8/lib/libedit/Makefile head/lib/libedit/Makefile --- stable/8/lib/libedit/Makefile 2009-07-19 13:25:24.703896000 -0400 +++ head/lib/libedit/Makefile 2010-06-13 13:04:42.741765000 -0400 @@ -1,12 +1,13 @@ # $NetBSD: Makefile,v 1.34 2005/05/28 12:02:53 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 -# $FreeBSD: stable/8/lib/libedit/Makefile 195767 2009-07-19 17:25:24Z kensmith $ +# $FreeBSD: head/lib/libedit/Makefile 209136 2010-06-13 17:04:42Z jilles $ LIB= edit SHLIB_MAJOR= 7 SHLIBDIR?= /lib -OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \ +OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ + hist.c key.c map.c \ parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c DPADD= ${LIBNCURSES} @@ -35,6 +36,8 @@ CFLAGS+= #-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH CFLAGS+= #-DDEBUG_PASTE -DDEBUG_EDIT +WARNS?= 1 + AHDR= vi.h emacs.h common.h ASRC= ${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c diff -urN stable/8/lib/libedit/TEST/test.c head/lib/libedit/TEST/test.c --- stable/8/lib/libedit/TEST/test.c 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/TEST/test.c 2005-08-07 16:55:59.000000000 -0400 @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ __RCSID("$NetBSD: test.c,v 1.18 2005/06/01 11:37:52 lukem Exp $"); -__FBSDID("$FreeBSD: stable/8/lib/libedit/TEST/test.c 148834 2005-08-07 20:55:59Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/TEST/test.c 148834 2005-08-07 20:55:59Z stefanf $"); /* * test.c: A little test program diff -urN stable/8/lib/libedit/chared.c head/lib/libedit/chared.c --- stable/8/lib/libedit/chared.c 2005-08-09 09:31:59.000000000 -0400 +++ head/lib/libedit/chared.c 2005-08-09 09:31:59.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/chared.c 148897 2005-08-09 13:31:59Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/chared.c 148897 2005-08-09 13:31:59Z stefanf $"); /* * chared.c: Character editor utilities diff -urN stable/8/lib/libedit/chared.h head/lib/libedit/chared.h --- stable/8/lib/libedit/chared.h 2007-03-11 14:30:22.000000000 -0400 +++ head/lib/libedit/chared.h 2007-03-11 14:30:22.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)chared.h 8.1 (Berkeley) 6/4/93 * $NetBSD: chared.h,v 1.17 2006/03/06 21:11:56 christos Exp $ - * $FreeBSD: stable/8/lib/libedit/chared.h 167457 2007-03-11 18:30:22Z stefanf $ + * $FreeBSD: head/lib/libedit/chared.h 167457 2007-03-11 18:30:22Z stefanf $ */ /* diff -urN stable/8/lib/libedit/common.c head/lib/libedit/common.c --- stable/8/lib/libedit/common.c 2007-03-11 14:30:22.000000000 -0400 +++ head/lib/libedit/common.c 2007-03-11 14:30:22.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/common.c 167457 2007-03-11 18:30:22Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/common.c 167457 2007-03-11 18:30:22Z stefanf $"); /* * common.c: Common Editor functions diff -urN stable/8/lib/libedit/editline.3 head/lib/libedit/editline.3 --- stable/8/lib/libedit/editline.3 2007-06-10 15:06:09.000000000 -0400 +++ head/lib/libedit/editline.3 2010-04-14 15:08:06.333546000 -0400 @@ -13,9 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -29,11 +26,11 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: stable/8/lib/libedit/editline.3 170511 2007-06-10 19:06:09Z stefanf $ +.\" $FreeBSD: head/lib/libedit/editline.3 206622 2010-04-14 19:08:06Z uqs $ .\" .Dd January 12, 2007 -.Os .Dt EDITLINE 3 +.Os .Sh NAME .Nm editline , .Nm el_init , diff -urN stable/8/lib/libedit/editrc.5 head/lib/libedit/editrc.5 --- stable/8/lib/libedit/editrc.5 2007-03-11 04:41:01.000000000 -0400 +++ head/lib/libedit/editrc.5 2010-04-14 15:08:06.333546000 -0400 @@ -13,9 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -29,11 +26,11 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: stable/8/lib/libedit/editrc.5 167444 2007-03-11 08:41:01Z stefanf $ +.\" $FreeBSD: head/lib/libedit/editrc.5 206622 2010-04-14 19:08:06Z uqs $ .\" .Dd October 18, 2003 -.Os .Dt EDITRC 5 +.Os .Sh NAME .Nm editrc .Nd configuration file for editline library diff -urN stable/8/lib/libedit/el.c head/lib/libedit/el.c --- stable/8/lib/libedit/el.c 2007-06-10 15:06:09.000000000 -0400 +++ head/lib/libedit/el.c 2007-06-10 15:06:09.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/el.c 170511 2007-06-10 19:06:09Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/el.c 170511 2007-06-10 19:06:09Z stefanf $"); /* * el.c: EditLine interface functions diff -urN stable/8/lib/libedit/el.h head/lib/libedit/el.h --- stable/8/lib/libedit/el.h 2007-06-10 15:06:09.000000000 -0400 +++ head/lib/libedit/el.h 2007-06-10 15:06:09.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)el.h 8.1 (Berkeley) 6/4/93 * $NetBSD: el.h,v 1.17 2006/12/15 22:13:33 christos Exp $ - * $FreeBSD: stable/8/lib/libedit/el.h 170511 2007-06-10 19:06:09Z stefanf $ + * $FreeBSD: head/lib/libedit/el.h 170511 2007-06-10 19:06:09Z stefanf $ */ /* diff -urN stable/8/lib/libedit/emacs.c head/lib/libedit/emacs.c --- stable/8/lib/libedit/emacs.c 2007-03-11 14:30:22.000000000 -0400 +++ head/lib/libedit/emacs.c 2007-03-11 14:30:22.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/emacs.c 167457 2007-03-11 18:30:22Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/emacs.c 167457 2007-03-11 18:30:22Z stefanf $"); /* * emacs.c: Emacs functions diff -urN stable/8/lib/libedit/filecomplete.c head/lib/libedit/filecomplete.c --- stable/8/lib/libedit/filecomplete.c 1969-12-31 19:00:00.000000000 -0500 +++ head/lib/libedit/filecomplete.c 2010-06-15 18:23:21.565992000 -0400 @@ -0,0 +1,667 @@ +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jaromir Dolecek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: filecomplete.c,v 1.19 2010/06/01 18:20:26 christos Exp $ + */ + +#include +__FBSDID("$FreeBSD: head/lib/libedit/filecomplete.c 209224 2010-06-15 22:23:21Z jilles $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "el.h" +#include "fcns.h" /* for EL_NUM_FCNS */ +#include "histedit.h" +#include "filecomplete.h" + +static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', + '>', '<', '=', ';', '|', '&', '{', '(', '\0' }; +/* Tilde is deliberately omitted here, we treat it specially. */ +static char extra_quote_chars[] = { ')', '}', '*', '?', '[', '$', '\0' }; + + +/********************************/ +/* completion functions */ + +/* + * does tilde expansion of strings of type ``~user/foo'' + * if ``user'' isn't valid user name or ``txt'' doesn't start + * w/ '~', returns pointer to strdup()ed copy of ``txt'' + * + * it's callers's responsibility to free() returned string + */ +char * +fn_tilde_expand(const char *txt) +{ + struct passwd pwres, *pass; + char *temp; + size_t len = 0; + char pwbuf[1024]; + + if (txt[0] != '~') + return (strdup(txt)); + + temp = strchr(txt + 1, '/'); + if (temp == NULL) { + temp = strdup(txt + 1); + if (temp == NULL) + return NULL; + } else { + len = temp - txt + 1; /* text until string after slash */ + temp = malloc(len); + if (temp == NULL) + return NULL; + (void)strncpy(temp, txt + 1, len - 2); + temp[len - 2] = '\0'; + } + if (temp[0] == 0) { + if (getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf), &pass) != 0) + pass = NULL; + } else { + if (getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf), &pass) != 0) + pass = NULL; + } + free(temp); /* value no more needed */ + if (pass == NULL) + return (strdup(txt)); + + /* update pointer txt to point at string immediately following */ + /* first slash */ + txt += len; + + temp = malloc(strlen(pass->pw_dir) + 1 + strlen(txt) + 1); + if (temp == NULL) + return NULL; + (void)sprintf(temp, "%s/%s", pass->pw_dir, txt); + + return (temp); +} + + +/* + * return first found file name starting by the ``text'' or NULL if no + * such file can be found + * value of ``state'' is ignored + * + * it's caller's responsibility to free returned string + */ +char * +fn_filename_completion_function(const char *text, int state) +{ + static DIR *dir = NULL; + static char *filename = NULL, *dirname = NULL, *dirpath = NULL; + static size_t filename_len = 0; + struct dirent *entry; + char *temp; + size_t len; + + if (state == 0 || dir == NULL) { + temp = strrchr(text, '/'); + if (temp) { + char *nptr; + temp++; + nptr = realloc(filename, strlen(temp) + 1); + if (nptr == NULL) { + free(filename); + filename = NULL; + return NULL; + } + filename = nptr; + (void)strcpy(filename, temp); + len = temp - text; /* including last slash */ + + nptr = realloc(dirname, len + 1); + if (nptr == NULL) { + free(dirname); + dirname = NULL; + return NULL; + } + dirname = nptr; + (void)strncpy(dirname, text, len); + dirname[len] = '\0'; + } else { + free(filename); + if (*text == 0) + filename = NULL; + else { + filename = strdup(text); + if (filename == NULL) + return NULL; + } + free(dirname); + dirname = NULL; + } + + if (dir != NULL) { + (void)closedir(dir); + dir = NULL; + } + + /* support for ``~user'' syntax */ + + free(dirpath); + dirpath = NULL; + if (dirname == NULL) { + if ((dirname = strdup("")) == NULL) + return NULL; + dirpath = strdup("./"); + } else if (*dirname == '~') + dirpath = fn_tilde_expand(dirname); + else + dirpath = strdup(dirname); + + if (dirpath == NULL) + return NULL; + + dir = opendir(dirpath); + if (!dir) + return (NULL); /* cannot open the directory */ + + /* will be used in cycle */ + filename_len = filename ? strlen(filename) : 0; + } + + /* find the match */ + while ((entry = readdir(dir)) != NULL) { + /* skip . and .. */ + if (entry->d_name[0] == '.' && (!entry->d_name[1] + || (entry->d_name[1] == '.' && !entry->d_name[2]))) + continue; + if (filename_len == 0) + break; + /* otherwise, get first entry where first */ + /* filename_len characters are equal */ + if (entry->d_name[0] == filename[0] + && entry->d_namlen >= filename_len + && strncmp(entry->d_name, filename, + filename_len) == 0) + break; + } + + if (entry) { /* match found */ + len = entry->d_namlen; + + temp = malloc(strlen(dirname) + len + 1); + if (temp == NULL) + return NULL; + (void)sprintf(temp, "%s%s", dirname, entry->d_name); + } else { + (void)closedir(dir); + dir = NULL; + temp = NULL; + } + + return (temp); +} + + +static const char * +append_char_function(const char *name) +{ + struct stat stbuf; + char *expname = *name == '~' ? fn_tilde_expand(name) : NULL; + const char *rs = " "; + + if (stat(expname ? expname : name, &stbuf) == -1) + goto out; + if (S_ISDIR(stbuf.st_mode)) + rs = "/"; +out: + if (expname) + free(expname); + return rs; +} + + +/* + * returns list of completions for text given + * non-static for readline. + */ +char ** completion_matches(const char *, char *(*)(const char *, int)); +char ** +completion_matches(const char *text, char *(*genfunc)(const char *, int)) +{ + char **match_list = NULL, *retstr, *prevstr; + size_t match_list_len, max_equal, which, i; + size_t matches; + + matches = 0; + match_list_len = 1; + while ((retstr = (*genfunc) (text, (int)matches)) != NULL) { + /* allow for list terminator here */ + if (matches + 3 >= match_list_len) { + char **nmatch_list; + while (matches + 3 >= match_list_len) + match_list_len <<= 1; + nmatch_list = realloc(match_list, + match_list_len * sizeof(char *)); + if (nmatch_list == NULL) { + free(match_list); + return NULL; + } + match_list = nmatch_list; + + } + match_list[++matches] = retstr; + } + + if (!match_list) + return NULL; /* nothing found */ + + /* find least denominator and insert it to match_list[0] */ + which = 2; + prevstr = match_list[1]; + max_equal = strlen(prevstr); + for (; which <= matches; which++) { + for (i = 0; i < max_equal && + prevstr[i] == match_list[which][i]; i++) + continue; + max_equal = i; + } + + retstr = malloc(max_equal + 1); + if (retstr == NULL) { + free(match_list); + return NULL; + } + (void)strncpy(retstr, match_list[1], max_equal); + retstr[max_equal] = '\0'; + match_list[0] = retstr; + + /* add NULL as last pointer to the array */ + match_list[matches + 1] = (char *) NULL; + + return (match_list); +} + + +/* + * Sort function for qsort(). Just wrapper around strcasecmp(). + */ +static int +_fn_qsort_string_compare(const void *i1, const void *i2) +{ + const char *s1 = ((const char * const *)i1)[0]; + const char *s2 = ((const char * const *)i2)[0]; + + return strcasecmp(s1, s2); +} + + +/* + * Display list of strings in columnar format on readline's output stream. + * 'matches' is list of strings, 'len' is number of strings in 'matches', + * 'max' is maximum length of string in 'matches'. + */ +void +fn_display_match_list(EditLine *el, char **matches, size_t len, size_t max) +{ + size_t i, idx, limit, count; + int screenwidth = el->el_term.t_size.h; + + /* + * Find out how many entries can be put on one line, count + * with two spaces between strings. + */ + limit = screenwidth / (max + 2); + if (limit == 0) + limit = 1; + + /* how many lines of output */ + count = len / limit; + if (count * limit < len) + count++; + + /* Sort the items if they are not already sorted. */ + qsort(&matches[1], len, sizeof(char *), _fn_qsort_string_compare); + + idx = 1; + for(; count > 0; count--) { + int more = limit > 0 && matches[0]; + for(i = 0; more; idx++) { + more = ++i < limit && matches[idx + 1]; + (void)fprintf(el->el_outfile, "%-*s%s", (int)max, + matches[idx], more ? " " : ""); + } + (void)fprintf(el->el_outfile, "\n"); + } +} + + +/* + * Complete the word at or before point, + * 'what_to_do' says what to do with the completion. + * \t means do standard completion. + * `?' means list the possible completions. + * `*' means insert all of the possible completions. + * `!' means to do standard completion, and list all possible completions if + * there is more than one. + * + * Note: '*' support is not implemented + * '!' could never be invoked + */ +int +fn_complete(EditLine *el, + char *(*complet_func)(const char *, int), + char **(*attempted_completion_function)(const char *, int, int), + const char *word_break, const char *special_prefixes, + const char *(*app_func)(const char *), size_t query_items, + int *completion_type, int *over, int *point, int *end, + const char *(*find_word_start_func)(const char *, const char *), + char *(*dequoting_func)(const char *), + char *(*quoting_func)(const char *)) +{ + const LineInfo *li; + char *temp; + char *dequoted_temp; + char **matches; + const char *ctemp; + size_t len; + int what_to_do = '\t'; + int retval = CC_NORM; + + if (el->el_state.lastcmd == el->el_state.thiscmd) + what_to_do = '?'; + + /* readline's rl_complete() has to be told what we did... */ + if (completion_type != NULL) + *completion_type = what_to_do; + + if (!complet_func) + complet_func = fn_filename_completion_function; + if (!app_func) + app_func = append_char_function; + + /* We now look backwards for the start of a filename/variable word */ + li = el_line(el); + if (find_word_start_func) + ctemp = find_word_start_func(li->buffer, li->cursor); + else { + ctemp = li->cursor; + while (ctemp > li->buffer + && !strchr(word_break, ctemp[-1]) + && (!special_prefixes || !strchr(special_prefixes, ctemp[-1]) ) ) + ctemp--; + } + + len = li->cursor - ctemp; +#if defined(__SSP__) || defined(__SSP_ALL__) + temp = malloc(sizeof(*temp) * (len + 1)); + if (temp == NULL) + return retval; +#else + temp = alloca(sizeof(*temp) * (len + 1)); +#endif + (void)strncpy(temp, ctemp, len); + temp[len] = '\0'; + + if (dequoting_func) { + dequoted_temp = dequoting_func(temp); + if (dequoted_temp == NULL) + return retval; + } else + dequoted_temp = NULL; + + /* these can be used by function called in completion_matches() */ + /* or (*attempted_completion_function)() */ + if (point != 0) + *point = (int)(li->cursor - li->buffer); + if (end != NULL) + *end = (int)(li->lastchar - li->buffer); + + if (attempted_completion_function) { + int cur_off = (int)(li->cursor - li->buffer); + matches = (*attempted_completion_function) (dequoted_temp ? dequoted_temp : temp, + (int)(cur_off - len), cur_off); + } else + matches = 0; + if (!attempted_completion_function || + (over != NULL && !*over && !matches)) + matches = completion_matches(dequoted_temp ? dequoted_temp : temp, complet_func); + + if (over != NULL) + *over = 0; + + if (matches) { + int i; + size_t matches_num, maxlen, match_len, match_display=1; + + retval = CC_REFRESH; + /* + * Only replace the completed string with common part of + * possible matches if there is possible completion. + */ + if (matches[0][0] != '\0') { + char *quoted_match; + if (quoting_func) { + quoted_match = quoting_func(matches[0]); + if (quoted_match == NULL) + goto free_matches; + } else + quoted_match = NULL; + + el_deletestr(el, (int) len); + el_insertstr(el, quoted_match ? quoted_match : matches[0]); + + free(quoted_match); + } + + if (what_to_do == '?') + goto display_matches; + + if (matches[2] == NULL && strcmp(matches[0], matches[1]) == 0) { + /* + * We found exact match. Add a space after + * it, unless we do filename completion and the + * object is a directory. + */ + el_insertstr(el, (*app_func)(matches[0])); + } else if (what_to_do == '!') { + display_matches: + /* + * More than one match and requested to list possible + * matches. + */ + + for(i = 1, maxlen = 0; matches[i]; i++) { + match_len = strlen(matches[i]); + if (match_len > maxlen) + maxlen = match_len; + } + matches_num = i - 1; + + /* newline to get on next line from command line */ + (void)fprintf(el->el_outfile, "\n"); + + /* + * If there are too many items, ask user for display + * confirmation. + */ + if (matches_num > query_items) { + (void)fprintf(el->el_outfile, + "Display all %zu possibilities? (y or n) ", + matches_num); + (void)fflush(el->el_outfile); + if (getc(stdin) != 'y') + match_display = 0; + (void)fprintf(el->el_outfile, "\n"); + } + + if (match_display) + fn_display_match_list(el, matches, matches_num, + maxlen); + retval = CC_REDISPLAY; + } else if (matches[0][0]) { + /* + * There was some common match, but the name was + * not complete enough. Next tab will print possible + * completions. + */ + el_beep(el); + } else { + /* lcd is not a valid object - further specification */ + /* is needed */ + el_beep(el); + retval = CC_NORM; + } + +free_matches: + /* free elements of array and the array itself */ + for (i = 0; matches[i]; i++) + free(matches[i]); + free(matches); + matches = NULL; + } + free(dequoted_temp); +#if defined(__SSP__) || defined(__SSP_ALL__) + free(temp); +#endif + return retval; +} + + +/* + * el-compatible wrapper around rl_complete; needed for key binding + */ +/* ARGSUSED */ +unsigned char +_el_fn_complete(EditLine *el, int ch __attribute__((__unused__))) +{ + return (unsigned char)fn_complete(el, NULL, NULL, + break_chars, NULL, NULL, 100, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL); +} + + +static const char * +sh_find_word_start(const char *buffer, const char *cursor) +{ + const char *word_start = buffer; + + while (buffer < cursor) { + if (*buffer == '\\') + buffer++; + else if (strchr(break_chars, *buffer)) + word_start = buffer + 1; + + buffer++; + } + + return word_start; +} + + +static char * +sh_quote(const char *str) +{ + const char *src; + int extra_len = 0; + char *quoted_str, *dst; + + if (*str == '-' || *str == '+') + extra_len += 2; + for (src = str; *src != '\0'; src++) + if (strchr(break_chars, *src) || + strchr(extra_quote_chars, *src)) + extra_len++; + + quoted_str = malloc(sizeof(*quoted_str) * + (strlen(str) + extra_len + 1)); + if (quoted_str == NULL) + return NULL; + + dst = quoted_str; + if (*str == '-' || *str == '+') + *dst++ = '.', *dst++ = '/'; + for (src = str; *src != '\0'; src++) { + if (strchr(break_chars, *src) || + strchr(extra_quote_chars, *src)) + *dst++ = '\\'; + *dst++ = *src; + } + *dst = '\0'; + + return quoted_str; +} + + +static char * +sh_dequote(const char *str) +{ + char *dequoted_str, *dst; + + /* save extra space to replace \~ with ./~ */ + dequoted_str = malloc(sizeof(*dequoted_str) * (strlen(str) + 1 + 1)); + if (dequoted_str == NULL) + return NULL; + + dst = dequoted_str; + + /* dequote \~ at start as ./~ */ + if (*str == '\\' && str[1] == '~') { + str++; + *dst++ = '.'; + *dst++ = '/'; + } + + while (*str) { + if (*str == '\\') + str++; + if (*str) + *dst++ = *str++; + } + *dst = '\0'; + + return dequoted_str; +} + + +/* + * completion function using sh quoting rules; for key binding + */ +/* ARGSUSED */ +unsigned char +_el_fn_sh_complete(EditLine *el, int ch __attribute__((__unused__))) +{ + return (unsigned char)fn_complete(el, NULL, NULL, + break_chars, NULL, NULL, 100, + NULL, NULL, NULL, NULL, + sh_find_word_start, sh_dequote, sh_quote); +} diff -urN stable/8/lib/libedit/filecomplete.h head/lib/libedit/filecomplete.h --- stable/8/lib/libedit/filecomplete.h 1969-12-31 19:00:00.000000000 -0500 +++ head/lib/libedit/filecomplete.h 2010-06-15 17:34:57.534333000 -0400 @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jaromir Dolecek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: filecomplete.h,v 1.9 2009/12/30 22:37:40 christos Exp $ + * $FreeBSD: head/lib/libedit/filecomplete.h 209219 2010-06-15 21:34:57Z jilles $ + */ +#ifndef _FILECOMPLETE_H_ +#define _FILECOMPLETE_H_ + +int fn_complete(EditLine *, + char *(*)(const char *, int), + char **(*)(const char *, int, int), + const char *, const char *, const char *(*)(const char *), size_t, + int *, int *, int *, int *, + const char *(*)(const char *, const char *), + char *(*)(const char *), + char *(*)(const char *)); + +void fn_display_match_list(EditLine *, char **, size_t, size_t); +char *fn_tilde_expand(const char *); +char *fn_filename_completion_function(const char *, int); + +#endif diff -urN stable/8/lib/libedit/hist.c head/lib/libedit/hist.c --- stable/8/lib/libedit/hist.c 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/hist.c 2005-08-07 16:55:59.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/hist.c 148834 2005-08-07 20:55:59Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/hist.c 148834 2005-08-07 20:55:59Z stefanf $"); /* * hist.c: History access functions diff -urN stable/8/lib/libedit/hist.h head/lib/libedit/hist.h --- stable/8/lib/libedit/hist.h 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/hist.h 2005-08-07 16:55:59.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)hist.h 8.1 (Berkeley) 6/4/93 * $NetBSD: hist.h,v 1.10 2003/08/07 16:44:31 agc Exp $ - * $FreeBSD: stable/8/lib/libedit/hist.h 148834 2005-08-07 20:55:59Z stefanf $ + * $FreeBSD: head/lib/libedit/hist.h 148834 2005-08-07 20:55:59Z stefanf $ */ /* diff -urN stable/8/lib/libedit/history.c head/lib/libedit/history.c --- stable/8/lib/libedit/history.c 2007-03-11 17:47:40.000000000 -0400 +++ head/lib/libedit/history.c 2007-03-11 17:47:40.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/history.c 167464 2007-03-11 21:47:40Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/history.c 167464 2007-03-11 21:47:40Z stefanf $"); /* * hist.c: History access functions diff -urN stable/8/lib/libedit/key.c head/lib/libedit/key.c --- stable/8/lib/libedit/key.c 2007-03-11 14:30:22.000000000 -0400 +++ head/lib/libedit/key.c 2007-03-11 14:30:22.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/key.c 167457 2007-03-11 18:30:22Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/key.c 167457 2007-03-11 18:30:22Z stefanf $"); /* * key.c: This module contains the procedures for maintaining diff -urN stable/8/lib/libedit/key.h head/lib/libedit/key.h --- stable/8/lib/libedit/key.h 2007-03-11 14:30:22.000000000 -0400 +++ head/lib/libedit/key.h 2007-03-11 14:30:22.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)key.h 8.1 (Berkeley) 6/4/93 * $NetBSD: key.h,v 1.10 2006/03/23 20:22:51 christos Exp $ - * $FreeBSD: stable/8/lib/libedit/key.h 167457 2007-03-11 18:30:22Z stefanf $ + * $FreeBSD: head/lib/libedit/key.h 167457 2007-03-11 18:30:22Z stefanf $ */ /* diff -urN stable/8/lib/libedit/makelist head/lib/libedit/makelist --- stable/8/lib/libedit/makelist 2005-10-04 17:59:29.000000000 -0400 +++ head/lib/libedit/makelist 2005-10-04 17:59:29.000000000 -0400 @@ -1,6 +1,6 @@ #!/bin/sh - # $NetBSD: makelist,v 1.10 2005/08/08 14:04:49 christos Exp $ -# $FreeBSD: stable/8/lib/libedit/makelist 150947 2005-10-04 21:59:29Z stefanf $ +# $FreeBSD: head/lib/libedit/makelist 150947 2005-10-04 21:59:29Z stefanf $ # # Copyright (c) 1992, 1993 # The Regents of the University of California. All rights reserved. diff -urN stable/8/lib/libedit/map.c head/lib/libedit/map.c --- stable/8/lib/libedit/map.c 2007-03-11 17:47:40.000000000 -0400 +++ head/lib/libedit/map.c 2007-03-11 17:47:40.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/map.c 167464 2007-03-11 21:47:40Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/map.c 167464 2007-03-11 21:47:40Z stefanf $"); /* * map.c: Editor function definitions diff -urN stable/8/lib/libedit/map.h head/lib/libedit/map.h --- stable/8/lib/libedit/map.h 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/map.h 2005-08-07 16:55:59.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)map.h 8.1 (Berkeley) 6/4/93 * $NetBSD: map.h,v 1.8 2003/08/07 16:44:32 agc Exp $ - * $FreeBSD: stable/8/lib/libedit/map.h 148834 2005-08-07 20:55:59Z stefanf $ + * $FreeBSD: head/lib/libedit/map.h 148834 2005-08-07 20:55:59Z stefanf $ */ /* diff -urN stable/8/lib/libedit/parse.c head/lib/libedit/parse.c --- stable/8/lib/libedit/parse.c 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/parse.c 2005-08-07 16:55:59.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/parse.c 148834 2005-08-07 20:55:59Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/parse.c 148834 2005-08-07 20:55:59Z stefanf $"); /* * parse.c: parse an editline extended command diff -urN stable/8/lib/libedit/parse.h head/lib/libedit/parse.h --- stable/8/lib/libedit/parse.h 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/parse.h 2005-08-07 16:55:59.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)parse.h 8.1 (Berkeley) 6/4/93 * $NetBSD: parse.h,v 1.6 2005/05/29 04:58:15 lukem Exp $ - * $FreeBSD: stable/8/lib/libedit/parse.h 148834 2005-08-07 20:55:59Z stefanf $ + * $FreeBSD: head/lib/libedit/parse.h 148834 2005-08-07 20:55:59Z stefanf $ */ /* diff -urN stable/8/lib/libedit/prompt.c head/lib/libedit/prompt.c --- stable/8/lib/libedit/prompt.c 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/prompt.c 2005-08-07 16:55:59.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/prompt.c 148834 2005-08-07 20:55:59Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/prompt.c 148834 2005-08-07 20:55:59Z stefanf $"); /* * prompt.c: Prompt printing functions diff -urN stable/8/lib/libedit/prompt.h head/lib/libedit/prompt.h --- stable/8/lib/libedit/prompt.h 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/prompt.h 2005-08-07 16:55:59.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)prompt.h 8.1 (Berkeley) 6/4/93 * $NetBSD: prompt.h,v 1.6 2003/08/07 16:44:32 agc Exp $ - * $FreeBSD: stable/8/lib/libedit/prompt.h 148834 2005-08-07 20:55:59Z stefanf $ + * $FreeBSD: head/lib/libedit/prompt.h 148834 2005-08-07 20:55:59Z stefanf $ */ /* diff -urN stable/8/lib/libedit/read.c head/lib/libedit/read.c --- stable/8/lib/libedit/read.c 2007-03-11 17:47:40.000000000 -0400 +++ head/lib/libedit/read.c 2007-03-11 17:47:40.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/read.c 167464 2007-03-11 21:47:40Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/read.c 167464 2007-03-11 21:47:40Z stefanf $"); /* * read.c: Clean this junk up! This is horrible code. diff -urN stable/8/lib/libedit/read.h head/lib/libedit/read.h --- stable/8/lib/libedit/read.h 2007-03-11 04:41:01.000000000 -0400 +++ head/lib/libedit/read.h 2010-03-02 02:25:20.369016000 -0500 @@ -13,9 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -30,7 +27,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: read.h,v 1.5 2006/08/21 12:45:30 christos Exp $ - * $FreeBSD: stable/8/lib/libedit/read.h 167444 2007-03-11 08:41:01Z stefanf $ + * $FreeBSD: head/lib/libedit/read.h 204555 2010-03-02 07:25:20Z joel $ */ /* diff -urN stable/8/lib/libedit/refresh.c head/lib/libedit/refresh.c --- stable/8/lib/libedit/refresh.c 2005-12-04 04:34:56.000000000 -0500 +++ head/lib/libedit/refresh.c 2005-12-04 04:34:56.000000000 -0500 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/refresh.c 153079 2005-12-04 09:34:56Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/refresh.c 153079 2005-12-04 09:34:56Z stefanf $"); /* * refresh.c: Lower level screen refreshing functions diff -urN stable/8/lib/libedit/refresh.h head/lib/libedit/refresh.h --- stable/8/lib/libedit/refresh.h 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/refresh.h 2005-08-07 16:55:59.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)refresh.h 8.1 (Berkeley) 6/4/93 * $NetBSD: refresh.h,v 1.5 2003/08/07 16:44:33 agc Exp $ - * $FreeBSD: stable/8/lib/libedit/refresh.h 148834 2005-08-07 20:55:59Z stefanf $ + * $FreeBSD: head/lib/libedit/refresh.h 148834 2005-08-07 20:55:59Z stefanf $ */ /* diff -urN stable/8/lib/libedit/search.c head/lib/libedit/search.c --- stable/8/lib/libedit/search.c 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/search.c 2005-08-07 16:55:59.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/search.c 148834 2005-08-07 20:55:59Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/search.c 148834 2005-08-07 20:55:59Z stefanf $"); /* * search.c: History and character search functions diff -urN stable/8/lib/libedit/search.h head/lib/libedit/search.h --- stable/8/lib/libedit/search.h 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/search.h 2005-08-07 16:55:59.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)search.h 8.1 (Berkeley) 6/4/93 * $NetBSD: search.h,v 1.8 2003/10/18 23:27:36 christos Exp $ - * $FreeBSD: stable/8/lib/libedit/search.h 148834 2005-08-07 20:55:59Z stefanf $ + * $FreeBSD: head/lib/libedit/search.h 148834 2005-08-07 20:55:59Z stefanf $ */ /* diff -urN stable/8/lib/libedit/sig.c head/lib/libedit/sig.c --- stable/8/lib/libedit/sig.c 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/sig.c 2005-08-07 16:55:59.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/sig.c 148834 2005-08-07 20:55:59Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/sig.c 148834 2005-08-07 20:55:59Z stefanf $"); /* * sig.c: Signal handling stuff. diff -urN stable/8/lib/libedit/sig.h head/lib/libedit/sig.h --- stable/8/lib/libedit/sig.h 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/sig.h 2005-08-07 16:55:59.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)sig.h 8.1 (Berkeley) 6/4/93 * $NetBSD: sig.h,v 1.5 2003/08/07 16:44:33 agc Exp $ - * $FreeBSD: stable/8/lib/libedit/sig.h 148834 2005-08-07 20:55:59Z stefanf $ + * $FreeBSD: head/lib/libedit/sig.h 148834 2005-08-07 20:55:59Z stefanf $ */ /* diff -urN stable/8/lib/libedit/sys.h head/lib/libedit/sys.h --- stable/8/lib/libedit/sys.h 2005-08-10 09:41:31.000000000 -0400 +++ head/lib/libedit/sys.h 2005-08-10 09:41:31.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)sys.h 8.1 (Berkeley) 6/4/93 * $NetBSD: sys.h,v 1.9 2004/01/17 17:57:40 christos Exp $ - * $FreeBSD: stable/8/lib/libedit/sys.h 148924 2005-08-10 13:41:31Z stefanf $ + * $FreeBSD: head/lib/libedit/sys.h 148924 2005-08-10 13:41:31Z stefanf $ */ /* diff -urN stable/8/lib/libedit/term.c head/lib/libedit/term.c --- stable/8/lib/libedit/term.c 2007-06-10 15:06:09.000000000 -0400 +++ head/lib/libedit/term.c 2007-06-10 15:06:09.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/term.c 170511 2007-06-10 19:06:09Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/term.c 170511 2007-06-10 19:06:09Z stefanf $"); /* * term.c: Editor/termcap-curses interface diff -urN stable/8/lib/libedit/term.h head/lib/libedit/term.h --- stable/8/lib/libedit/term.h 2007-06-10 15:06:09.000000000 -0400 +++ head/lib/libedit/term.h 2007-06-10 15:06:09.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)term.h 8.1 (Berkeley) 6/4/93 * $NetBSD: term.h,v 1.18 2006/11/24 00:01:17 christos Exp $ - * $FreeBSD: stable/8/lib/libedit/term.h 170511 2007-06-10 19:06:09Z stefanf $ + * $FreeBSD: head/lib/libedit/term.h 170511 2007-06-10 19:06:09Z stefanf $ */ /* diff -urN stable/8/lib/libedit/tokenizer.c head/lib/libedit/tokenizer.c --- stable/8/lib/libedit/tokenizer.c 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/tokenizer.c 2005-08-07 16:55:59.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/tokenizer.c 148834 2005-08-07 20:55:59Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/tokenizer.c 148834 2005-08-07 20:55:59Z stefanf $"); /* * tokenize.c: Bourne shell like tokenizer diff -urN stable/8/lib/libedit/tty.c head/lib/libedit/tty.c --- stable/8/lib/libedit/tty.c 2007-03-11 17:47:40.000000000 -0400 +++ head/lib/libedit/tty.c 2007-03-11 17:47:40.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/tty.c 167464 2007-03-11 21:47:40Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/tty.c 167464 2007-03-11 21:47:40Z stefanf $"); /* * tty.c: tty interface stuff diff -urN stable/8/lib/libedit/tty.h head/lib/libedit/tty.h --- stable/8/lib/libedit/tty.h 2005-08-07 16:55:59.000000000 -0400 +++ head/lib/libedit/tty.h 2005-08-07 16:55:59.000000000 -0400 @@ -31,7 +31,7 @@ * * @(#)tty.h 8.1 (Berkeley) 6/4/93 * $NetBSD: tty.h,v 1.11 2005/06/01 11:37:52 lukem Exp $ - * $FreeBSD: stable/8/lib/libedit/tty.h 148834 2005-08-07 20:55:59Z stefanf $ + * $FreeBSD: head/lib/libedit/tty.h 148834 2005-08-07 20:55:59Z stefanf $ */ /* diff -urN stable/8/lib/libedit/vi.c head/lib/libedit/vi.c --- stable/8/lib/libedit/vi.c 2007-03-11 14:30:22.000000000 -0400 +++ head/lib/libedit/vi.c 2007-03-11 14:30:22.000000000 -0400 @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ #include -__FBSDID("$FreeBSD: stable/8/lib/libedit/vi.c 167457 2007-03-11 18:30:22Z stefanf $"); +__FBSDID("$FreeBSD: head/lib/libedit/vi.c 167457 2007-03-11 18:30:22Z stefanf $"); /* * vi.c: Vi mode commands. --------------020203000205020600080704 Content-Type: application/octet-stream; name="head_lib_libedit_filecomplete.c.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="head_lib_libedit_filecomplete.c.sig" iQEcBAABAgAGBQJMH1duAAoJEJBXh4mJ2FR+yvcIAJ+vy6qKj/sx3YEAGxpqNKyJgHr34rA3 N2P4luHJlAkDmja6MlJZno+huYeiZlclokT54MceIuG7Hp7lUHaC12dCLUBMWVYqiYqY6V9O I7I9Ej7vRksw1PR2T/bX5MbhTFvh2P2T/+vFm6GNAvPGoZBI4s2ty/jxEnNG3YmMYSyJNkun eZ0E/y+WrqqZ6BRv3dWZu1QPOBOuexmgH5ksCQcIUI7kCBGlMjrmbR9A2sZ4ai6qzniBxMnl q/hTlRXSs3fd+JMUmRS3J37U49DIBumqrsJrWkEqlXzMYytNhRTODxmEWCxQQNKv+suCX1RY Sw+C8huo4kGV3TicOovo2VI= --------------020203000205020600080704 Content-Type: application/octet-stream; name="head_lib_libedit_filecomplete.h.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="head_lib_libedit_filecomplete.h.sig" iQEcBAABAgAGBQJMH1duAAoJEJBXh4mJ2FR+yAQH/1Jz0OK8of1xyOK2ui/rqLQILbyt5bJS 2a28zMS6WqmjEeGVczz9HeDYYcdpiVvWphiyIjx8R2J7guguyd67L9CULkCLFHAhei7Lxhqd zc3Jf5g+Dol8MLtBBW+jMvxSGTdl/vn7hYHwKXkwhsxcQYu55Cxzmn9RPOx+qFEPibL9mRld NOJ7dLMWFtN9/PYi/Leai5NMQwy63TNBE93RKFxvN4mXfOvv896XqpYvFZ4TS9mBatC9qF5K 7UivinM+s016dZhoUTJz0Vg5iTBEZB9Cb64yfrKiYeegLzIbRiY7Adtpo0Fc6gF9SBlIzYTi uSaactMuW2ZVhjpjxvZBc3w= --------------020203000205020600080704 Content-Type: application/octet-stream; name="sh-tab-complete-stable8.diff.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sh-tab-complete-stable8.diff.sig" iQEcBAABAgAGBQJMH1duAAoJEJBXh4mJ2FR+ms8H/2v/IKUFAl5ju4Ve4023aYYpbNYI/6UA siUMchvqEy34DIeOs7N9eHizcCh9X90m0K1S1cBZvZsm2F7A60o5yuwMR0+GZ3wxGcWRyydt awdTkVPKTfK4OqfKsgmaSaVDP0Q1/RwcfbaTBhbzS/YvFOIo0cfVIToHh2j/JhqahNwmmSY8 Gw8UT5I7xT8DysEcnFk14BNt8iEq6CX4zrccrfCr5M6AvKQ+3i8EDuCRNgslPFEwHBqTdA0Q sqAU2lqGOw2scFCHIeUHEeBwfZAqPM7lIYfSuyVetRqG2SR1yumaW0LKnJRW4v2VD2PrxeO7 zmOgDW/8UhkLTloqDkBs/x8= --------------020203000205020600080704-- From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 12:18:10 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5193B106566C for ; Mon, 21 Jun 2010 12:18:10 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0E30A8FC0A for ; Mon, 21 Jun 2010 12:18:09 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0D3F61FFC33; Mon, 21 Jun 2010 12:18:09 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 44563844A3; Mon, 21 Jun 2010 14:15:58 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: jhell References: <4C18304A.1080601@dataix.net> <4C18322A.6050007@dataix.net> <86wrtz5mk6.fsf@ds4.des.no> <4C1F576F.9090901@dataix.net> Date: Mon, 21 Jun 2010 14:15:58 +0200 In-Reply-To: <4C1F576F.9090901@dataix.net> (jhell@dataix.net's message of "Mon, 21 Jun 2010 08:13:35 -0400") Message-ID: <86y6e8fuo1.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "Sam Fourman Jr." , Brandon Gooch , FreeBSD Current , jilles@stack.nl Subject: Re: [MFC REQUEST] Filename completion in sh(1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 12:18:10 -0000 jhell writes: > Because SVN in both our patches for tab completion missed filecomplete.h > and filecomplete.c [...] the previous patches from des@ & > myself will break world builds. Speak for yourself. Both files are present in the patch I posted, and I tested it (make toolchain, which builds both libedit and sh) before I posted it. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 12:19:33 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E04F51065672; Mon, 21 Jun 2010 12:19:33 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 769118FC18; Mon, 21 Jun 2010 12:19:33 +0000 (UTC) Received: by iwn7 with SMTP id 7so4226131iwn.13 for ; Mon, 21 Jun 2010 05:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=WT7dFiyzg9D79P7ndnyQDEkjt3MYz6MeTZFfs6YSnEQ=; b=Th04HaA08EM83EyXuTtF7SMqyYL+cRLB2ZqBwa/lwNJ/NjZWWwiscZb+T4DaSfwE3C qplyJ5Mo6+y0Ysb4KXnccy8TO4GcK0sLhDjeAsbjVmQV2gHGc0+JV8FRc8STUR1GJ0cz S+TWBbH4l2Tt3y1ROvpFL6eowleyk32SKfaoE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=LcMJ+uoOcV8yPJ8xRArsspJZLk1gVovEssdwlJlNUmhUxyedRNOkzYZjTwxjn53nPJ 4Ef1Fjx7XsxCdLaRNTEBiWV+3MUhuTxlcd5EAI5JZo9TQJCSnyMh+WYMTI4Kyo1+8vzf j+dH2bAgMPaAz5Oy+FhehPX2iaBh593Apv8no= MIME-Version: 1.0 Received: by 10.231.211.208 with SMTP id gp16mr5252671ibb.133.1277122772597; Mon, 21 Jun 2010 05:19:32 -0700 (PDT) Received: by 10.231.182.212 with HTTP; Mon, 21 Jun 2010 05:19:32 -0700 (PDT) In-Reply-To: <4C1EF99B.5080300@FreeBSD.org> References: <4C0C1AE4.8050807@FreeBSD.org> <4C1DB296.5040605@FreeBSD.org> <4C1E381B.30405@FreeBSD.org> <4C1E7B89.1030005@FreeBSD.org> <4C1EF99B.5080300@FreeBSD.org> Date: Mon, 21 Jun 2010 07:19:32 -0500 Message-ID: From: Brandon Gooch To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-arch@freebsd.org, Doug Barton , FreeBSD-Current Subject: Re: RFC: New event timers infrastructure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 12:19:34 -0000 On Mon, Jun 21, 2010 at 12:33 AM, Alexander Motin wrote: > Brandon Gooch wrote: >> On Sun, Jun 20, 2010 at 3:35 PM, Doug Barton wrote: >>> On 06/20/10 08:47, Alexander Motin wrote: >>>> While this can be done in sysctl.conf, it would be better to do it in >>>> loader.conf to make it applied from the beginning, without on-the-fly >>>> timers change. >>> You're probably right that for something this fundamental it's better to do >>> it in loader.conf, however I wanted to mention that I recently changed the >>> rcorder for the "early" boot scripts to run sysctl first for very similar >>> reasons. >> >> This is good information, so sorry if I'm being dense: does this mean >> that it should have worked by applying the changes via >> /etc/sysctl.conf? > > "You are too old. You are already born." (c) Sergey Lukyanenko. > stathz set much earlier, just before "Starting kernel event timers" > logged first time. It can only be affected from loader.conf. OK. I understand everything[*] now... >> No worries though, I've set it in /boot/loader.conf to avoid any >> possible ambiguity or anomalous behavior, and it's working very well! > > Nice. Very nice :) > BTW, I've successfully tested suspend/resume on my amd64 laptop with all > timers. For me, suspend/resume trials will be this evening, U.S. Central Standard Time... Looking forward to it! -Brandon [*] Well, almost everything, except for the Russian Sci-Fi quote ;) From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 12:23:25 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84757106566B for ; Mon, 21 Jun 2010 12:23:25 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3B97C8FC14 for ; Mon, 21 Jun 2010 12:23:24 +0000 (UTC) Received: by iwn7 with SMTP id 7so4229835iwn.13 for ; Mon, 21 Jun 2010 05:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CQbD5A9TRE/wvLloSMUJbN8FC66ZrB1EHZEYNFSQLvM=; b=HWeZAobDHPmk15gG/UNFtZIlvjFibvAZxuYjjmcPWf7JuBB/4gxGcKPOhHaubM9cPK hODOb1FfKp082WCL3NMHKqFQrPN78UlJ4SbZt2SRo/yth7IdNkiPekWhsw5LbifvdMyH vFD/0wEV7So6WalNlufQcIwkNL3y2TUgnJ4iE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=q3ZL0Urq6RYuOhx+zQ5CVZFn+67FReUeOaYS82HkRg+h2IV3TAg6WDAL71hKIjrhun FF9cHjhigtEyDFLkWaqC4JJWskXu0H6nsC589Nb6yo54JUOhfjp5eFbGXC5SNp0DLpVX SgVFtzOuWbKPqhFkb4lyE4ffMQD+zu5dtR1kI= MIME-Version: 1.0 Received: by 10.231.169.6 with SMTP id w6mr4831128iby.5.1277123004401; Mon, 21 Jun 2010 05:23:24 -0700 (PDT) Received: by 10.231.182.212 with HTTP; Mon, 21 Jun 2010 05:23:24 -0700 (PDT) In-Reply-To: <86y6e8fuo1.fsf@ds4.des.no> References: <4C18304A.1080601@dataix.net> <4C18322A.6050007@dataix.net> <86wrtz5mk6.fsf@ds4.des.no> <4C1F576F.9090901@dataix.net> <86y6e8fuo1.fsf@ds4.des.no> Date: Mon, 21 Jun 2010 07:23:24 -0500 Message-ID: From: Brandon Gooch To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "Sam Fourman Jr." , FreeBSD Current , jilles@stack.nl Subject: Re: [MFC REQUEST] Filename completion in sh(1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 12:23:25 -0000 2010/6/21 Dag-Erling Sm=F8rgrav : > jhell writes: >> Because SVN in both our patches for tab completion missed filecomplete.h >> and filecomplete.c [...] the previous patches from des@ & >> myself will break world builds. > > Speak for yourself. =A0Both files are present in the patch I posted, and = I > tested it (make toolchain, which builds both libedit and sh) before I > posted it. I thank the both of you! I'll test this further today on my 8-STABLE boxes :) -Brandon From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 12:55:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6084F106566B for ; Mon, 21 Jun 2010 12:55:43 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 01DD58FC20 for ; Mon, 21 Jun 2010 12:55:42 +0000 (UTC) Received: by iwn7 with SMTP id 7so4262881iwn.13 for ; Mon, 21 Jun 2010 05:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type; bh=xwh01wWmT1Sj5zGF/FNX2DS1rlY2pGk/3Jf1G6HxmN8=; b=kgZHEtO/1B+ErVeI7ODhxI8ovcebJn5b5h2hFJpvMy8UxS+4bdO6NCF6PWsDUf91BY hAyU6fOrWWX951uYqDKUlM1nw8iZHFnc7wLKtXc4F1B/iFXUjEUJ0Ce2ibjNvNexRJcV 1yonCWBWWweRcSfBjZZ7LY/Xde6RzNFgct24Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:openpgp:content-type; b=FqsIDT2Jl5cbhao24kPA54/FapTGy2xh6JpCkEuLwHB1GZAqpCyDltxJr2yIbcuj1b 8rdaJH4MvuizXIRyWwv1kZ0AJmqB/oHNJiL8tfHONPWSSJTnU1OZf/j6oSrQIvhbsrKG dMT5QRppFruc7n2LhRbWIIUe2HwlpI4KWaj6E= Received: by 10.231.17.141 with SMTP id s13mr3780781iba.149.1277124942170; Mon, 21 Jun 2010 05:55:42 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-128-180.dsl.klmzmi.sbcglobal.net [99.181.128.180]) by mx.google.com with ESMTPS id a8sm56941257ibi.23.2010.06.21.05.55.37 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 05:55:40 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C1F6148.9010300@dataix.net> Date: Mon, 21 Jun 2010 08:55:36 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100620 Thunderbird MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <4C18304A.1080601@dataix.net> <4C18322A.6050007@dataix.net> <86wrtz5mk6.fsf@ds4.des.no> <4C1F576F.9090901@dataix.net> <86y6e8fuo1.fsf@ds4.des.no> In-Reply-To: <86y6e8fuo1.fsf@ds4.des.no> X-Enigmail-Version: 1.0.1 OpenPGP: id=89D8547E Content-Type: multipart/mixed; boundary="------------080309060107090207060608" Cc: "Sam Fourman Jr." , Brandon Gooch , FreeBSD Current , jilles@stack.nl Subject: Re: [MFC REQUEST] Filename completion in sh(1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 12:55:43 -0000 This is a multi-part message in MIME format. --------------080309060107090207060608 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 06/21/2010 08:15, Dag-Erling Smørgrav wrote: > jhell writes: >> Because SVN in both our patches for tab completion missed filecomplete.h >> and filecomplete.c [...] the previous patches from des@ & >> myself will break world builds. > > Speak for yourself. Both files are present in the patch I posted, and I > tested it (make toolchain, which builds both libedit and sh) before I > posted it. > > DES Sorry but he only mention of filecomplete in your patch is in this section. That is exactly the same in the patch I had originally generated using SVN. I would really like to know how SVN knows how to create files that are missing from one tree to the next ? Attached is another copy of your patch. downloaded from the message you sent it with. No need to get upset, of course the commands above you stated work but also attached is the build log of how I found these were missing FYI. I took the time to review the differences, if you would like to point out where in the patch that you sent or mine... that the new files get created please let me know. Index: lib/libedit/Makefile =================================================================== --- lib/libedit/Makefile (revision 209229) +++ lib/libedit/Makefile (working copy) @@ -6,7 +6,8 @@ SHLIB_MAJOR= 7 SHLIBDIR?= /lib -OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \ +OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ + hist.c key.c map.c \ parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c Regards, -- jhell --------------080309060107090207060608 Content-Type: text/x-patch; name="sh-tab-completion-stable-8.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="sh-tab-completion-stable-8.diff" Index: include/histedit.h =================================================================== --- include/histedit.h (revision 209229) +++ include/histedit.h (working copy) @@ -105,9 +105,8 @@ */ int el_set(EditLine *, int, ...); int el_get(EditLine *, int, ...); -#if 0 unsigned char _el_fn_complete(EditLine *, int); -#endif +unsigned char _el_fn_sh_complete(EditLine *, int); /* * el_set/el_get parameters Index: lib/libedit/read.h =================================================================== --- lib/libedit/read.h (revision 209229) +++ lib/libedit/read.h (working copy) @@ -13,9 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Index: lib/libedit/Makefile =================================================================== --- lib/libedit/Makefile (revision 209229) +++ lib/libedit/Makefile (working copy) @@ -6,7 +6,8 @@ SHLIB_MAJOR= 7 SHLIBDIR?= /lib -OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \ +OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ + hist.c key.c map.c \ parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c DPADD= ${LIBNCURSES} @@ -35,6 +36,8 @@ CFLAGS+= #-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH CFLAGS+= #-DDEBUG_PASTE -DDEBUG_EDIT +WARNS?= 1 + AHDR= vi.h emacs.h common.h ASRC= ${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c Index: lib/libedit/editrc.5 =================================================================== --- lib/libedit/editrc.5 (revision 209229) +++ lib/libedit/editrc.5 (working copy) @@ -13,9 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -32,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd October 18, 2003 -.Os .Dt EDITRC 5 +.Os .Sh NAME .Nm editrc .Nd configuration file for editline library Index: lib/libedit/editline.3 =================================================================== --- lib/libedit/editline.3 (revision 209229) +++ lib/libedit/editline.3 (working copy) @@ -13,9 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -32,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd January 12, 2007 -.Os .Dt EDITLINE 3 +.Os .Sh NAME .Nm editline , .Nm el_init , Index: bin/sh/memalloc.h =================================================================== --- bin/sh/memalloc.h (revision 209229) +++ bin/sh/memalloc.h (working copy) @@ -51,7 +51,7 @@ pointer ckmalloc(size_t); pointer ckrealloc(pointer, int); void ckfree(pointer); -char *savestr(char *); +char *savestr(const char *); pointer stalloc(int); void stunalloc(pointer); void setstackmark(struct stackmark *); Index: bin/sh/alias.h =================================================================== --- bin/sh/alias.h (revision 209229) +++ bin/sh/alias.h (working copy) @@ -42,7 +42,7 @@ int flag; }; -struct alias *lookupalias(char *, int); +struct alias *lookupalias(const char *, int); int aliascmd(int, char **); int unaliascmd(int, char **); void rmaliases(void); Index: bin/sh/mkbuiltins =================================================================== --- bin/sh/mkbuiltins (revision 209229) +++ bin/sh/mkbuiltins (working copy) @@ -88,7 +88,7 @@ awk '{ printf "#define %s %d\n", $1, NR-1}' echo ' struct builtincmd { - char *name; + const char *name; int code; int special; }; Index: bin/sh/options.h =================================================================== --- bin/sh/options.h (revision 209229) +++ bin/sh/options.h (working copy) @@ -102,7 +102,7 @@ extern struct shparam shellparam; /* $@ */ extern char **argptr; /* argument list for builtin commands */ extern char *shoptarg; /* set by nextopt */ -extern char *optptr; /* used by nextopt */ +extern char *nextopt_optptr; /* used by nextopt */ void procargs(int, char **); void optschanged(void); @@ -111,5 +111,5 @@ int shiftcmd(int, char **); int setcmd(int, char **); int getoptscmd(int, char **); -int nextopt(char *); +int nextopt(const char *); void getoptsreset(const char *); Index: bin/sh/output.c =================================================================== --- bin/sh/output.c (revision 209229) +++ bin/sh/output.c (working copy) @@ -71,7 +71,7 @@ static int doformat_wr(void *, const char *, int); struct output output = {NULL, 0, NULL, OUTBUFSIZ, 1, 0}; -struct output errout = {NULL, 0, NULL, 100, 2, 0}; +struct output errout = {NULL, 0, NULL, 256, 2, 0}; struct output memout = {NULL, 0, NULL, 0, MEM_OUT, 0}; struct output *out1 = &output; struct output *out2 = &errout; @@ -124,8 +124,6 @@ { while (*p) outc(*p++, file); - if (file == out2) - flushout(file); } /* Like outstr(), but quote for re-input into the shell. */ @@ -255,7 +253,7 @@ } void -dprintf(const char *fmt, ...) +out2fmt_flush(const char *fmt, ...) { va_list ap; @@ -316,7 +314,7 @@ */ int -xwrite(int fd, char *buf, int nbytes) +xwrite(int fd, const char *buf, int nbytes) { int ntry; int i; Index: bin/sh/parser.h =================================================================== --- bin/sh/parser.h (revision 209229) +++ bin/sh/parser.h (working copy) @@ -73,9 +73,10 @@ extern int tokpushback; #define NEOF ((union node *)&tokpushback) extern int whichprompt; /* 1 == PS1, 2 == PS2 */ +extern const char *const parsekwd[]; union node *parsecmd(int); void fixredir(union node *, const char *, int); -int goodname(char *); +int goodname(const char *); char *getprompt(void *); Index: bin/sh/output.h =================================================================== --- bin/sh/output.h (revision 209229) +++ bin/sh/output.h (working copy) @@ -46,13 +46,13 @@ short flags; }; -extern struct output output; -extern struct output errout; +extern struct output output; /* to fd 1 */ +extern struct output errout; /* to fd 2 */ extern struct output memout; -extern struct output *out1; -extern struct output *out2; +extern struct output *out1; /* &memout if backquote, otherwise &output */ +extern struct output *out2; /* &memout if backquote with 2>&1, otherwise + &errout */ -void open_mem(char *, int, struct output *); void out1str(const char *); void out1qstr(const char *); void out2str(const char *); @@ -65,10 +65,10 @@ void freestdout(void); void outfmt(struct output *, const char *, ...) __printflike(2, 3); void out1fmt(const char *, ...) __printflike(1, 2); -void dprintf(const char *, ...) __printflike(1, 2); +void out2fmt_flush(const char *, ...) __printflike(1, 2); void fmtstr(char *, int, const char *, ...) __printflike(3, 4); void doformat(struct output *, const char *, va_list) __printflike(2, 0); -int xwrite(int, char *, int); +int xwrite(int, const char *, int); #define outc(c, file) (--(file)->nleft < 0? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c))) #define out1c(c) outc(c, out1); Index: bin/sh/mystring.c =================================================================== --- bin/sh/mystring.c (revision 209229) +++ bin/sh/mystring.c (working copy) @@ -108,7 +108,7 @@ number(const char *s) { if (! is_number(s)) - error("Illegal number: %s", (char *)s); + error("Illegal number: %s", s); return atoi(s); } Index: bin/sh/histedit.c =================================================================== --- bin/sh/histedit.c (revision 209229) +++ bin/sh/histedit.c (working copy) @@ -92,12 +92,14 @@ if (hist != NULL) sethistsize(histsizeval()); else - out2str("sh: can't initialize history\n"); + out2fmt_flush("sh: can't initialize history\n"); } if (editing && !el && isatty(0)) { /* && isatty(2) ??? */ /* * turn editing on */ + char *term; + INTOFF; if (el_in == NULL) el_in = fdopen(0, "r"); @@ -107,14 +109,22 @@ el_out = fdopen(2, "w"); if (el_in == NULL || el_err == NULL || el_out == NULL) goto bad; + term = lookupvar("TERM"); + if (term) + setenv("TERM", term, 1); + else + unsetenv("TERM"); el = el_init(arg0, el_in, el_out, el_err); if (el != NULL) { if (hist) el_set(el, EL_HIST, history, hist); el_set(el, EL_PROMPT, getprompt); + el_set(el, EL_ADDFN, "sh-complete", + "Filename completion", + _el_fn_sh_complete); } else { bad: - out2str("sh: can't initialize editing\n"); + out2fmt_flush("sh: can't initialize editing\n"); } INTON; } else if (!editing && el) { @@ -128,6 +138,7 @@ el_set(el, EL_EDITOR, "vi"); else if (Eflag) el_set(el, EL_EDITOR, "emacs"); + el_set(el, EL_BIND, "^I", "sh-complete", NULL); el_source(el, NULL); } } else { @@ -160,23 +171,30 @@ } } +void +setterm(const char *term) +{ + if (rootshell && el != NULL && term != NULL) + el_set(el, EL_TERMINAL, term); +} + int histcmd(int argc, char **argv) { int ch; - char *editor = NULL; + const char *editor = NULL; HistEvent he; int lflg = 0, nflg = 0, rflg = 0, sflg = 0; int i, retval; - char *firststr, *laststr; + const char *firststr, *laststr; int first, last, direction; - char *pat = NULL, *repl; + char *pat = NULL, *repl = NULL; static int active = 0; struct jmploc jmploc; struct jmploc *savehandler; char editfilestr[PATH_MAX]; char *volatile editfile; - FILE *efp; + FILE *efp = NULL; int oldhistnum; if (hist == NULL) @@ -336,6 +354,7 @@ if (sflg) { if (displayhist) { out2str(s); + flushout(out2); } evalstring(s, 0); if (displayhist && hist) { @@ -405,7 +424,7 @@ } int -not_fcnumber(char *s) +not_fcnumber(const char *s) { if (s == NULL) return (0); @@ -415,10 +434,10 @@ } int -str_to_event(char *str, int last) +str_to_event(const char *str, int last) { HistEvent he; - char *s = str; + const char *s = str; int relative = 0; int i, retval; Index: bin/sh/show.c =================================================================== --- bin/sh/show.c (revision 209229) +++ bin/sh/show.c (working copy) @@ -307,7 +307,7 @@ void -trputs(char *s) +trputs(const char *s) { if (tracefile == NULL) return; Index: bin/sh/show.h =================================================================== --- bin/sh/show.h (revision 209229) +++ bin/sh/show.h (working copy) @@ -35,6 +35,6 @@ void sh_trace(const char *, ...) __printflike(1, 2); void trargs(char **); void trputc(int); -void trputs(char *); +void trputs(const char *); void opentrace(void); #endif Index: bin/sh/arith_lex.l =================================================================== --- bin/sh/arith_lex.l (revision 209229) +++ bin/sh/arith_lex.l (working copy) @@ -51,13 +51,6 @@ int yylex(void); -struct varname -{ - struct varname *next; - char name[1]; -}; -static struct varname *varnames; - #undef YY_INPUT #define YY_INPUT(buf,result,max) \ result = (*buf = *arith_buf++) ? 1 : YY_NULL; @@ -87,14 +80,11 @@ * If variable doesn't exist, we should initialize * it to zero. */ - struct varname *temp; + char *temp; if (lookupvar(yytext) == NULL) setvarsafe(yytext, "0", 0); - temp = ckmalloc(sizeof(struct varname) + - strlen(yytext)); - temp->next = varnames; - varnames = temp; - yylval.s_value = strcpy(temp->name, yytext); + temp = stalloc(strlen(yytext) + 1); + yylval.s_value = strcpy(temp, yytext); return ARITH_VAR; } @@ -140,15 +130,5 @@ void arith_lex_reset(void) { - struct varname *name, *next; - YY_NEW_FILE; - - name = varnames; - while (name != NULL) { - next = name->next; - ckfree(name); - name = next; - } - varnames = NULL; } Index: bin/sh/myhistedit.h =================================================================== --- bin/sh/myhistedit.h (revision 209229) +++ bin/sh/myhistedit.h (working copy) @@ -38,8 +38,9 @@ void histedit(void); void sethistsize(const char *); +void setterm(const char *); int histcmd(int, char **); -int not_fcnumber(char *); -int str_to_event(char *, int); +int not_fcnumber(const char *); +int str_to_event(const char *, int); int bindcmd(int, char **); Index: bin/sh/sh.1 =================================================================== --- bin/sh/sh.1 (revision 209229) +++ bin/sh/sh.1 (working copy) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd May 24, 2010 .Dt SH 1 .Os .Sh NAME @@ -210,7 +210,8 @@ .Xr emacs 1 command line editor (disables the .Fl V -option if it has been set). +option if it has been set; +set automatically when interactive on terminals). .It Fl e Li errexit Exit immediately if any untested command fails in non-interactive mode. The exit status of a command is considered to be @@ -296,7 +297,10 @@ .Ed .It Fl u Li nounset Write a message to standard error when attempting -to expand a variable that is not set, and if the +to expand a variable, a positional parameter or +the special parameter +.Va \&! +that is not set, and if the shell is not interactive, exit immediately. .It Fl V Li vi Enable the built-in @@ -411,11 +415,11 @@ .Pq Ql \en . A backslash preceding a newline is treated as a line continuation. .El -.Ss Reserved Words -Reserved words are words that have special meaning to the +.Ss Keywords +Keywords or reserved words are words that have special meaning to the shell and are recognized at the beginning of a line and after a control operator. -The following are reserved words: +The following are keywords: .Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center .It Li \&! Ta { Ta } Ta Ic case Ta Ic do .It Ic done Ta Ic elif Ta Ic else Ta Ic esac Ta Ic fi @@ -425,8 +429,8 @@ An alias is a name and corresponding value set using the .Ic alias built-in command. -Whenever a reserved word may occur (see above), -and after checking for reserved words, the shell +Whenever a keyword may occur (see above), +and after checking for keywords, the shell checks the word to see if it matches an alias. If it does, it replaces it in the input stream with its value. For example, if there is an alias called @@ -465,7 +469,7 @@ document). Essentially though, a line is read and if the first word of the line (or after a control operator) -is not a reserved word, then the shell has recognized a +is not a keyword, then the shell has recognized a simple command. Otherwise, a complex command or some other special construct may have been recognized. @@ -661,11 +665,11 @@ performing any searches. .It The shell searches each entry in the -.Ev PATH -environment variable +.Va PATH +variable in turn for the command. The value of the -.Ev PATH +.Va PATH variable should be a series of entries separated by colons. Each entry consists of a @@ -691,7 +695,7 @@ .In sys/signal.h . .Ss Complex Commands Complex commands are combinations of simple commands -with control operators or reserved words, together creating a larger complex +with control operators or keywords, together creating a larger complex command. More generally, a command is one of the following: .Bl -item -offset indent @@ -735,7 +739,7 @@ If the pipeline is not in the background (discussed later), the shell waits for all commands to complete. .Pp -If the reserved word +If the keyword .Ic !\& does not precede the pipeline, the exit status is the exit status of the last command specified @@ -1036,13 +1040,9 @@ .Ic set built-in command can also be used to set or reset them. .Ss Special Parameters -A special parameter is a parameter denoted by a special one-character -name. -The special parameters recognized by the -.Nm -shell of -.Fx -are shown in the following list, exactly as they would appear in input +Special parameters are parameters denoted by a single special character +or the digit zero. +They are shown in the following list, exactly as they would appear in input typed by the user or in the source of a shell script. .Bl -hang .It Li $* @@ -1109,6 +1109,84 @@ .It Li $0 (zero) Expands to the name of the shell or shell script. .El +.Ss Special Variables +The following variables are set by the shell or +have special meaning to it: +.Bl -tag -width ".Va HISTSIZE" +.It Va CDPATH +The search path used with the +.Ic cd +built-in. +.It Va EDITOR +The fallback editor used with the +.Ic fc +built-in. +If not set, the default editor is +.Xr ed 1 . +.It Va FCEDIT +The default editor used with the +.Ic fc +built-in. +.It Va HISTSIZE +The number of previous commands that are accessible. +.It Va HOME +The user's home directory, +used in tilde expansion and as a default directory for the +.Ic cd +built-in. +.It Va IFS +Input Field Separators. +This is normally set to +.Aq space , +.Aq tab , +and +.Aq newline . +See the +.Sx White Space Splitting +section for more details. +.It Va LINENO +The current line number in the script or function. +.It Va MAIL +The name of a mail file, that will be checked for the arrival of new +mail. +Overridden by +.Va MAILPATH . +.It Va MAILPATH +A colon +.Pq Ql \&: +separated list of file names, for the shell to check for incoming +mail. +This variable overrides the +.Va MAIL +setting. +There is a maximum of 10 mailboxes that can be monitored at once. +.It Va PATH +The default search path for executables. +See the +.Sx Path Search +section for details. +.It Va PPID +The parent process ID of the invoked shell. +This is set at startup +unless this variable is in the environment. +A later change of parent process ID is not reflected. +A subshell retains the same value of +.Va PPID . +.It Va PS1 +The primary prompt string, which defaults to +.Dq Li "$ " , +unless you are the superuser, in which case it defaults to +.Dq Li "# " . +.It Va PS2 +The secondary prompt string, which defaults to +.Dq Li "> " . +.It Va PS4 +The prefix for the trace output (if +.Fl x +is active). +The default is +.Dq Li "+ " . +.El .Ss Word Expansions This clause describes the various expansions that are performed on words. @@ -1162,7 +1240,7 @@ username is missing (as in .Pa ~/foobar ) , the tilde is replaced with the value of the -.Ev HOME +.Va HOME variable (the current user's home directory). .Ss Parameter Expansion The format for parameter expansion is as follows: @@ -1175,10 +1253,20 @@ .Ql } . Any .Ql } -escaped by a backslash or within a quoted string, and characters in +escaped by a backslash or within a single-quoted string, and characters in embedded arithmetic expansions, command substitutions, and variable expansions, are not examined in determining the matching .Ql } . +Except for the variants with +.Ql + , +.Ql - , +.Ql = +or +.Ql ?\& , +any +.Ql } +within a double-quoted string is also not examined in determining the matching +.Ql } . .Pp The simplest form for parameter expansion is: .Pp @@ -1262,6 +1350,14 @@ In the parameter expansions shown previously, use of the colon in the format results in a test for a parameter that is unset or null; omission of the colon results in a test for a parameter that is only unset. +.Pp +The +.Ar word +inherits the type of quoting +(unquoted, double-quoted or here-document) +from the surroundings, +with the exception that a backslash that quotes a closing brace is removed +during quote removal. .Bl -tag -width indent .It Li ${# Ns Ar parameter Ns Li } String Length. @@ -1469,10 +1565,10 @@ .Ql / characters, it is used as is. Otherwise, the shell searches the -.Ev PATH +.Va PATH for the file. If it is not found in the -.Ev PATH , +.Va PATH , it is sought in the current working directory. .It Ic \&[ A built-in equivalent of @@ -1516,7 +1612,7 @@ Switch to the specified .Ar directory , or to the directory specified in the -.Ev HOME +.Va HOME environment variable if no .Ar directory is specified. @@ -1527,17 +1623,17 @@ or .Pa .. , then the directories listed in the -.Ev CDPATH +.Va CDPATH variable will be searched for the specified .Ar directory . If -.Ev CDPATH +.Va CDPATH is unset, the current directory is searched. The format of -.Ev CDPATH +.Va CDPATH is the same as that of -.Ev PATH . +.Va PATH . In an interactive shell, the .Ic cd @@ -1545,7 +1641,7 @@ that it actually switched to if this is different from the name that the user gave. These may be different either because the -.Ev CDPATH +.Va CDPATH mechanism was used or because a symbolic link was crossed. .Pp If the @@ -1568,16 +1664,18 @@ .It Ic command Oo Fl p Oc Op Ar utility Op Ar argument ... .It Ic command Oo Fl v | V Oc Op Ar utility The first form of invocation executes the specified +.Ar utility , +ignoring shell functions in the search. +If .Ar utility -as a simple command (see the -.Sx Simple Commands -section). +is a special builtin, +it is executed as if it were a regular builtin. .Pp If the .Fl p option is specified, the command search is performed using a default value of -.Ev PATH +.Va PATH that is guaranteed to find all of the standard utilities. .Pp If the @@ -1736,20 +1834,20 @@ .Ar editor string is a command name, subject to search via the -.Ev PATH +.Va PATH variable. The value in the -.Ev FCEDIT +.Va FCEDIT variable is used as a default when .Fl e is not specified. If -.Ev FCEDIT +.Va FCEDIT is null or unset, the value of the -.Ev EDITOR +.Va EDITOR variable is used. If -.Ev EDITOR +.Va EDITOR is null or unset, .Xr ed 1 is used as the editor. @@ -1783,7 +1881,7 @@ Select the commands to list or edit. The number of previous commands that can be accessed are determined by the value of the -.Ev HISTSIZE +.Va HISTSIZE variable. The value of .Ar first @@ -1814,12 +1912,12 @@ .El .El .Pp -The following environment variables affect the execution of +The following variables affect the execution of .Ic fc : -.Bl -tag -width ".Ev HISTSIZE" -.It Ev FCEDIT +.Bl -tag -width ".Va HISTSIZE" +.It Va FCEDIT Name of the editor to use for history editing. -.It Ev HISTSIZE +.It Va HISTSIZE The number of previous commands that are accessible. .El .It Ic fg Op Ar job @@ -2285,74 +2383,27 @@ .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev HISTSIZE" -.It Ev CDPATH -The search path used with the -.Ic cd -built-in. -.It Ev EDITOR -The fallback editor used with the -.Ic fc -built-in. -If not set, the default editor is -.Xr ed 1 . -.It Ev FCEDIT -The default editor used with the -.Ic fc -built-in. -.It Ev HISTSIZE -The number of previous commands that are accessible. -.It Ev HOME -The starting directory of -.Nm . -.It Ev IFS -Input Field Separators. -This is normally set to -.Aq space , -.Aq tab , -and -.Aq newline . -See the -.Sx White Space Splitting -section for more details. -.It Ev MAIL -The name of a mail file, that will be checked for the arrival of new -mail. -Overridden by -.Ev MAILPATH . -.It Ev MAILPATH -A colon -.Pq Ql \&: -separated list of file names, for the shell to check for incoming -mail. -This environment setting overrides the -.Ev MAIL -setting. -There is a maximum of 10 mailboxes that can be monitored at once. -.It Ev PATH -The default search path for executables. -See the -.Sx Path Search -section for details. -.It Ev PS1 -The primary prompt string, which defaults to -.Dq Li "$ " , -unless you are the superuser, in which case it defaults to -.Dq Li "# " . -.It Ev PS2 -The secondary prompt string, which defaults to -.Dq Li "> " . -.It Ev PS4 -The prefix for the trace output (if -.Fl x -is active). -The default is -.Dq Li "+ " . +.Bl -tag -width ".Ev LANGXXXXXX" +.It Ev ENV +Initialization file for interactive shells. +.It Ev LANG , Ev LC_* +Locale settings. +These are inherited by children of the shell, +and is used in a limited manner by the shell itself. +.It Ev PWD +An absolute pathname for the current directory, +possibly containing symbolic links. +This is used and updated by the shell. .It Ev TERM The default terminal setting for the shell. This is inherited by children of the shell, and is used in the history editing modes. .El +.Pp +Additionally, all environment variables are turned into shell variables +at startup, +which may affect the shell as described under +.Sx Special Variables . .Sh EXIT STATUS Errors that are detected by the shell, such as a syntax error, will cause the shell to exit with a non-zero exit status. Index: bin/sh/error.c =================================================================== --- bin/sh/error.c (revision 209229) +++ bin/sh/error.c (working copy) @@ -67,17 +67,21 @@ char *commandname; -static void exverror(int, const char *, va_list) __printf0like(2, 0); +static void exverror(int, const char *, va_list) __printf0like(2, 0) __dead2; /* * Called to raise an exception. Since C doesn't include exceptions, we * just do a longjmp to the exception handler. The type of exception is * stored in the global variable "exception". + * + * Interrupts are disabled; they should be reenabled when the exception is + * caught. */ void exraise(int e) { + INTOFF; if (handler == NULL) abort(); exception = e; @@ -138,8 +142,15 @@ static void exverror(int cond, const char *msg, va_list ap) { - CLEAR_PENDING_INT; - INTOFF; + /* + * An interrupt trumps an error. Certain places catch error + * exceptions or transform them to a plain nonzero exit code + * in child processes, and if an error exception can be handled, + * an interrupt can be handled as well. + * + * exraise() will disable interrupts for the exception handler. + */ + FORCEINTON; #ifdef DEBUG if (msg) @@ -149,8 +160,8 @@ #endif if (msg) { if (commandname) - outfmt(&errout, "%s: ", commandname); - doformat(&errout, msg, ap); + outfmt(out2, "%s: ", commandname); + doformat(out2, msg, ap); out2c('\n'); } flushall(); Index: bin/sh/error.h =================================================================== --- bin/sh/error.h (revision 209229) +++ bin/sh/error.h (working copy) @@ -72,14 +72,16 @@ #define INTOFF suppressint++ #define INTON { if (--suppressint == 0 && intpending) onint(); } +#define is_int_on() suppressint +#define SETINTON(s) suppressint = (s) #define FORCEINTON {suppressint = 0; if (intpending) onint();} #define CLEAR_PENDING_INT intpending = 0 #define int_pending() intpending -void exraise(int); +void exraise(int) __dead2; void onint(void); -void error(const char *, ...) __printf0like(1, 2); -void exerror(int, const char *, ...) __printf0like(2, 3); +void error(const char *, ...) __printf0like(1, 2) __dead2; +void exerror(int, const char *, ...) __printf0like(2, 3) __dead2; /* Index: bin/sh/input.c =================================================================== --- bin/sh/input.c (revision 209229) +++ bin/sh/input.c (working copy) @@ -93,7 +93,7 @@ int plinno = 1; /* input line number */ -MKINIT int parsenleft; /* copy of parsefile->nleft */ +int parsenleft; /* copy of parsefile->nleft */ MKINIT int parselleft; /* copy of parsefile->lleft */ char *parsenextc; /* copy of parsefile->nextc */ MKINIT struct parsefile basepf; /* top level input file */ @@ -111,9 +111,9 @@ INCLUDE "input.h" INCLUDE "error.h" +MKINIT char basebuf[]; + INIT { - extern char basebuf[]; - basepf.nextc = basepf.buf = basebuf; } @@ -215,7 +215,7 @@ if (flags >= 0 && flags & O_NONBLOCK) { flags &=~ O_NONBLOCK; if (fcntl(0, F_SETFL, flags) >= 0) { - out2str("sh: turning off NDELAY mode\n"); + out2fmt_flush("sh: turning off NDELAY mode\n"); goto retry; } } @@ -359,7 +359,7 @@ struct strpush *sp; INTOFF; -/*dprintf("*** calling pushstring: %s, %d\n", s, len);*/ +/*out2fmt_flush("*** calling pushstring: %s, %d\n", s, len);*/ if (parsefile->strpush) { sp = ckmalloc(sizeof (struct strpush)); sp->prev = parsefile->strpush; @@ -386,7 +386,7 @@ parsenextc = sp->prevstring; parsenleft = sp->prevnleft; parselleft = sp->prevlleft; -/*dprintf("*** calling popstring: restoring to '%s'\n", parsenextc);*/ +/*out2fmt_flush("*** calling popstring: restoring to '%s'\n", parsenextc);*/ if (sp->ap) sp->ap->flag &= ~ALIASINUSE; parsefile->strpush = sp->prev; @@ -401,7 +401,7 @@ */ void -setinputfile(char *fname, int push) +setinputfile(const char *fname, int push) { int fd; int fd2; @@ -509,6 +509,32 @@ /* + * Return current file (to go back to it later using popfilesupto()). + */ + +struct parsefile * +getcurrentfile(void) +{ + return parsefile; +} + + +/* + * Pop files until the given file is on top again. Useful for regular + * builtins that read shell commands from files or strings. + * If the given file is not an active file, an error is raised. + */ + +void +popfilesupto(struct parsefile *file) +{ + while (parsefile != file && parsefile != &basepf) + popfile(); + if (parsefile != file) + error("popfilesupto() misused"); +} + +/* * Return to top level. */ Index: bin/sh/input.h =================================================================== --- bin/sh/input.h (revision 209229) +++ bin/sh/input.h (working copy) @@ -45,6 +45,8 @@ extern char *parsenextc; /* next character in input buffer */ extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */ +struct parsefile; + char *pfgets(char *, int); int pgetc(void); int preadbuffer(void); @@ -52,10 +54,12 @@ void pungetc(void); void pushstring(char *, int, void *); void popstring(void); -void setinputfile(char *, int); +void setinputfile(const char *, int); void setinputfd(int, int); void setinputstring(char *, int); void popfile(void); +struct parsefile *getcurrentfile(void); +void popfilesupto(struct parsefile *); void popallfiles(void); void closescript(void); Index: bin/sh/redir.c =================================================================== --- bin/sh/redir.c (revision 209229) +++ bin/sh/redir.c (working copy) @@ -63,6 +63,7 @@ #define EMPTY -2 /* marks an unused slot in redirtab */ +#define CLOSED -1 /* fd was not open before redir */ #define PIPESIZE 4096 /* amount of buffering in a pipe */ @@ -101,7 +102,6 @@ struct redirtab *sv = NULL; int i; int fd; - int try; char memory[10]; /* file descriptors to write to memory */ for (i = 10 ; --i >= 0 ; ) @@ -116,38 +116,30 @@ } for (n = redir ; n ; n = n->nfile.next) { fd = n->nfile.fd; - try = 0; if ((n->nfile.type == NTOFD || n->nfile.type == NFROMFD) && n->ndup.dupfd == fd) continue; /* redirect from/to same file descriptor */ if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) { INTOFF; -again: if ((i = fcntl(fd, F_DUPFD, 10)) == -1) { switch (errno) { case EBADF: - if (!try) { - openredirect(n, memory); - try++; - goto again; - } - /* FALLTHROUGH*/ + i = CLOSED; + break; default: INTON; error("%d: %s", fd, strerror(errno)); break; } - } - if (!try) { - sv->renamed[fd] = i; - } + } else + (void)fcntl(i, F_SETFD, FD_CLOEXEC); + sv->renamed[fd] = i; INTON; } if (fd == 0) fd0_redirected++; - if (!try) - openredirect(n, memory); + openredirect(n, memory); } if (memory[1]) out1 = &memout; @@ -166,8 +158,11 @@ /* * We suppress interrupts so that we won't leave open file - * descriptors around. This may not be such a good idea because - * an open of a device or a fifo can block indefinitely. + * descriptors around. Because the signal handler remains + * installed and we do not use system call restart, interrupts + * will still abort blocking opens such as fifos (they will fail + * with EINTR). There is, however, a race condition if an interrupt + * arrives after INTOFF and before open blocks. */ INTOFF; memory[fd] = 0; Index: bin/sh/trap.c =================================================================== --- bin/sh/trap.c (revision 209229) +++ bin/sh/trap.c (working copy) @@ -149,6 +149,7 @@ { char *action; int signo; + int errors = 0; if (argc <= 1) { for (signo = 0 ; signo < sys_nsig ; signo++) { @@ -183,8 +184,10 @@ } } while (*argv) { - if ((signo = sigstring_to_signum(*argv)) == -1) - error("bad signal %s", *argv); + if ((signo = sigstring_to_signum(*argv)) == -1) { + out2fmt_flush("trap: bad signal %s\n", *argv); + errors = 1; + } INTOFF; if (action) action = savestr(action); @@ -196,7 +199,7 @@ INTON; argv++; } - return 0; + return errors; } @@ -244,7 +247,8 @@ setsignal(int signo) { int action; - sig_t sig, sigact = SIG_DFL; + sig_t sigact = SIG_DFL; + struct sigaction sa; char *t; if ((t = trap[signo]) == NULL) @@ -320,9 +324,10 @@ case S_IGN: sigact = SIG_IGN; break; } *t = action; - sig = signal(signo, sigact); - if (sig != SIG_ERR && action == S_CATCH) - siginterrupt(signo, 1); + sa.sa_handler = sigact; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(signo, &sa, NULL); } Index: bin/sh/trap.h =================================================================== --- bin/sh/trap.h (revision 209229) +++ bin/sh/trap.h (working copy) @@ -45,4 +45,4 @@ void onsig(int); void dotrap(void); void setinteractive(int); -void exitshell(int); +void exitshell(int) __dead2; Index: bin/sh/arith.h =================================================================== --- bin/sh/arith.h (revision 209229) +++ bin/sh/arith.h (working copy) @@ -34,8 +34,8 @@ #define DIGITS(var) (3 + (2 + CHAR_BIT * sizeof((var))) / 3) -extern char *arith_buf, *arith_startbuf; +extern const char *arith_buf, *arith_startbuf; -arith_t arith(char *); +arith_t arith(const char *); void arith_lex_reset(void); int expcmd(int, char **); Index: bin/sh/mksyntax.c =================================================================== --- bin/sh/mksyntax.c (revision 209229) +++ bin/sh/mksyntax.c (working copy) @@ -55,8 +55,8 @@ struct synclass { - char *name; - char *comment; + const char *name; + const char *comment; }; /* Syntax classes */ @@ -101,16 +101,16 @@ static FILE *cfile; static FILE *hfile; -static char *syntax[513]; +static const char *syntax[513]; static int base; static int size; /* number of values which a char variable can have */ static int nbits; /* number of bits in a character */ static int digit_contig;/* true if digits are contiguous */ -static void filltable(char *); +static void filltable(const char *); static void init(void); -static void add(char *, char *); -static void print(char *); +static void add(const char *, const char *); +static void print(const char *); static void output_type_macros(void); static void digit_convert(void); @@ -232,7 +232,6 @@ add("\n", "CNL"); add("\\", "CBACK"); add("`", "CBQUOTE"); - add("'", "CSQUOTE"); add("\"", "CDQUOTE"); add("$", "CVAR"); add("}", "CENDVAR"); @@ -259,7 +258,7 @@ */ static void -filltable(char *dftval) +filltable(const char *dftval) { int i; @@ -293,7 +292,7 @@ */ static void -add(char *p, char *type) +add(const char *p, const char *type) { while (*p) syntax[*p++ + base] = type; @@ -306,7 +305,7 @@ */ static void -print(char *name) +print(const char *name) { int i; int col; @@ -338,7 +337,7 @@ * contiguous, we can test for them quickly. */ -static char *macro[] = { +static const char *macro[] = { "#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)", "#define is_eof(c)\t((c) == PEOF)", "#define is_alpha(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))", @@ -351,7 +350,7 @@ static void output_type_macros(void) { - char **pp; + const char **pp; if (digit_contig) macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)"; Index: bin/sh/expand.c =================================================================== --- bin/sh/expand.c (revision 209229) +++ bin/sh/expand.c (working copy) @@ -109,7 +109,7 @@ STATIC void addfname(char *); STATIC struct strlist *expsort(struct strlist *); STATIC struct strlist *msort(struct strlist *, int); -STATIC int pmatch(char *, char *, int); +STATIC int pmatch(const char *, const char *, int); STATIC char *cvtnum(int, char *); STATIC int collate_range_cmp(int, int); @@ -273,8 +273,12 @@ while ((c = *p) != '\0') { switch(c) { - case CTLESC: - return (startp); + case CTLESC: /* This means CTL* are always considered quoted. */ + case CTLVAR: + case CTLBACKQ: + case CTLBACKQ | CTLQUOTE: + case CTLARI: + case CTLENDARI: case CTLQUOTEMARK: return (startp); case ':': @@ -282,6 +286,7 @@ goto done; break; case '/': + case CTLENDVAR: goto done; } p++; @@ -357,7 +362,7 @@ void expari(int flag) { - char *p, *start; + char *p, *q, *start; arith_t result; int begoff; int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); @@ -395,7 +400,9 @@ removerecordregions(begoff); if (quotes) rmescapes(p+2); + q = grabstackstr(expdest); result = arith(p+2); + ungrabstackstr(q, expdest); fmtstr(p, DIGITS(result), ARITH_FORMAT_STR, result); while (*p++) ; @@ -503,7 +510,9 @@ int amount; herefd = -1; - argstr(p, 0); + argstr(p, (subtype == VSTRIMLEFT || subtype == VSTRIMLEFTMAX || + subtype == VSTRIMRIGHT || subtype == VSTRIMRIGHTMAX ? + EXP_CASE : 0) | EXP_TILDE); STACKSTRNUL(expdest); herefd = saveherefd; argbackq = saveargbackq; @@ -523,7 +532,7 @@ case VSQUESTION: if (*p != CTLENDVAR) { - outfmt(&errout, "%s\n", startp); + outfmt(out2, "%s\n", startp); error((char *)NULL); } error("%.*s: parameter %snot set", (int)(p - str - 1), @@ -659,7 +668,7 @@ } varlen = 0; startloc = expdest - stackblock(); - if (!set && uflag) { + if (!set && uflag && *var != '@' && *var != '*') { switch (subtype) { case VSNORMAL: case VSTRIMLEFT: @@ -852,7 +861,6 @@ int num; char *p; int i; - extern int oexitstatus; char sep; char **ap; char const *syntax; @@ -976,7 +984,7 @@ char *start; char *p; char *q; - char *ifs; + const char *ifs; const char *ifsspc; int had_param_ch = 0; @@ -1344,7 +1352,7 @@ */ int -patmatch(char *pattern, char *string, int squoted) +patmatch(const char *pattern, const char *string, int squoted) { #ifdef notdef if (pattern[0] == '!' && pattern[1] == '!') @@ -1356,9 +1364,9 @@ STATIC int -pmatch(char *pattern, char *string, int squoted) +pmatch(const char *pattern, const char *string, int squoted) { - char *p, *q; + const char *p, *q; char c; p = pattern; @@ -1406,7 +1414,7 @@ } while (*q++ != '\0'); return 0; case '[': { - char *endp; + const char *endp; int invert, found; char chr; @@ -1510,7 +1518,7 @@ */ int -casematch(union node *pattern, char *val) +casematch(union node *pattern, const char *val) { struct stackmark smark; int result; Index: bin/sh/mail.c =================================================================== --- bin/sh/mail.c (revision 209229) +++ bin/sh/mail.c (working copy) @@ -72,7 +72,7 @@ chkmail(int silent) { int i; - char *mpath; + const char *mpath; char *p; char *q; struct stackmark smark; Index: bin/sh/main.c =================================================================== --- bin/sh/main.c (revision 209229) +++ bin/sh/main.c (working copy) @@ -75,8 +75,9 @@ int rootpid; int rootshell; +struct jmploc main_handler; -STATIC void read_profile(char *); +STATIC void read_profile(const char *); STATIC char *find_dot_file(char *); /* @@ -90,14 +91,13 @@ int main(int argc, char *argv[]) { - struct jmploc jmploc; struct stackmark smark; volatile int state; char *shinit; (void) setlocale(LC_ALL, ""); state = 0; - if (setjmp(jmploc.loc)) { + if (setjmp(main_handler.loc)) { /* * When a shell procedure is executed, we raise the * exception EXSHELLPROC to clean up before executing @@ -143,7 +143,7 @@ else goto state4; } - handler = &jmploc; + handler = &main_handler; #ifdef DEBUG opentrace(); trputs("Shell args: "); trargs(argv); @@ -153,10 +153,7 @@ init(); setstackmark(&smark); procargs(argc, argv); - if (getpwd() == NULL && iflag) - out2str("sh: cannot determine working directory\n"); - if (getpwd() != NULL) - setvar ("PWD", getpwd(), VEXPORT); + pwd_init(iflag); if (iflag) chkmail(1); if (argv[0] && argv[0][0] == '-') { @@ -225,7 +222,7 @@ if (!stoppedjobs()) { if (!Iflag) break; - out2str("\nUse \"exit\" to leave shell.\n"); + out2fmt_flush("\nUse \"exit\" to leave shell.\n"); } numeof++; } else if (n != NULL && nflag == 0) { @@ -250,7 +247,7 @@ */ STATIC void -read_profile(char *name) +read_profile(const char *name) { int fd; @@ -271,7 +268,7 @@ */ void -readcmdfile(char *name) +readcmdfile(const char *name) { int fd; @@ -298,7 +295,7 @@ { static char localname[FILENAME_MAX+1]; char *fullname; - char *path = pathval(); + const char *path = pathval(); struct stat statb; /* don't try this for absolute or relative paths */ @@ -317,14 +314,20 @@ int dotcmd(int argc, char **argv) { - char *fullname; + char *filename, *fullname; if (argc < 2) error("missing filename"); exitstatus = 0; - fullname = find_dot_file(argv[1]); + /* + * Because we have historically not supported any options, + * only treat "--" specially. + */ + filename = argc > 2 && strcmp(argv[1], "--") == 0 ? argv[2] : argv[1]; + + fullname = find_dot_file(filename); setinputfile(fullname, 1); commandname = fullname; cmdloop(0); @@ -336,8 +339,6 @@ int exitcmd(int argc, char **argv) { - extern int oexitstatus; - if (stoppedjobs()) return 0; if (argc > 1) Index: bin/sh/expand.h =================================================================== --- bin/sh/expand.h (revision 209229) +++ bin/sh/expand.h (working copy) @@ -58,7 +58,7 @@ void expandhere(union node *, int); void expandarg(union node *, struct arglist *, int); void expari(int); -int patmatch(char *, char *, int); +int patmatch(const char *, const char *, int); void rmescapes(char *); -int casematch(union node *, char *); +int casematch(union node *, const char *); int wordexpcmd(int, char **); Index: bin/sh/exec.c =================================================================== --- bin/sh/exec.c (revision 209229) +++ bin/sh/exec.c (working copy) @@ -98,7 +98,7 @@ STATIC void tryexec(char *, char **, char **); STATIC void printentry(struct tblentry *, int); -STATIC struct tblentry *cmdlookup(char *, int); +STATIC struct tblentry *cmdlookup(const char *, int); STATIC void delete_cmd_entry(void); @@ -109,7 +109,7 @@ */ void -shellexec(char **argv, char **envp, char *path, int index) +shellexec(char **argv, char **envp, const char *path, int idx) { char *cmdname; int e; @@ -120,7 +120,7 @@ } else { e = ENOENT; while ((cmdname = padvance(&path, argv[0])) != NULL) { - if (--index < 0 && pathopt == NULL) { + if (--idx < 0 && pathopt == NULL) { tryexec(cmdname, argv, envp); if (errno != ENOENT && errno != ENOTDIR) e = errno; @@ -175,13 +175,13 @@ * NULL. */ -char *pathopt; +const char *pathopt; char * -padvance(char **path, char *name) +padvance(const char **path, const char *name) { - char *p, *q; - char *start; + const char *p, *start; + char *q; int len; if (*path == NULL) @@ -248,14 +248,14 @@ && (cmdp->cmdtype == CMDNORMAL || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0))) delete_cmd_entry(); - find_command(name, &entry, 1, pathval()); + find_command(name, &entry, DO_ERR, pathval()); if (verbose) { if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ cmdp = cmdlookup(name, 0); if (cmdp != NULL) printentry(cmdp, verbose); else - outfmt(&errout, "%s: not found\n", name); + outfmt(out2, "%s: not found\n", name); } flushall(); } @@ -268,17 +268,17 @@ STATIC void printentry(struct tblentry *cmdp, int verbose) { - int index; - char *path; + int idx; + const char *path; char *name; if (cmdp->cmdtype == CMDNORMAL) { - index = cmdp->param.index; + idx = cmdp->param.index; path = pathval(); do { name = padvance(&path, cmdp->cmdname); stunalloc(name); - } while (--index >= 0); + } while (--idx >= 0); out1str(name); } else if (cmdp->cmdtype == CMDBUILTIN) { out1fmt("builtin %s", cmdp->cmdname); @@ -310,10 +310,11 @@ */ void -find_command(char *name, struct cmdentry *entry, int printerr, char *path) +find_command(const char *name, struct cmdentry *entry, int act, + const char *path) { - struct tblentry *cmdp; - int index; + struct tblentry *cmdp, loc_cmd; + int idx; int prev; char *fullname; struct stat statb; @@ -329,13 +330,19 @@ } /* If name is in the table, and not invalidated by cd, we're done */ - if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) - goto success; + if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) { + if (cmdp->cmdtype == CMDFUNCTION && act & DO_NOFUNC) + cmdp = NULL; + else + goto success; + } /* If %builtin not in path, check for builtin next */ if (builtinloc < 0 && (i = find_builtin(name, &spec)) >= 0) { INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDBUILTIN; cmdp->param.index = i; cmdp->special = spec; @@ -353,17 +360,19 @@ } e = ENOENT; - index = -1; + idx = -1; loop: while ((fullname = padvance(&path, name)) != NULL) { stunalloc(fullname); - index++; + idx++; if (pathopt) { if (prefix("builtin", pathopt)) { if ((i = find_builtin(name, &spec)) < 0) goto loop; INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDBUILTIN; cmdp->param.index = i; cmdp->special = spec; @@ -376,8 +385,8 @@ } } /* if rehash, don't redo absolute path names */ - if (fullname[0] == '/' && index <= prev) { - if (index < prev) + if (fullname[0] == '/' && idx <= prev) { + if (idx < prev) goto loop; TRACE(("searchexec \"%s\": no change\n", name)); goto success; @@ -413,22 +422,25 @@ TRACE(("searchexec \"%s\" returns \"%s\"\n", name, fullname)); INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDNORMAL; - cmdp->param.index = index; + cmdp->param.index = idx; INTON; goto success; } /* We failed. If there was an entry for this command, delete it */ - if (cmdp) + if (cmdp && cmdp->cmdtype != CMDFUNCTION) delete_cmd_entry(); - if (printerr) { + if (act & DO_ERR) { if (e == ENOENT || e == ENOTDIR) outfmt(out2, "%s: not found\n", name); else outfmt(out2, "%s: %s\n", name, strerror(e)); } entry->cmdtype = CMDUNKNOWN; + entry->u.index = 0; return; success: @@ -445,7 +457,7 @@ */ int -find_builtin(char *name, int *special) +find_builtin(const char *name, int *special) { const struct builtincmd *bp; @@ -492,18 +504,18 @@ changepath(const char *newval) { const char *old, *new; - int index; + int idx; int firstchange; int bltin; old = pathval(); new = newval; firstchange = 9999; /* assume no change */ - index = 0; + idx = 0; bltin = -1; for (;;) { if (*old != *new) { - firstchange = index; + firstchange = idx; if ((*old == '\0' && *new == ':') || (*old == ':' && *new == '\0')) firstchange++; @@ -512,9 +524,9 @@ if (*new == '\0') break; if (*new == '%' && bltin < 0 && prefix("builtin", new + 1)) - bltin = index; + bltin = idx; if (*new == ':') { - index++; + idx++; } new++, old++; } @@ -607,10 +619,10 @@ STATIC struct tblentry * -cmdlookup(char *name, int add) +cmdlookup(const char *name, int add) { int hashval; - char *p; + const char *p; struct tblentry *cmdp; struct tblentry **pp; @@ -663,7 +675,7 @@ */ void -addcmdentry(char *name, struct cmdentry *entry) +addcmdentry(const char *name, struct cmdentry *entry) { struct tblentry *cmdp; @@ -683,7 +695,7 @@ */ void -defun(char *name, union node *func) +defun(const char *name, union node *func) { struct cmdentry entry; @@ -700,7 +712,7 @@ */ int -unsetfunc(char *name) +unsetfunc(const char *name) { struct tblentry *cmdp; @@ -718,19 +730,21 @@ */ int -typecmd_impl(int argc, char **argv, int cmd) +typecmd_impl(int argc, char **argv, int cmd, const char *path) { struct cmdentry entry; struct tblentry *cmdp; - char **pp; + const char *const *pp; struct alias *ap; int i; - int error = 0; - extern char *const parsekwd[]; + int error1 = 0; + if (path != pathval()) + clearcmdentry(0); + for (i = 1; i < argc; i++) { /* First look at the keywords */ - for (pp = (char **)parsekwd; *pp; pp++) + for (pp = parsekwd; *pp; pp++) if (**pp == *argv[i] && equal(*pp, argv[i])) break; @@ -760,16 +774,17 @@ } else { /* Finally use brute force */ - find_command(argv[i], &entry, 0, pathval()); + find_command(argv[i], &entry, 0, path); } switch (entry.cmdtype) { case CMDNORMAL: { if (strchr(argv[i], '/') == NULL) { - char *path = pathval(), *name; + const char *path2 = path; + char *name; int j = entry.u.index; do { - name = padvance(&path, argv[i]); + name = padvance(&path2, argv[i]); stunalloc(name); } while (--j >= 0); if (cmd == TYPECMD_SMALLV) @@ -790,7 +805,7 @@ if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: %s\n", argv[i], strerror(errno)); - error |= 127; + error1 |= 127; } } break; @@ -815,11 +830,15 @@ default: if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: not found\n", argv[i]); - error |= 127; + error1 |= 127; break; } } - return error; + + if (path != pathval()) + clearcmdentry(0); + + return error1; } /* @@ -829,5 +848,5 @@ int typecmd(int argc, char **argv) { - return typecmd_impl(argc, argv, TYPECMD_TYPE); + return typecmd_impl(argc, argv, TYPECMD_TYPE, bltinlookup("PATH", 1)); } Index: bin/sh/miscbltin.c =================================================================== --- bin/sh/miscbltin.c (revision 209229) +++ bin/sh/miscbltin.c (working copy) @@ -93,7 +93,7 @@ char c; int rflag; char *prompt; - char *ifs; + const char *ifs; char *p; int startword; int status; @@ -254,7 +254,7 @@ int -umaskcmd(int argc __unused, char **argv) +umaskcmd(int argc __unused, char **argv __unused) { char *ap; int mask; Index: bin/sh/cd.c =================================================================== --- bin/sh/cd.c (revision 209229) +++ bin/sh/cd.c (working copy) @@ -70,6 +70,7 @@ STATIC char *getcomponent(void); STATIC char *findcwd(char *); STATIC void updatepwd(char *); +STATIC char *getpwd(void); STATIC char *getpwd2(void); STATIC char *curdir = NULL; /* current working directory */ @@ -79,8 +80,8 @@ int cdcmd(int argc, char **argv) { - char *dest; - char *path; + const char *dest; + const char *path; char *p; struct stat statb; int ch, phys, print = 0; @@ -351,7 +352,7 @@ /* * Get the current directory and cache the result in curdir. */ -char * +STATIC char * getpwd(void) { char *p; @@ -374,7 +375,6 @@ STATIC char * getpwd2(void) { - struct stat stdot, stpwd; char *pwd; int i; @@ -387,12 +387,29 @@ break; } - pwd = getenv("PWD"); + return NULL; +} + +/* + * Initialize PWD in a new shell. + * If the shell is interactive, we need to warn if this fails. + */ +void +pwd_init(int warn) +{ + char *pwd; + struct stat stdot, stpwd; + + pwd = lookupvar("PWD"); if (pwd && *pwd == '/' && stat(".", &stdot) != -1 && stat(pwd, &stpwd) != -1 && stdot.st_dev == stpwd.st_dev && stdot.st_ino == stpwd.st_ino) { - return pwd; + if (curdir) + ckfree(curdir); + curdir = savestr(pwd); } - return NULL; + if (getpwd() == NULL && warn) + out2fmt_flush("sh: cannot determine working directory\n"); + setvar("PWD", curdir, VEXPORT); } Index: bin/sh/eval.c =================================================================== --- bin/sh/eval.c (revision 209229) +++ bin/sh/eval.c (working copy) @@ -74,7 +74,7 @@ #endif -MKINIT int evalskip; /* set if we are skipping commands */ +int evalskip; /* set if we are skipping commands */ STATIC int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ @@ -91,6 +91,7 @@ STATIC void evalfor(union node *, int); STATIC void evalcase(union node *, int); STATIC void evalsubshell(union node *, int); +STATIC void evalredir(union node *, int); STATIC void expredir(union node *); STATIC void evalpipe(union node *); STATIC void evalcommand(union node *, int, struct backcmd *); @@ -221,10 +222,7 @@ evaltree(n->nbinary.ch2, flags); break; case NREDIR: - expredir(n->nredir.redirect); - redirect(n->nredir.redirect, REDIR_PUSH); - evaltree(n->nredir.n, flags); - popredir(); + evalredir(n, flags); break; case NSUBSHELL: evalsubshell(n, flags); @@ -407,8 +405,7 @@ flags &=~ EV_TESTED; redirect(n->nredir.redirect, 0); evaltree(n->nredir.n, flags | EV_EXIT); /* never returns */ - } - if (! backgnd) { + } else if (! backgnd) { INTOFF; exitstatus = waitforjob(jp, (int *)NULL); INTON; @@ -416,7 +413,47 @@ } +/* + * Evaluate a redirected compound command. + */ +STATIC void +evalredir(union node *n, int flags) +{ + struct jmploc jmploc; + struct jmploc *savehandler; + volatile int in_redirect = 1; + + expredir(n->nredir.redirect); + savehandler = handler; + if (setjmp(jmploc.loc)) { + int e; + + handler = savehandler; + e = exception; + if (e == EXERROR || e == EXEXEC) { + popredir(); + if (in_redirect) { + exitstatus = 2; + return; + } + } + longjmp(handler->loc, 1); + } else { + INTOFF; + handler = &jmploc; + redirect(n->nredir.redirect, REDIR_PUSH); + in_redirect = 0; + INTON; + evaltree(n->nredir.n, flags); + } + INTOFF; + handler = savehandler; + popredir(); + INTON; +} + + /* * Compute the names of the files in a redirection list. */ @@ -593,10 +630,12 @@ char *savecmdname; struct shparam saveparam; struct localvar *savelocalvars; + struct parsefile *savetopfile; volatile int e; char *lastarg; int realstatus; int do_clearcmdentry; + char *path = pathval(); /* First expand the arguments. */ TRACE(("evalcommand(%p, %d) called\n", (void *)cmd, flags)); @@ -646,7 +685,7 @@ out2str(ps4val()); for (sp = varlist.list ; sp ; sp = sp->next) { if (sep != 0) - outc(' ', &errout); + out2c(' '); p = sp->text; while (*p != '=' && *p != '\0') out2c(*p++); @@ -658,7 +697,7 @@ } for (sp = arglist.list ; sp ; sp = sp->next) { if (sep != 0) - outc(' ', &errout); + out2c(' '); /* Disambiguate command looking like assignment. */ if (sp == arglist.list && strchr(sp->text, '=') != NULL && @@ -670,7 +709,7 @@ out2qstr(sp->text); sep = ' '; } - outc('\n', &errout); + out2c('\n'); flushout(&errout); } @@ -679,10 +718,10 @@ /* Variable assignment(s) without command */ cmdentry.cmdtype = CMDBUILTIN; cmdentry.u.index = BLTINCMD; - cmdentry.special = 1; + cmdentry.special = 0; } else { static const char PATH[] = "PATH="; - char *path = pathval(); + int cmd_flags = 0, bltinonly = 0; /* * Modify the command lookup path, if a PATH= assignment @@ -713,42 +752,79 @@ do_clearcmdentry = 1; } - find_command(argv[0], &cmdentry, 1, path); - if (cmdentry.cmdtype == CMDUNKNOWN) { /* command not found */ - exitstatus = 127; - flushout(&errout); - return; - } - /* implement the bltin builtin here */ - if (cmdentry.cmdtype == CMDBUILTIN && cmdentry.u.index == BLTINCMD) { - for (;;) { + for (;;) { + if (bltinonly) { + cmdentry.u.index = find_builtin(*argv, &cmdentry.special); + if (cmdentry.u.index < 0) { + cmdentry.u.index = BLTINCMD; + argv--; + argc++; + break; + } + } else + find_command(argv[0], &cmdentry, cmd_flags, path); + /* implement the bltin and command builtins here */ + if (cmdentry.cmdtype != CMDBUILTIN) + break; + if (cmdentry.u.index == BLTINCMD) { + if (argc == 1) + break; argv++; - if (--argc == 0) + argc--; + bltinonly = 1; + } else if (cmdentry.u.index == COMMANDCMD) { + if (argc == 1) break; - if ((cmdentry.u.index = find_builtin(*argv, - &cmdentry.special)) < 0) { - outfmt(&errout, "%s: not found\n", *argv); - exitstatus = 127; - flushout(&errout); - return; + if (!strcmp(argv[1], "-p")) { + if (argc == 2) + break; + if (argv[2][0] == '-') { + if (strcmp(argv[2], "--")) + break; + if (argc == 3) + break; + argv += 3; + argc -= 3; + } else { + argv += 2; + argc -= 2; + } + path = _PATH_STDPATH; + clearcmdentry(0); + do_clearcmdentry = 1; + } else if (!strcmp(argv[1], "--")) { + if (argc == 2) + break; + argv += 2; + argc -= 2; + } else if (argv[1][0] == '-') + break; + else { + argv++; + argc--; } - if (cmdentry.u.index != BLTINCMD) - break; - } + cmd_flags |= DO_NOFUNC; + bltinonly = 0; + } else + break; } + /* + * Special builtins lose their special properties when + * called via 'command'. + */ + if (cmd_flags & DO_NOFUNC) + cmdentry.special = 0; } /* Fork off a child process if necessary. */ if (cmd->ncmd.backgnd - || (cmdentry.cmdtype == CMDNORMAL + || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 && (cmdentry.cmdtype != CMDBUILTIN || cmdentry.u.index == CDCMD || cmdentry.u.index == DOTCMD - || cmdentry.u.index == EVALCMD)) - || (cmdentry.cmdtype == CMDBUILTIN && - cmdentry.u.index == COMMANDCMD)) { + || cmdentry.u.index == EVALCMD))) { jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; if (flags & EV_BACKCMD) { @@ -775,7 +851,6 @@ #ifdef DEBUG trputs("Shell function: "); trargs(argv); #endif - redirect(cmd->ncmd.redirect, REDIR_PUSH); saveparam = shellparam; shellparam.malloc = 0; shellparam.reset = 1; @@ -786,7 +861,6 @@ savelocalvars = localvars; localvars = NULL; reffunc(cmdentry.u.func); - INTON; savehandler = handler; if (setjmp(jmploc.loc)) { if (exception == EXSHELLPROC) @@ -794,23 +868,27 @@ else { freeparam(&shellparam); shellparam = saveparam; + if (exception == EXERROR || exception == EXEXEC) + popredir(); } unreffunc(cmdentry.u.func); poplocalvars(); localvars = savelocalvars; + funcnest--; handler = savehandler; longjmp(handler->loc, 1); } handler = &jmploc; + funcnest++; + redirect(cmd->ncmd.redirect, REDIR_PUSH); + INTON; for (sp = varlist.list ; sp ; sp = sp->next) mklocal(sp->text); - funcnest++; exitstatus = oexitstatus; if (flags & EV_TESTED) evaltree(getfuncnode(cmdentry.u.func), EV_TESTED); else evaltree(getfuncnode(cmdentry.u.func), 0); - funcnest--; INTOFF; unreffunc(cmdentry.u.func); poplocalvars(); @@ -818,6 +896,7 @@ freeparam(&shellparam); shellparam = saveparam; handler = savehandler; + funcnest--; popredir(); INTON; if (evalskip == SKIPFUNC) { @@ -836,8 +915,10 @@ memout.nextc = memout.buf; memout.bufsize = 64; mode |= REDIR_BACKQ; + cmdentry.special = 0; } savecmdname = commandname; + savetopfile = getcurrentfile(); cmdenviron = varlist.list; e = -1; savehandler = handler; @@ -848,15 +929,25 @@ } handler = &jmploc; redirect(cmd->ncmd.redirect, mode); + /* + * If there is no command word, redirection errors should + * not be fatal but assignment errors should. + */ + if (argc == 0 && !(flags & EV_BACKCMD)) + cmdentry.special = 1; if (cmdentry.special) listsetvar(cmdenviron); + if (argc > 0) + bltinsetlocale(); commandname = argv[0]; argptr = argv + 1; - optptr = NULL; /* initialize nextopt */ + nextopt_optptr = NULL; /* initialize nextopt */ builtin_flags = flags; exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv); flushall(); cmddone: + if (argc > 0) + bltinunsetlocale(); cmdenviron = NULL; out1 = &output; out2 = &errout; @@ -868,29 +959,31 @@ } } handler = savehandler; + if (flags == EV_BACKCMD) { + backcmd->buf = memout.buf; + backcmd->nleft = memout.nextc - memout.buf; + memout.buf = NULL; + } + if (cmdentry.u.index != EXECCMD && + (e == -1 || e == EXERROR || e == EXEXEC)) + popredir(); if (e != -1) { if ((e != EXERROR && e != EXEXEC) || cmdentry.special) exraise(e); - FORCEINTON; + popfilesupto(savetopfile); + if (flags != EV_BACKCMD) + FORCEINTON; } - if (cmdentry.u.index != EXECCMD) - popredir(); - if (flags == EV_BACKCMD) { - backcmd->buf = memout.buf; - backcmd->nleft = memout.nextc - memout.buf; - memout.buf = NULL; - } } else { #ifdef DEBUG trputs("normal command: "); trargs(argv); #endif - clearredir(); redirect(cmd->ncmd.redirect, 0); for (sp = varlist.list ; sp ; sp = sp->next) setvareq(sp->text, VEXPORT|VSTACK); envp = environment(); - shellexec(argv, envp, pathval(), cmdentry.u.index); + shellexec(argv, envp, path, cmdentry.u.index); /*NOTREACHED*/ } goto out; @@ -946,12 +1039,17 @@ */ /* - * No command given, or a bltin command with no arguments. + * No command given, a bltin command with no arguments, or a bltin command + * with an invalid name. */ int -bltincmd(int argc __unused, char **argv __unused) +bltincmd(int argc, char **argv) { + if (argc > 1) { + out2fmt_flush("%s: not found\n", argv[1]); + return 127; + } /* * Preserve exitstatus of a previous possible redirection * as POSIX mandates @@ -991,23 +1089,18 @@ int commandcmd(int argc, char **argv) { - static char stdpath[] = _PATH_STDPATH; - struct jmploc loc, *old; - struct strlist *sp; - char *path; + const char *path; int ch; int cmd = -1; - for (sp = cmdenviron; sp ; sp = sp->next) - setvareq(sp->text, VEXPORT|VSTACK); - path = pathval(); + path = bltinlookup("PATH", 1); optind = optreset = 1; opterr = 0; while ((ch = getopt(argc, argv, "pvV")) != -1) { switch (ch) { case 'p': - path = stdpath; + path = _PATH_STDPATH; break; case 'v': cmd = TYPECMD_SMALLV; @@ -1026,24 +1119,16 @@ if (cmd != -1) { if (argc != 1) error("wrong number of arguments"); - return typecmd_impl(2, argv - 1, cmd); + return typecmd_impl(2, argv - 1, cmd, path); } - if (argc != 0) { - old = handler; - handler = &loc; - if (setjmp(handler->loc) == 0) - shellexec(argv, environment(), path, 0); - handler = old; - if (exception == EXEXEC) - exit(exerrno); - exraise(exception); - } + if (argc != 0) + error("commandcmd() called while it should not be"); /* * Do nothing successfully if no command was specified; * ksh also does this. */ - exit(0); + return 0; } @@ -1085,6 +1170,12 @@ int execcmd(int argc, char **argv) { + /* + * Because we have historically not supported any options, + * only treat "--" specially. + */ + if (argc > 1 && strcmp(argv[1], "--") == 0) + argc--, argv++; if (argc > 1) { struct strlist *sp; Index: bin/sh/var.c =================================================================== --- bin/sh/var.c (revision 209229) +++ bin/sh/var.c (working copy) @@ -73,13 +73,14 @@ struct varinit { struct var *var; int flags; - char *text; + const char *text; void (*func)(const char *); }; #ifndef NO_HISTORY struct var vhistsize; +struct var vterm; #endif struct var vifs; struct var vmail; @@ -94,27 +95,31 @@ STATIC const struct varinit varinit[] = { #ifndef NO_HISTORY - { &vhistsize, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE=", + { &vhistsize, VUNSET, "HISTSIZE=", sethistsize }, #endif - { &vifs, VSTRFIXED|VTEXTFIXED, "IFS= \t\n", + { &vifs, 0, "IFS= \t\n", NULL }, - { &vmail, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL=", + { &vmail, VUNSET, "MAIL=", NULL }, - { &vmpath, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH=", + { &vmpath, VUNSET, "MAILPATH=", NULL }, - { &vpath, VSTRFIXED|VTEXTFIXED, "PATH=" _PATH_DEFPATH, + { &vpath, 0, "PATH=" _PATH_DEFPATH, changepath }, - { &vppid, VSTRFIXED|VTEXTFIXED|VUNSET, "PPID=", + { &vppid, VUNSET, "PPID=", NULL }, /* * vps1 depends on uid */ - { &vps2, VSTRFIXED|VTEXTFIXED, "PS2=> ", + { &vps2, 0, "PS2=> ", NULL }, - { &vps4, VSTRFIXED|VTEXTFIXED, "PS4=+ ", + { &vps4, 0, "PS4=+ ", NULL }, - { &voptind, VSTRFIXED|VTEXTFIXED, "OPTIND=1", +#ifndef NO_HISTORY + { &vterm, VUNSET, "TERM=", + setterm }, +#endif + { &voptind, 0, "OPTIND=1", getoptsreset }, { NULL, 0, NULL, NULL } @@ -122,19 +127,27 @@ STATIC struct var *vartab[VTABSIZE]; -STATIC struct var **hashvar(char *); -STATIC int varequal(char *, char *); -STATIC int localevar(char *); +STATIC const char *const locale_names[7] = { + "LC_COLLATE", "LC_CTYPE", "LC_MONETARY", + "LC_NUMERIC", "LC_TIME", "LC_MESSAGES", NULL +}; +STATIC const int locale_categories[7] = { + LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, LC_MESSAGES, 0 +}; +STATIC struct var **hashvar(const char *); +STATIC int varequal(const char *, const char *); +STATIC int localevar(const char *); + /* * Initialize the variable symbol tables and import the environment. */ #ifdef mkinit INCLUDE "var.h" +MKINIT char **environ; INIT { char **envp; - extern char **environ; initvar(); for (envp = environ ; *envp ; envp++) { @@ -164,8 +177,8 @@ vpp = hashvar(ip->text); vp->next = *vpp; *vpp = vp; - vp->text = ip->text; - vp->flags = ip->flags; + vp->text = __DECONST(char *, ip->text); + vp->flags = ip->flags | VSTRFIXED | VTEXTFIXED; vp->func = ip->func; } } @@ -176,7 +189,7 @@ vpp = hashvar("PS1="); vps1.next = *vpp; *vpp = &vps1; - vps1.text = geteuid() ? "PS1=$ " : "PS1=# "; + vps1.text = __DECONST(char *, geteuid() ? "PS1=$ " : "PS1=# "); vps1.flags = VSTRFIXED|VTEXTFIXED; } if ((vppid.flags & VEXPORT) == 0) { @@ -190,12 +203,14 @@ */ int -setvarsafe(char *name, char *val, int flags) +setvarsafe(const char *name, const char *val, int flags) { struct jmploc jmploc; struct jmploc *const savehandler = handler; int err = 0; + int inton; + inton = is_int_on(); if (setjmp(jmploc.loc)) err = 1; else { @@ -203,6 +218,7 @@ setvar(name, val, flags); } handler = savehandler; + SETINTON(inton); return err; } @@ -212,9 +228,9 @@ */ void -setvar(char *name, char *val, int flags) +setvar(const char *name, const char *val, int flags) { - char *p, *q; + const char *p; int len; int namelen; char *nameeq; @@ -242,25 +258,20 @@ } else { len += strlen(val); } - p = nameeq = ckmalloc(len); - q = name; - while (--namelen >= 0) - *p++ = *q++; - *p++ = '='; - *p = '\0'; + nameeq = ckmalloc(len); + memcpy(nameeq, name, namelen); + nameeq[namelen] = '='; if (val) - scopy(val, p); + scopy(val, nameeq + namelen + 1); + else + nameeq[namelen + 1] = '\0'; setvareq(nameeq, flags); } STATIC int -localevar(char *s) +localevar(const char *s) { - static char *lnames[7] = { - "ALL", "COLLATE", "CTYPE", "MONETARY", - "NUMERIC", "TIME", NULL - }; - char **ss; + const char *const *ss; if (*s != 'L') return 0; @@ -268,8 +279,10 @@ return 1; if (strncmp(s + 1, "C_", 2) != 0) return 0; - for (ss = lnames; *ss ; ss++) - if (varequal(s + 3, *ss)) + if (varequal(s + 3, "ALL")) + return 1; + for (ss = locale_names; *ss ; ss++) + if (varequal(s + 3, *ss + 3)) return 1; return 0; } @@ -280,7 +293,7 @@ * pointer into environ where the string should not be manipulated. */ static void -change_env(char *s, int set) +change_env(const char *s, int set) { char *eqp; char *ss; @@ -391,7 +404,7 @@ */ char * -lookupvar(char *name) +lookupvar(const char *name) { struct var *v; @@ -414,7 +427,7 @@ */ char * -bltinlookup(char *name, int doall) +bltinlookup(const char *name, int doall) { struct strlist *sp; struct var *v; @@ -435,8 +448,63 @@ } +/* + * Set up locale for a builtin (LANG/LC_* assignments). + */ +void +bltinsetlocale(void) +{ + struct strlist *lp; + int act = 0; + char *loc, *locdef; + int i; + for (lp = cmdenviron ; lp ; lp = lp->next) { + if (localevar(lp->text)) { + act = 1; + break; + } + } + if (!act) + return; + loc = bltinlookup("LC_ALL", 0); + INTOFF; + if (loc != NULL) { + setlocale(LC_ALL, loc); + INTON; + return; + } + locdef = bltinlookup("LANG", 0); + for (i = 0; locale_names[i] != NULL; i++) { + loc = bltinlookup(locale_names[i], 0); + if (loc == NULL) + loc = locdef; + if (loc != NULL) + setlocale(locale_categories[i], loc); + } + INTON; +} + /* + * Undo the effect of bltinlocaleset(). + */ +void +bltinunsetlocale(void) +{ + struct strlist *lp; + + INTOFF; + for (lp = cmdenviron ; lp ; lp = lp->next) { + if (localevar(lp->text)) { + setlocale(LC_ALL, ""); + return; + } + } + INTON; +} + + +/* * Generate a list of exported variables. This routine is used to construct * the third argument to execve when executing a program. */ @@ -472,9 +540,9 @@ * VSTACK set since these are currently allocated on the stack. */ -#ifdef mkinit MKINIT void shprocvar(void); +#ifdef mkinit SHELLPROC { shprocvar(); } @@ -798,7 +866,7 @@ */ int -unsetvar(char *s) +unsetvar(const char *s) { struct var **vpp; struct var *vp; @@ -838,7 +906,7 @@ */ STATIC struct var ** -hashvar(char *p) +hashvar(const char *p) { unsigned int hashval; @@ -857,7 +925,7 @@ */ STATIC int -varequal(char *p, char *q) +varequal(const char *p, const char *q) { while (*p == *q++) { if (*p++ == '=') Index: bin/sh/memalloc.c =================================================================== --- bin/sh/memalloc.c (revision 209229) +++ bin/sh/memalloc.c (working copy) @@ -95,7 +95,7 @@ */ char * -savestr(char *s) +savestr(const char *s) { char *p; Index: bin/sh/main.h =================================================================== --- bin/sh/main.h (revision 209229) +++ bin/sh/main.h (working copy) @@ -35,8 +35,9 @@ extern int rootpid; /* pid of main shell */ extern int rootshell; /* true if we aren't a child of the main shell */ +extern struct jmploc main_handler; /* top level exception handler */ -void readcmdfile(char *); +void readcmdfile(const char *); void cmdloop(int); int dotcmd(int, char **); int exitcmd(int, char **); Index: bin/sh/exec.h =================================================================== --- bin/sh/exec.h (revision 209229) +++ bin/sh/exec.h (working copy) @@ -57,20 +57,24 @@ }; -extern char *pathopt; /* set by padvance */ +/* action to find_command() */ +#define DO_ERR 0x01 /* prints errors */ +#define DO_NOFUNC 0x02 /* don't return shell functions, for command */ + +extern const char *pathopt; /* set by padvance */ extern int exerrno; /* last exec error */ -void shellexec(char **, char **, char *, int); -char *padvance(char **, char *); +void shellexec(char **, char **, const char *, int) __dead2; +char *padvance(const char **, const char *); int hashcmd(int, char **); -void find_command(char *, struct cmdentry *, int, char *); -int find_builtin(char *, int *); +void find_command(const char *, struct cmdentry *, int, const char *); +int find_builtin(const char *, int *); void hashcd(void); void changepath(const char *); void deletefuncs(void); -void addcmdentry(char *, struct cmdentry *); -void defun(char *, union node *); -int unsetfunc(char *); -int typecmd_impl(int, char **, int); +void addcmdentry(const char *, struct cmdentry *); +void defun(const char *, union node *); +int unsetfunc(const char *); +int typecmd_impl(int, char **, int, const char *); int typecmd(int, char **); void clearcmdentry(int); Index: bin/sh/alias.c =================================================================== --- bin/sh/alias.c (revision 209229) +++ bin/sh/alias.c (working copy) @@ -52,13 +52,13 @@ STATIC struct alias *atab[ATABSIZE]; STATIC int aliases; -STATIC void setalias(char *, char *); +STATIC void setalias(const char *, const char *); STATIC int unalias(const char *); STATIC struct alias **hashalias(const char *); STATIC void -setalias(char *name, char *val) +setalias(const char *name, const char *val) { struct alias *ap, **app; @@ -176,7 +176,7 @@ } struct alias * -lookupalias(char *name, int check) +lookupalias(const char *name, int check) { struct alias *ap = *hashalias(name); Index: bin/sh/cd.h =================================================================== --- bin/sh/cd.h (revision 209229) +++ bin/sh/cd.h (working copy) @@ -29,6 +29,6 @@ * $FreeBSD$ */ -char *getpwd(void); +void pwd_init(int); int cdcmd (int, char **); int pwdcmd(int, char **); Index: bin/sh/mkinit.c =================================================================== --- bin/sh/mkinit.c (revision 209229) +++ bin/sh/mkinit.c (working copy) @@ -102,9 +102,9 @@ */ struct event { - char *name; /* name of event (e.g. INIT) */ - char *routine; /* name of routine called on event */ - char *comment; /* comment describing routine */ + const char *name; /* name of event (e.g. INIT) */ + const char *routine; /* name of routine called on event */ + const char *comment; /* comment describing routine */ struct text code; /* code for handling event */ }; @@ -140,7 +140,7 @@ }; -char *curfile; /* current file */ +const char *curfile; /* current file */ int linno; /* current line */ char *header_files[200]; /* list of header files */ struct text defines; /* #define statements */ @@ -148,20 +148,20 @@ int amiddecls; /* for formatting */ -void readfile(char *); -int match(char *, char *); -int gooddefine(char *); -void doevent(struct event *, FILE *, char *); +void readfile(const char *); +int match(const char *, const char *); +int gooddefine(const char *); +void doevent(struct event *, FILE *, const char *); void doinclude(char *); void dodecl(char *, FILE *); void output(void); -void addstr(char *, struct text *); +void addstr(const char *, struct text *); void addchar(int, struct text *); void writetext(struct text *, FILE *); -FILE *ckfopen(char *, char *); +FILE *ckfopen(const char *, const char *); void *ckmalloc(size_t); -char *savestr(char *); -void error(char *); +char *savestr(const char *); +void error(const char *); #define equal(s1, s2) (strcmp(s1, s2) == 0) @@ -170,9 +170,9 @@ { char **ap; - header_files[0] = "\"shell.h\""; - header_files[1] = "\"mystring.h\""; - header_files[2] = "\"init.h\""; + header_files[0] = savestr("\"shell.h\""); + header_files[1] = savestr("\"mystring.h\""); + header_files[2] = savestr("\"init.h\""); for (ap = argv + 1 ; *ap ; ap++) readfile(*ap); output(); @@ -186,7 +186,7 @@ */ void -readfile(char *fname) +readfile(const char *fname) { FILE *fp; char line[1024]; @@ -230,9 +230,9 @@ int -match(char *name, char *line) +match(const char *name, const char *line) { - char *p, *q; + const char *p, *q; p = name, q = line; while (*p) { @@ -246,9 +246,9 @@ int -gooddefine(char *line) +gooddefine(const char *line) { - char *p; + const char *p; if (! match("#define", line)) return 0; /* not a define */ @@ -269,11 +269,11 @@ void -doevent(struct event *ep, FILE *fp, char *fname) +doevent(struct event *ep, FILE *fp, const char *fname) { char line[1024]; int indent; - char *p; + const char *p; sprintf(line, "\n /* from %s: */\n", fname); addstr(line, &ep->code); @@ -407,7 +407,7 @@ */ void -addstr(char *s, struct text *text) +addstr(const char *s, struct text *text) { while (*s) { if (--text->nleft < 0) @@ -452,7 +452,7 @@ } FILE * -ckfopen(char *file, char *mode) +ckfopen(const char *file, const char *mode) { FILE *fp; @@ -474,7 +474,7 @@ } char * -savestr(char *s) +savestr(const char *s) { char *p; @@ -484,7 +484,7 @@ } void -error(char *msg) +error(const char *msg) { if (curfile != NULL) fprintf(stderr, "%s:%d: ", curfile, linno); Index: bin/sh/options.c =================================================================== --- bin/sh/options.c (revision 209229) +++ bin/sh/options.c (working copy) @@ -64,7 +64,7 @@ struct shparam shellparam; /* current positional parameters */ char **argptr; /* argument list for builtin commands */ char *shoptarg; /* set by nextopt (like getopt) */ -char *optptr; /* used by nextopt */ +char *nextopt_optptr; /* used by nextopt */ char *minusc; /* argument to -c option */ @@ -93,8 +93,11 @@ options(1); if (*argptr == NULL && minusc == NULL) sflag = 1; - if (iflag == 2 && sflag == 1 && isatty(0) && isatty(1)) + if (iflag != 0 && sflag == 1 && isatty(0) && isatty(1)) { iflag = 1; + if (Eflag == 2) + Eflag = 1; + } if (mflag == 2) mflag = iflag; for (i = 0; i < NOPTS; i++) @@ -554,12 +557,13 @@ */ int -nextopt(char *optstring) +nextopt(const char *optstring) { - char *p, *q; + char *p; + const char *q; char c; - if ((p = optptr) == NULL || *p == '\0') { + if ((p = nextopt_optptr) == NULL || *p == '\0') { p = *argptr; if (p == NULL || *p != '-' || *++p == '\0') return '\0'; @@ -580,6 +584,6 @@ shoptarg = p; p = NULL; } - optptr = p; + nextopt_optptr = p; return c; } Index: bin/sh/eval.h =================================================================== --- bin/sh/eval.h (revision 209229) +++ bin/sh/eval.h (working copy) @@ -35,6 +35,7 @@ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ +extern int oexitstatus; /* saved exit status */ extern struct strlist *cmdenviron; /* environment for builtin command */ Index: bin/sh/parser.c =================================================================== --- bin/sh/parser.c (revision 209229) +++ bin/sh/parser.c (working copy) @@ -79,10 +79,13 @@ int striptabs; /* if set, strip leading tabs */ }; +struct parser_temp { + struct parser_temp *next; + void *data; +}; STATIC struct heredoc *heredoclist; /* list of here documents to read */ -STATIC int parsebackquote; /* nonzero if we are inside backquotes */ STATIC int doprompt; /* if set, prompt the user */ STATIC int needprompt; /* true if interactive and at start of line */ STATIC int lasttoken; /* last token read */ @@ -95,6 +98,7 @@ STATIC int quoteflag; /* set if (part of) last token was quoted */ STATIC int startlinno; /* line # where last token started */ STATIC int funclinno; /* line # where the current function started */ +STATIC struct parser_temp *parser_temp; /* XXX When 'noaliases' is set to one, no alias expansion takes place. */ static int noaliases = 0; @@ -114,10 +118,77 @@ STATIC int readtoken1(int, char const *, char *, int); STATIC int noexpand(char *); STATIC void synexpect(int); -STATIC void synerror(char *); +STATIC void synerror(const char *); STATIC void setprompt(int); +STATIC void * +parser_temp_alloc(size_t len) +{ + struct parser_temp *t; + + INTOFF; + t = ckmalloc(sizeof(*t)); + t->data = NULL; + t->next = parser_temp; + parser_temp = t; + t->data = ckmalloc(len); + INTON; + return t->data; +} + + +STATIC void * +parser_temp_realloc(void *ptr, size_t len) +{ + struct parser_temp *t; + + INTOFF; + t = parser_temp; + if (ptr != t->data) + error("bug: parser_temp_realloc misused"); + t->data = ckrealloc(t->data, len); + INTON; + return t->data; +} + + +STATIC void +parser_temp_free_upto(void *ptr) +{ + struct parser_temp *t; + int done = 0; + + INTOFF; + while (parser_temp != NULL && !done) { + t = parser_temp; + parser_temp = t->next; + done = t->data == ptr; + ckfree(t->data); + ckfree(t); + } + INTON; + if (!done) + error("bug: parser_temp_free_upto misused"); +} + + +STATIC void +parser_temp_free_all(void) +{ + struct parser_temp *t; + + INTOFF; + while (parser_temp != NULL) { + t = parser_temp; + parser_temp = t->next; + ckfree(t->data); + ckfree(t); + } + INTON; +} + + /* * Read and parse a command. Returns NEOF on end of file. (NULL is a * valid parse tree indicating a blank line.) @@ -128,6 +199,12 @@ { int t; + /* This assumes the parser is not re-entered, + * which could happen if we add command substitution on PS1/PS2. + */ + parser_temp_free_all(); + heredoclist = NULL; + tokpushback = 0; doprompt = interact; if (doprompt) @@ -864,8 +941,190 @@ } +#define MAXNEST_STATIC 8 +struct tokenstate +{ + const char *syntax; /* *SYNTAX */ + int parenlevel; /* levels of parentheses in arithmetic */ + enum tokenstate_category + { + TSTATE_TOP, + TSTATE_VAR_OLD, /* ${var+-=?}, inherits dquotes */ + TSTATE_VAR_NEW, /* other ${var...}, own dquote state */ + TSTATE_ARITH + } category; +}; + /* + * Called to parse command substitutions. + */ + +STATIC char * +parsebackq(char *out, struct nodelist **pbqlist, + int oldstyle, int dblquote, int quoted) +{ + struct nodelist **nlpp; + union node *n; + char *volatile str; + struct jmploc jmploc; + struct jmploc *const savehandler = handler; + int savelen; + int saveprompt; + const int bq_startlinno = plinno; + char *volatile ostr = NULL; + struct parsefile *const savetopfile = getcurrentfile(); + struct heredoc *const saveheredoclist = heredoclist; + struct heredoc *here; + + str = NULL; + if (setjmp(jmploc.loc)) { + popfilesupto(savetopfile); + if (str) + ckfree(str); + if (ostr) + ckfree(ostr); + heredoclist = saveheredoclist; + handler = savehandler; + if (exception == EXERROR) { + startlinno = bq_startlinno; + synerror("Error in command substitution"); + } + longjmp(handler->loc, 1); + } + INTOFF; + savelen = out - stackblock(); + if (savelen > 0) { + str = ckmalloc(savelen); + memcpy(str, stackblock(), savelen); + } + handler = &jmploc; + heredoclist = NULL; + INTON; + if (oldstyle) { + /* We must read until the closing backquote, giving special + treatment to some slashes, and then push the string and + reread it as input, interpreting it normally. */ + char *oout; + int c; + int olen; + + + STARTSTACKSTR(oout); + for (;;) { + if (needprompt) { + setprompt(2); + needprompt = 0; + } + switch (c = pgetc()) { + case '`': + goto done; + + case '\\': + if ((c = pgetc()) == '\n') { + plinno++; + if (doprompt) + setprompt(2); + else + setprompt(0); + /* + * If eating a newline, avoid putting + * the newline into the new character + * stream (via the STPUTC after the + * switch). + */ + continue; + } + if (c != '\\' && c != '`' && c != '$' + && (!dblquote || c != '"')) + STPUTC('\\', oout); + break; + + case '\n': + plinno++; + needprompt = doprompt; + break; + + case PEOF: + startlinno = plinno; + synerror("EOF in backquote substitution"); + break; + + default: + break; + } + STPUTC(c, oout); + } +done: + STPUTC('\0', oout); + olen = oout - stackblock(); + INTOFF; + ostr = ckmalloc(olen); + memcpy(ostr, stackblock(), olen); + setinputstring(ostr, 1); + INTON; + } + nlpp = pbqlist; + while (*nlpp) + nlpp = &(*nlpp)->next; + *nlpp = (struct nodelist *)stalloc(sizeof (struct nodelist)); + (*nlpp)->next = NULL; + + if (oldstyle) { + saveprompt = doprompt; + doprompt = 0; + } + + n = list(0); + + if (oldstyle) + doprompt = saveprompt; + else { + if (readtoken() != TRP) + synexpect(TRP); + } + + (*nlpp)->n = n; + if (oldstyle) { + /* + * Start reading from old file again, ignoring any pushed back + * tokens left from the backquote parsing + */ + popfile(); + tokpushback = 0; + } + while (stackblocksize() <= savelen) + growstackblock(); + STARTSTACKSTR(out); + INTOFF; + if (str) { + memcpy(out, str, savelen); + STADJUST(savelen, out); + ckfree(str); + str = NULL; + } + if (ostr) { + ckfree(ostr); + ostr = NULL; + } + here = saveheredoclist; + if (here != NULL) { + while (here->next != NULL) + here = here->next; + here->next = heredoclist; + heredoclist = saveheredoclist; + } + handler = savehandler; + INTON; + if (quoted) + USTPUTC(CTLBACKQ | CTLQUOTE, out); + else + USTPUTC(CTLBACKQ, out); + return out; +} + + +/* * If eofmark is NULL, read a word or a redirection symbol. If eofmark * is not NULL, read a here document. In the latter case, eofmark is the * word which marks the end of the document and striptabs is true if @@ -880,12 +1139,10 @@ #define CHECKEND() {goto checkend; checkend_return:;} #define PARSEREDIR() {goto parseredir; parseredir_return:;} #define PARSESUB() {goto parsesub; parsesub_return:;} -#define PARSEBACKQOLD() {oldstyle = 1; goto parsebackq; parsebackq_oldreturn:;} -#define PARSEBACKQNEW() {oldstyle = 0; goto parsebackq; parsebackq_newreturn:;} #define PARSEARITH() {goto parsearith; parsearith_return:;} STATIC int -readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) +readtoken1(int firstc, char const *initialsyntax, char *eofmark, int striptabs) { int c = firstc; char *out; @@ -893,23 +1150,21 @@ char line[EOFMARKLEN + 1]; struct nodelist *bqlist; int quotef; - int dblquote; - int varnest; /* levels of variables expansion */ - int arinest; /* levels of arithmetic expansion */ - int parenlevel; /* levels of parens in arithmetic */ - int oldstyle; - char const *prevsyntax; /* syntax before arithmetic */ + int newvarnest; + int level; int synentry; + struct tokenstate state_static[MAXNEST_STATIC]; + int maxnest = MAXNEST_STATIC; + struct tokenstate *state = state_static; startlinno = plinno; - dblquote = 0; - if (syntax == DQSYNTAX) - dblquote = 1; quotef = 0; bqlist = NULL; - varnest = 0; - arinest = 0; - parenlevel = 0; + newvarnest = 0; + level = 0; + state[level].syntax = initialsyntax; + state[level].parenlevel = 0; + state[level].category = TSTATE_TOP; STARTSTACKSTR(out); loop: { /* for each line, until end of word */ @@ -917,11 +1172,11 @@ for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(3, out); /* permit 3 calls to USTPUTC */ - synentry = syntax[c]; + synentry = state[level].syntax[c]; switch(synentry) { case CNL: /* '\n' */ - if (syntax == BASESYNTAX) + if (state[level].syntax == BASESYNTAX) goto endword; /* exit outer loop */ USTPUTC(c, out); plinno++; @@ -935,7 +1190,7 @@ USTPUTC(c, out); break; case CCTL: - if (eofmark == NULL || dblquote) + if (eofmark == NULL || initialsyntax != SQSYNTAX) USTPUTC(CTLESC, out); USTPUTC(c, out); break; @@ -951,41 +1206,37 @@ else setprompt(0); } else { - if (dblquote && c != '\\' && - c != '`' && c != '$' && - (c != '"' || eofmark != NULL)) + if (state[level].syntax == DQSYNTAX && + c != '\\' && c != '`' && c != '$' && + (c != '"' || (eofmark != NULL && + newvarnest == 0)) && + (c != '}' || state[level].category != TSTATE_VAR_OLD)) USTPUTC('\\', out); if (SQSYNTAX[c] == CCTL) USTPUTC(CTLESC, out); - else if (eofmark == NULL) + else if (eofmark == NULL || + newvarnest > 0) USTPUTC(CTLQUOTEMARK, out); USTPUTC(c, out); quotef++; } break; case CSQUOTE: - if (eofmark == NULL) - USTPUTC(CTLQUOTEMARK, out); - syntax = SQSYNTAX; + USTPUTC(CTLQUOTEMARK, out); + state[level].syntax = SQSYNTAX; break; case CDQUOTE: - if (eofmark == NULL) - USTPUTC(CTLQUOTEMARK, out); - syntax = DQSYNTAX; - dblquote = 1; + USTPUTC(CTLQUOTEMARK, out); + state[level].syntax = DQSYNTAX; break; case CENDQUOTE: - if (eofmark != NULL && arinest == 0 && - varnest == 0) { + if (eofmark != NULL && newvarnest == 0) USTPUTC(c, out); - } else { - if (arinest) { - syntax = ARISYNTAX; - dblquote = 0; - } else if (eofmark == NULL) { - syntax = BASESYNTAX; - dblquote = 0; - } + else { + if (state[level].category == TSTATE_ARITH) + state[level].syntax = ARISYNTAX; + else + state[level].syntax = BASESYNTAX; quotef++; } break; @@ -993,30 +1244,33 @@ PARSESUB(); /* parse substitution */ break; case CENDVAR: /* '}' */ - if (varnest > 0) { - varnest--; + if (level > 0 && + (state[level].category == TSTATE_VAR_OLD || + state[level].category == TSTATE_VAR_NEW)) { + if (state[level].category == TSTATE_VAR_OLD) + state[level - 1].syntax = state[level].syntax; + else + newvarnest--; + level--; USTPUTC(CTLENDVAR, out); } else { USTPUTC(c, out); } break; case CLP: /* '(' in arithmetic */ - parenlevel++; + state[level].parenlevel++; USTPUTC(c, out); break; case CRP: /* ')' in arithmetic */ - if (parenlevel > 0) { + if (state[level].parenlevel > 0) { USTPUTC(c, out); - --parenlevel; + --state[level].parenlevel; } else { if (pgetc() == ')') { - if (--arinest == 0) { + if (level > 0 && + state[level].category == TSTATE_ARITH) { + level--; USTPUTC(CTLENDARI, out); - syntax = prevsyntax; - if (syntax == DQSYNTAX) - dblquote = 1; - else - dblquote = 0; } else USTPUTC(')', out); } else { @@ -1030,12 +1284,15 @@ } break; case CBQUOTE: /* '`' */ - PARSEBACKQOLD(); + out = parsebackq(out, &bqlist, 1, + state[level].syntax == DQSYNTAX && + (eofmark == NULL || newvarnest > 0), + state[level].syntax == DQSYNTAX || state[level].syntax == ARISYNTAX); break; case CEOF: goto endword; /* exit outer loop */ default: - if (varnest == 0) + if (level == 0) goto endword; /* exit outer loop */ USTPUTC(c, out); } @@ -1043,14 +1300,17 @@ } } endword: - if (syntax == ARISYNTAX) + if (state[level].syntax == ARISYNTAX) synerror("Missing '))'"); - if (syntax != BASESYNTAX && ! parsebackquote && eofmark == NULL) + if (state[level].syntax != BASESYNTAX && eofmark == NULL) synerror("Unterminated quoted string"); - if (varnest != 0) { + if (state[level].category == TSTATE_VAR_OLD || + state[level].category == TSTATE_VAR_NEW) { startlinno = plinno; synerror("Missing '}'"); } + if (state != state_static) + parser_temp_free_upto(state); USTPUTC('\0', out); len = out - stackblock(); out = stackblock(); @@ -1073,7 +1333,6 @@ /* end of readtoken routine */ - /* * Check to see whether we are at the end of the here document. When this * is called, c is set to the first character of the next input line. If @@ -1190,7 +1449,11 @@ PARSEARITH(); } else { pungetc(); - PARSEBACKQNEW(); + out = parsebackq(out, &bqlist, 0, + state[level].syntax == DQSYNTAX && + (eofmark == NULL || newvarnest > 0), + state[level].syntax == DQSYNTAX || + state[level].syntax == ARISYNTAX); } } else { USTPUTC(CTLVAR, out); @@ -1245,6 +1508,8 @@ subtype = VSERROR; if (c == '}') pungetc(); + else if (c == '\n' || c == PEOF) + synerror("Unexpected end of line in substitution"); else USTPUTC(c, out); } else { @@ -1261,6 +1526,8 @@ default: p = strchr(types, c); if (p == NULL) { + if (c == '\n' || c == PEOF) + synerror("Unexpected end of line in substitution"); if (flags == VSNUL) STPUTC(':', out); STPUTC(c, out); @@ -1286,192 +1553,74 @@ pungetc(); } STPUTC('=', out); - if (subtype != VSLENGTH && (dblquote || arinest)) + if (subtype != VSLENGTH && (state[level].syntax == DQSYNTAX || + state[level].syntax == ARISYNTAX)) flags |= VSQUOTE; *(stackblock() + typeloc) = subtype | flags; - if (subtype != VSNORMAL) - varnest++; + if (subtype != VSNORMAL) { + if (level + 1 >= maxnest) { + maxnest *= 2; + if (state == state_static) { + state = parser_temp_alloc( + maxnest * sizeof(*state)); + memcpy(state, state_static, + MAXNEST_STATIC * sizeof(*state)); + } else + state = parser_temp_realloc(state, + maxnest * sizeof(*state)); + } + level++; + state[level].parenlevel = 0; + if (subtype == VSMINUS || subtype == VSPLUS || + subtype == VSQUESTION || subtype == VSASSIGN) { + /* + * For operators that were in the Bourne shell, + * inherit the double-quote state. + */ + state[level].syntax = state[level - 1].syntax; + state[level].category = TSTATE_VAR_OLD; + } else { + /* + * The other operators take a pattern, + * so go to BASESYNTAX. + * Also, ' and " are now special, even + * in here documents. + */ + state[level].syntax = BASESYNTAX; + state[level].category = TSTATE_VAR_NEW; + newvarnest++; + } + } } goto parsesub_return; } /* - * Called to parse command substitutions. Newstyle is set if the command - * is enclosed inside $(...); nlpp is a pointer to the head of the linked - * list of commands (passed by reference), and savelen is the number of - * characters on the top of the stack which must be preserved. - */ - -parsebackq: { - struct nodelist **nlpp; - int savepbq; - union node *n; - char *volatile str; - struct jmploc jmploc; - struct jmploc *const savehandler = handler; - int savelen; - int saveprompt; - const int bq_startlinno = plinno; - - savepbq = parsebackquote; - if (setjmp(jmploc.loc)) { - if (str) - ckfree(str); - parsebackquote = 0; - handler = savehandler; - if (exception == EXERROR) { - startlinno = bq_startlinno; - synerror("Error in command substitution"); - } - longjmp(handler->loc, 1); - } - INTOFF; - str = NULL; - savelen = out - stackblock(); - if (savelen > 0) { - str = ckmalloc(savelen); - memcpy(str, stackblock(), savelen); - } - handler = &jmploc; - INTON; - if (oldstyle) { - /* We must read until the closing backquote, giving special - treatment to some slashes, and then push the string and - reread it as input, interpreting it normally. */ - char *out; - int c; - int savelen; - char *str; - - - STARTSTACKSTR(out); - for (;;) { - if (needprompt) { - setprompt(2); - needprompt = 0; - } - switch (c = pgetc()) { - case '`': - goto done; - - case '\\': - if ((c = pgetc()) == '\n') { - plinno++; - if (doprompt) - setprompt(2); - else - setprompt(0); - /* - * If eating a newline, avoid putting - * the newline into the new character - * stream (via the STPUTC after the - * switch). - */ - continue; - } - if (c != '\\' && c != '`' && c != '$' - && (!dblquote || c != '"')) - STPUTC('\\', out); - break; - - case '\n': - plinno++; - needprompt = doprompt; - break; - - case PEOF: - startlinno = plinno; - synerror("EOF in backquote substitution"); - break; - - default: - break; - } - STPUTC(c, out); - } -done: - STPUTC('\0', out); - savelen = out - stackblock(); - if (savelen > 0) { - str = ckmalloc(savelen); - memcpy(str, stackblock(), savelen); - setinputstring(str, 1); - } - } - nlpp = &bqlist; - while (*nlpp) - nlpp = &(*nlpp)->next; - *nlpp = (struct nodelist *)stalloc(sizeof (struct nodelist)); - (*nlpp)->next = NULL; - parsebackquote = oldstyle; - - if (oldstyle) { - saveprompt = doprompt; - doprompt = 0; - } - - n = list(0); - - if (oldstyle) - doprompt = saveprompt; - else { - if (readtoken() != TRP) - synexpect(TRP); - } - - (*nlpp)->n = n; - if (oldstyle) { - /* - * Start reading from old file again, ignoring any pushed back - * tokens left from the backquote parsing - */ - popfile(); - tokpushback = 0; - } - while (stackblocksize() <= savelen) - growstackblock(); - STARTSTACKSTR(out); - if (str) { - memcpy(out, str, savelen); - STADJUST(savelen, out); - INTOFF; - ckfree(str); - str = NULL; - INTON; - } - parsebackquote = savepbq; - handler = savehandler; - if (arinest || dblquote) - USTPUTC(CTLBACKQ | CTLQUOTE, out); - else - USTPUTC(CTLBACKQ, out); - if (oldstyle) - goto parsebackq_oldreturn; - else - goto parsebackq_newreturn; -} - -/* * Parse an arithmetic expansion (indicate start of one and set state) */ parsearith: { - if (++arinest == 1) { - prevsyntax = syntax; - syntax = ARISYNTAX; - USTPUTC(CTLARI, out); - if (dblquote) - USTPUTC('"',out); - else - USTPUTC(' ',out); - } else { - /* - * we collapse embedded arithmetic expansion to - * parenthesis, which should be equivalent - */ - USTPUTC('(', out); + if (level + 1 >= maxnest) { + maxnest *= 2; + if (state == state_static) { + state = parser_temp_alloc( + maxnest * sizeof(*state)); + memcpy(state, state_static, + MAXNEST_STATIC * sizeof(*state)); + } else + state = parser_temp_realloc(state, + maxnest * sizeof(*state)); } + level++; + state[level].syntax = ARISYNTAX; + state[level].parenlevel = 0; + state[level].category = TSTATE_ARITH; + USTPUTC(CTLARI, out); + if (state[level - 1].syntax == DQSYNTAX) + USTPUTC('"',out); + else + USTPUTC(' ',out); goto parsearith_return; } @@ -1516,9 +1665,9 @@ */ int -goodname(char *name) +goodname(const char *name) { - char *p; + const char *p; p = name; if (! is_name(*p)) @@ -1553,11 +1702,11 @@ STATIC void -synerror(char *msg) +synerror(const char *msg) { if (commandname) - outfmt(&errout, "%s: %d: ", commandname, startlinno); - outfmt(&errout, "Syntax error: %s\n", msg); + outfmt(out2, "%s: %d: ", commandname, startlinno); + outfmt(out2, "Syntax error: %s\n", msg); error((char *)NULL); } @@ -1569,7 +1718,10 @@ #ifndef NO_HISTORY if (!el) #endif + { out2str(getprompt(NULL)); + flushout(out2); + } } /* @@ -1582,13 +1734,14 @@ static char ps[PROMPTLEN]; char *fmt; int i, j, trim; + static char internal_error[] = ""; /* * Select prompt format. */ switch (whichprompt) { case 0: - fmt = ""; + fmt = nullstr; break; case 1: fmt = ps1val(); @@ -1597,7 +1750,7 @@ fmt = ps2val(); break; default: - return ""; + return internal_error; } /* Index: bin/sh/jobs.c =================================================================== --- bin/sh/jobs.c (revision 209229) +++ bin/sh/jobs.c (working copy) @@ -91,8 +91,9 @@ STATIC struct job *getjob(char *); STATIC pid_t dowait(int, struct job *); STATIC pid_t waitproc(int, int *); +STATIC void checkzombies(void); STATIC void cmdtxt(union node *); -STATIC void cmdputs(char *); +STATIC void cmdputs(const char *); #if JOBS STATIC void setcurjob(struct job *); STATIC void deljob(struct job *); @@ -146,7 +147,7 @@ do { /* while we are in the background */ initialpgrp = tcgetpgrp(ttyfd); if (initialpgrp < 0) { -out: out2str("sh: can't access tty; job control turned off\n"); +out: out2fmt_flush("sh: can't access tty; job control turned off\n"); mflag = 0; return; } @@ -400,7 +401,7 @@ struct job *jp; TRACE(("showjobs(%d) called\n", change)); - while (dowait(0, (struct job *)NULL) > 0); + checkzombies(); for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) { if (! jp->used) continue; @@ -742,6 +743,8 @@ TRACE(("forkshell(%%%d, %p, %d) called\n", jp - jobtab, (void *)n, mode)); INTOFF; + if (mode == FORK_BG) + checkzombies(); flushall(); pid = fork(); if (pid == -1) { @@ -757,6 +760,7 @@ TRACE(("Child shell %d\n", (int)getpid())); wasroot = rootshell; rootshell = 0; + handler = &main_handler; closescript(); INTON; clear_traps(); @@ -862,6 +866,7 @@ { #if JOBS pid_t mypgrp = getpgrp(); + int propagate_int = jp->jobctl && jp->foreground; #endif int status; int st; @@ -899,6 +904,11 @@ else CLEAR_PENDING_INT; } +#if JOBS + else if (rootshell && iflag && propagate_int && + WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) + kill(getpid(), SIGINT); +#endif INTON; return st; } @@ -1046,7 +1056,7 @@ if (jp->used == 0) continue; if (jp->state == JOBSTOPPED) { - out2str("You have stopped jobs.\n"); + out2fmt_flush("You have stopped jobs.\n"); job_warning = 2; return (1); } @@ -1055,6 +1065,15 @@ return (0); } + +STATIC void +checkzombies(void) +{ + while (njobs > 0 && dowait(0, NULL) > 0) + ; +} + + /* * Return a string identifying a command (to be printed by the * jobs command. @@ -1082,7 +1101,7 @@ { union node *np; struct nodelist *lp; - char *p; + const char *p; int i; char s[2]; @@ -1211,9 +1230,10 @@ STATIC void -cmdputs(char *s) +cmdputs(const char *s) { - char *p, *q; + const char *p; + char *q; char c; int subtype = 0; Index: bin/sh/arith.y =================================================================== --- bin/sh/arith.y (revision 209229) +++ bin/sh/arith.y (working copy) @@ -85,9 +85,9 @@ ARITH_LPAREN expr ARITH_RPAREN { $$ = $2; } | expr ARITH_OR expr - { $$ = $1 ? $1 : $3 ? $3 : 0; } | + { $$ = $1 || $3; } | expr ARITH_AND expr - { $$ = $1 ? ( $3 ? $3 : 0 ) : 0; } | + { $$ = $1 && $3; } | expr ARITH_BOR expr { $$ = $1 | $3; } | expr ARITH_BXOR expr @@ -265,7 +265,7 @@ #define YYPARSE_PARAM_TYPE arith_t * #define YYPARSE_PARAM result -char *arith_buf, *arith_startbuf; +const char *arith_buf, *arith_startbuf; int yylex(void); int yyparse(YYPARSE_PARAM_TYPE); @@ -284,10 +284,12 @@ } arith_t -arith(char *s) +arith(const char *s) { arith_t result; + struct stackmark smark; + setstackmark(&smark); arith_buf = arith_startbuf = s; INTOFF; @@ -295,11 +297,13 @@ arith_lex_reset(); /* Reprime lex. */ INTON; + popstackmark(&smark); + return result; } static void -yyerror(char *s) +yyerror(const char *s) { yyerrok; @@ -314,7 +318,7 @@ int expcmd(int argc, char **argv) { - char *p; + const char *p; char *concat; char **ap; arith_t i; @@ -354,7 +358,7 @@ printf("%d\n", exp(argv[1])); } -error(char *s) +error(const char *s) { fprintf(stderr, "exp: %s\n", s); exit(1); Index: bin/sh/var.h =================================================================== --- bin/sh/var.h (revision 209229) +++ bin/sh/var.h (working copy) @@ -77,6 +77,7 @@ extern struct var vps4; #ifndef NO_HISTORY extern struct var vhistsize; +extern struct var vterm; #endif /* @@ -96,19 +97,21 @@ #define optindval() (voptind.text + 7) #ifndef NO_HISTORY #define histsizeval() (vhistsize.text + 9) +#define termval() (vterm.text + 5) #endif #define mpathset() ((vmpath.flags & VUNSET) == 0) void initvar(void); -void setvar(char *, char *, int); +void setvar(const char *, const char *, int); void setvareq(char *, int); struct strlist; void listsetvar(struct strlist *); -char *lookupvar(char *); -char *bltinlookup(char *, int); +char *lookupvar(const char *); +char *bltinlookup(const char *, int); +void bltinsetlocale(void); +void bltinunsetlocale(void); char **environment(void); -void shprocvar(void); int showvarscmd(int, char **); int exportcmd(int, char **); int localcmd(int, char **); @@ -116,5 +119,5 @@ void poplocalvars(void); int setvarcmd(int, char **); int unsetcmd(int, char **); -int unsetvar(char *); -int setvarsafe(char *, char *, int); +int unsetvar(const char *); +int setvarsafe(const char *, const char *, int); --------------080309060107090207060608 Content-Type: text/plain; name="buildworld.log" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="buildworld.log" PT09PiBsaWIvbGliY2FsZW5kYXIgKGRlcGVuZCkKcm0gLWYgLmRlcGVuZApta2RlcCAtZiAu ZGVwZW5kIC1hICAgICAvdXNyL3NyYy9saWIvbGliY2FsZW5kYXIvY2FsZW5kYXIuYyAvdXNy L3NyYy9saWIvbGliY2FsZW5kYXIvZWFzdGVyLmMKPT09PiBsaWIvbGliY2FtIChkZXBlbmQp CnJtIC1mIC5kZXBlbmQKbWtkZXAgLWYgLmRlcGVuZCAtYSAgICAtSS91c3Ivc3JjL2xpYi9s aWJjYW0gLUkvdXNyL3NyYy9saWIvbGliY2FtLy4uLy4uL3N5cyAvdXNyL3NyYy9saWIvbGli Y2FtL2NhbWxpYi5jIC91c3Ivc3JjL2xpYi9saWJjYW0vc2NzaV9jbWRwYXJzZS5jIC91c3Iv c3JjL2xpYi9saWJjYW0vLi4vLi4vc3lzL2NhbS9zY3NpL3Njc2lfYWxsLmMgL3Vzci9zcmMv bGliL2xpYmNhbS8uLi8uLi9zeXMvY2FtL3Njc2kvc2NzaV9kYS5jIC91c3Ivc3JjL2xpYi9s aWJjYW0vLi4vLi4vc3lzL2NhbS9zY3NpL3Njc2lfc2EuYyAvdXNyL3NyYy9saWIvbGliY2Ft Ly4uLy4uL3N5cy9jYW0vY2FtLmMgL3Vzci9zcmMvbGliL2xpYmNhbS8uLi8uLi9zeXMvY2Ft L2F0YS9hdGFfYWxsLmMKZWNobyBsaWJjYW0uc28uNTogL3Vzci9vYmovamFpbC91c3Ivc3Jj L3RtcC91c3IvbGliL2xpYnNidWYuYSA+PiAuZGVwZW5kCj09PT4gbGliL2xpYmNvbXBhdCAo ZGVwZW5kKQpybSAtZiAuZGVwZW5kCm1rZGVwIC1mIC5kZXBlbmQgLWEgICAgLURMSUJDX1ND Q1MgLURTWVNMSUJDX1NDQ1MgLUkvdXNyL3NyYy9saWIvbGliY29tcGF0Ly4uL2xpYmMvbG9j YWxlIC91c3Ivc3JjL2xpYi9saWJjb21wYXQvNC4xL2FzY2Z0aW1lLmMgL3Vzci9zcmMvbGli L2xpYmNvbXBhdC80LjEvY2Z0aW1lLmMgL3Vzci9zcmMvbGliL2xpYmNvbXBhdC80LjEvZnRp bWUuYyAvdXNyL3NyYy9saWIvbGliY29tcGF0LzQuMS9nZXRwdy5jIC91c3Ivc3JjL2xpYi9s aWJjb21wYXQvNC4zL2NmcmVlLmMgL3Vzci9zcmMvbGliL2xpYmNvbXBhdC80LjMvcmVnZXgu YyAvdXNyL3NyYy9saWIvbGliY29tcGF0LzQuMy9yZXhlYy5jIC91c3Ivc3JjL2xpYi9saWJj b21wYXQvNC40L2N1c2VyaWQuYyAvdXNyL3NyYy9saWIvbGliY29tcGF0L3JlZ2V4cC9yZWdl cnJvci5jIC91c3Ivc3JjL2xpYi9saWJjb21wYXQvcmVnZXhwL3JlZ2V4cC5jIC91c3Ivc3Jj L2xpYi9saWJjb21wYXQvcmVnZXhwL3JlZ3N1Yi5jCj09PT4gbGliL2xpYmRldmluZm8gKGRl cGVuZCkKcm0gLWYgLmRlcGVuZApta2RlcCAtZiAuZGVwZW5kIC1hICAgICAvdXNyL3NyYy9s aWIvbGliZGV2aW5mby9kZXZpbmZvLmMKPT09PiBsaWIvbGliZGV2c3RhdCAoZGVwZW5kKQpy bSAtZiAuZGVwZW5kCm1rZGVwIC1mIC5kZXBlbmQgLWEgICAgLUkvdXNyL3NyYy9saWIvbGli ZGV2c3RhdCAvdXNyL3NyYy9saWIvbGliZGV2c3RhdC9kZXZzdGF0LmMKZWNobyBsaWJkZXZz dGF0LnNvLjc6IC91c3Ivb2JqL2phaWwvdXNyL3NyYy90bXAvdXNyL2xpYi9saWJrdm0uYSA+ PiAuZGVwZW5kCj09PT4gbGliL2xpYmRpc2sgKGRlcGVuZCkKcm0gLWYgLmRlcGVuZApta2Rl cCAtZiAuZGVwZW5kIC1hICAgIC1JL3Vzci9zcmMvbGliL2xpYmRpc2svLi4vLi4vc3lzL2dl b20gL3Vzci9zcmMvbGliL2xpYmRpc2svYmxvY2tzLmMgL3Vzci9zcmMvbGliL2xpYmRpc2sv Y2hhbmdlLmMgL3Vzci9zcmMvbGliL2xpYmRpc2svY2h1bmsuYyAvdXNyL3NyYy9saWIvbGli ZGlzay9jcmVhdGVfY2h1bmsuYyAvdXNyL3NyYy9saWIvbGliZGlzay9kaXNrLmMgL3Vzci9z cmMvbGliL2xpYmRpc2svb3Blbl9kaXNrLmMgL3Vzci9zcmMvbGliL2xpYmRpc2svcnVsZXMu YyAvdXNyL3NyYy9saWIvbGliZGlzay93cml0ZV9kaXNrLmMgL3Vzci9zcmMvbGliL2xpYmRp c2svd3JpdGVfaTM4Nl9kaXNrLmMKPT09PiBsaWIvbGliZHdhcmYgKGRlcGVuZCkKcm0gLWYg LmRlcGVuZApta2RlcCAtZiAuZGVwZW5kIC1hICAgIC1JLiAtSS91c3Ivc3JjL2xpYi9saWJk d2FyZiAvdXNyL3NyYy9saWIvbGliZHdhcmYvZHdhcmZfYWJicmV2LmMgL3Vzci9zcmMvbGli L2xpYmR3YXJmL2R3YXJmX2F0dHIuYyAvdXNyL3NyYy9saWIvbGliZHdhcmYvZHdhcmZfYXR0 cnZhbC5jIC91c3Ivc3JjL2xpYi9saWJkd2FyZi9kd2FyZl9jdS5jIC91c3Ivc3JjL2xpYi9s aWJkd2FyZi9kd2FyZl9kZWFsbG9jLmMgL3Vzci9zcmMvbGliL2xpYmR3YXJmL2R3YXJmX2Rp ZS5jIC91c3Ivc3JjL2xpYi9saWJkd2FyZi9kd2FyZl9kdW1wLmMgL3Vzci9zcmMvbGliL2xp YmR3YXJmL2R3YXJmX2Vycm1zZy5jIC91c3Ivc3JjL2xpYi9saWJkd2FyZi9kd2FyZl9lcnJu by5jIC91c3Ivc3JjL2xpYi9saWJkd2FyZi9kd2FyZl9maW5pc2guYyAvdXNyL3NyYy9saWIv bGliZHdhcmYvZHdhcmZfZm9ybS5jIC91c3Ivc3JjL2xpYi9saWJkd2FyZi9kd2FyZl9pbml0 LmMgL3Vzci9zcmMvbGliL2xpYmR3YXJmL2R3YXJmX2xvYy5jCj09PT4gbGliL2xpYmVkaXQg KGRlcGVuZCkKc2ggL3Vzci9zcmMvbGliL2xpYmVkaXQvbWFrZWxpc3QgLWggL3Vzci9zcmMv bGliL2xpYmVkaXQvdmkuYyA+IHZpLmgKc2ggL3Vzci9zcmMvbGliL2xpYmVkaXQvbWFrZWxp c3QgLWggL3Vzci9zcmMvbGliL2xpYmVkaXQvZW1hY3MuYyA+IGVtYWNzLmgKc2ggL3Vzci9z cmMvbGliL2xpYmVkaXQvbWFrZWxpc3QgLWggL3Vzci9zcmMvbGliL2xpYmVkaXQvY29tbW9u LmMgPiBjb21tb24uaApzaCAvdXNyL3NyYy9saWIvbGliZWRpdC9tYWtlbGlzdCAtZmggdmku aCBlbWFjcy5oIGNvbW1vbi5oID4gZmNucy5oCnNoIC91c3Ivc3JjL2xpYi9saWJlZGl0L21h a2VsaXN0IC1mYyB2aS5oIGVtYWNzLmggY29tbW9uLmggPiBmY25zLmMKbWFrZTogZG9uJ3Qg a25vdyBob3cgdG8gbWFrZSBmaWxlY29tcGxldGUuYy4gU3RvcAoqKiogRXJyb3IgY29kZSAy CgpTdG9wIGluIC91c3Ivc3JjL2xpYi4KKioqIEVycm9yIGNvZGUgMQoKU3RvcCBpbiAvdXNy L3NyYy4KKioqIEVycm9yIGNvZGUgMQoKU3RvcCBpbiAvdXNyL3NyYy4KKioqIEVycm9yIGNv ZGUgMQoKU3RvcCBpbiAvdXNyL3NyYy4KKioqIEVycm9yIGNvZGUgMQoKU3RvcCBpbiAvdXNy L3NyYy4KcmVhbCA0MTY1LjE3CnVzZXIgMjY1MS43MApzeXMgNDUxLjk2CgpTY3JpcHQgZG9u ZSBvbiBGcmkgSnVuIDE4IDIzOjM3OjQ1IDIwMTAK --------------080309060107090207060608-- From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 13:15:04 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E22C01065673 for ; Mon, 21 Jun 2010 13:15:04 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id A4F618FC1D for ; Mon, 21 Jun 2010 13:15:03 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 75DB01FFC33; Mon, 21 Jun 2010 13:15:01 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id D7CE5844A3; Mon, 21 Jun 2010 15:12:50 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: jhell References: <4C18304A.1080601@dataix.net> <4C18322A.6050007@dataix.net> <86wrtz5mk6.fsf@ds4.des.no> <4C1F576F.9090901@dataix.net> <86y6e8fuo1.fsf@ds4.des.no> <4C1F6148.9010300@dataix.net> Date: Mon, 21 Jun 2010 15:12:50 +0200 In-Reply-To: <4C1F6148.9010300@dataix.net> (jhell@dataix.net's message of "Mon, 21 Jun 2010 08:55:36 -0400") Message-ID: <86pqzkfs19.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: "Sam Fourman Jr." , Brandon Gooch , FreeBSD Current , jilles@stack.nl Subject: Re: [MFC REQUEST] Filename completion in sh(1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 13:15:05 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable jhell writes: > Sorry but he only mention of filecomplete in your patch is in this > section. That is exactly the same in the patch I had originally > generated using SVN. Umm, the copy I have on my disk has those files. Just to be sure, I just generated a new diff from the tree I tested it in. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=sh-tab-completion-stable-8.diff Index: include/histedit.h =================================================================== --- include/histedit.h (revision 209229) +++ include/histedit.h (working copy) @@ -105,9 +105,8 @@ */ int el_set(EditLine *, int, ...); int el_get(EditLine *, int, ...); -#if 0 unsigned char _el_fn_complete(EditLine *, int); -#endif +unsigned char _el_fn_sh_complete(EditLine *, int); /* * el_set/el_get parameters Index: lib/libedit/filecomplete.c =================================================================== --- lib/libedit/filecomplete.c (revision 0) +++ lib/libedit/filecomplete.c (revision 0) @@ -0,0 +1,667 @@ +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jaromir Dolecek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: filecomplete.c,v 1.19 2010/06/01 18:20:26 christos Exp $ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "el.h" +#include "fcns.h" /* for EL_NUM_FCNS */ +#include "histedit.h" +#include "filecomplete.h" + +static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', + '>', '<', '=', ';', '|', '&', '{', '(', '\0' }; +/* Tilde is deliberately omitted here, we treat it specially. */ +static char extra_quote_chars[] = { ')', '}', '*', '?', '[', '$', '\0' }; + + +/********************************/ +/* completion functions */ + +/* + * does tilde expansion of strings of type ``~user/foo'' + * if ``user'' isn't valid user name or ``txt'' doesn't start + * w/ '~', returns pointer to strdup()ed copy of ``txt'' + * + * it's callers's responsibility to free() returned string + */ +char * +fn_tilde_expand(const char *txt) +{ + struct passwd pwres, *pass; + char *temp; + size_t len = 0; + char pwbuf[1024]; + + if (txt[0] != '~') + return (strdup(txt)); + + temp = strchr(txt + 1, '/'); + if (temp == NULL) { + temp = strdup(txt + 1); + if (temp == NULL) + return NULL; + } else { + len = temp - txt + 1; /* text until string after slash */ + temp = malloc(len); + if (temp == NULL) + return NULL; + (void)strncpy(temp, txt + 1, len - 2); + temp[len - 2] = '\0'; + } + if (temp[0] == 0) { + if (getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf), &pass) != 0) + pass = NULL; + } else { + if (getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf), &pass) != 0) + pass = NULL; + } + free(temp); /* value no more needed */ + if (pass == NULL) + return (strdup(txt)); + + /* update pointer txt to point at string immediately following */ + /* first slash */ + txt += len; + + temp = malloc(strlen(pass->pw_dir) + 1 + strlen(txt) + 1); + if (temp == NULL) + return NULL; + (void)sprintf(temp, "%s/%s", pass->pw_dir, txt); + + return (temp); +} + + +/* + * return first found file name starting by the ``text'' or NULL if no + * such file can be found + * value of ``state'' is ignored + * + * it's caller's responsibility to free returned string + */ +char * +fn_filename_completion_function(const char *text, int state) +{ + static DIR *dir = NULL; + static char *filename = NULL, *dirname = NULL, *dirpath = NULL; + static size_t filename_len = 0; + struct dirent *entry; + char *temp; + size_t len; + + if (state == 0 || dir == NULL) { + temp = strrchr(text, '/'); + if (temp) { + char *nptr; + temp++; + nptr = realloc(filename, strlen(temp) + 1); + if (nptr == NULL) { + free(filename); + filename = NULL; + return NULL; + } + filename = nptr; + (void)strcpy(filename, temp); + len = temp - text; /* including last slash */ + + nptr = realloc(dirname, len + 1); + if (nptr == NULL) { + free(dirname); + dirname = NULL; + return NULL; + } + dirname = nptr; + (void)strncpy(dirname, text, len); + dirname[len] = '\0'; + } else { + free(filename); + if (*text == 0) + filename = NULL; + else { + filename = strdup(text); + if (filename == NULL) + return NULL; + } + free(dirname); + dirname = NULL; + } + + if (dir != NULL) { + (void)closedir(dir); + dir = NULL; + } + + /* support for ``~user'' syntax */ + + free(dirpath); + dirpath = NULL; + if (dirname == NULL) { + if ((dirname = strdup("")) == NULL) + return NULL; + dirpath = strdup("./"); + } else if (*dirname == '~') + dirpath = fn_tilde_expand(dirname); + else + dirpath = strdup(dirname); + + if (dirpath == NULL) + return NULL; + + dir = opendir(dirpath); + if (!dir) + return (NULL); /* cannot open the directory */ + + /* will be used in cycle */ + filename_len = filename ? strlen(filename) : 0; + } + + /* find the match */ + while ((entry = readdir(dir)) != NULL) { + /* skip . and .. */ + if (entry->d_name[0] == '.' && (!entry->d_name[1] + || (entry->d_name[1] == '.' && !entry->d_name[2]))) + continue; + if (filename_len == 0) + break; + /* otherwise, get first entry where first */ + /* filename_len characters are equal */ + if (entry->d_name[0] == filename[0] + && entry->d_namlen >= filename_len + && strncmp(entry->d_name, filename, + filename_len) == 0) + break; + } + + if (entry) { /* match found */ + len = entry->d_namlen; + + temp = malloc(strlen(dirname) + len + 1); + if (temp == NULL) + return NULL; + (void)sprintf(temp, "%s%s", dirname, entry->d_name); + } else { + (void)closedir(dir); + dir = NULL; + temp = NULL; + } + + return (temp); +} + + +static const char * +append_char_function(const char *name) +{ + struct stat stbuf; + char *expname = *name == '~' ? fn_tilde_expand(name) : NULL; + const char *rs = " "; + + if (stat(expname ? expname : name, &stbuf) == -1) + goto out; + if (S_ISDIR(stbuf.st_mode)) + rs = "/"; +out: + if (expname) + free(expname); + return rs; +} + + +/* + * returns list of completions for text given + * non-static for readline. + */ +char ** completion_matches(const char *, char *(*)(const char *, int)); +char ** +completion_matches(const char *text, char *(*genfunc)(const char *, int)) +{ + char **match_list = NULL, *retstr, *prevstr; + size_t match_list_len, max_equal, which, i; + size_t matches; + + matches = 0; + match_list_len = 1; + while ((retstr = (*genfunc) (text, (int)matches)) != NULL) { + /* allow for list terminator here */ + if (matches + 3 >= match_list_len) { + char **nmatch_list; + while (matches + 3 >= match_list_len) + match_list_len <<= 1; + nmatch_list = realloc(match_list, + match_list_len * sizeof(char *)); + if (nmatch_list == NULL) { + free(match_list); + return NULL; + } + match_list = nmatch_list; + + } + match_list[++matches] = retstr; + } + + if (!match_list) + return NULL; /* nothing found */ + + /* find least denominator and insert it to match_list[0] */ + which = 2; + prevstr = match_list[1]; + max_equal = strlen(prevstr); + for (; which <= matches; which++) { + for (i = 0; i < max_equal && + prevstr[i] == match_list[which][i]; i++) + continue; + max_equal = i; + } + + retstr = malloc(max_equal + 1); + if (retstr == NULL) { + free(match_list); + return NULL; + } + (void)strncpy(retstr, match_list[1], max_equal); + retstr[max_equal] = '\0'; + match_list[0] = retstr; + + /* add NULL as last pointer to the array */ + match_list[matches + 1] = (char *) NULL; + + return (match_list); +} + + +/* + * Sort function for qsort(). Just wrapper around strcasecmp(). + */ +static int +_fn_qsort_string_compare(const void *i1, const void *i2) +{ + const char *s1 = ((const char * const *)i1)[0]; + const char *s2 = ((const char * const *)i2)[0]; + + return strcasecmp(s1, s2); +} + + +/* + * Display list of strings in columnar format on readline's output stream. + * 'matches' is list of strings, 'len' is number of strings in 'matches', + * 'max' is maximum length of string in 'matches'. + */ +void +fn_display_match_list(EditLine *el, char **matches, size_t len, size_t max) +{ + size_t i, idx, limit, count; + int screenwidth = el->el_term.t_size.h; + + /* + * Find out how many entries can be put on one line, count + * with two spaces between strings. + */ + limit = screenwidth / (max + 2); + if (limit == 0) + limit = 1; + + /* how many lines of output */ + count = len / limit; + if (count * limit < len) + count++; + + /* Sort the items if they are not already sorted. */ + qsort(&matches[1], len, sizeof(char *), _fn_qsort_string_compare); + + idx = 1; + for(; count > 0; count--) { + int more = limit > 0 && matches[0]; + for(i = 0; more; idx++) { + more = ++i < limit && matches[idx + 1]; + (void)fprintf(el->el_outfile, "%-*s%s", (int)max, + matches[idx], more ? " " : ""); + } + (void)fprintf(el->el_outfile, "\n"); + } +} + + +/* + * Complete the word at or before point, + * 'what_to_do' says what to do with the completion. + * \t means do standard completion. + * `?' means list the possible completions. + * `*' means insert all of the possible completions. + * `!' means to do standard completion, and list all possible completions if + * there is more than one. + * + * Note: '*' support is not implemented + * '!' could never be invoked + */ +int +fn_complete(EditLine *el, + char *(*complet_func)(const char *, int), + char **(*attempted_completion_function)(const char *, int, int), + const char *word_break, const char *special_prefixes, + const char *(*app_func)(const char *), size_t query_items, + int *completion_type, int *over, int *point, int *end, + const char *(*find_word_start_func)(const char *, const char *), + char *(*dequoting_func)(const char *), + char *(*quoting_func)(const char *)) +{ + const LineInfo *li; + char *temp; + char *dequoted_temp; + char **matches; + const char *ctemp; + size_t len; + int what_to_do = '\t'; + int retval = CC_NORM; + + if (el->el_state.lastcmd == el->el_state.thiscmd) + what_to_do = '?'; + + /* readline's rl_complete() has to be told what we did... */ + if (completion_type != NULL) + *completion_type = what_to_do; + + if (!complet_func) + complet_func = fn_filename_completion_function; + if (!app_func) + app_func = append_char_function; + + /* We now look backwards for the start of a filename/variable word */ + li = el_line(el); + if (find_word_start_func) + ctemp = find_word_start_func(li->buffer, li->cursor); + else { + ctemp = li->cursor; + while (ctemp > li->buffer + && !strchr(word_break, ctemp[-1]) + && (!special_prefixes || !strchr(special_prefixes, ctemp[-1]) ) ) + ctemp--; + } + + len = li->cursor - ctemp; +#if defined(__SSP__) || defined(__SSP_ALL__) + temp = malloc(sizeof(*temp) * (len + 1)); + if (temp == NULL) + return retval; +#else + temp = alloca(sizeof(*temp) * (len + 1)); +#endif + (void)strncpy(temp, ctemp, len); + temp[len] = '\0'; + + if (dequoting_func) { + dequoted_temp = dequoting_func(temp); + if (dequoted_temp == NULL) + return retval; + } else + dequoted_temp = NULL; + + /* these can be used by function called in completion_matches() */ + /* or (*attempted_completion_function)() */ + if (point != 0) + *point = (int)(li->cursor - li->buffer); + if (end != NULL) + *end = (int)(li->lastchar - li->buffer); + + if (attempted_completion_function) { + int cur_off = (int)(li->cursor - li->buffer); + matches = (*attempted_completion_function) (dequoted_temp ? dequoted_temp : temp, + (int)(cur_off - len), cur_off); + } else + matches = 0; + if (!attempted_completion_function || + (over != NULL && !*over && !matches)) + matches = completion_matches(dequoted_temp ? dequoted_temp : temp, complet_func); + + if (over != NULL) + *over = 0; + + if (matches) { + int i; + size_t matches_num, maxlen, match_len, match_display=1; + + retval = CC_REFRESH; + /* + * Only replace the completed string with common part of + * possible matches if there is possible completion. + */ + if (matches[0][0] != '\0') { + char *quoted_match; + if (quoting_func) { + quoted_match = quoting_func(matches[0]); + if (quoted_match == NULL) + goto free_matches; + } else + quoted_match = NULL; + + el_deletestr(el, (int) len); + el_insertstr(el, quoted_match ? quoted_match : matches[0]); + + free(quoted_match); + } + + if (what_to_do == '?') + goto display_matches; + + if (matches[2] == NULL && strcmp(matches[0], matches[1]) == 0) { + /* + * We found exact match. Add a space after + * it, unless we do filename completion and the + * object is a directory. + */ + el_insertstr(el, (*app_func)(matches[0])); + } else if (what_to_do == '!') { + display_matches: + /* + * More than one match and requested to list possible + * matches. + */ + + for(i = 1, maxlen = 0; matches[i]; i++) { + match_len = strlen(matches[i]); + if (match_len > maxlen) + maxlen = match_len; + } + matches_num = i - 1; + + /* newline to get on next line from command line */ + (void)fprintf(el->el_outfile, "\n"); + + /* + * If there are too many items, ask user for display + * confirmation. + */ + if (matches_num > query_items) { + (void)fprintf(el->el_outfile, + "Display all %zu possibilities? (y or n) ", + matches_num); + (void)fflush(el->el_outfile); + if (getc(stdin) != 'y') + match_display = 0; + (void)fprintf(el->el_outfile, "\n"); + } + + if (match_display) + fn_display_match_list(el, matches, matches_num, + maxlen); + retval = CC_REDISPLAY; + } else if (matches[0][0]) { + /* + * There was some common match, but the name was + * not complete enough. Next tab will print possible + * completions. + */ + el_beep(el); + } else { + /* lcd is not a valid object - further specification */ + /* is needed */ + el_beep(el); + retval = CC_NORM; + } + +free_matches: + /* free elements of array and the array itself */ + for (i = 0; matches[i]; i++) + free(matches[i]); + free(matches); + matches = NULL; + } + free(dequoted_temp); +#if defined(__SSP__) || defined(__SSP_ALL__) + free(temp); +#endif + return retval; +} + + +/* + * el-compatible wrapper around rl_complete; needed for key binding + */ +/* ARGSUSED */ +unsigned char +_el_fn_complete(EditLine *el, int ch __attribute__((__unused__))) +{ + return (unsigned char)fn_complete(el, NULL, NULL, + break_chars, NULL, NULL, 100, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL); +} + + +static const char * +sh_find_word_start(const char *buffer, const char *cursor) +{ + const char *word_start = buffer; + + while (buffer < cursor) { + if (*buffer == '\\') + buffer++; + else if (strchr(break_chars, *buffer)) + word_start = buffer + 1; + + buffer++; + } + + return word_start; +} + + +static char * +sh_quote(const char *str) +{ + const char *src; + int extra_len = 0; + char *quoted_str, *dst; + + if (*str == '-' || *str == '+') + extra_len += 2; + for (src = str; *src != '\0'; src++) + if (strchr(break_chars, *src) || + strchr(extra_quote_chars, *src)) + extra_len++; + + quoted_str = malloc(sizeof(*quoted_str) * + (strlen(str) + extra_len + 1)); + if (quoted_str == NULL) + return NULL; + + dst = quoted_str; + if (*str == '-' || *str == '+') + *dst++ = '.', *dst++ = '/'; + for (src = str; *src != '\0'; src++) { + if (strchr(break_chars, *src) || + strchr(extra_quote_chars, *src)) + *dst++ = '\\'; + *dst++ = *src; + } + *dst = '\0'; + + return quoted_str; +} + + +static char * +sh_dequote(const char *str) +{ + char *dequoted_str, *dst; + + /* save extra space to replace \~ with ./~ */ + dequoted_str = malloc(sizeof(*dequoted_str) * (strlen(str) + 1 + 1)); + if (dequoted_str == NULL) + return NULL; + + dst = dequoted_str; + + /* dequote \~ at start as ./~ */ + if (*str == '\\' && str[1] == '~') { + str++; + *dst++ = '.'; + *dst++ = '/'; + } + + while (*str) { + if (*str == '\\') + str++; + if (*str) + *dst++ = *str++; + } + *dst = '\0'; + + return dequoted_str; +} + + +/* + * completion function using sh quoting rules; for key binding + */ +/* ARGSUSED */ +unsigned char +_el_fn_sh_complete(EditLine *el, int ch __attribute__((__unused__))) +{ + return (unsigned char)fn_complete(el, NULL, NULL, + break_chars, NULL, NULL, 100, + NULL, NULL, NULL, NULL, + sh_find_word_start, sh_dequote, sh_quote); +} Property changes on: lib/libedit/filecomplete.c ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Index: lib/libedit/filecomplete.h =================================================================== --- lib/libedit/filecomplete.h (revision 0) +++ lib/libedit/filecomplete.h (revision 0) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jaromir Dolecek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: filecomplete.h,v 1.9 2009/12/30 22:37:40 christos Exp $ + * $FreeBSD$ + */ +#ifndef _FILECOMPLETE_H_ +#define _FILECOMPLETE_H_ + +int fn_complete(EditLine *, + char *(*)(const char *, int), + char **(*)(const char *, int, int), + const char *, const char *, const char *(*)(const char *), size_t, + int *, int *, int *, int *, + const char *(*)(const char *, const char *), + char *(*)(const char *), + char *(*)(const char *)); + +void fn_display_match_list(EditLine *, char **, size_t, size_t); +char *fn_tilde_expand(const char *); +char *fn_filename_completion_function(const char *, int); + +#endif Property changes on: lib/libedit/filecomplete.h ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Index: lib/libedit/read.h =================================================================== --- lib/libedit/read.h (revision 209229) +++ lib/libedit/read.h (working copy) @@ -13,9 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Index: lib/libedit/Makefile =================================================================== --- lib/libedit/Makefile (revision 209229) +++ lib/libedit/Makefile (working copy) @@ -6,7 +6,8 @@ SHLIB_MAJOR= 7 SHLIBDIR?= /lib -OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \ +OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ + hist.c key.c map.c \ parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c DPADD= ${LIBNCURSES} @@ -35,6 +36,8 @@ CFLAGS+= #-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH CFLAGS+= #-DDEBUG_PASTE -DDEBUG_EDIT +WARNS?= 1 + AHDR= vi.h emacs.h common.h ASRC= ${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c Index: lib/libedit/editrc.5 =================================================================== --- lib/libedit/editrc.5 (revision 209229) +++ lib/libedit/editrc.5 (working copy) @@ -13,9 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -32,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd October 18, 2003 -.Os .Dt EDITRC 5 +.Os .Sh NAME .Nm editrc .Nd configuration file for editline library Index: lib/libedit/editline.3 =================================================================== --- lib/libedit/editline.3 (revision 209229) +++ lib/libedit/editline.3 (working copy) @@ -13,9 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -32,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd January 12, 2007 -.Os .Dt EDITLINE 3 +.Os .Sh NAME .Nm editline , .Nm el_init , Index: bin/sh/memalloc.h =================================================================== --- bin/sh/memalloc.h (revision 209229) +++ bin/sh/memalloc.h (working copy) @@ -51,7 +51,7 @@ pointer ckmalloc(size_t); pointer ckrealloc(pointer, int); void ckfree(pointer); -char *savestr(char *); +char *savestr(const char *); pointer stalloc(int); void stunalloc(pointer); void setstackmark(struct stackmark *); Index: bin/sh/alias.h =================================================================== --- bin/sh/alias.h (revision 209229) +++ bin/sh/alias.h (working copy) @@ -42,7 +42,7 @@ int flag; }; -struct alias *lookupalias(char *, int); +struct alias *lookupalias(const char *, int); int aliascmd(int, char **); int unaliascmd(int, char **); void rmaliases(void); Index: bin/sh/mkbuiltins =================================================================== --- bin/sh/mkbuiltins (revision 209229) +++ bin/sh/mkbuiltins (working copy) @@ -88,7 +88,7 @@ awk '{ printf "#define %s %d\n", $1, NR-1}' echo ' struct builtincmd { - char *name; + const char *name; int code; int special; }; Index: bin/sh/options.h =================================================================== --- bin/sh/options.h (revision 209229) +++ bin/sh/options.h (working copy) @@ -102,7 +102,7 @@ extern struct shparam shellparam; /* $@ */ extern char **argptr; /* argument list for builtin commands */ extern char *shoptarg; /* set by nextopt */ -extern char *optptr; /* used by nextopt */ +extern char *nextopt_optptr; /* used by nextopt */ void procargs(int, char **); void optschanged(void); @@ -111,5 +111,5 @@ int shiftcmd(int, char **); int setcmd(int, char **); int getoptscmd(int, char **); -int nextopt(char *); +int nextopt(const char *); void getoptsreset(const char *); Index: bin/sh/output.c =================================================================== --- bin/sh/output.c (revision 209229) +++ bin/sh/output.c (working copy) @@ -71,7 +71,7 @@ static int doformat_wr(void *, const char *, int); struct output output = {NULL, 0, NULL, OUTBUFSIZ, 1, 0}; -struct output errout = {NULL, 0, NULL, 100, 2, 0}; +struct output errout = {NULL, 0, NULL, 256, 2, 0}; struct output memout = {NULL, 0, NULL, 0, MEM_OUT, 0}; struct output *out1 = &output; struct output *out2 = &errout; @@ -124,8 +124,6 @@ { while (*p) outc(*p++, file); - if (file == out2) - flushout(file); } /* Like outstr(), but quote for re-input into the shell. */ @@ -255,7 +253,7 @@ } void -dprintf(const char *fmt, ...) +out2fmt_flush(const char *fmt, ...) { va_list ap; @@ -316,7 +314,7 @@ */ int -xwrite(int fd, char *buf, int nbytes) +xwrite(int fd, const char *buf, int nbytes) { int ntry; int i; Index: bin/sh/parser.h =================================================================== --- bin/sh/parser.h (revision 209229) +++ bin/sh/parser.h (working copy) @@ -73,9 +73,10 @@ extern int tokpushback; #define NEOF ((union node *)&tokpushback) extern int whichprompt; /* 1 == PS1, 2 == PS2 */ +extern const char *const parsekwd[]; union node *parsecmd(int); void fixredir(union node *, const char *, int); -int goodname(char *); +int goodname(const char *); char *getprompt(void *); Index: bin/sh/output.h =================================================================== --- bin/sh/output.h (revision 209229) +++ bin/sh/output.h (working copy) @@ -46,13 +46,13 @@ short flags; }; -extern struct output output; -extern struct output errout; +extern struct output output; /* to fd 1 */ +extern struct output errout; /* to fd 2 */ extern struct output memout; -extern struct output *out1; -extern struct output *out2; +extern struct output *out1; /* &memout if backquote, otherwise &output */ +extern struct output *out2; /* &memout if backquote with 2>&1, otherwise + &errout */ -void open_mem(char *, int, struct output *); void out1str(const char *); void out1qstr(const char *); void out2str(const char *); @@ -65,10 +65,10 @@ void freestdout(void); void outfmt(struct output *, const char *, ...) __printflike(2, 3); void out1fmt(const char *, ...) __printflike(1, 2); -void dprintf(const char *, ...) __printflike(1, 2); +void out2fmt_flush(const char *, ...) __printflike(1, 2); void fmtstr(char *, int, const char *, ...) __printflike(3, 4); void doformat(struct output *, const char *, va_list) __printflike(2, 0); -int xwrite(int, char *, int); +int xwrite(int, const char *, int); #define outc(c, file) (--(file)->nleft < 0? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c))) #define out1c(c) outc(c, out1); Index: bin/sh/mystring.c =================================================================== --- bin/sh/mystring.c (revision 209229) +++ bin/sh/mystring.c (working copy) @@ -108,7 +108,7 @@ number(const char *s) { if (! is_number(s)) - error("Illegal number: %s", (char *)s); + error("Illegal number: %s", s); return atoi(s); } Index: bin/sh/histedit.c =================================================================== --- bin/sh/histedit.c (revision 209229) +++ bin/sh/histedit.c (working copy) @@ -92,12 +92,14 @@ if (hist != NULL) sethistsize(histsizeval()); else - out2str("sh: can't initialize history\n"); + out2fmt_flush("sh: can't initialize history\n"); } if (editing && !el && isatty(0)) { /* && isatty(2) ??? */ /* * turn editing on */ + char *term; + INTOFF; if (el_in == NULL) el_in = fdopen(0, "r"); @@ -107,14 +109,22 @@ el_out = fdopen(2, "w"); if (el_in == NULL || el_err == NULL || el_out == NULL) goto bad; + term = lookupvar("TERM"); + if (term) + setenv("TERM", term, 1); + else + unsetenv("TERM"); el = el_init(arg0, el_in, el_out, el_err); if (el != NULL) { if (hist) el_set(el, EL_HIST, history, hist); el_set(el, EL_PROMPT, getprompt); + el_set(el, EL_ADDFN, "sh-complete", + "Filename completion", + _el_fn_sh_complete); } else { bad: - out2str("sh: can't initialize editing\n"); + out2fmt_flush("sh: can't initialize editing\n"); } INTON; } else if (!editing && el) { @@ -128,6 +138,7 @@ el_set(el, EL_EDITOR, "vi"); else if (Eflag) el_set(el, EL_EDITOR, "emacs"); + el_set(el, EL_BIND, "^I", "sh-complete", NULL); el_source(el, NULL); } } else { @@ -160,23 +171,30 @@ } } +void +setterm(const char *term) +{ + if (rootshell && el != NULL && term != NULL) + el_set(el, EL_TERMINAL, term); +} + int histcmd(int argc, char **argv) { int ch; - char *editor = NULL; + const char *editor = NULL; HistEvent he; int lflg = 0, nflg = 0, rflg = 0, sflg = 0; int i, retval; - char *firststr, *laststr; + const char *firststr, *laststr; int first, last, direction; - char *pat = NULL, *repl; + char *pat = NULL, *repl = NULL; static int active = 0; struct jmploc jmploc; struct jmploc *savehandler; char editfilestr[PATH_MAX]; char *volatile editfile; - FILE *efp; + FILE *efp = NULL; int oldhistnum; if (hist == NULL) @@ -336,6 +354,7 @@ if (sflg) { if (displayhist) { out2str(s); + flushout(out2); } evalstring(s, 0); if (displayhist && hist) { @@ -405,7 +424,7 @@ } int -not_fcnumber(char *s) +not_fcnumber(const char *s) { if (s == NULL) return (0); @@ -415,10 +434,10 @@ } int -str_to_event(char *str, int last) +str_to_event(const char *str, int last) { HistEvent he; - char *s = str; + const char *s = str; int relative = 0; int i, retval; Index: bin/sh/show.c =================================================================== --- bin/sh/show.c (revision 209229) +++ bin/sh/show.c (working copy) @@ -307,7 +307,7 @@ void -trputs(char *s) +trputs(const char *s) { if (tracefile == NULL) return; Index: bin/sh/show.h =================================================================== --- bin/sh/show.h (revision 209229) +++ bin/sh/show.h (working copy) @@ -35,6 +35,6 @@ void sh_trace(const char *, ...) __printflike(1, 2); void trargs(char **); void trputc(int); -void trputs(char *); +void trputs(const char *); void opentrace(void); #endif Index: bin/sh/arith_lex.l =================================================================== --- bin/sh/arith_lex.l (revision 209229) +++ bin/sh/arith_lex.l (working copy) @@ -51,13 +51,6 @@ int yylex(void); -struct varname -{ - struct varname *next; - char name[1]; -}; -static struct varname *varnames; - #undef YY_INPUT #define YY_INPUT(buf,result,max) \ result = (*buf = *arith_buf++) ? 1 : YY_NULL; @@ -87,14 +80,11 @@ * If variable doesn't exist, we should initialize * it to zero. */ - struct varname *temp; + char *temp; if (lookupvar(yytext) == NULL) setvarsafe(yytext, "0", 0); - temp = ckmalloc(sizeof(struct varname) + - strlen(yytext)); - temp->next = varnames; - varnames = temp; - yylval.s_value = strcpy(temp->name, yytext); + temp = stalloc(strlen(yytext) + 1); + yylval.s_value = strcpy(temp, yytext); return ARITH_VAR; } @@ -140,15 +130,5 @@ void arith_lex_reset(void) { - struct varname *name, *next; - YY_NEW_FILE; - - name = varnames; - while (name != NULL) { - next = name->next; - ckfree(name); - name = next; - } - varnames = NULL; } Index: bin/sh/myhistedit.h =================================================================== --- bin/sh/myhistedit.h (revision 209229) +++ bin/sh/myhistedit.h (working copy) @@ -38,8 +38,9 @@ void histedit(void); void sethistsize(const char *); +void setterm(const char *); int histcmd(int, char **); -int not_fcnumber(char *); -int str_to_event(char *, int); +int not_fcnumber(const char *); +int str_to_event(const char *, int); int bindcmd(int, char **); Index: bin/sh/sh.1 =================================================================== --- bin/sh/sh.1 (revision 209229) +++ bin/sh/sh.1 (working copy) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd May 24, 2010 .Dt SH 1 .Os .Sh NAME @@ -210,7 +210,8 @@ .Xr emacs 1 command line editor (disables the .Fl V -option if it has been set). +option if it has been set; +set automatically when interactive on terminals). .It Fl e Li errexit Exit immediately if any untested command fails in non-interactive mode. The exit status of a command is considered to be @@ -296,7 +297,10 @@ .Ed .It Fl u Li nounset Write a message to standard error when attempting -to expand a variable that is not set, and if the +to expand a variable, a positional parameter or +the special parameter +.Va \&! +that is not set, and if the shell is not interactive, exit immediately. .It Fl V Li vi Enable the built-in @@ -411,11 +415,11 @@ .Pq Ql \en . A backslash preceding a newline is treated as a line continuation. .El -.Ss Reserved Words -Reserved words are words that have special meaning to the +.Ss Keywords +Keywords or reserved words are words that have special meaning to the shell and are recognized at the beginning of a line and after a control operator. -The following are reserved words: +The following are keywords: .Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center .It Li \&! Ta { Ta } Ta Ic case Ta Ic do .It Ic done Ta Ic elif Ta Ic else Ta Ic esac Ta Ic fi @@ -425,8 +429,8 @@ An alias is a name and corresponding value set using the .Ic alias built-in command. -Whenever a reserved word may occur (see above), -and after checking for reserved words, the shell +Whenever a keyword may occur (see above), +and after checking for keywords, the shell checks the word to see if it matches an alias. If it does, it replaces it in the input stream with its value. For example, if there is an alias called @@ -465,7 +469,7 @@ document). Essentially though, a line is read and if the first word of the line (or after a control operator) -is not a reserved word, then the shell has recognized a +is not a keyword, then the shell has recognized a simple command. Otherwise, a complex command or some other special construct may have been recognized. @@ -661,11 +665,11 @@ performing any searches. .It The shell searches each entry in the -.Ev PATH -environment variable +.Va PATH +variable in turn for the command. The value of the -.Ev PATH +.Va PATH variable should be a series of entries separated by colons. Each entry consists of a @@ -691,7 +695,7 @@ .In sys/signal.h . .Ss Complex Commands Complex commands are combinations of simple commands -with control operators or reserved words, together creating a larger complex +with control operators or keywords, together creating a larger complex command. More generally, a command is one of the following: .Bl -item -offset indent @@ -735,7 +739,7 @@ If the pipeline is not in the background (discussed later), the shell waits for all commands to complete. .Pp -If the reserved word +If the keyword .Ic !\& does not precede the pipeline, the exit status is the exit status of the last command specified @@ -1036,13 +1040,9 @@ .Ic set built-in command can also be used to set or reset them. .Ss Special Parameters -A special parameter is a parameter denoted by a special one-character -name. -The special parameters recognized by the -.Nm -shell of -.Fx -are shown in the following list, exactly as they would appear in input +Special parameters are parameters denoted by a single special character +or the digit zero. +They are shown in the following list, exactly as they would appear in input typed by the user or in the source of a shell script. .Bl -hang .It Li $* @@ -1109,6 +1109,84 @@ .It Li $0 (zero) Expands to the name of the shell or shell script. .El +.Ss Special Variables +The following variables are set by the shell or +have special meaning to it: +.Bl -tag -width ".Va HISTSIZE" +.It Va CDPATH +The search path used with the +.Ic cd +built-in. +.It Va EDITOR +The fallback editor used with the +.Ic fc +built-in. +If not set, the default editor is +.Xr ed 1 . +.It Va FCEDIT +The default editor used with the +.Ic fc +built-in. +.It Va HISTSIZE +The number of previous commands that are accessible. +.It Va HOME +The user's home directory, +used in tilde expansion and as a default directory for the +.Ic cd +built-in. +.It Va IFS +Input Field Separators. +This is normally set to +.Aq space , +.Aq tab , +and +.Aq newline . +See the +.Sx White Space Splitting +section for more details. +.It Va LINENO +The current line number in the script or function. +.It Va MAIL +The name of a mail file, that will be checked for the arrival of new +mail. +Overridden by +.Va MAILPATH . +.It Va MAILPATH +A colon +.Pq Ql \&: +separated list of file names, for the shell to check for incoming +mail. +This variable overrides the +.Va MAIL +setting. +There is a maximum of 10 mailboxes that can be monitored at once. +.It Va PATH +The default search path for executables. +See the +.Sx Path Search +section for details. +.It Va PPID +The parent process ID of the invoked shell. +This is set at startup +unless this variable is in the environment. +A later change of parent process ID is not reflected. +A subshell retains the same value of +.Va PPID . +.It Va PS1 +The primary prompt string, which defaults to +.Dq Li "$ " , +unless you are the superuser, in which case it defaults to +.Dq Li "# " . +.It Va PS2 +The secondary prompt string, which defaults to +.Dq Li "> " . +.It Va PS4 +The prefix for the trace output (if +.Fl x +is active). +The default is +.Dq Li "+ " . +.El .Ss Word Expansions This clause describes the various expansions that are performed on words. @@ -1162,7 +1240,7 @@ username is missing (as in .Pa ~/foobar ) , the tilde is replaced with the value of the -.Ev HOME +.Va HOME variable (the current user's home directory). .Ss Parameter Expansion The format for parameter expansion is as follows: @@ -1175,10 +1253,20 @@ .Ql } . Any .Ql } -escaped by a backslash or within a quoted string, and characters in +escaped by a backslash or within a single-quoted string, and characters in embedded arithmetic expansions, command substitutions, and variable expansions, are not examined in determining the matching .Ql } . +Except for the variants with +.Ql + , +.Ql - , +.Ql = +or +.Ql ?\& , +any +.Ql } +within a double-quoted string is also not examined in determining the matching +.Ql } . .Pp The simplest form for parameter expansion is: .Pp @@ -1262,6 +1350,14 @@ In the parameter expansions shown previously, use of the colon in the format results in a test for a parameter that is unset or null; omission of the colon results in a test for a parameter that is only unset. +.Pp +The +.Ar word +inherits the type of quoting +(unquoted, double-quoted or here-document) +from the surroundings, +with the exception that a backslash that quotes a closing brace is removed +during quote removal. .Bl -tag -width indent .It Li ${# Ns Ar parameter Ns Li } String Length. @@ -1469,10 +1565,10 @@ .Ql / characters, it is used as is. Otherwise, the shell searches the -.Ev PATH +.Va PATH for the file. If it is not found in the -.Ev PATH , +.Va PATH , it is sought in the current working directory. .It Ic \&[ A built-in equivalent of @@ -1516,7 +1612,7 @@ Switch to the specified .Ar directory , or to the directory specified in the -.Ev HOME +.Va HOME environment variable if no .Ar directory is specified. @@ -1527,17 +1623,17 @@ or .Pa .. , then the directories listed in the -.Ev CDPATH +.Va CDPATH variable will be searched for the specified .Ar directory . If -.Ev CDPATH +.Va CDPATH is unset, the current directory is searched. The format of -.Ev CDPATH +.Va CDPATH is the same as that of -.Ev PATH . +.Va PATH . In an interactive shell, the .Ic cd @@ -1545,7 +1641,7 @@ that it actually switched to if this is different from the name that the user gave. These may be different either because the -.Ev CDPATH +.Va CDPATH mechanism was used or because a symbolic link was crossed. .Pp If the @@ -1568,16 +1664,18 @@ .It Ic command Oo Fl p Oc Op Ar utility Op Ar argument ... .It Ic command Oo Fl v | V Oc Op Ar utility The first form of invocation executes the specified +.Ar utility , +ignoring shell functions in the search. +If .Ar utility -as a simple command (see the -.Sx Simple Commands -section). +is a special builtin, +it is executed as if it were a regular builtin. .Pp If the .Fl p option is specified, the command search is performed using a default value of -.Ev PATH +.Va PATH that is guaranteed to find all of the standard utilities. .Pp If the @@ -1736,20 +1834,20 @@ .Ar editor string is a command name, subject to search via the -.Ev PATH +.Va PATH variable. The value in the -.Ev FCEDIT +.Va FCEDIT variable is used as a default when .Fl e is not specified. If -.Ev FCEDIT +.Va FCEDIT is null or unset, the value of the -.Ev EDITOR +.Va EDITOR variable is used. If -.Ev EDITOR +.Va EDITOR is null or unset, .Xr ed 1 is used as the editor. @@ -1783,7 +1881,7 @@ Select the commands to list or edit. The number of previous commands that can be accessed are determined by the value of the -.Ev HISTSIZE +.Va HISTSIZE variable. The value of .Ar first @@ -1814,12 +1912,12 @@ .El .El .Pp -The following environment variables affect the execution of +The following variables affect the execution of .Ic fc : -.Bl -tag -width ".Ev HISTSIZE" -.It Ev FCEDIT +.Bl -tag -width ".Va HISTSIZE" +.It Va FCEDIT Name of the editor to use for history editing. -.It Ev HISTSIZE +.It Va HISTSIZE The number of previous commands that are accessible. .El .It Ic fg Op Ar job @@ -2285,74 +2383,27 @@ .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev HISTSIZE" -.It Ev CDPATH -The search path used with the -.Ic cd -built-in. -.It Ev EDITOR -The fallback editor used with the -.Ic fc -built-in. -If not set, the default editor is -.Xr ed 1 . -.It Ev FCEDIT -The default editor used with the -.Ic fc -built-in. -.It Ev HISTSIZE -The number of previous commands that are accessible. -.It Ev HOME -The starting directory of -.Nm . -.It Ev IFS -Input Field Separators. -This is normally set to -.Aq space , -.Aq tab , -and -.Aq newline . -See the -.Sx White Space Splitting -section for more details. -.It Ev MAIL -The name of a mail file, that will be checked for the arrival of new -mail. -Overridden by -.Ev MAILPATH . -.It Ev MAILPATH -A colon -.Pq Ql \&: -separated list of file names, for the shell to check for incoming -mail. -This environment setting overrides the -.Ev MAIL -setting. -There is a maximum of 10 mailboxes that can be monitored at once. -.It Ev PATH -The default search path for executables. -See the -.Sx Path Search -section for details. -.It Ev PS1 -The primary prompt string, which defaults to -.Dq Li "$ " , -unless you are the superuser, in which case it defaults to -.Dq Li "# " . -.It Ev PS2 -The secondary prompt string, which defaults to -.Dq Li "> " . -.It Ev PS4 -The prefix for the trace output (if -.Fl x -is active). -The default is -.Dq Li "+ " . +.Bl -tag -width ".Ev LANGXXXXXX" +.It Ev ENV +Initialization file for interactive shells. +.It Ev LANG , Ev LC_* +Locale settings. +These are inherited by children of the shell, +and is used in a limited manner by the shell itself. +.It Ev PWD +An absolute pathname for the current directory, +possibly containing symbolic links. +This is used and updated by the shell. .It Ev TERM The default terminal setting for the shell. This is inherited by children of the shell, and is used in the history editing modes. .El +.Pp +Additionally, all environment variables are turned into shell variables +at startup, +which may affect the shell as described under +.Sx Special Variables . .Sh EXIT STATUS Errors that are detected by the shell, such as a syntax error, will cause the shell to exit with a non-zero exit status. Index: bin/sh/error.c =================================================================== --- bin/sh/error.c (revision 209229) +++ bin/sh/error.c (working copy) @@ -67,17 +67,21 @@ char *commandname; -static void exverror(int, const char *, va_list) __printf0like(2, 0); +static void exverror(int, const char *, va_list) __printf0like(2, 0) __dead2; /* * Called to raise an exception. Since C doesn't include exceptions, we * just do a longjmp to the exception handler. The type of exception is * stored in the global variable "exception". + * + * Interrupts are disabled; they should be reenabled when the exception is + * caught. */ void exraise(int e) { + INTOFF; if (handler == NULL) abort(); exception = e; @@ -138,8 +142,15 @@ static void exverror(int cond, const char *msg, va_list ap) { - CLEAR_PENDING_INT; - INTOFF; + /* + * An interrupt trumps an error. Certain places catch error + * exceptions or transform them to a plain nonzero exit code + * in child processes, and if an error exception can be handled, + * an interrupt can be handled as well. + * + * exraise() will disable interrupts for the exception handler. + */ + FORCEINTON; #ifdef DEBUG if (msg) @@ -149,8 +160,8 @@ #endif if (msg) { if (commandname) - outfmt(&errout, "%s: ", commandname); - doformat(&errout, msg, ap); + outfmt(out2, "%s: ", commandname); + doformat(out2, msg, ap); out2c('\n'); } flushall(); Index: bin/sh/error.h =================================================================== --- bin/sh/error.h (revision 209229) +++ bin/sh/error.h (working copy) @@ -72,14 +72,16 @@ #define INTOFF suppressint++ #define INTON { if (--suppressint == 0 && intpending) onint(); } +#define is_int_on() suppressint +#define SETINTON(s) suppressint = (s) #define FORCEINTON {suppressint = 0; if (intpending) onint();} #define CLEAR_PENDING_INT intpending = 0 #define int_pending() intpending -void exraise(int); +void exraise(int) __dead2; void onint(void); -void error(const char *, ...) __printf0like(1, 2); -void exerror(int, const char *, ...) __printf0like(2, 3); +void error(const char *, ...) __printf0like(1, 2) __dead2; +void exerror(int, const char *, ...) __printf0like(2, 3) __dead2; /* Index: bin/sh/input.c =================================================================== --- bin/sh/input.c (revision 209229) +++ bin/sh/input.c (working copy) @@ -93,7 +93,7 @@ int plinno = 1; /* input line number */ -MKINIT int parsenleft; /* copy of parsefile->nleft */ +int parsenleft; /* copy of parsefile->nleft */ MKINIT int parselleft; /* copy of parsefile->lleft */ char *parsenextc; /* copy of parsefile->nextc */ MKINIT struct parsefile basepf; /* top level input file */ @@ -111,9 +111,9 @@ INCLUDE "input.h" INCLUDE "error.h" +MKINIT char basebuf[]; + INIT { - extern char basebuf[]; - basepf.nextc = basepf.buf = basebuf; } @@ -215,7 +215,7 @@ if (flags >= 0 && flags & O_NONBLOCK) { flags &=~ O_NONBLOCK; if (fcntl(0, F_SETFL, flags) >= 0) { - out2str("sh: turning off NDELAY mode\n"); + out2fmt_flush("sh: turning off NDELAY mode\n"); goto retry; } } @@ -359,7 +359,7 @@ struct strpush *sp; INTOFF; -/*dprintf("*** calling pushstring: %s, %d\n", s, len);*/ +/*out2fmt_flush("*** calling pushstring: %s, %d\n", s, len);*/ if (parsefile->strpush) { sp = ckmalloc(sizeof (struct strpush)); sp->prev = parsefile->strpush; @@ -386,7 +386,7 @@ parsenextc = sp->prevstring; parsenleft = sp->prevnleft; parselleft = sp->prevlleft; -/*dprintf("*** calling popstring: restoring to '%s'\n", parsenextc);*/ +/*out2fmt_flush("*** calling popstring: restoring to '%s'\n", parsenextc);*/ if (sp->ap) sp->ap->flag &= ~ALIASINUSE; parsefile->strpush = sp->prev; @@ -401,7 +401,7 @@ */ void -setinputfile(char *fname, int push) +setinputfile(const char *fname, int push) { int fd; int fd2; @@ -509,6 +509,32 @@ /* + * Return current file (to go back to it later using popfilesupto()). + */ + +struct parsefile * +getcurrentfile(void) +{ + return parsefile; +} + + +/* + * Pop files until the given file is on top again. Useful for regular + * builtins that read shell commands from files or strings. + * If the given file is not an active file, an error is raised. + */ + +void +popfilesupto(struct parsefile *file) +{ + while (parsefile != file && parsefile != &basepf) + popfile(); + if (parsefile != file) + error("popfilesupto() misused"); +} + +/* * Return to top level. */ Index: bin/sh/input.h =================================================================== --- bin/sh/input.h (revision 209229) +++ bin/sh/input.h (working copy) @@ -45,6 +45,8 @@ extern char *parsenextc; /* next character in input buffer */ extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */ +struct parsefile; + char *pfgets(char *, int); int pgetc(void); int preadbuffer(void); @@ -52,10 +54,12 @@ void pungetc(void); void pushstring(char *, int, void *); void popstring(void); -void setinputfile(char *, int); +void setinputfile(const char *, int); void setinputfd(int, int); void setinputstring(char *, int); void popfile(void); +struct parsefile *getcurrentfile(void); +void popfilesupto(struct parsefile *); void popallfiles(void); void closescript(void); Index: bin/sh/redir.c =================================================================== --- bin/sh/redir.c (revision 209229) +++ bin/sh/redir.c (working copy) @@ -63,6 +63,7 @@ #define EMPTY -2 /* marks an unused slot in redirtab */ +#define CLOSED -1 /* fd was not open before redir */ #define PIPESIZE 4096 /* amount of buffering in a pipe */ @@ -101,7 +102,6 @@ struct redirtab *sv = NULL; int i; int fd; - int try; char memory[10]; /* file descriptors to write to memory */ for (i = 10 ; --i >= 0 ; ) @@ -116,38 +116,30 @@ } for (n = redir ; n ; n = n->nfile.next) { fd = n->nfile.fd; - try = 0; if ((n->nfile.type == NTOFD || n->nfile.type == NFROMFD) && n->ndup.dupfd == fd) continue; /* redirect from/to same file descriptor */ if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) { INTOFF; -again: if ((i = fcntl(fd, F_DUPFD, 10)) == -1) { switch (errno) { case EBADF: - if (!try) { - openredirect(n, memory); - try++; - goto again; - } - /* FALLTHROUGH*/ + i = CLOSED; + break; default: INTON; error("%d: %s", fd, strerror(errno)); break; } - } - if (!try) { - sv->renamed[fd] = i; - } + } else + (void)fcntl(i, F_SETFD, FD_CLOEXEC); + sv->renamed[fd] = i; INTON; } if (fd == 0) fd0_redirected++; - if (!try) - openredirect(n, memory); + openredirect(n, memory); } if (memory[1]) out1 = &memout; @@ -166,8 +158,11 @@ /* * We suppress interrupts so that we won't leave open file - * descriptors around. This may not be such a good idea because - * an open of a device or a fifo can block indefinitely. + * descriptors around. Because the signal handler remains + * installed and we do not use system call restart, interrupts + * will still abort blocking opens such as fifos (they will fail + * with EINTR). There is, however, a race condition if an interrupt + * arrives after INTOFF and before open blocks. */ INTOFF; memory[fd] = 0; Index: bin/sh/trap.c =================================================================== --- bin/sh/trap.c (revision 209229) +++ bin/sh/trap.c (working copy) @@ -149,6 +149,7 @@ { char *action; int signo; + int errors = 0; if (argc <= 1) { for (signo = 0 ; signo < sys_nsig ; signo++) { @@ -183,8 +184,10 @@ } } while (*argv) { - if ((signo = sigstring_to_signum(*argv)) == -1) - error("bad signal %s", *argv); + if ((signo = sigstring_to_signum(*argv)) == -1) { + out2fmt_flush("trap: bad signal %s\n", *argv); + errors = 1; + } INTOFF; if (action) action = savestr(action); @@ -196,7 +199,7 @@ INTON; argv++; } - return 0; + return errors; } @@ -244,7 +247,8 @@ setsignal(int signo) { int action; - sig_t sig, sigact = SIG_DFL; + sig_t sigact = SIG_DFL; + struct sigaction sa; char *t; if ((t = trap[signo]) == NULL) @@ -320,9 +324,10 @@ case S_IGN: sigact = SIG_IGN; break; } *t = action; - sig = signal(signo, sigact); - if (sig != SIG_ERR && action == S_CATCH) - siginterrupt(signo, 1); + sa.sa_handler = sigact; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(signo, &sa, NULL); } Index: bin/sh/trap.h =================================================================== --- bin/sh/trap.h (revision 209229) +++ bin/sh/trap.h (working copy) @@ -45,4 +45,4 @@ void onsig(int); void dotrap(void); void setinteractive(int); -void exitshell(int); +void exitshell(int) __dead2; Index: bin/sh/arith.h =================================================================== --- bin/sh/arith.h (revision 209229) +++ bin/sh/arith.h (working copy) @@ -34,8 +34,8 @@ #define DIGITS(var) (3 + (2 + CHAR_BIT * sizeof((var))) / 3) -extern char *arith_buf, *arith_startbuf; +extern const char *arith_buf, *arith_startbuf; -arith_t arith(char *); +arith_t arith(const char *); void arith_lex_reset(void); int expcmd(int, char **); Index: bin/sh/mksyntax.c =================================================================== --- bin/sh/mksyntax.c (revision 209229) +++ bin/sh/mksyntax.c (working copy) @@ -55,8 +55,8 @@ struct synclass { - char *name; - char *comment; + const char *name; + const char *comment; }; /* Syntax classes */ @@ -101,16 +101,16 @@ static FILE *cfile; static FILE *hfile; -static char *syntax[513]; +static const char *syntax[513]; static int base; static int size; /* number of values which a char variable can have */ static int nbits; /* number of bits in a character */ static int digit_contig;/* true if digits are contiguous */ -static void filltable(char *); +static void filltable(const char *); static void init(void); -static void add(char *, char *); -static void print(char *); +static void add(const char *, const char *); +static void print(const char *); static void output_type_macros(void); static void digit_convert(void); @@ -232,7 +232,6 @@ add("\n", "CNL"); add("\\", "CBACK"); add("`", "CBQUOTE"); - add("'", "CSQUOTE"); add("\"", "CDQUOTE"); add("$", "CVAR"); add("}", "CENDVAR"); @@ -259,7 +258,7 @@ */ static void -filltable(char *dftval) +filltable(const char *dftval) { int i; @@ -293,7 +292,7 @@ */ static void -add(char *p, char *type) +add(const char *p, const char *type) { while (*p) syntax[*p++ + base] = type; @@ -306,7 +305,7 @@ */ static void -print(char *name) +print(const char *name) { int i; int col; @@ -338,7 +337,7 @@ * contiguous, we can test for them quickly. */ -static char *macro[] = { +static const char *macro[] = { "#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)", "#define is_eof(c)\t((c) == PEOF)", "#define is_alpha(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))", @@ -351,7 +350,7 @@ static void output_type_macros(void) { - char **pp; + const char **pp; if (digit_contig) macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)"; Index: bin/sh/expand.c =================================================================== --- bin/sh/expand.c (revision 209229) +++ bin/sh/expand.c (working copy) @@ -109,7 +109,7 @@ STATIC void addfname(char *); STATIC struct strlist *expsort(struct strlist *); STATIC struct strlist *msort(struct strlist *, int); -STATIC int pmatch(char *, char *, int); +STATIC int pmatch(const char *, const char *, int); STATIC char *cvtnum(int, char *); STATIC int collate_range_cmp(int, int); @@ -273,8 +273,12 @@ while ((c = *p) != '\0') { switch(c) { - case CTLESC: - return (startp); + case CTLESC: /* This means CTL* are always considered quoted. */ + case CTLVAR: + case CTLBACKQ: + case CTLBACKQ | CTLQUOTE: + case CTLARI: + case CTLENDARI: case CTLQUOTEMARK: return (startp); case ':': @@ -282,6 +286,7 @@ goto done; break; case '/': + case CTLENDVAR: goto done; } p++; @@ -357,7 +362,7 @@ void expari(int flag) { - char *p, *start; + char *p, *q, *start; arith_t result; int begoff; int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); @@ -395,7 +400,9 @@ removerecordregions(begoff); if (quotes) rmescapes(p+2); + q = grabstackstr(expdest); result = arith(p+2); + ungrabstackstr(q, expdest); fmtstr(p, DIGITS(result), ARITH_FORMAT_STR, result); while (*p++) ; @@ -503,7 +510,9 @@ int amount; herefd = -1; - argstr(p, 0); + argstr(p, (subtype == VSTRIMLEFT || subtype == VSTRIMLEFTMAX || + subtype == VSTRIMRIGHT || subtype == VSTRIMRIGHTMAX ? + EXP_CASE : 0) | EXP_TILDE); STACKSTRNUL(expdest); herefd = saveherefd; argbackq = saveargbackq; @@ -523,7 +532,7 @@ case VSQUESTION: if (*p != CTLENDVAR) { - outfmt(&errout, "%s\n", startp); + outfmt(out2, "%s\n", startp); error((char *)NULL); } error("%.*s: parameter %snot set", (int)(p - str - 1), @@ -659,7 +668,7 @@ } varlen = 0; startloc = expdest - stackblock(); - if (!set && uflag) { + if (!set && uflag && *var != '@' && *var != '*') { switch (subtype) { case VSNORMAL: case VSTRIMLEFT: @@ -852,7 +861,6 @@ int num; char *p; int i; - extern int oexitstatus; char sep; char **ap; char const *syntax; @@ -976,7 +984,7 @@ char *start; char *p; char *q; - char *ifs; + const char *ifs; const char *ifsspc; int had_param_ch = 0; @@ -1344,7 +1352,7 @@ */ int -patmatch(char *pattern, char *string, int squoted) +patmatch(const char *pattern, const char *string, int squoted) { #ifdef notdef if (pattern[0] == '!' && pattern[1] == '!') @@ -1356,9 +1364,9 @@ STATIC int -pmatch(char *pattern, char *string, int squoted) +pmatch(const char *pattern, const char *string, int squoted) { - char *p, *q; + const char *p, *q; char c; p = pattern; @@ -1406,7 +1414,7 @@ } while (*q++ != '\0'); return 0; case '[': { - char *endp; + const char *endp; int invert, found; char chr; @@ -1510,7 +1518,7 @@ */ int -casematch(union node *pattern, char *val) +casematch(union node *pattern, const char *val) { struct stackmark smark; int result; Index: bin/sh/mail.c =================================================================== --- bin/sh/mail.c (revision 209229) +++ bin/sh/mail.c (working copy) @@ -72,7 +72,7 @@ chkmail(int silent) { int i; - char *mpath; + const char *mpath; char *p; char *q; struct stackmark smark; Index: bin/sh/main.c =================================================================== --- bin/sh/main.c (revision 209229) +++ bin/sh/main.c (working copy) @@ -75,8 +75,9 @@ int rootpid; int rootshell; +struct jmploc main_handler; -STATIC void read_profile(char *); +STATIC void read_profile(const char *); STATIC char *find_dot_file(char *); /* @@ -90,14 +91,13 @@ int main(int argc, char *argv[]) { - struct jmploc jmploc; struct stackmark smark; volatile int state; char *shinit; (void) setlocale(LC_ALL, ""); state = 0; - if (setjmp(jmploc.loc)) { + if (setjmp(main_handler.loc)) { /* * When a shell procedure is executed, we raise the * exception EXSHELLPROC to clean up before executing @@ -143,7 +143,7 @@ else goto state4; } - handler = &jmploc; + handler = &main_handler; #ifdef DEBUG opentrace(); trputs("Shell args: "); trargs(argv); @@ -153,10 +153,7 @@ init(); setstackmark(&smark); procargs(argc, argv); - if (getpwd() == NULL && iflag) - out2str("sh: cannot determine working directory\n"); - if (getpwd() != NULL) - setvar ("PWD", getpwd(), VEXPORT); + pwd_init(iflag); if (iflag) chkmail(1); if (argv[0] && argv[0][0] == '-') { @@ -225,7 +222,7 @@ if (!stoppedjobs()) { if (!Iflag) break; - out2str("\nUse \"exit\" to leave shell.\n"); + out2fmt_flush("\nUse \"exit\" to leave shell.\n"); } numeof++; } else if (n != NULL && nflag == 0) { @@ -250,7 +247,7 @@ */ STATIC void -read_profile(char *name) +read_profile(const char *name) { int fd; @@ -271,7 +268,7 @@ */ void -readcmdfile(char *name) +readcmdfile(const char *name) { int fd; @@ -298,7 +295,7 @@ { static char localname[FILENAME_MAX+1]; char *fullname; - char *path = pathval(); + const char *path = pathval(); struct stat statb; /* don't try this for absolute or relative paths */ @@ -317,14 +314,20 @@ int dotcmd(int argc, char **argv) { - char *fullname; + char *filename, *fullname; if (argc < 2) error("missing filename"); exitstatus = 0; - fullname = find_dot_file(argv[1]); + /* + * Because we have historically not supported any options, + * only treat "--" specially. + */ + filename = argc > 2 && strcmp(argv[1], "--") == 0 ? argv[2] : argv[1]; + + fullname = find_dot_file(filename); setinputfile(fullname, 1); commandname = fullname; cmdloop(0); @@ -336,8 +339,6 @@ int exitcmd(int argc, char **argv) { - extern int oexitstatus; - if (stoppedjobs()) return 0; if (argc > 1) Index: bin/sh/expand.h =================================================================== --- bin/sh/expand.h (revision 209229) +++ bin/sh/expand.h (working copy) @@ -58,7 +58,7 @@ void expandhere(union node *, int); void expandarg(union node *, struct arglist *, int); void expari(int); -int patmatch(char *, char *, int); +int patmatch(const char *, const char *, int); void rmescapes(char *); -int casematch(union node *, char *); +int casematch(union node *, const char *); int wordexpcmd(int, char **); Index: bin/sh/exec.c =================================================================== --- bin/sh/exec.c (revision 209229) +++ bin/sh/exec.c (working copy) @@ -98,7 +98,7 @@ STATIC void tryexec(char *, char **, char **); STATIC void printentry(struct tblentry *, int); -STATIC struct tblentry *cmdlookup(char *, int); +STATIC struct tblentry *cmdlookup(const char *, int); STATIC void delete_cmd_entry(void); @@ -109,7 +109,7 @@ */ void -shellexec(char **argv, char **envp, char *path, int index) +shellexec(char **argv, char **envp, const char *path, int idx) { char *cmdname; int e; @@ -120,7 +120,7 @@ } else { e = ENOENT; while ((cmdname = padvance(&path, argv[0])) != NULL) { - if (--index < 0 && pathopt == NULL) { + if (--idx < 0 && pathopt == NULL) { tryexec(cmdname, argv, envp); if (errno != ENOENT && errno != ENOTDIR) e = errno; @@ -175,13 +175,13 @@ * NULL. */ -char *pathopt; +const char *pathopt; char * -padvance(char **path, char *name) +padvance(const char **path, const char *name) { - char *p, *q; - char *start; + const char *p, *start; + char *q; int len; if (*path == NULL) @@ -248,14 +248,14 @@ && (cmdp->cmdtype == CMDNORMAL || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0))) delete_cmd_entry(); - find_command(name, &entry, 1, pathval()); + find_command(name, &entry, DO_ERR, pathval()); if (verbose) { if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ cmdp = cmdlookup(name, 0); if (cmdp != NULL) printentry(cmdp, verbose); else - outfmt(&errout, "%s: not found\n", name); + outfmt(out2, "%s: not found\n", name); } flushall(); } @@ -268,17 +268,17 @@ STATIC void printentry(struct tblentry *cmdp, int verbose) { - int index; - char *path; + int idx; + const char *path; char *name; if (cmdp->cmdtype == CMDNORMAL) { - index = cmdp->param.index; + idx = cmdp->param.index; path = pathval(); do { name = padvance(&path, cmdp->cmdname); stunalloc(name); - } while (--index >= 0); + } while (--idx >= 0); out1str(name); } else if (cmdp->cmdtype == CMDBUILTIN) { out1fmt("builtin %s", cmdp->cmdname); @@ -310,10 +310,11 @@ */ void -find_command(char *name, struct cmdentry *entry, int printerr, char *path) +find_command(const char *name, struct cmdentry *entry, int act, + const char *path) { - struct tblentry *cmdp; - int index; + struct tblentry *cmdp, loc_cmd; + int idx; int prev; char *fullname; struct stat statb; @@ -329,13 +330,19 @@ } /* If name is in the table, and not invalidated by cd, we're done */ - if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) - goto success; + if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) { + if (cmdp->cmdtype == CMDFUNCTION && act & DO_NOFUNC) + cmdp = NULL; + else + goto success; + } /* If %builtin not in path, check for builtin next */ if (builtinloc < 0 && (i = find_builtin(name, &spec)) >= 0) { INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDBUILTIN; cmdp->param.index = i; cmdp->special = spec; @@ -353,17 +360,19 @@ } e = ENOENT; - index = -1; + idx = -1; loop: while ((fullname = padvance(&path, name)) != NULL) { stunalloc(fullname); - index++; + idx++; if (pathopt) { if (prefix("builtin", pathopt)) { if ((i = find_builtin(name, &spec)) < 0) goto loop; INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDBUILTIN; cmdp->param.index = i; cmdp->special = spec; @@ -376,8 +385,8 @@ } } /* if rehash, don't redo absolute path names */ - if (fullname[0] == '/' && index <= prev) { - if (index < prev) + if (fullname[0] == '/' && idx <= prev) { + if (idx < prev) goto loop; TRACE(("searchexec \"%s\": no change\n", name)); goto success; @@ -413,22 +422,25 @@ TRACE(("searchexec \"%s\" returns \"%s\"\n", name, fullname)); INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDNORMAL; - cmdp->param.index = index; + cmdp->param.index = idx; INTON; goto success; } /* We failed. If there was an entry for this command, delete it */ - if (cmdp) + if (cmdp && cmdp->cmdtype != CMDFUNCTION) delete_cmd_entry(); - if (printerr) { + if (act & DO_ERR) { if (e == ENOENT || e == ENOTDIR) outfmt(out2, "%s: not found\n", name); else outfmt(out2, "%s: %s\n", name, strerror(e)); } entry->cmdtype = CMDUNKNOWN; + entry->u.index = 0; return; success: @@ -445,7 +457,7 @@ */ int -find_builtin(char *name, int *special) +find_builtin(const char *name, int *special) { const struct builtincmd *bp; @@ -492,18 +504,18 @@ changepath(const char *newval) { const char *old, *new; - int index; + int idx; int firstchange; int bltin; old = pathval(); new = newval; firstchange = 9999; /* assume no change */ - index = 0; + idx = 0; bltin = -1; for (;;) { if (*old != *new) { - firstchange = index; + firstchange = idx; if ((*old == '\0' && *new == ':') || (*old == ':' && *new == '\0')) firstchange++; @@ -512,9 +524,9 @@ if (*new == '\0') break; if (*new == '%' && bltin < 0 && prefix("builtin", new + 1)) - bltin = index; + bltin = idx; if (*new == ':') { - index++; + idx++; } new++, old++; } @@ -607,10 +619,10 @@ STATIC struct tblentry * -cmdlookup(char *name, int add) +cmdlookup(const char *name, int add) { int hashval; - char *p; + const char *p; struct tblentry *cmdp; struct tblentry **pp; @@ -663,7 +675,7 @@ */ void -addcmdentry(char *name, struct cmdentry *entry) +addcmdentry(const char *name, struct cmdentry *entry) { struct tblentry *cmdp; @@ -683,7 +695,7 @@ */ void -defun(char *name, union node *func) +defun(const char *name, union node *func) { struct cmdentry entry; @@ -700,7 +712,7 @@ */ int -unsetfunc(char *name) +unsetfunc(const char *name) { struct tblentry *cmdp; @@ -718,19 +730,21 @@ */ int -typecmd_impl(int argc, char **argv, int cmd) +typecmd_impl(int argc, char **argv, int cmd, const char *path) { struct cmdentry entry; struct tblentry *cmdp; - char **pp; + const char *const *pp; struct alias *ap; int i; - int error = 0; - extern char *const parsekwd[]; + int error1 = 0; + if (path != pathval()) + clearcmdentry(0); + for (i = 1; i < argc; i++) { /* First look at the keywords */ - for (pp = (char **)parsekwd; *pp; pp++) + for (pp = parsekwd; *pp; pp++) if (**pp == *argv[i] && equal(*pp, argv[i])) break; @@ -760,16 +774,17 @@ } else { /* Finally use brute force */ - find_command(argv[i], &entry, 0, pathval()); + find_command(argv[i], &entry, 0, path); } switch (entry.cmdtype) { case CMDNORMAL: { if (strchr(argv[i], '/') == NULL) { - char *path = pathval(), *name; + const char *path2 = path; + char *name; int j = entry.u.index; do { - name = padvance(&path, argv[i]); + name = padvance(&path2, argv[i]); stunalloc(name); } while (--j >= 0); if (cmd == TYPECMD_SMALLV) @@ -790,7 +805,7 @@ if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: %s\n", argv[i], strerror(errno)); - error |= 127; + error1 |= 127; } } break; @@ -815,11 +830,15 @@ default: if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: not found\n", argv[i]); - error |= 127; + error1 |= 127; break; } } - return error; + + if (path != pathval()) + clearcmdentry(0); + + return error1; } /* @@ -829,5 +848,5 @@ int typecmd(int argc, char **argv) { - return typecmd_impl(argc, argv, TYPECMD_TYPE); + return typecmd_impl(argc, argv, TYPECMD_TYPE, bltinlookup("PATH", 1)); } Index: bin/sh/miscbltin.c =================================================================== --- bin/sh/miscbltin.c (revision 209229) +++ bin/sh/miscbltin.c (working copy) @@ -93,7 +93,7 @@ char c; int rflag; char *prompt; - char *ifs; + const char *ifs; char *p; int startword; int status; @@ -254,7 +254,7 @@ int -umaskcmd(int argc __unused, char **argv) +umaskcmd(int argc __unused, char **argv __unused) { char *ap; int mask; Index: bin/sh/cd.c =================================================================== --- bin/sh/cd.c (revision 209229) +++ bin/sh/cd.c (working copy) @@ -70,6 +70,7 @@ STATIC char *getcomponent(void); STATIC char *findcwd(char *); STATIC void updatepwd(char *); +STATIC char *getpwd(void); STATIC char *getpwd2(void); STATIC char *curdir = NULL; /* current working directory */ @@ -79,8 +80,8 @@ int cdcmd(int argc, char **argv) { - char *dest; - char *path; + const char *dest; + const char *path; char *p; struct stat statb; int ch, phys, print = 0; @@ -351,7 +352,7 @@ /* * Get the current directory and cache the result in curdir. */ -char * +STATIC char * getpwd(void) { char *p; @@ -374,7 +375,6 @@ STATIC char * getpwd2(void) { - struct stat stdot, stpwd; char *pwd; int i; @@ -387,12 +387,29 @@ break; } - pwd = getenv("PWD"); + return NULL; +} + +/* + * Initialize PWD in a new shell. + * If the shell is interactive, we need to warn if this fails. + */ +void +pwd_init(int warn) +{ + char *pwd; + struct stat stdot, stpwd; + + pwd = lookupvar("PWD"); if (pwd && *pwd == '/' && stat(".", &stdot) != -1 && stat(pwd, &stpwd) != -1 && stdot.st_dev == stpwd.st_dev && stdot.st_ino == stpwd.st_ino) { - return pwd; + if (curdir) + ckfree(curdir); + curdir = savestr(pwd); } - return NULL; + if (getpwd() == NULL && warn) + out2fmt_flush("sh: cannot determine working directory\n"); + setvar("PWD", curdir, VEXPORT); } Index: bin/sh/eval.c =================================================================== --- bin/sh/eval.c (revision 209229) +++ bin/sh/eval.c (working copy) @@ -74,7 +74,7 @@ #endif -MKINIT int evalskip; /* set if we are skipping commands */ +int evalskip; /* set if we are skipping commands */ STATIC int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ @@ -91,6 +91,7 @@ STATIC void evalfor(union node *, int); STATIC void evalcase(union node *, int); STATIC void evalsubshell(union node *, int); +STATIC void evalredir(union node *, int); STATIC void expredir(union node *); STATIC void evalpipe(union node *); STATIC void evalcommand(union node *, int, struct backcmd *); @@ -221,10 +222,7 @@ evaltree(n->nbinary.ch2, flags); break; case NREDIR: - expredir(n->nredir.redirect); - redirect(n->nredir.redirect, REDIR_PUSH); - evaltree(n->nredir.n, flags); - popredir(); + evalredir(n, flags); break; case NSUBSHELL: evalsubshell(n, flags); @@ -407,8 +405,7 @@ flags &=~ EV_TESTED; redirect(n->nredir.redirect, 0); evaltree(n->nredir.n, flags | EV_EXIT); /* never returns */ - } - if (! backgnd) { + } else if (! backgnd) { INTOFF; exitstatus = waitforjob(jp, (int *)NULL); INTON; @@ -416,7 +413,47 @@ } +/* + * Evaluate a redirected compound command. + */ +STATIC void +evalredir(union node *n, int flags) +{ + struct jmploc jmploc; + struct jmploc *savehandler; + volatile int in_redirect = 1; + + expredir(n->nredir.redirect); + savehandler = handler; + if (setjmp(jmploc.loc)) { + int e; + + handler = savehandler; + e = exception; + if (e == EXERROR || e == EXEXEC) { + popredir(); + if (in_redirect) { + exitstatus = 2; + return; + } + } + longjmp(handler->loc, 1); + } else { + INTOFF; + handler = &jmploc; + redirect(n->nredir.redirect, REDIR_PUSH); + in_redirect = 0; + INTON; + evaltree(n->nredir.n, flags); + } + INTOFF; + handler = savehandler; + popredir(); + INTON; +} + + /* * Compute the names of the files in a redirection list. */ @@ -593,10 +630,12 @@ char *savecmdname; struct shparam saveparam; struct localvar *savelocalvars; + struct parsefile *savetopfile; volatile int e; char *lastarg; int realstatus; int do_clearcmdentry; + char *path = pathval(); /* First expand the arguments. */ TRACE(("evalcommand(%p, %d) called\n", (void *)cmd, flags)); @@ -646,7 +685,7 @@ out2str(ps4val()); for (sp = varlist.list ; sp ; sp = sp->next) { if (sep != 0) - outc(' ', &errout); + out2c(' '); p = sp->text; while (*p != '=' && *p != '\0') out2c(*p++); @@ -658,7 +697,7 @@ } for (sp = arglist.list ; sp ; sp = sp->next) { if (sep != 0) - outc(' ', &errout); + out2c(' '); /* Disambiguate command looking like assignment. */ if (sp == arglist.list && strchr(sp->text, '=') != NULL && @@ -670,7 +709,7 @@ out2qstr(sp->text); sep = ' '; } - outc('\n', &errout); + out2c('\n'); flushout(&errout); } @@ -679,10 +718,10 @@ /* Variable assignment(s) without command */ cmdentry.cmdtype = CMDBUILTIN; cmdentry.u.index = BLTINCMD; - cmdentry.special = 1; + cmdentry.special = 0; } else { static const char PATH[] = "PATH="; - char *path = pathval(); + int cmd_flags = 0, bltinonly = 0; /* * Modify the command lookup path, if a PATH= assignment @@ -713,42 +752,79 @@ do_clearcmdentry = 1; } - find_command(argv[0], &cmdentry, 1, path); - if (cmdentry.cmdtype == CMDUNKNOWN) { /* command not found */ - exitstatus = 127; - flushout(&errout); - return; - } - /* implement the bltin builtin here */ - if (cmdentry.cmdtype == CMDBUILTIN && cmdentry.u.index == BLTINCMD) { - for (;;) { + for (;;) { + if (bltinonly) { + cmdentry.u.index = find_builtin(*argv, &cmdentry.special); + if (cmdentry.u.index < 0) { + cmdentry.u.index = BLTINCMD; + argv--; + argc++; + break; + } + } else + find_command(argv[0], &cmdentry, cmd_flags, path); + /* implement the bltin and command builtins here */ + if (cmdentry.cmdtype != CMDBUILTIN) + break; + if (cmdentry.u.index == BLTINCMD) { + if (argc == 1) + break; argv++; - if (--argc == 0) + argc--; + bltinonly = 1; + } else if (cmdentry.u.index == COMMANDCMD) { + if (argc == 1) break; - if ((cmdentry.u.index = find_builtin(*argv, - &cmdentry.special)) < 0) { - outfmt(&errout, "%s: not found\n", *argv); - exitstatus = 127; - flushout(&errout); - return; + if (!strcmp(argv[1], "-p")) { + if (argc == 2) + break; + if (argv[2][0] == '-') { + if (strcmp(argv[2], "--")) + break; + if (argc == 3) + break; + argv += 3; + argc -= 3; + } else { + argv += 2; + argc -= 2; + } + path = _PATH_STDPATH; + clearcmdentry(0); + do_clearcmdentry = 1; + } else if (!strcmp(argv[1], "--")) { + if (argc == 2) + break; + argv += 2; + argc -= 2; + } else if (argv[1][0] == '-') + break; + else { + argv++; + argc--; } - if (cmdentry.u.index != BLTINCMD) - break; - } + cmd_flags |= DO_NOFUNC; + bltinonly = 0; + } else + break; } + /* + * Special builtins lose their special properties when + * called via 'command'. + */ + if (cmd_flags & DO_NOFUNC) + cmdentry.special = 0; } /* Fork off a child process if necessary. */ if (cmd->ncmd.backgnd - || (cmdentry.cmdtype == CMDNORMAL + || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 && (cmdentry.cmdtype != CMDBUILTIN || cmdentry.u.index == CDCMD || cmdentry.u.index == DOTCMD - || cmdentry.u.index == EVALCMD)) - || (cmdentry.cmdtype == CMDBUILTIN && - cmdentry.u.index == COMMANDCMD)) { + || cmdentry.u.index == EVALCMD))) { jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; if (flags & EV_BACKCMD) { @@ -775,7 +851,6 @@ #ifdef DEBUG trputs("Shell function: "); trargs(argv); #endif - redirect(cmd->ncmd.redirect, REDIR_PUSH); saveparam = shellparam; shellparam.malloc = 0; shellparam.reset = 1; @@ -786,7 +861,6 @@ savelocalvars = localvars; localvars = NULL; reffunc(cmdentry.u.func); - INTON; savehandler = handler; if (setjmp(jmploc.loc)) { if (exception == EXSHELLPROC) @@ -794,23 +868,27 @@ else { freeparam(&shellparam); shellparam = saveparam; + if (exception == EXERROR || exception == EXEXEC) + popredir(); } unreffunc(cmdentry.u.func); poplocalvars(); localvars = savelocalvars; + funcnest--; handler = savehandler; longjmp(handler->loc, 1); } handler = &jmploc; + funcnest++; + redirect(cmd->ncmd.redirect, REDIR_PUSH); + INTON; for (sp = varlist.list ; sp ; sp = sp->next) mklocal(sp->text); - funcnest++; exitstatus = oexitstatus; if (flags & EV_TESTED) evaltree(getfuncnode(cmdentry.u.func), EV_TESTED); else evaltree(getfuncnode(cmdentry.u.func), 0); - funcnest--; INTOFF; unreffunc(cmdentry.u.func); poplocalvars(); @@ -818,6 +896,7 @@ freeparam(&shellparam); shellparam = saveparam; handler = savehandler; + funcnest--; popredir(); INTON; if (evalskip == SKIPFUNC) { @@ -836,8 +915,10 @@ memout.nextc = memout.buf; memout.bufsize = 64; mode |= REDIR_BACKQ; + cmdentry.special = 0; } savecmdname = commandname; + savetopfile = getcurrentfile(); cmdenviron = varlist.list; e = -1; savehandler = handler; @@ -848,15 +929,25 @@ } handler = &jmploc; redirect(cmd->ncmd.redirect, mode); + /* + * If there is no command word, redirection errors should + * not be fatal but assignment errors should. + */ + if (argc == 0 && !(flags & EV_BACKCMD)) + cmdentry.special = 1; if (cmdentry.special) listsetvar(cmdenviron); + if (argc > 0) + bltinsetlocale(); commandname = argv[0]; argptr = argv + 1; - optptr = NULL; /* initialize nextopt */ + nextopt_optptr = NULL; /* initialize nextopt */ builtin_flags = flags; exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv); flushall(); cmddone: + if (argc > 0) + bltinunsetlocale(); cmdenviron = NULL; out1 = &output; out2 = &errout; @@ -868,29 +959,31 @@ } } handler = savehandler; + if (flags == EV_BACKCMD) { + backcmd->buf = memout.buf; + backcmd->nleft = memout.nextc - memout.buf; + memout.buf = NULL; + } + if (cmdentry.u.index != EXECCMD && + (e == -1 || e == EXERROR || e == EXEXEC)) + popredir(); if (e != -1) { if ((e != EXERROR && e != EXEXEC) || cmdentry.special) exraise(e); - FORCEINTON; + popfilesupto(savetopfile); + if (flags != EV_BACKCMD) + FORCEINTON; } - if (cmdentry.u.index != EXECCMD) - popredir(); - if (flags == EV_BACKCMD) { - backcmd->buf = memout.buf; - backcmd->nleft = memout.nextc - memout.buf; - memout.buf = NULL; - } } else { #ifdef DEBUG trputs("normal command: "); trargs(argv); #endif - clearredir(); redirect(cmd->ncmd.redirect, 0); for (sp = varlist.list ; sp ; sp = sp->next) setvareq(sp->text, VEXPORT|VSTACK); envp = environment(); - shellexec(argv, envp, pathval(), cmdentry.u.index); + shellexec(argv, envp, path, cmdentry.u.index); /*NOTREACHED*/ } goto out; @@ -946,12 +1039,17 @@ */ /* - * No command given, or a bltin command with no arguments. + * No command given, a bltin command with no arguments, or a bltin command + * with an invalid name. */ int -bltincmd(int argc __unused, char **argv __unused) +bltincmd(int argc, char **argv) { + if (argc > 1) { + out2fmt_flush("%s: not found\n", argv[1]); + return 127; + } /* * Preserve exitstatus of a previous possible redirection * as POSIX mandates @@ -991,23 +1089,18 @@ int commandcmd(int argc, char **argv) { - static char stdpath[] = _PATH_STDPATH; - struct jmploc loc, *old; - struct strlist *sp; - char *path; + const char *path; int ch; int cmd = -1; - for (sp = cmdenviron; sp ; sp = sp->next) - setvareq(sp->text, VEXPORT|VSTACK); - path = pathval(); + path = bltinlookup("PATH", 1); optind = optreset = 1; opterr = 0; while ((ch = getopt(argc, argv, "pvV")) != -1) { switch (ch) { case 'p': - path = stdpath; + path = _PATH_STDPATH; break; case 'v': cmd = TYPECMD_SMALLV; @@ -1026,24 +1119,16 @@ if (cmd != -1) { if (argc != 1) error("wrong number of arguments"); - return typecmd_impl(2, argv - 1, cmd); + return typecmd_impl(2, argv - 1, cmd, path); } - if (argc != 0) { - old = handler; - handler = &loc; - if (setjmp(handler->loc) == 0) - shellexec(argv, environment(), path, 0); - handler = old; - if (exception == EXEXEC) - exit(exerrno); - exraise(exception); - } + if (argc != 0) + error("commandcmd() called while it should not be"); /* * Do nothing successfully if no command was specified; * ksh also does this. */ - exit(0); + return 0; } @@ -1085,6 +1170,12 @@ int execcmd(int argc, char **argv) { + /* + * Because we have historically not supported any options, + * only treat "--" specially. + */ + if (argc > 1 && strcmp(argv[1], "--") == 0) + argc--, argv++; if (argc > 1) { struct strlist *sp; Index: bin/sh/var.c =================================================================== --- bin/sh/var.c (revision 209229) +++ bin/sh/var.c (working copy) @@ -73,13 +73,14 @@ struct varinit { struct var *var; int flags; - char *text; + const char *text; void (*func)(const char *); }; #ifndef NO_HISTORY struct var vhistsize; +struct var vterm; #endif struct var vifs; struct var vmail; @@ -94,27 +95,31 @@ STATIC const struct varinit varinit[] = { #ifndef NO_HISTORY - { &vhistsize, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE=", + { &vhistsize, VUNSET, "HISTSIZE=", sethistsize }, #endif - { &vifs, VSTRFIXED|VTEXTFIXED, "IFS= \t\n", + { &vifs, 0, "IFS= \t\n", NULL }, - { &vmail, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL=", + { &vmail, VUNSET, "MAIL=", NULL }, - { &vmpath, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH=", + { &vmpath, VUNSET, "MAILPATH=", NULL }, - { &vpath, VSTRFIXED|VTEXTFIXED, "PATH=" _PATH_DEFPATH, + { &vpath, 0, "PATH=" _PATH_DEFPATH, changepath }, - { &vppid, VSTRFIXED|VTEXTFIXED|VUNSET, "PPID=", + { &vppid, VUNSET, "PPID=", NULL }, /* * vps1 depends on uid */ - { &vps2, VSTRFIXED|VTEXTFIXED, "PS2=> ", + { &vps2, 0, "PS2=> ", NULL }, - { &vps4, VSTRFIXED|VTEXTFIXED, "PS4=+ ", + { &vps4, 0, "PS4=+ ", NULL }, - { &voptind, VSTRFIXED|VTEXTFIXED, "OPTIND=1", +#ifndef NO_HISTORY + { &vterm, VUNSET, "TERM=", + setterm }, +#endif + { &voptind, 0, "OPTIND=1", getoptsreset }, { NULL, 0, NULL, NULL } @@ -122,19 +127,27 @@ STATIC struct var *vartab[VTABSIZE]; -STATIC struct var **hashvar(char *); -STATIC int varequal(char *, char *); -STATIC int localevar(char *); +STATIC const char *const locale_names[7] = { + "LC_COLLATE", "LC_CTYPE", "LC_MONETARY", + "LC_NUMERIC", "LC_TIME", "LC_MESSAGES", NULL +}; +STATIC const int locale_categories[7] = { + LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, LC_MESSAGES, 0 +}; +STATIC struct var **hashvar(const char *); +STATIC int varequal(const char *, const char *); +STATIC int localevar(const char *); + /* * Initialize the variable symbol tables and import the environment. */ #ifdef mkinit INCLUDE "var.h" +MKINIT char **environ; INIT { char **envp; - extern char **environ; initvar(); for (envp = environ ; *envp ; envp++) { @@ -164,8 +177,8 @@ vpp = hashvar(ip->text); vp->next = *vpp; *vpp = vp; - vp->text = ip->text; - vp->flags = ip->flags; + vp->text = __DECONST(char *, ip->text); + vp->flags = ip->flags | VSTRFIXED | VTEXTFIXED; vp->func = ip->func; } } @@ -176,7 +189,7 @@ vpp = hashvar("PS1="); vps1.next = *vpp; *vpp = &vps1; - vps1.text = geteuid() ? "PS1=$ " : "PS1=# "; + vps1.text = __DECONST(char *, geteuid() ? "PS1=$ " : "PS1=# "); vps1.flags = VSTRFIXED|VTEXTFIXED; } if ((vppid.flags & VEXPORT) == 0) { @@ -190,12 +203,14 @@ */ int -setvarsafe(char *name, char *val, int flags) +setvarsafe(const char *name, const char *val, int flags) { struct jmploc jmploc; struct jmploc *const savehandler = handler; int err = 0; + int inton; + inton = is_int_on(); if (setjmp(jmploc.loc)) err = 1; else { @@ -203,6 +218,7 @@ setvar(name, val, flags); } handler = savehandler; + SETINTON(inton); return err; } @@ -212,9 +228,9 @@ */ void -setvar(char *name, char *val, int flags) +setvar(const char *name, const char *val, int flags) { - char *p, *q; + const char *p; int len; int namelen; char *nameeq; @@ -242,25 +258,20 @@ } else { len += strlen(val); } - p = nameeq = ckmalloc(len); - q = name; - while (--namelen >= 0) - *p++ = *q++; - *p++ = '='; - *p = '\0'; + nameeq = ckmalloc(len); + memcpy(nameeq, name, namelen); + nameeq[namelen] = '='; if (val) - scopy(val, p); + scopy(val, nameeq + namelen + 1); + else + nameeq[namelen + 1] = '\0'; setvareq(nameeq, flags); } STATIC int -localevar(char *s) +localevar(const char *s) { - static char *lnames[7] = { - "ALL", "COLLATE", "CTYPE", "MONETARY", - "NUMERIC", "TIME", NULL - }; - char **ss; + const char *const *ss; if (*s != 'L') return 0; @@ -268,8 +279,10 @@ return 1; if (strncmp(s + 1, "C_", 2) != 0) return 0; - for (ss = lnames; *ss ; ss++) - if (varequal(s + 3, *ss)) + if (varequal(s + 3, "ALL")) + return 1; + for (ss = locale_names; *ss ; ss++) + if (varequal(s + 3, *ss + 3)) return 1; return 0; } @@ -280,7 +293,7 @@ * pointer into environ where the string should not be manipulated. */ static void -change_env(char *s, int set) +change_env(const char *s, int set) { char *eqp; char *ss; @@ -391,7 +404,7 @@ */ char * -lookupvar(char *name) +lookupvar(const char *name) { struct var *v; @@ -414,7 +427,7 @@ */ char * -bltinlookup(char *name, int doall) +bltinlookup(const char *name, int doall) { struct strlist *sp; struct var *v; @@ -435,8 +448,63 @@ } +/* + * Set up locale for a builtin (LANG/LC_* assignments). + */ +void +bltinsetlocale(void) +{ + struct strlist *lp; + int act = 0; + char *loc, *locdef; + int i; + for (lp = cmdenviron ; lp ; lp = lp->next) { + if (localevar(lp->text)) { + act = 1; + break; + } + } + if (!act) + return; + loc = bltinlookup("LC_ALL", 0); + INTOFF; + if (loc != NULL) { + setlocale(LC_ALL, loc); + INTON; + return; + } + locdef = bltinlookup("LANG", 0); + for (i = 0; locale_names[i] != NULL; i++) { + loc = bltinlookup(locale_names[i], 0); + if (loc == NULL) + loc = locdef; + if (loc != NULL) + setlocale(locale_categories[i], loc); + } + INTON; +} + /* + * Undo the effect of bltinlocaleset(). + */ +void +bltinunsetlocale(void) +{ + struct strlist *lp; + + INTOFF; + for (lp = cmdenviron ; lp ; lp = lp->next) { + if (localevar(lp->text)) { + setlocale(LC_ALL, ""); + return; + } + } + INTON; +} + + +/* * Generate a list of exported variables. This routine is used to construct * the third argument to execve when executing a program. */ @@ -472,9 +540,9 @@ * VSTACK set since these are currently allocated on the stack. */ -#ifdef mkinit MKINIT void shprocvar(void); +#ifdef mkinit SHELLPROC { shprocvar(); } @@ -798,7 +866,7 @@ */ int -unsetvar(char *s) +unsetvar(const char *s) { struct var **vpp; struct var *vp; @@ -838,7 +906,7 @@ */ STATIC struct var ** -hashvar(char *p) +hashvar(const char *p) { unsigned int hashval; @@ -857,7 +925,7 @@ */ STATIC int -varequal(char *p, char *q) +varequal(const char *p, const char *q) { while (*p == *q++) { if (*p++ == '=') Index: bin/sh/memalloc.c =================================================================== --- bin/sh/memalloc.c (revision 209229) +++ bin/sh/memalloc.c (working copy) @@ -95,7 +95,7 @@ */ char * -savestr(char *s) +savestr(const char *s) { char *p; Index: bin/sh/main.h =================================================================== --- bin/sh/main.h (revision 209229) +++ bin/sh/main.h (working copy) @@ -35,8 +35,9 @@ extern int rootpid; /* pid of main shell */ extern int rootshell; /* true if we aren't a child of the main shell */ +extern struct jmploc main_handler; /* top level exception handler */ -void readcmdfile(char *); +void readcmdfile(const char *); void cmdloop(int); int dotcmd(int, char **); int exitcmd(int, char **); Index: bin/sh/exec.h =================================================================== --- bin/sh/exec.h (revision 209229) +++ bin/sh/exec.h (working copy) @@ -57,20 +57,24 @@ }; -extern char *pathopt; /* set by padvance */ +/* action to find_command() */ +#define DO_ERR 0x01 /* prints errors */ +#define DO_NOFUNC 0x02 /* don't return shell functions, for command */ + +extern const char *pathopt; /* set by padvance */ extern int exerrno; /* last exec error */ -void shellexec(char **, char **, char *, int); -char *padvance(char **, char *); +void shellexec(char **, char **, const char *, int) __dead2; +char *padvance(const char **, const char *); int hashcmd(int, char **); -void find_command(char *, struct cmdentry *, int, char *); -int find_builtin(char *, int *); +void find_command(const char *, struct cmdentry *, int, const char *); +int find_builtin(const char *, int *); void hashcd(void); void changepath(const char *); void deletefuncs(void); -void addcmdentry(char *, struct cmdentry *); -void defun(char *, union node *); -int unsetfunc(char *); -int typecmd_impl(int, char **, int); +void addcmdentry(const char *, struct cmdentry *); +void defun(const char *, union node *); +int unsetfunc(const char *); +int typecmd_impl(int, char **, int, const char *); int typecmd(int, char **); void clearcmdentry(int); Index: bin/sh/alias.c =================================================================== --- bin/sh/alias.c (revision 209229) +++ bin/sh/alias.c (working copy) @@ -52,13 +52,13 @@ STATIC struct alias *atab[ATABSIZE]; STATIC int aliases; -STATIC void setalias(char *, char *); +STATIC void setalias(const char *, const char *); STATIC int unalias(const char *); STATIC struct alias **hashalias(const char *); STATIC void -setalias(char *name, char *val) +setalias(const char *name, const char *val) { struct alias *ap, **app; @@ -176,7 +176,7 @@ } struct alias * -lookupalias(char *name, int check) +lookupalias(const char *name, int check) { struct alias *ap = *hashalias(name); Index: bin/sh/cd.h =================================================================== --- bin/sh/cd.h (revision 209229) +++ bin/sh/cd.h (working copy) @@ -29,6 +29,6 @@ * $FreeBSD$ */ -char *getpwd(void); +void pwd_init(int); int cdcmd (int, char **); int pwdcmd(int, char **); Index: bin/sh/mkinit.c =================================================================== --- bin/sh/mkinit.c (revision 209229) +++ bin/sh/mkinit.c (working copy) @@ -102,9 +102,9 @@ */ struct event { - char *name; /* name of event (e.g. INIT) */ - char *routine; /* name of routine called on event */ - char *comment; /* comment describing routine */ + const char *name; /* name of event (e.g. INIT) */ + const char *routine; /* name of routine called on event */ + const char *comment; /* comment describing routine */ struct text code; /* code for handling event */ }; @@ -140,7 +140,7 @@ }; -char *curfile; /* current file */ +const char *curfile; /* current file */ int linno; /* current line */ char *header_files[200]; /* list of header files */ struct text defines; /* #define statements */ @@ -148,20 +148,20 @@ int amiddecls; /* for formatting */ -void readfile(char *); -int match(char *, char *); -int gooddefine(char *); -void doevent(struct event *, FILE *, char *); +void readfile(const char *); +int match(const char *, const char *); +int gooddefine(const char *); +void doevent(struct event *, FILE *, const char *); void doinclude(char *); void dodecl(char *, FILE *); void output(void); -void addstr(char *, struct text *); +void addstr(const char *, struct text *); void addchar(int, struct text *); void writetext(struct text *, FILE *); -FILE *ckfopen(char *, char *); +FILE *ckfopen(const char *, const char *); void *ckmalloc(size_t); -char *savestr(char *); -void error(char *); +char *savestr(const char *); +void error(const char *); #define equal(s1, s2) (strcmp(s1, s2) == 0) @@ -170,9 +170,9 @@ { char **ap; - header_files[0] = "\"shell.h\""; - header_files[1] = "\"mystring.h\""; - header_files[2] = "\"init.h\""; + header_files[0] = savestr("\"shell.h\""); + header_files[1] = savestr("\"mystring.h\""); + header_files[2] = savestr("\"init.h\""); for (ap = argv + 1 ; *ap ; ap++) readfile(*ap); output(); @@ -186,7 +186,7 @@ */ void -readfile(char *fname) +readfile(const char *fname) { FILE *fp; char line[1024]; @@ -230,9 +230,9 @@ int -match(char *name, char *line) +match(const char *name, const char *line) { - char *p, *q; + const char *p, *q; p = name, q = line; while (*p) { @@ -246,9 +246,9 @@ int -gooddefine(char *line) +gooddefine(const char *line) { - char *p; + const char *p; if (! match("#define", line)) return 0; /* not a define */ @@ -269,11 +269,11 @@ void -doevent(struct event *ep, FILE *fp, char *fname) +doevent(struct event *ep, FILE *fp, const char *fname) { char line[1024]; int indent; - char *p; + const char *p; sprintf(line, "\n /* from %s: */\n", fname); addstr(line, &ep->code); @@ -407,7 +407,7 @@ */ void -addstr(char *s, struct text *text) +addstr(const char *s, struct text *text) { while (*s) { if (--text->nleft < 0) @@ -452,7 +452,7 @@ } FILE * -ckfopen(char *file, char *mode) +ckfopen(const char *file, const char *mode) { FILE *fp; @@ -474,7 +474,7 @@ } char * -savestr(char *s) +savestr(const char *s) { char *p; @@ -484,7 +484,7 @@ } void -error(char *msg) +error(const char *msg) { if (curfile != NULL) fprintf(stderr, "%s:%d: ", curfile, linno); Index: bin/sh/options.c =================================================================== --- bin/sh/options.c (revision 209229) +++ bin/sh/options.c (working copy) @@ -64,7 +64,7 @@ struct shparam shellparam; /* current positional parameters */ char **argptr; /* argument list for builtin commands */ char *shoptarg; /* set by nextopt (like getopt) */ -char *optptr; /* used by nextopt */ +char *nextopt_optptr; /* used by nextopt */ char *minusc; /* argument to -c option */ @@ -93,8 +93,11 @@ options(1); if (*argptr == NULL && minusc == NULL) sflag = 1; - if (iflag == 2 && sflag == 1 && isatty(0) && isatty(1)) + if (iflag != 0 && sflag == 1 && isatty(0) && isatty(1)) { iflag = 1; + if (Eflag == 2) + Eflag = 1; + } if (mflag == 2) mflag = iflag; for (i = 0; i < NOPTS; i++) @@ -554,12 +557,13 @@ */ int -nextopt(char *optstring) +nextopt(const char *optstring) { - char *p, *q; + char *p; + const char *q; char c; - if ((p = optptr) == NULL || *p == '\0') { + if ((p = nextopt_optptr) == NULL || *p == '\0') { p = *argptr; if (p == NULL || *p != '-' || *++p == '\0') return '\0'; @@ -580,6 +584,6 @@ shoptarg = p; p = NULL; } - optptr = p; + nextopt_optptr = p; return c; } Index: bin/sh/eval.h =================================================================== --- bin/sh/eval.h (revision 209229) +++ bin/sh/eval.h (working copy) @@ -35,6 +35,7 @@ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ +extern int oexitstatus; /* saved exit status */ extern struct strlist *cmdenviron; /* environment for builtin command */ Index: bin/sh/parser.c =================================================================== --- bin/sh/parser.c (revision 209229) +++ bin/sh/parser.c (working copy) @@ -79,10 +79,13 @@ int striptabs; /* if set, strip leading tabs */ }; +struct parser_temp { + struct parser_temp *next; + void *data; +}; STATIC struct heredoc *heredoclist; /* list of here documents to read */ -STATIC int parsebackquote; /* nonzero if we are inside backquotes */ STATIC int doprompt; /* if set, prompt the user */ STATIC int needprompt; /* true if interactive and at start of line */ STATIC int lasttoken; /* last token read */ @@ -95,6 +98,7 @@ STATIC int quoteflag; /* set if (part of) last token was quoted */ STATIC int startlinno; /* line # where last token started */ STATIC int funclinno; /* line # where the current function started */ +STATIC struct parser_temp *parser_temp; /* XXX When 'noaliases' is set to one, no alias expansion takes place. */ static int noaliases = 0; @@ -114,10 +118,77 @@ STATIC int readtoken1(int, char const *, char *, int); STATIC int noexpand(char *); STATIC void synexpect(int); -STATIC void synerror(char *); +STATIC void synerror(const char *); STATIC void setprompt(int); +STATIC void * +parser_temp_alloc(size_t len) +{ + struct parser_temp *t; + + INTOFF; + t = ckmalloc(sizeof(*t)); + t->data = NULL; + t->next = parser_temp; + parser_temp = t; + t->data = ckmalloc(len); + INTON; + return t->data; +} + + +STATIC void * +parser_temp_realloc(void *ptr, size_t len) +{ + struct parser_temp *t; + + INTOFF; + t = parser_temp; + if (ptr != t->data) + error("bug: parser_temp_realloc misused"); + t->data = ckrealloc(t->data, len); + INTON; + return t->data; +} + + +STATIC void +parser_temp_free_upto(void *ptr) +{ + struct parser_temp *t; + int done = 0; + + INTOFF; + while (parser_temp != NULL && !done) { + t = parser_temp; + parser_temp = t->next; + done = t->data == ptr; + ckfree(t->data); + ckfree(t); + } + INTON; + if (!done) + error("bug: parser_temp_free_upto misused"); +} + + +STATIC void +parser_temp_free_all(void) +{ + struct parser_temp *t; + + INTOFF; + while (parser_temp != NULL) { + t = parser_temp; + parser_temp = t->next; + ckfree(t->data); + ckfree(t); + } + INTON; +} + + /* * Read and parse a command. Returns NEOF on end of file. (NULL is a * valid parse tree indicating a blank line.) @@ -128,6 +199,12 @@ { int t; + /* This assumes the parser is not re-entered, + * which could happen if we add command substitution on PS1/PS2. + */ + parser_temp_free_all(); + heredoclist = NULL; + tokpushback = 0; doprompt = interact; if (doprompt) @@ -864,8 +941,190 @@ } +#define MAXNEST_STATIC 8 +struct tokenstate +{ + const char *syntax; /* *SYNTAX */ + int parenlevel; /* levels of parentheses in arithmetic */ + enum tokenstate_category + { + TSTATE_TOP, + TSTATE_VAR_OLD, /* ${var+-=?}, inherits dquotes */ + TSTATE_VAR_NEW, /* other ${var...}, own dquote state */ + TSTATE_ARITH + } category; +}; + /* + * Called to parse command substitutions. + */ + +STATIC char * +parsebackq(char *out, struct nodelist **pbqlist, + int oldstyle, int dblquote, int quoted) +{ + struct nodelist **nlpp; + union node *n; + char *volatile str; + struct jmploc jmploc; + struct jmploc *const savehandler = handler; + int savelen; + int saveprompt; + const int bq_startlinno = plinno; + char *volatile ostr = NULL; + struct parsefile *const savetopfile = getcurrentfile(); + struct heredoc *const saveheredoclist = heredoclist; + struct heredoc *here; + + str = NULL; + if (setjmp(jmploc.loc)) { + popfilesupto(savetopfile); + if (str) + ckfree(str); + if (ostr) + ckfree(ostr); + heredoclist = saveheredoclist; + handler = savehandler; + if (exception == EXERROR) { + startlinno = bq_startlinno; + synerror("Error in command substitution"); + } + longjmp(handler->loc, 1); + } + INTOFF; + savelen = out - stackblock(); + if (savelen > 0) { + str = ckmalloc(savelen); + memcpy(str, stackblock(), savelen); + } + handler = &jmploc; + heredoclist = NULL; + INTON; + if (oldstyle) { + /* We must read until the closing backquote, giving special + treatment to some slashes, and then push the string and + reread it as input, interpreting it normally. */ + char *oout; + int c; + int olen; + + + STARTSTACKSTR(oout); + for (;;) { + if (needprompt) { + setprompt(2); + needprompt = 0; + } + switch (c = pgetc()) { + case '`': + goto done; + + case '\\': + if ((c = pgetc()) == '\n') { + plinno++; + if (doprompt) + setprompt(2); + else + setprompt(0); + /* + * If eating a newline, avoid putting + * the newline into the new character + * stream (via the STPUTC after the + * switch). + */ + continue; + } + if (c != '\\' && c != '`' && c != '$' + && (!dblquote || c != '"')) + STPUTC('\\', oout); + break; + + case '\n': + plinno++; + needprompt = doprompt; + break; + + case PEOF: + startlinno = plinno; + synerror("EOF in backquote substitution"); + break; + + default: + break; + } + STPUTC(c, oout); + } +done: + STPUTC('\0', oout); + olen = oout - stackblock(); + INTOFF; + ostr = ckmalloc(olen); + memcpy(ostr, stackblock(), olen); + setinputstring(ostr, 1); + INTON; + } + nlpp = pbqlist; + while (*nlpp) + nlpp = &(*nlpp)->next; + *nlpp = (struct nodelist *)stalloc(sizeof (struct nodelist)); + (*nlpp)->next = NULL; + + if (oldstyle) { + saveprompt = doprompt; + doprompt = 0; + } + + n = list(0); + + if (oldstyle) + doprompt = saveprompt; + else { + if (readtoken() != TRP) + synexpect(TRP); + } + + (*nlpp)->n = n; + if (oldstyle) { + /* + * Start reading from old file again, ignoring any pushed back + * tokens left from the backquote parsing + */ + popfile(); + tokpushback = 0; + } + while (stackblocksize() <= savelen) + growstackblock(); + STARTSTACKSTR(out); + INTOFF; + if (str) { + memcpy(out, str, savelen); + STADJUST(savelen, out); + ckfree(str); + str = NULL; + } + if (ostr) { + ckfree(ostr); + ostr = NULL; + } + here = saveheredoclist; + if (here != NULL) { + while (here->next != NULL) + here = here->next; + here->next = heredoclist; + heredoclist = saveheredoclist; + } + handler = savehandler; + INTON; + if (quoted) + USTPUTC(CTLBACKQ | CTLQUOTE, out); + else + USTPUTC(CTLBACKQ, out); + return out; +} + + +/* * If eofmark is NULL, read a word or a redirection symbol. If eofmark * is not NULL, read a here document. In the latter case, eofmark is the * word which marks the end of the document and striptabs is true if @@ -880,12 +1139,10 @@ #define CHECKEND() {goto checkend; checkend_return:;} #define PARSEREDIR() {goto parseredir; parseredir_return:;} #define PARSESUB() {goto parsesub; parsesub_return:;} -#define PARSEBACKQOLD() {oldstyle = 1; goto parsebackq; parsebackq_oldreturn:;} -#define PARSEBACKQNEW() {oldstyle = 0; goto parsebackq; parsebackq_newreturn:;} #define PARSEARITH() {goto parsearith; parsearith_return:;} STATIC int -readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) +readtoken1(int firstc, char const *initialsyntax, char *eofmark, int striptabs) { int c = firstc; char *out; @@ -893,23 +1150,21 @@ char line[EOFMARKLEN + 1]; struct nodelist *bqlist; int quotef; - int dblquote; - int varnest; /* levels of variables expansion */ - int arinest; /* levels of arithmetic expansion */ - int parenlevel; /* levels of parens in arithmetic */ - int oldstyle; - char const *prevsyntax; /* syntax before arithmetic */ + int newvarnest; + int level; int synentry; + struct tokenstate state_static[MAXNEST_STATIC]; + int maxnest = MAXNEST_STATIC; + struct tokenstate *state = state_static; startlinno = plinno; - dblquote = 0; - if (syntax == DQSYNTAX) - dblquote = 1; quotef = 0; bqlist = NULL; - varnest = 0; - arinest = 0; - parenlevel = 0; + newvarnest = 0; + level = 0; + state[level].syntax = initialsyntax; + state[level].parenlevel = 0; + state[level].category = TSTATE_TOP; STARTSTACKSTR(out); loop: { /* for each line, until end of word */ @@ -917,11 +1172,11 @@ for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(3, out); /* permit 3 calls to USTPUTC */ - synentry = syntax[c]; + synentry = state[level].syntax[c]; switch(synentry) { case CNL: /* '\n' */ - if (syntax == BASESYNTAX) + if (state[level].syntax == BASESYNTAX) goto endword; /* exit outer loop */ USTPUTC(c, out); plinno++; @@ -935,7 +1190,7 @@ USTPUTC(c, out); break; case CCTL: - if (eofmark == NULL || dblquote) + if (eofmark == NULL || initialsyntax != SQSYNTAX) USTPUTC(CTLESC, out); USTPUTC(c, out); break; @@ -951,41 +1206,37 @@ else setprompt(0); } else { - if (dblquote && c != '\\' && - c != '`' && c != '$' && - (c != '"' || eofmark != NULL)) + if (state[level].syntax == DQSYNTAX && + c != '\\' && c != '`' && c != '$' && + (c != '"' || (eofmark != NULL && + newvarnest == 0)) && + (c != '}' || state[level].category != TSTATE_VAR_OLD)) USTPUTC('\\', out); if (SQSYNTAX[c] == CCTL) USTPUTC(CTLESC, out); - else if (eofmark == NULL) + else if (eofmark == NULL || + newvarnest > 0) USTPUTC(CTLQUOTEMARK, out); USTPUTC(c, out); quotef++; } break; case CSQUOTE: - if (eofmark == NULL) - USTPUTC(CTLQUOTEMARK, out); - syntax = SQSYNTAX; + USTPUTC(CTLQUOTEMARK, out); + state[level].syntax = SQSYNTAX; break; case CDQUOTE: - if (eofmark == NULL) - USTPUTC(CTLQUOTEMARK, out); - syntax = DQSYNTAX; - dblquote = 1; + USTPUTC(CTLQUOTEMARK, out); + state[level].syntax = DQSYNTAX; break; case CENDQUOTE: - if (eofmark != NULL && arinest == 0 && - varnest == 0) { + if (eofmark != NULL && newvarnest == 0) USTPUTC(c, out); - } else { - if (arinest) { - syntax = ARISYNTAX; - dblquote = 0; - } else if (eofmark == NULL) { - syntax = BASESYNTAX; - dblquote = 0; - } + else { + if (state[level].category == TSTATE_ARITH) + state[level].syntax = ARISYNTAX; + else + state[level].syntax = BASESYNTAX; quotef++; } break; @@ -993,30 +1244,33 @@ PARSESUB(); /* parse substitution */ break; case CENDVAR: /* '}' */ - if (varnest > 0) { - varnest--; + if (level > 0 && + (state[level].category == TSTATE_VAR_OLD || + state[level].category == TSTATE_VAR_NEW)) { + if (state[level].category == TSTATE_VAR_OLD) + state[level - 1].syntax = state[level].syntax; + else + newvarnest--; + level--; USTPUTC(CTLENDVAR, out); } else { USTPUTC(c, out); } break; case CLP: /* '(' in arithmetic */ - parenlevel++; + state[level].parenlevel++; USTPUTC(c, out); break; case CRP: /* ')' in arithmetic */ - if (parenlevel > 0) { + if (state[level].parenlevel > 0) { USTPUTC(c, out); - --parenlevel; + --state[level].parenlevel; } else { if (pgetc() == ')') { - if (--arinest == 0) { + if (level > 0 && + state[level].category == TSTATE_ARITH) { + level--; USTPUTC(CTLENDARI, out); - syntax = prevsyntax; - if (syntax == DQSYNTAX) - dblquote = 1; - else - dblquote = 0; } else USTPUTC(')', out); } else { @@ -1030,12 +1284,15 @@ } break; case CBQUOTE: /* '`' */ - PARSEBACKQOLD(); + out = parsebackq(out, &bqlist, 1, + state[level].syntax == DQSYNTAX && + (eofmark == NULL || newvarnest > 0), + state[level].syntax == DQSYNTAX || state[level].syntax == ARISYNTAX); break; case CEOF: goto endword; /* exit outer loop */ default: - if (varnest == 0) + if (level == 0) goto endword; /* exit outer loop */ USTPUTC(c, out); } @@ -1043,14 +1300,17 @@ } } endword: - if (syntax == ARISYNTAX) + if (state[level].syntax == ARISYNTAX) synerror("Missing '))'"); - if (syntax != BASESYNTAX && ! parsebackquote && eofmark == NULL) + if (state[level].syntax != BASESYNTAX && eofmark == NULL) synerror("Unterminated quoted string"); - if (varnest != 0) { + if (state[level].category == TSTATE_VAR_OLD || + state[level].category == TSTATE_VAR_NEW) { startlinno = plinno; synerror("Missing '}'"); } + if (state != state_static) + parser_temp_free_upto(state); USTPUTC('\0', out); len = out - stackblock(); out = stackblock(); @@ -1073,7 +1333,6 @@ /* end of readtoken routine */ - /* * Check to see whether we are at the end of the here document. When this * is called, c is set to the first character of the next input line. If @@ -1190,7 +1449,11 @@ PARSEARITH(); } else { pungetc(); - PARSEBACKQNEW(); + out = parsebackq(out, &bqlist, 0, + state[level].syntax == DQSYNTAX && + (eofmark == NULL || newvarnest > 0), + state[level].syntax == DQSYNTAX || + state[level].syntax == ARISYNTAX); } } else { USTPUTC(CTLVAR, out); @@ -1245,6 +1508,8 @@ subtype = VSERROR; if (c == '}') pungetc(); + else if (c == '\n' || c == PEOF) + synerror("Unexpected end of line in substitution"); else USTPUTC(c, out); } else { @@ -1261,6 +1526,8 @@ default: p = strchr(types, c); if (p == NULL) { + if (c == '\n' || c == PEOF) + synerror("Unexpected end of line in substitution"); if (flags == VSNUL) STPUTC(':', out); STPUTC(c, out); @@ -1286,192 +1553,74 @@ pungetc(); } STPUTC('=', out); - if (subtype != VSLENGTH && (dblquote || arinest)) + if (subtype != VSLENGTH && (state[level].syntax == DQSYNTAX || + state[level].syntax == ARISYNTAX)) flags |= VSQUOTE; *(stackblock() + typeloc) = subtype | flags; - if (subtype != VSNORMAL) - varnest++; + if (subtype != VSNORMAL) { + if (level + 1 >= maxnest) { + maxnest *= 2; + if (state == state_static) { + state = parser_temp_alloc( + maxnest * sizeof(*state)); + memcpy(state, state_static, + MAXNEST_STATIC * sizeof(*state)); + } else + state = parser_temp_realloc(state, + maxnest * sizeof(*state)); + } + level++; + state[level].parenlevel = 0; + if (subtype == VSMINUS || subtype == VSPLUS || + subtype == VSQUESTION || subtype == VSASSIGN) { + /* + * For operators that were in the Bourne shell, + * inherit the double-quote state. + */ + state[level].syntax = state[level - 1].syntax; + state[level].category = TSTATE_VAR_OLD; + } else { + /* + * The other operators take a pattern, + * so go to BASESYNTAX. + * Also, ' and " are now special, even + * in here documents. + */ + state[level].syntax = BASESYNTAX; + state[level].category = TSTATE_VAR_NEW; + newvarnest++; + } + } } goto parsesub_return; } /* - * Called to parse command substitutions. Newstyle is set if the command - * is enclosed inside $(...); nlpp is a pointer to the head of the linked - * list of commands (passed by reference), and savelen is the number of - * characters on the top of the stack which must be preserved. - */ - -parsebackq: { - struct nodelist **nlpp; - int savepbq; - union node *n; - char *volatile str; - struct jmploc jmploc; - struct jmploc *const savehandler = handler; - int savelen; - int saveprompt; - const int bq_startlinno = plinno; - - savepbq = parsebackquote; - if (setjmp(jmploc.loc)) { - if (str) - ckfree(str); - parsebackquote = 0; - handler = savehandler; - if (exception == EXERROR) { - startlinno = bq_startlinno; - synerror("Error in command substitution"); - } - longjmp(handler->loc, 1); - } - INTOFF; - str = NULL; - savelen = out - stackblock(); - if (savelen > 0) { - str = ckmalloc(savelen); - memcpy(str, stackblock(), savelen); - } - handler = &jmploc; - INTON; - if (oldstyle) { - /* We must read until the closing backquote, giving special - treatment to some slashes, and then push the string and - reread it as input, interpreting it normally. */ - char *out; - int c; - int savelen; - char *str; - - - STARTSTACKSTR(out); - for (;;) { - if (needprompt) { - setprompt(2); - needprompt = 0; - } - switch (c = pgetc()) { - case '`': - goto done; - - case '\\': - if ((c = pgetc()) == '\n') { - plinno++; - if (doprompt) - setprompt(2); - else - setprompt(0); - /* - * If eating a newline, avoid putting - * the newline into the new character - * stream (via the STPUTC after the - * switch). - */ - continue; - } - if (c != '\\' && c != '`' && c != '$' - && (!dblquote || c != '"')) - STPUTC('\\', out); - break; - - case '\n': - plinno++; - needprompt = doprompt; - break; - - case PEOF: - startlinno = plinno; - synerror("EOF in backquote substitution"); - break; - - default: - break; - } - STPUTC(c, out); - } -done: - STPUTC('\0', out); - savelen = out - stackblock(); - if (savelen > 0) { - str = ckmalloc(savelen); - memcpy(str, stackblock(), savelen); - setinputstring(str, 1); - } - } - nlpp = &bqlist; - while (*nlpp) - nlpp = &(*nlpp)->next; - *nlpp = (struct nodelist *)stalloc(sizeof (struct nodelist)); - (*nlpp)->next = NULL; - parsebackquote = oldstyle; - - if (oldstyle) { - saveprompt = doprompt; - doprompt = 0; - } - - n = list(0); - - if (oldstyle) - doprompt = saveprompt; - else { - if (readtoken() != TRP) - synexpect(TRP); - } - - (*nlpp)->n = n; - if (oldstyle) { - /* - * Start reading from old file again, ignoring any pushed back - * tokens left from the backquote parsing - */ - popfile(); - tokpushback = 0; - } - while (stackblocksize() <= savelen) - growstackblock(); - STARTSTACKSTR(out); - if (str) { - memcpy(out, str, savelen); - STADJUST(savelen, out); - INTOFF; - ckfree(str); - str = NULL; - INTON; - } - parsebackquote = savepbq; - handler = savehandler; - if (arinest || dblquote) - USTPUTC(CTLBACKQ | CTLQUOTE, out); - else - USTPUTC(CTLBACKQ, out); - if (oldstyle) - goto parsebackq_oldreturn; - else - goto parsebackq_newreturn; -} - -/* * Parse an arithmetic expansion (indicate start of one and set state) */ parsearith: { - if (++arinest == 1) { - prevsyntax = syntax; - syntax = ARISYNTAX; - USTPUTC(CTLARI, out); - if (dblquote) - USTPUTC('"',out); - else - USTPUTC(' ',out); - } else { - /* - * we collapse embedded arithmetic expansion to - * parenthesis, which should be equivalent - */ - USTPUTC('(', out); + if (level + 1 >= maxnest) { + maxnest *= 2; + if (state == state_static) { + state = parser_temp_alloc( + maxnest * sizeof(*state)); + memcpy(state, state_static, + MAXNEST_STATIC * sizeof(*state)); + } else + state = parser_temp_realloc(state, + maxnest * sizeof(*state)); } + level++; + state[level].syntax = ARISYNTAX; + state[level].parenlevel = 0; + state[level].category = TSTATE_ARITH; + USTPUTC(CTLARI, out); + if (state[level - 1].syntax == DQSYNTAX) + USTPUTC('"',out); + else + USTPUTC(' ',out); goto parsearith_return; } @@ -1516,9 +1665,9 @@ */ int -goodname(char *name) +goodname(const char *name) { - char *p; + const char *p; p = name; if (! is_name(*p)) @@ -1553,11 +1702,11 @@ STATIC void -synerror(char *msg) +synerror(const char *msg) { if (commandname) - outfmt(&errout, "%s: %d: ", commandname, startlinno); - outfmt(&errout, "Syntax error: %s\n", msg); + outfmt(out2, "%s: %d: ", commandname, startlinno); + outfmt(out2, "Syntax error: %s\n", msg); error((char *)NULL); } @@ -1569,7 +1718,10 @@ #ifndef NO_HISTORY if (!el) #endif + { out2str(getprompt(NULL)); + flushout(out2); + } } /* @@ -1582,13 +1734,14 @@ static char ps[PROMPTLEN]; char *fmt; int i, j, trim; + static char internal_error[] = ""; /* * Select prompt format. */ switch (whichprompt) { case 0: - fmt = ""; + fmt = nullstr; break; case 1: fmt = ps1val(); @@ -1597,7 +1750,7 @@ fmt = ps2val(); break; default: - return ""; + return internal_error; } /* Index: bin/sh/jobs.c =================================================================== --- bin/sh/jobs.c (revision 209229) +++ bin/sh/jobs.c (working copy) @@ -91,8 +91,9 @@ STATIC struct job *getjob(char *); STATIC pid_t dowait(int, struct job *); STATIC pid_t waitproc(int, int *); +STATIC void checkzombies(void); STATIC void cmdtxt(union node *); -STATIC void cmdputs(char *); +STATIC void cmdputs(const char *); #if JOBS STATIC void setcurjob(struct job *); STATIC void deljob(struct job *); @@ -146,7 +147,7 @@ do { /* while we are in the background */ initialpgrp = tcgetpgrp(ttyfd); if (initialpgrp < 0) { -out: out2str("sh: can't access tty; job control turned off\n"); +out: out2fmt_flush("sh: can't access tty; job control turned off\n"); mflag = 0; return; } @@ -400,7 +401,7 @@ struct job *jp; TRACE(("showjobs(%d) called\n", change)); - while (dowait(0, (struct job *)NULL) > 0); + checkzombies(); for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) { if (! jp->used) continue; @@ -742,6 +743,8 @@ TRACE(("forkshell(%%%d, %p, %d) called\n", jp - jobtab, (void *)n, mode)); INTOFF; + if (mode == FORK_BG) + checkzombies(); flushall(); pid = fork(); if (pid == -1) { @@ -757,6 +760,7 @@ TRACE(("Child shell %d\n", (int)getpid())); wasroot = rootshell; rootshell = 0; + handler = &main_handler; closescript(); INTON; clear_traps(); @@ -862,6 +866,7 @@ { #if JOBS pid_t mypgrp = getpgrp(); + int propagate_int = jp->jobctl && jp->foreground; #endif int status; int st; @@ -899,6 +904,11 @@ else CLEAR_PENDING_INT; } +#if JOBS + else if (rootshell && iflag && propagate_int && + WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) + kill(getpid(), SIGINT); +#endif INTON; return st; } @@ -1046,7 +1056,7 @@ if (jp->used == 0) continue; if (jp->state == JOBSTOPPED) { - out2str("You have stopped jobs.\n"); + out2fmt_flush("You have stopped jobs.\n"); job_warning = 2; return (1); } @@ -1055,6 +1065,15 @@ return (0); } + +STATIC void +checkzombies(void) +{ + while (njobs > 0 && dowait(0, NULL) > 0) + ; +} + + /* * Return a string identifying a command (to be printed by the * jobs command. @@ -1082,7 +1101,7 @@ { union node *np; struct nodelist *lp; - char *p; + const char *p; int i; char s[2]; @@ -1211,9 +1230,10 @@ STATIC void -cmdputs(char *s) +cmdputs(const char *s) { - char *p, *q; + const char *p; + char *q; char c; int subtype = 0; Index: bin/sh/arith.y =================================================================== --- bin/sh/arith.y (revision 209229) +++ bin/sh/arith.y (working copy) @@ -85,9 +85,9 @@ ARITH_LPAREN expr ARITH_RPAREN { $$ = $2; } | expr ARITH_OR expr - { $$ = $1 ? $1 : $3 ? $3 : 0; } | + { $$ = $1 || $3; } | expr ARITH_AND expr - { $$ = $1 ? ( $3 ? $3 : 0 ) : 0; } | + { $$ = $1 && $3; } | expr ARITH_BOR expr { $$ = $1 | $3; } | expr ARITH_BXOR expr @@ -265,7 +265,7 @@ #define YYPARSE_PARAM_TYPE arith_t * #define YYPARSE_PARAM result -char *arith_buf, *arith_startbuf; +const char *arith_buf, *arith_startbuf; int yylex(void); int yyparse(YYPARSE_PARAM_TYPE); @@ -284,10 +284,12 @@ } arith_t -arith(char *s) +arith(const char *s) { arith_t result; + struct stackmark smark; + setstackmark(&smark); arith_buf = arith_startbuf = s; INTOFF; @@ -295,11 +297,13 @@ arith_lex_reset(); /* Reprime lex. */ INTON; + popstackmark(&smark); + return result; } static void -yyerror(char *s) +yyerror(const char *s) { yyerrok; @@ -314,7 +318,7 @@ int expcmd(int argc, char **argv) { - char *p; + const char *p; char *concat; char **ap; arith_t i; @@ -354,7 +358,7 @@ printf("%d\n", exp(argv[1])); } -error(char *s) +error(const char *s) { fprintf(stderr, "exp: %s\n", s); exit(1); Index: bin/sh/var.h =================================================================== --- bin/sh/var.h (revision 209229) +++ bin/sh/var.h (working copy) @@ -77,6 +77,7 @@ extern struct var vps4; #ifndef NO_HISTORY extern struct var vhistsize; +extern struct var vterm; #endif /* @@ -96,19 +97,21 @@ #define optindval() (voptind.text + 7) #ifndef NO_HISTORY #define histsizeval() (vhistsize.text + 9) +#define termval() (vterm.text + 5) #endif #define mpathset() ((vmpath.flags & VUNSET) == 0) void initvar(void); -void setvar(char *, char *, int); +void setvar(const char *, const char *, int); void setvareq(char *, int); struct strlist; void listsetvar(struct strlist *); -char *lookupvar(char *); -char *bltinlookup(char *, int); +char *lookupvar(const char *); +char *bltinlookup(const char *, int); +void bltinsetlocale(void); +void bltinunsetlocale(void); char **environment(void); -void shprocvar(void); int showvarscmd(int, char **); int exportcmd(int, char **); int localcmd(int, char **); @@ -116,5 +119,5 @@ void poplocalvars(void); int setvarcmd(int, char **); int unsetcmd(int, char **); -int unsetvar(char *); -int setvarsafe(char *, char *, int); +int unsetvar(const char *); +int setvarsafe(const char *, const char *, int); --=-=-=-- From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 13:31:16 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E132A1065677 for ; Mon, 21 Jun 2010 13:31:16 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 30FE68FC0C for ; Mon, 21 Jun 2010 13:31:15 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA22531; Mon, 21 Jun 2010 16:30:58 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4C1F6991.1070501@icyb.net.ua> Date: Mon, 21 Jun 2010 16:30:57 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100517) MIME-Version: 1.0 To: Andrey Fesenko References: <4C1CFB72.5000806@fgznet.ch> <4C1D27F9.60709@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Andreas Tobler , freebsd-current Subject: Re: only 3 of 4GB memory available on amd64 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 13:31:17 -0000 on 21/06/2010 11:41 Andrey Fesenko said the following: > My notebook Toshiba U200-10H > Install 4Gb(2+2) bios detect 3,... not all > > SMAP > tipe=01 base=0000000000000000 len=000000000009fc00 > tipe=02 base=000000000009fc00 len=0000000000000400 > tipe=02 base=00000000000e0000 len=000000000000ee00 > tipe=04 base=00000000000eee00 len=0000000000000200 > tipe=02 base=00000000000ef000 len=0000000000011000 > tipe=01 base=0000000000100000 len=00000000cf690000 > tipe=02 base=00000000cf790000 len=0000000000010000 > tipe=02 base=00000000cf7a0000 len=0000000000060000 > tipe=02 base=00000000cf800000 len=0000000000800000 > tipe=02 base=00000000fec00000 len=0000000000018000 > tipe=02 base=00000000fec20000 len=0000000000008000 > tipe=02 base=00000000fed00000 len=0000000000000400 > tipe=02 base=00000000fed14000 len=0000000000006000 > tipe=02 base=00000000fed1c000 len=0000000000074000 > tipe=02 base=00000000feda0000 len=0000000000020000 > tipe=02 base=00000000fee00000 len=0000000000001000 > tipe=02 base=00000000ffb00000 len=0000000000100000 > tipe=02 base=00000000ffe00000 len=0000000000200000 Looks like your hardware+BIOS can/does not do memory hoisting. 786MB of your RAM can not be used. -- Andriy Gapon From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 13:51:21 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A37A106566B for ; Mon, 21 Jun 2010 13:51:21 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id EA00E8FC0A for ; Mon, 21 Jun 2010 13:51:20 +0000 (UTC) Received: by gyh20 with SMTP id 20so2928582gyh.13 for ; Mon, 21 Jun 2010 06:51:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; bh=7TuiQQdZX09aN38whC68oRu9uJrR8Rmx75w/zRqWgX4=; b=oPxLr7WtKwDCjhV0KEwi7QlLfp9fjnwWcg1Sms26QWqgsZ2yifEv53WaQ1sgn3hc83 WQs71cGTFH4NZLbkDkXAIEovf9L/uRSwn7bHFqXwsQeb/RIz38UTt71PFW7n01BxWxlt Mz/OSF5+ONZYQ1GGNYAnCOGHjBM6SESUUZzZ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:openpgp:content-type :content-transfer-encoding; b=lYSTNl2eWkZXE/p70Aj4HdUUa20nf9Gf6uAplhDyZ6YANG+jDJE/J5Wkcg4vUndvBN M6botHNVsCqPGcRI6T5pQVrsgISSVwhyPaJOcQvEXFUjo1clS/JyRTe77ML5eHs+3mqH IDSgncwsb7WVbL6hs4OO0JUS2hE81NuYrDCDw= Received: by 10.150.160.14 with SMTP id i14mr4295825ybe.144.1277128279554; Mon, 21 Jun 2010 06:51:19 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-128-180.dsl.klmzmi.sbcglobal.net [99.181.128.180]) by mx.google.com with ESMTPS id b3sm2482896ibf.13.2010.06.21.06.51.16 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 06:51:17 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C1F6E53.3040908@dataix.net> Date: Mon, 21 Jun 2010 09:51:15 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100620 Thunderbird MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <4C18304A.1080601@dataix.net> <4C18322A.6050007@dataix.net> <86wrtz5mk6.fsf@ds4.des.no> <4C1F576F.9090901@dataix.net> <86y6e8fuo1.fsf@ds4.des.no> <4C1F6148.9010300@dataix.net> <86pqzkfs19.fsf@ds4.des.no> In-Reply-To: <86pqzkfs19.fsf@ds4.des.no> X-Enigmail-Version: 1.0.1 OpenPGP: id=89D8547E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: "Sam Fourman Jr." , Brandon Gooch , FreeBSD Current , jilles@stack.nl Subject: Re: [MFC REQUEST] Filename completion in sh(1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 13:51:21 -0000 On 06/21/2010 09:12, Dag-Erling Smørgrav wrote: > jhell writes: >> Sorry but he only mention of filecomplete in your patch is in this >> section. That is exactly the same in the patch I had originally >> generated using SVN. > > Umm, the copy I have on my disk has those files. Just to be sure, I > just generated a new diff from the tree I tested it in. > > DES I can forward the original message If you would like but I think its just a waste of time, it does not have them files in there, verify your sent folder. I do see that your new patch does "this is a good thing ;)" Since those files do not exist in stable/8 I believe the error was running ( cd /usr/src && svn diff %%ARGS_HERE%% ) which I repeated more then once and the files disapear from the diff. The diff you sent in the original attachment had matched mine all except the order in which the files appeared. ANYWAY... two new correct patches now exist on the list so no worries. -- jhell From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 14:47:15 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE6BB106566C for ; Mon, 21 Jun 2010 14:47:15 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 79DB28FC0C for ; Mon, 21 Jun 2010 14:47:15 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 59A371FFC34; Mon, 21 Jun 2010 14:47:14 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id B1A95844A3; Mon, 21 Jun 2010 16:45:03 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: jhell References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> Date: Mon, 21 Jun 2010 16:45:03 +0200 In-Reply-To: <4C1B63A1.3010604@dataix.net> (jhell@dataix.net's message of "Fri, 18 Jun 2010 08:16:33 -0400") Message-ID: <8639wgfnrk.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 14:47:15 -0000 jhell writes: > Anton Shterenlikht writes: > > What do you mean by "updating your headers"? > cd /usr/src/include && make obj && make depend && make all && make install wrong. % cd /usr/src % make obj % make cleandepend % make depend % make buildincludes % make installincludes DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 15:04:49 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58B9B1065675; Mon, 21 Jun 2010 15:04:49 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 127408FC08; Mon, 21 Jun 2010 15:04:48 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1OQiYJ-0002oj-7U; Mon, 21 Jun 2010 16:04:47 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1OQiYI-0004aZ-4T; Mon, 21 Jun 2010 16:04:46 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5LF4jDC050229; Mon, 21 Jun 2010 16:04:45 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5LF4jeA050228; Mon, 21 Jun 2010 16:04:45 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Mon, 21 Jun 2010 16:04:45 +0100 From: Anton Shterenlikht To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8639wgfnrk.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 15:04:49 -0000 On Mon, Jun 21, 2010 at 04:45:03PM +0200, Dag-Erling Smørgrav wrote: > jhell writes: > > Anton Shterenlikht writes: > > > What do you mean by "updating your headers"? > > cd /usr/src/include && make obj && make depend && make all && make install > > wrong. > > % cd /usr/src > % make obj > % make cleandepend > % make depend > % make buildincludes > % make installincludes > > DES > -- > Dag-Erling Smørgrav - des@des.no Sorry, just to take one step back, why has this become necessary for this particular box? If /usr/obj is empty, and "svn up", followed by "svn diff", doesn't show any local changes, why can't I go straight to make buildworld? In other words, why do my headers need updating on this particular box, and not on other ia64 boxes? I must've screwed something up, haven't I? Anyway, I tried what jhell suggested, and got the same error again. I'll now try to follow DES's advice. many thanks for your help anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 15:25:00 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9979106564A; Mon, 21 Jun 2010 15:25:00 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 85DBA8FC12; Mon, 21 Jun 2010 15:24:57 +0000 (UTC) Received: by iwn7 with SMTP id 7so4423592iwn.13 for ; Mon, 21 Jun 2010 08:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; bh=RKT8p2HDjX6+UKG4msRGNoGw29UBJL3lYi+CTLVK2EE=; b=neWGCphIs5KK3XXSnfqNFkGTAvXWRJconk21QEpOO6hyChNHxKmlQYUXV6f46kRmW4 WyZWAwPOwaAd22dSngxOQMnw3UpBQPNe0YRviTh7bwRryzVIQx5kOxWccZuhx7xLtpmU tNYj8Y8OXncW554k16jlSRcM/m+5rYntorZhg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:openpgp:content-type :content-transfer-encoding; b=ekPGH0Zyb75ngdM7PHmznZgfTGNfJesAx4YjWNPSzyBKFVsgnXa5GOoVBKLG9/N4aC m+16HfrWcimC3ooCR/Hx20ISlL8/kegGpCvLYsyrVxWfgGuVbE7/bk958TbclE9InlaH Gufk95Z3hvXXl5Wtg80RpErYgYDLTPq90Giio= Received: by 10.42.4.210 with SMTP id 18mr1796646ict.0.1277133896542; Mon, 21 Jun 2010 08:24:56 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-128-180.dsl.klmzmi.sbcglobal.net [99.181.128.180]) by mx.google.com with ESMTPS id r12sm19497545ibi.20.2010.06.21.08.24.54 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 08:24:54 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C1F8444.80002@dataix.net> Date: Mon, 21 Jun 2010 11:24:52 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100620 Thunderbird MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> In-Reply-To: <8639wgfnrk.fsf@ds4.des.no> X-Enigmail-Version: 1.0.1 OpenPGP: id=89D8547E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 15:25:00 -0000 On 06/21/2010 10:45, Dag-Erling Smørgrav wrote: > jhell writes: >> Anton Shterenlikht writes: >>> What do you mean by "updating your headers"? >> cd /usr/src/include && make obj && make depend && make all && make install > > wrong. > > % cd /usr/src > % make obj > % make cleandepend > % make depend > % make buildincludes > % make installincludes > > DES Sure, the only difference here is you just seem to have added cleandepend for extra added surety but is unneeded if the obj directory is assumed empty. buildincludes covered by a simple make, I don't even know why I decided to mention the all target since thats what it makes by default. I sure hope the make system was designed to cover that target under all because that would be a shame if it didn't ;). installincludes ,,,,mmmmmm really ? Before install, after install and in the obj directories during the build process there is no difference. Can you point them out ? And yes Ive checked them. Anyhoo this subject is three days old and did not hear anything back, I would say that it probably solved his problem unless you would say he probably crashed and could not reply. ;) Regards, -- jhell From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 15:43:49 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06E66106566B for ; Mon, 21 Jun 2010 15:43:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B9D018FC1A for ; Mon, 21 Jun 2010 15:43:48 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5396D46B58; Mon, 21 Jun 2010 11:43:48 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0BEB28A050; Mon, 21 Jun 2010 11:43:47 -0400 (EDT) From: John Baldwin To: Scott Long Date: Mon, 21 Jun 2010 11:21:51 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <9B404DAF-CD34-4799-8DFA-F24AF62F0117@samsco.org> In-Reply-To: <9B404DAF-CD34-4799-8DFA-F24AF62F0117@samsco.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006211121.51649.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 21 Jun 2010 11:43:47 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: "freebsd-current@freebsd.org" , Jille Timmermans , Alexander Best Subject: Re: strange scsi/CAM related dmesg output X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 15:43:49 -0000 On Friday 18 June 2010 10:18:54 pm Scott Long wrote: > On Jun 18, 2010, at 9:11 AM, Alexander Best muenster.de> wrote: > > > On Mon, Jun 7, 2010 at 3:57 PM, John Baldwin wrote: > >> On Saturday 05 June 2010 2:54:15 pm Jille Timmermans wrote: > >>> Scott Long schreef: > >>>> On Jun 4, 2010, at 4:35 PM, Alexander Best wrote: > >>>> > >>>>> hi there. running HEAD, amd64 and r208806 i get this dmesg output > >>>>> which doesn't look right: > >>>>> > >>>>> ada0 at ahcich2 bus 0 scbus3 target 0 lun 0 > >>>>> ada0: ATA-7 SATA 2.x device > >>>>> ada0: 300.000MB/s transferscd0 at ata2 bus 0 scbus2 target 0 lun 0 > >>>>> cd0: Removable CD-ROM SCSI-0 > >>>>> device > >>>>> cd0: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes) > >>>>> cd0: cd present [1944656 x 2048 byte records] > >>>>> (SATA 2.x, UDMA6, PIO 8192bytes) > >>>>> ada0: Command Queueing enabled > >>>>> ada0: 238474MB (488395055 512 byte sectors: 16H 63S/T 16383C) > >>>>> > >>>>> > >>>>> my kernel contains: > >>>>> > >>>>> options SC_HISTORY_SIZE=1000 > >>>>> options MSGBUF_SIZE=65536 > >>>>> options PRINTF_BUFR_SIZE=128 > >>>>> > >>>>> might this be caused by one of these lines? > >>>>> > >>>>> cheers. > >>>>> > >>>> > >>>> Can you be more specific about what you think is not right? > >>>> > >>>> Scott > >>> I assume he means that 'cd0 at ata2 ...' is on the same line as the > >>> third ada0 line. After all the cd0-lines, the ada0 line continues. > >>> That shouldn't happen with PRINTF_BUFR_SIZE set, should it? > >> > >> It can happen because the print buffer size thing is not line- > >> buffered, it is > >> printf-invocation buffered. > > > > hmmm...can this somehow be fixed? i'm not sure this is specific to > > scsi/cam. the other day i bootd my system and almost all of the dmesg > > output was displayed incorrectly. would increasing PRINTF_BUFR_SIZE > > from 128 to lets say 512 or 1024 solve the issue > > > Johns response is off base. I explained the issue prior to him, > please review that. Huh? My point is that the buffer size is not line buffered, but the entire buffer is always output before printf() returns. Thus, if you do: printf("foo"); printf(" bar\n"); Then another CPU or thread can send output in between the "foo" and " bar\n". What people want, aesthetically, is to have per-thread line-buffered output, so each thread would accumulate chars up to a limit or '\n' across multiple calls to printf() and output all of that at once. On the other hand, if something else should be serializing these printfs then they shouldn't interleave even w/o PRINTF_BUFR_SIZE, so I don't see how PRINTF_BUFR_SIZE would fix it. -- John Baldwin From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 15:46:02 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 409261065700; Mon, 21 Jun 2010 15:46:02 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id ED9608FC12; Mon, 21 Jun 2010 15:46:01 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1OQjCC-0005cd-A3; Mon, 21 Jun 2010 16:46:00 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1OQjCC-0005E5-0F; Mon, 21 Jun 2010 16:46:00 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5LFjxr4050466; Mon, 21 Jun 2010 16:45:59 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5LFjxaW050465; Mon, 21 Jun 2010 16:45:59 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Mon, 21 Jun 2010 16:45:59 +0100 From: Anton Shterenlikht To: jhell Message-ID: <20100621154559.GA50416@mech-cluster241.men.bris.ac.uk> References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <4C1F8444.80002@dataix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4C1F8444.80002@dataix.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 15:46:02 -0000 On Mon, Jun 21, 2010 at 11:24:52AM -0400, jhell wrote: > On 06/21/2010 10:45, Dag-Erling Smørgrav wrote: > > jhell writes: > >> Anton Shterenlikht writes: > >>> What do you mean by "updating your headers"? > >> cd /usr/src/include && make obj && make depend && make all && make install > > > > wrong. > > > > % cd /usr/src > > % make obj > > % make cleandepend > > % make depend > > % make buildincludes > > % make installincludes > > > > DES > > Sure, the only difference here is you just seem to have added > cleandepend for extra added surety but is unneeded if the obj directory > is assumed empty. > > buildincludes covered by a simple make, I don't even know why I decided > to mention the all target since thats what it makes by default. I sure > hope the make system was designed to cover that target under all because > that would be a shame if it didn't ;). > > installincludes ,,,,mmmmmm really ? > > Before install, after install and in the obj directories during the > build process there is no difference. Can you point them out ? > > And yes Ive checked them. > > Anyhoo this subject is three days old and did not hear anything back, I > would say that it probably solved his problem unless you would say he > probably crashed and could not reply. ;) well.. I was busy with other things over the week-end. No, I haven't solved this problem yet. I've 3 ia64 boxes, this problem only occured on one of those. I did # cd /usr/src # rm -rf /usr/obj/* # svn up # svn diff The last command did not show any differences. I can't understand how I can have problems with unupdated headers.. many thanks anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 15:59:30 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2AEC1065675; Mon, 21 Jun 2010 15:59:30 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 8BA1C8FC18; Mon, 21 Jun 2010 15:59:30 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1OQjPF-0006YV-70; Mon, 21 Jun 2010 16:59:29 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1OQjPE-0005gS-TX; Mon, 21 Jun 2010 16:59:28 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5LFxSe6066926; Mon, 21 Jun 2010 16:59:28 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5LFxSpu066912; Mon, 21 Jun 2010 16:59:28 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Mon, 21 Jun 2010 16:59:28 +0100 From: Anton Shterenlikht To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100621155927.GA50490@mech-cluster241.men.bris.ac.uk> References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <8639wgfnrk.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 15:59:30 -0000 On Mon, Jun 21, 2010 at 04:45:03PM +0200, Dag-Erling Sm=F8rgrav wrote: > jhell writes: > > Anton Shterenlikht writes: > > > What do you mean by "updating your headers"? > > cd /usr/src/include && make obj && make depend && make all && make inst= all >=20 > wrong. >=20 > % cd /usr/src > % make obj > % make cleandepend > % make depend > % make buildincludes > % make installincludes this failed in "make depend" step with *skip* rm -f .depend mkdep -f .depend -a /usr/src/lib/libalias/modules/smedia/../../../../sy= s/netinet/libalias/alias_smedia.c =3D=3D=3D> lib/libarchive (depend) rm -f .depend mkdep -f .depend -a -DHAVE_BZLIB_H=3D1 -DHAVE_LIBLZMA=3D1 -DHAVE_LZMA_H= =3D1 -DPLATFORM_CONFIG_H=3D\"config_freebs .h\" -I/usr/obj/usr/src/lib/liba= rchive -DWITH_OPENSSL /usr/src/lib/libarchive/archive_check_magic.c /usr/sr= c lib/libarchive/archive_entry.c /usr/src/lib/libarchive/archive_entry_copy= _stat.c /usr/src/lib/libarchive/arc ive_entry_stat.c /usr/src/lib/libarchiv= e/archive_entry_strmode.c /usr/src/lib/libarchive/archive_entry_link_resolv= er.c /usr/src/lib/libarchive/archive_entry_xattr.c /usr/src/lib/libarchive/= archive_read.c /usr/src/lib/libarchive/archive_read_data_into_fd.c /usr/src= /lib/libarchive/archive_read_disk.c /usr/src/lib/libarchive/archive_read_di= sk_entry_from_file.c /usr/src/lib/libarchive/archive_read_disk_set_standard= _lookup.c /usr/src/lib/libarchive/archive_read_extract.c /usr/src/lib/libar= chive/archive_read_open_fd.c /usr/src/lib/libarchive/archive_read_open_file= =2Ec /usr/src/lib/libarchive/archive_read_open_filename.c /usr/src/lib/liba= rchive/archive_read_open_memory.c /usr/src/lib/libarchive/archive_read_supp= ort_compression_all.c /usr/src/lib/libarchive/archive_read_support_compress= ion_bzip2.c /usr/src/lib/libarchive/archive_read_support_compression_compre= ss.c /usr/src/lib/libarchive/archive_read_support_compression_gzip.c /usr/s= rc/lib/libarchive/archive_read_support_compression_none.c /usr/src/lib/liba= rchive/archive_read_support_compression_program.c /usr/src/lib/libarchive/a= rchive_read_support_compression_uu.c /usr/src/lib/libarchive/archive_read_s= upport_compression_xz.c /usr/src/lib/libarchive/archive_read_support_format= _all.c /usr/src/lib/libarchive/archive_read_support_format_ar.c /usr/src/li= b/libarchive/archive_read_support_format_cpio.c /usr/src/lib/libarchive/arc= hive_read_support_format_empty.c /usr/src/lib/libarchive/archive_read_suppo= rt_format_iso9660.c /usr/src/lib/libarchive/archive_read_support_format_mtr= ee.c /usr/src/lib/libarchive/archive_read_support_format_raw.c /usr/src/lib= /libarchive/archive_read_support_format_tar.c /usr/src/lib/libarchive/archi= ve_read_support_format_zip.c /usr/src/lib/libarchive/archive_string.c /usr/= src/lib/libarchive/archive_string_sprintf.c /usr/src/lib/libarchive/archive= _util.c /usr/src/lib/libarchive/archive_virtual.c /usr/src/lib/libarchive/a= rchive_write.c /usr/src/lib/libarchive/archive_write_disk.c /usr/src/lib/li= barchive/archive_write_disk_set_standard_lookup.c /usr/src/lib/libarchive/a= rchive_write_open_fd.c /usr/src/lib/libarchive/archive_write_open_file.c /u= sr/src/lib/libarchive/archive_write_open_filename.c /usr/src/lib/libarchive= /archive_write_open_memory.c /usr/src/lib/libarchive/archive_write_set_comp= ression_bzip2.c /usr/src/lib/libarchive/archive_write_set_compression_compr= ess.c /usr/src/lib/libarchive/archive_write_set_compression_gzip.c /usr/src= /lib/libarchive/archive_write_set_compression_none.c /usr/src/lib/libarchiv= e/archive_write_set_compression_program.c /usr/src/lib/libarchive/archive_w= rite_set_compression_xz.c /usr/src/lib/libarchive/archive_write_set_format.= c /usr/src/lib/libarchive/archive_write_set_format_ar.c /usr/src/lib/libarc= hive/archive_write_set_format_by_name.c /usr/src/lib/libarchive/archive_wri= te_set_format_cpio.c /usr/src/lib/libarchive/archive_write_set_format_cpio_= newc.c /usr/src/lib/libarchive/archive_write_set_format_mtree.c /usr/src/li= b/libarchive/archive_write_set_format_pax.c /usr/src/lib/libarchive/archive= _write_set_format_shar.c /usr/src/lib/libarchive/archive_write_set_format_u= star.c /usr/src/lib/libarchive/archive_write_set_format_zip.c /usr/src/lib/= libarchive/filter_fork.c /usr/src/lib/libarchive/archive_read_support_compression_xz.c:45:18: error:= lzma.h: No such file or directory /usr/src/lib/libarchive/archive_write_set_compression_xz.c:42:18: error: lz= ma.h: No such file or directory mkdep: compile failed *** Error code 1 Stop in /usr/src/lib/libarchive. *** Error code 1 I'm now at r209398 many thanks anton --=20 Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 16:24:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7957B106564A; Mon, 21 Jun 2010 16:24:43 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 32F5D8FC0A; Mon, 21 Jun 2010 16:24:42 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 26D951FFC34; Mon, 21 Jun 2010 16:24:42 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 8696584488; Mon, 21 Jun 2010 18:22:31 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> Date: Mon, 21 Jun 2010 18:22:31 +0200 In-Reply-To: <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> (Anton Shterenlikht's message of "Mon, 21 Jun 2010 16:04:45 +0100") Message-ID: <86r5k0fj94.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 16:24:43 -0000 Anton Shterenlikht writes: > Sorry, just to take one step back, why has this become necessary for > this particular box? I have no idea or opinion - I just responded to jhell's incorrect instructions for "updating your headers". > If /usr/obj is empty, and "svn up", followed by "svn diff", doesn't > show any local changes, why can't I go straight to make buildworld? If you're going to make buildworld, there is no reason whatsoever to "update your headers". That is only necessary if you want to shortcut the build process after applying patches which you know affect some headers. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 16:27:47 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB50C106564A; Mon, 21 Jun 2010 16:27:47 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 74B7C8FC0C; Mon, 21 Jun 2010 16:27:47 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 6A3441FFC34; Mon, 21 Jun 2010 16:27:46 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id D44F4844A3; Mon, 21 Jun 2010 18:25:35 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: jhell References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <4C1F8444.80002@dataix.net> Date: Mon, 21 Jun 2010 18:25:35 +0200 In-Reply-To: <4C1F8444.80002@dataix.net> (jhell@dataix.net's message of "Mon, 21 Jun 2010 11:24:52 -0400") Message-ID: <86mxuofj40.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 16:27:47 -0000 jhell writes: > Sure, the only difference here is you just seem to have added > cleandepend for extra added surety but is unneeded if the obj > directory is assumed empty. Assumption is the mother of all f***ups. The mother of your particular f***up is the assumption that all headers are in /usr/src/include. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 16:27:55 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35FA91065673; Mon, 21 Jun 2010 16:27:55 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id C57E28FC0C; Mon, 21 Jun 2010 16:27:54 +0000 (UTC) Received: by qyk11 with SMTP id 11so1617222qyk.13 for ; Mon, 21 Jun 2010 09:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Vyoyt5hUpHBsGm0VAAaYYdD2+P9HMNEH/6ZlSvhQICY=; b=hOXTJe1PWZr+BR4Zf5siLfKeHbK+fNZKRwNl+fcvXiLfaKqKePfLQXNBtjK/41ceo8 6OH2PAJORGRiZJl+p5BwCnrqzo3VvxZWDPAg2aHiAaBraIY8E4jB00thauTGbG1pzKAI 1GXunBP6FgpysBePwmI4eQWn5NbNmcPqHEYrU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lY2it4h2vyhmpC60NXlP37dlyCZ4cCi6pb9mIiqwnyBySUYAs0SsUGUuJXNVLjMZcF /Er3Dtm2vkK/zkqsWiDxkxpHOhooSCgmMzevIva6/5dm4fkm5u3ihb1T9wfIJTnx+0L0 gH+AdVPxrDyU+jmwUF/+c2QtNhGjg1EqHN/k4= MIME-Version: 1.0 Received: by 10.224.108.69 with SMTP id e5mr3217269qap.215.1277137673610; Mon, 21 Jun 2010 09:27:53 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Mon, 21 Jun 2010 09:27:53 -0700 (PDT) In-Reply-To: <20100621155927.GA50490@mech-cluster241.men.bris.ac.uk> References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621155927.GA50490@mech-cluster241.men.bris.ac.uk> Date: Mon, 21 Jun 2010 09:27:53 -0700 Message-ID: From: Garrett Cooper To: Anton Shterenlikht Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= , freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 16:27:55 -0000 2010/6/21 Anton Shterenlikht : > On Mon, Jun 21, 2010 at 04:45:03PM +0200, Dag-Erling Sm=F8rgrav wrote: >> jhell writes: >> > Anton Shterenlikht writes: >> > > What do you mean by "updating your headers"? >> > cd /usr/src/include && make obj && make depend && make all && make ins= tall >> >> wrong. >> >> % cd /usr/src >> % make obj >> % make cleandepend >> % make depend >> % make buildincludes >> % make installincludes > > this failed in "make depend" step with > > *skip* > > rm -f .depend > mkdep -f .depend -a =A0 =A0 /usr/src/lib/libalias/modules/smedia/../../..= /../sys/netinet/libalias/alias_smedia.c > =3D=3D=3D> lib/libarchive (depend) > rm -f .depend > mkdep -f .depend -a =A0 =A0-DHAVE_BZLIB_H=3D1 -DHAVE_LIBLZMA=3D1 -DHAVE_L= ZMA_H=3D1 -DPLATFORM_CONFIG_H=3D\"config_freebs .h\" -I/usr/obj/usr/src/lib= /libarchive -DWITH_OPENSSL /usr/src/lib/libarchive/archive_check_magic.c /u= sr/src lib/libarchive/archive_entry.c /usr/src/lib/libarchive/archive_entry= _copy_stat.c /usr/src/lib/libarchive/arc ive_entry_stat.c /usr/src/lib/liba= rchive/archive_entry_strmode.c /usr/src/lib/libarchive/archive_entry_link_r= esolver.c /usr/src/lib/libarchive/archive_entry_xattr.c /usr/src/lib/libarc= hive/archive_read.c /usr/src/lib/libarchive/archive_read_data_into_fd.c /us= r/src/lib/libarchive/archive_read_disk.c /usr/src/lib/libarchive/archive_re= ad_disk_entry_from_file.c /usr/src/lib/libarchive/archive_read_disk_set_sta= ndard_lookup.c /usr/src/lib/libarchive/archive_read_extract.c /usr/src/lib/= libarchive/archive_read_open_fd.c /usr/src/lib/libarchive/archive_read_open= _file.c /usr/src/lib/libarchive/archive_read_open_filename.c /usr/src/lib/l= ibarchive/archive_read_open_memory.c /usr/src/lib/libarchive/archive_read_s= upport_compression_all.c /usr/src/lib/libarchive/archive_read_support_compr= ession_bzip2.c /usr/src/lib/libarchive/archive_read_support_compression_com= press.c /usr/src/lib/libarchive/archive_read_support_compression_gzip.c /us= r/src/lib/libarchive/archive_read_support_compression_none.c /usr/src/lib/l= ibarchive/archive_read_support_compression_program.c /usr/src/lib/libarchiv= e/archive_read_support_compression_uu.c /usr/src/lib/libarchive/archive_rea= d_support_compression_xz.c /usr/src/lib/libarchive/archive_read_support_for= mat_all.c /usr/src/lib/libarchive/archive_read_support_format_ar.c /usr/src= /lib/libarchive/archive_read_support_format_cpio.c /usr/src/lib/libarchive/= archive_read_support_format_empty.c /usr/src/lib/libarchive/archive_read_su= pport_format_iso9660.c /usr/src/lib/libarchive/archive_read_support_format_= mtree.c /usr/src/lib/libarchive/archive_read_support_format_raw.c /usr/src/= lib/libarchive/archive_read_support_format_tar.c /usr/src/lib/libarchive/ar= chive_read_support_format_zip.c /usr/src/lib/libarchive/archive_string.c /u= sr/src/lib/libarchive/archive_string_sprintf.c /usr/src/lib/libarchive/arch= ive_util.c /usr/src/lib/libarchive/archive_virtual.c /usr/src/lib/libarchiv= e/archive_write.c /usr/src/lib/libarchive/archive_write_disk.c /usr/src/lib= /libarchive/archive_write_disk_set_standard_lookup.c /usr/src/lib/libarchiv= e/archive_write_open_fd.c /usr/src/lib/libarchive/archive_write_open_file.c= /usr/src/lib/libarchive/archive_write_open_filename.c /usr/src/lib/libarch= ive/archive_write_open_memory.c /usr/src/lib/libarchive/archive_write_set_c= ompression_bzip2.c /usr/src/lib/libarchive/archive_write_set_compression_co= mpress.c /usr/src/lib/libarchive/archive_write_set_compression_gzip.c /usr/= src/lib/libarchive/archive_write_set_compression_none.c /usr/src/lib/libarc= hive/archive_write_set_compression_program.c /usr/src/lib/libarchive/archiv= e_write_set_compression_xz.c /usr/src/lib/libarchive/archive_write_set_form= at.c /usr/src/lib/libarchive/archive_write_set_format_ar.c /usr/src/lib/lib= archive/archive_write_set_format_by_name.c /usr/src/lib/libarchive/archive_= write_set_format_cpio.c /usr/src/lib/libarchive/archive_write_set_format_cp= io_newc.c /usr/src/lib/libarchive/archive_write_set_format_mtree.c /usr/src= /lib/libarchive/archive_write_set_format_pax.c /usr/src/lib/libarchive/arch= ive_write_set_format_shar.c /usr/src/lib/libarchive/archive_write_set_forma= t_ustar.c /usr/src/lib/libarchive/archive_write_set_format_zip.c /usr/src/l= ib/libarchive/filter_fork.c > /usr/src/lib/libarchive/archive_read_support_compression_xz.c:45:18: erro= r: lzma.h: No such file or directory > /usr/src/lib/libarchive/archive_write_set_compression_xz.c:42:18: error: = lzma.h: No such file or directory > mkdep: compile failed > *** Error code 1 > > Stop in /usr/src/lib/libarchive. > *** Error code 1 > > > I'm now at r209398 Although I know it isn't the proper method of doing things, why not just do... pushd lib/lzma make obj make depend make buildincludes make installincludes popd # Resume regularly scheduled program ? Obviously something is screwed up with the environment on the machine as half-measures don't appear to be working :/... -Garrett From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 16:29:35 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D291065703; Mon, 21 Jun 2010 16:29:35 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id F1ADC8FC1B; Mon, 21 Jun 2010 16:29:34 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 12A531FFC35; Mon, 21 Jun 2010 16:29:34 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 795DF844A3; Mon, 21 Jun 2010 18:27:23 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621155927.GA50490@mech-cluster241.men.bris.ac.uk> Date: Mon, 21 Jun 2010 18:27:23 +0200 In-Reply-To: <20100621155927.GA50490@mech-cluster241.men.bris.ac.uk> (Anton Shterenlikht's message of "Mon, 21 Jun 2010 16:59:28 +0100") Message-ID: <86iq5cfj10.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 16:29:35 -0000 Anton Shterenlikht writes: > this failed in "make depend" step with you can skip that step... in fact, you can skip the whole thing, since it is completely irrelevant to your case. I'll go check the archives for your OP and see if I can provide some more useful advice than jhell. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 16:31:44 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 925A4106564A; Mon, 21 Jun 2010 16:31:44 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3DE8C8FC1A; Mon, 21 Jun 2010 16:31:43 +0000 (UTC) Received: by iwn7 with SMTP id 7so4497482iwn.13 for ; Mon, 21 Jun 2010 09:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; bh=cTvT4BOExNwYsJ/lp87YZkp27LtqKYJRhpLv1O7JVQ8=; b=oBLYUyDC9aa914UK+xVZsq6XnD79YetN7xS7c4m5bE4caoRRVbhabqscEwVmvV6Lik aJDp1wCAIGkF/XFNtaeIzg96QTCoam8KI3Q8m2noK30y1DuECA2prvyByE8kM59cog6x O9QiqP6bZ5U1fnklzD3DcfPDyofv/4+IUYfz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:openpgp:content-type :content-transfer-encoding; b=vrfRth2MCjOXOcgETcXsLyGVk0kofVIAFQrS/W+jSVrjvtkoyjHCw1ByYTGOod9aRb rn1lhWQct01htq4DcJeEqVBAwiI+7MoagJw+56XROrLpTsVnXgADlmJTtx+HQ+EOo4oh uE2CqVgxMw+xeB6rHlQmim103cstTP1HG1V3E= Received: by 10.231.200.24 with SMTP id eu24mr5380814ibb.186.1277137902736; Mon, 21 Jun 2010 09:31:42 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-128-180.dsl.klmzmi.sbcglobal.net [99.181.128.180]) by mx.google.com with ESMTPS id r12sm2436910ibi.14.2010.06.21.09.31.41 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 09:31:41 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C1F93EC.5060505@dataix.net> Date: Mon, 21 Jun 2010 12:31:40 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100620 Thunderbird MIME-Version: 1.0 To: Anton Shterenlikht References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621155927.GA50490@mech-cluster241.men.bris.ac.uk> In-Reply-To: <20100621155927.GA50490@mech-cluster241.men.bris.ac.uk> X-Enigmail-Version: 1.0.1 OpenPGP: id=89D8547E Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 16:31:44 -0000 On 06/21/2010 11:59, Anton Shterenlikht wrote: > On Mon, Jun 21, 2010 at 04:45:03PM +0200, Dag-Erling Smørgrav wrote: >> jhell writes: >>> Anton Shterenlikht writes: >>>> What do you mean by "updating your headers"? >>> cd /usr/src/include && make obj && make depend && make all && make install >> >> wrong. >> >> % cd /usr/src >> % make obj >> % make cleandepend >> % make depend >> % make buildincludes >> % make installincludes > > this failed in "make depend" step with > > *skip* > > rm -f .depend > mkdep -f .depend -a /usr/src/lib/libalias/modules/smedia/../../../../sys/netinet/libalias/alias_smedia.c > ===> lib/libarchive (depend) > rm -f .depend > mkdep -f .depend -a -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -DPLATFORM_CONFIG_H=\"config_freebs .h\" -I/usr/obj/usr/src/lib/libarchive -DWITH_OPENSSL /usr/src/lib/libarchive/archive_check_magic.c /usr/src lib/libarchive/archive_entry.c /usr/src/lib/libarchive/archive_entry_copy_stat.c /usr/src/lib/libarchive/arc ive_entry_stat.c /usr/src/lib/libarchive/archive_entry_strmode.c /usr/src/lib/libarchive/archive_entry_link_resolver.c /usr/src/lib/libarchive/archive_entry_xattr.c /usr/src/lib/libarchive/archive_read.c /usr/src/lib/libarchive/archive_read_data_into_fd.c /usr/src/lib/libarchive/archive_read_disk.c /usr/src/lib/libarchive/archive_read_disk_entry_from_file.c /usr/src/lib/libarchive/archive_read_disk_set_standard_lookup.c /usr/src/lib/libarchive/archive_read_extract.c /usr/src/lib/libarchive/archive_read_open_fd.c /usr/src/lib/libarchive/archive_read_open_file.c /usr/src/lib/libarchive/archive_read_open_filename.c /usr/src/lib/libarchive/archive_read_open _memory.c /usr/src/lib/libarchive/archive_read_support_compression_all.c /usr/src/lib/libarchive/archive_read_support_compression_bzip2.c /usr/src/lib/libarchive/archive_read_support_compression_compress.c /usr/src/lib/libarchive/archive_read_support_compression_gzip.c /usr/src/lib/libarchive/archive_read_support_compression_none.c /usr/src/lib/libarchive/archive_read_support_compression_program.c /usr/src/lib/libarchive/archive_read_support_compression_uu.c /usr/src/lib/libarchive/archive_read_support_compression_xz.c /usr/src/lib/libarchive/archive_read_support_format_all.c /usr/src/lib/libarchive/archive_read_support_format_ar.c /usr/src/lib/libarchive/archive_read_support_format_cpio.c /usr/src/lib/libarchive/archive_read_support_format_empty.c /usr/src/lib/libarchive/archive_read_support_format_iso9660.c /usr/src/lib/libarchive/archive_read_support_format_mtree.c /usr/src/lib/libarchive/archive_read_support_format_raw.c /usr/src/lib/libarchive/archive_read_support_format _tar.c /usr/src/lib/libarchive/archive_read_support_format_zip.c /usr/src/lib/libarchive/archive_string.c /usr/src/lib/libarchive/archive_string_sprintf.c /usr/src/lib/libarchive/archive_util.c /usr/src/lib/libarchive/archive_virtual.c /usr/src/lib/libarchive/archive_write.c /usr/src/lib/libarchive/archive_write_disk.c /usr/src/lib/libarchive/archive_write_disk_set_standard_lookup.c /usr/src/lib/libarchive/archive_write_open_fd.c /usr/src/lib/libarchive/archive_write_open_file.c /usr/src/lib/libarchive/archive_write_open_filename.c /usr/src/lib/libarchive/archive_write_open_memory.c /usr/src/lib/libarchive/archive_write_set_compression_bzip2.c /usr/src/lib/libarchive/archive_write_set_compression_compress.c /usr/src/lib/libarchive/archive_write_set_compression_gzip.c /usr/src/lib/libarchive/archive_write_set_compression_none.c /usr/src/lib/libarchive/archive_write_set_compression_program.c /usr/src/lib/libarchive/archive_write_set_compression_xz.c /usr/src/lib/libarchive/arch ive_write_set_format.c /usr/src/lib/libarchive/archive_write_set_format_ar.c /usr/src/lib/libarchive/archive_write_set_format_by_name.c /usr/src/lib/libarchive/archive_write_set_format_cpio.c /usr/src/lib/libarchive/archive_write_set_format_cpio_newc.c /usr/src/lib/libarchive/archive_write_set_format_mtree.c /usr/src/lib/libarchive/archive_write_set_format_pax.c /usr/src/lib/libarchive/archive_write_set_format_shar.c /usr/src/lib/libarchive/archive_write_set_format_ustar.c /usr/src/lib/libarchive/archive_write_set_format_zip.c /usr/src/lib/libarchive/filter_fork.c > /usr/src/lib/libarchive/archive_read_support_compression_xz.c:45:18: error: lzma.h: No such file or directory > /usr/src/lib/libarchive/archive_write_set_compression_xz.c:42:18: error: lzma.h: No such file or directory > mkdep: compile failed > *** Error code 1 > > Stop in /usr/src/lib/libarchive. > *** Error code 1 > > > I'm now at r209398 > > many thanks > anton > I do not remember what the exact fix was nor am I looking it up but give this a shot. # I think I missed this step when I did this. # Copy and paste for pleasure. cd /usr/src/lib make obj && make depend && make includes && make installincludes Retry your build from here and report back. Of course all these re-install of includes really is not needed now but this is just to skip some cd here & there steps. Good luck, -- jhell From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 16:38:56 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA513106564A; Mon, 21 Jun 2010 16:38:56 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 6B6CD8FC0C; Mon, 21 Jun 2010 16:38:56 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 6BC471FFC35; Mon, 21 Jun 2010 16:38:55 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id CCF0B844A3; Mon, 21 Jun 2010 18:36:44 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> Date: Mon, 21 Jun 2010 18:36:44 +0200 In-Reply-To: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> (Anton Shterenlikht's message of "Thu, 17 Jun 2010 11:15:41 +0100") Message-ID: <86eig0filf.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 16:38:56 -0000 Anton Shterenlikht writes: > I've r209203 kernel on ia64 box. > Now I'm trying to rebuild world to r209240. > I get these errors. There is absolutely nothing between those two revisions that would explain the errors you're getting. Are you absolutely sure those are the correct revision numbers? Have you tried checking out a clean copy of r209203 and building + installing that before trying to build r209240 again? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 16:57:15 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18B7A106566C; Mon, 21 Jun 2010 16:57:15 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id BA28C8FC0C; Mon, 21 Jun 2010 16:57:14 +0000 (UTC) Received: by iwn7 with SMTP id 7so4525023iwn.13 for ; Mon, 21 Jun 2010 09:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; bh=VY6M9aiS0xDgvMoERF2l+p/ECNiHWDaFz/LEhknh31M=; b=S3eKNKHEDqm+4bkeiDNSc5u/e0Qk0+R0u3CBsbe3xqiHugFy08BqXc2aDbIdK/8/KT cedQbQQ12O/08pSfEqsyzlalRlp/axG29ZElkSV6wYt4dvKa8UibHyAdFUp7EcVAZrpN +Ns60zBolVm+o5fhLvYnMwJMPVidgW/MMtUpE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:openpgp:content-type :content-transfer-encoding; b=PvFTXvhtD3TIvxXoCT1oW0G2GlTUQaK9KglXFw00iHb8n0V2gbTmxgWUeRp1Dclg4m z3rHojXHe4CxPlr4Loa4t+2X2VIpHM6UTKibN6IWOrLzz7bBp+JLahFhnACcFsZiVfF0 ZK+fgfqzTMzuINslM+55aoW66Wbih/L/ya/ac= Received: by 10.231.59.80 with SMTP id k16mr6098696ibh.114.1277139433423; Mon, 21 Jun 2010 09:57:13 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-128-180.dsl.klmzmi.sbcglobal.net [99.181.128.180]) by mx.google.com with ESMTPS id r12sm2529047ibi.14.2010.06.21.09.57.12 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 09:57:12 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C1F99E6.30202@dataix.net> Date: Mon, 21 Jun 2010 12:57:10 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100620 Thunderbird MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <4C1F8444.80002@dataix.net> <86mxuofj40.fsf@ds4.des.no> In-Reply-To: <86mxuofj40.fsf@ds4.des.no> X-Enigmail-Version: 1.0.1 OpenPGP: id=89D8547E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 16:57:15 -0000 On 06/21/2010 12:25, Dag-Erling Smørgrav wrote: > jhell writes: >> Sure, the only difference here is you just seem to have added >> cleandepend for extra added surety but is unneeded if the obj >> directory is assumed empty. > > Assumption is the mother of all f***ups. The mother of your particular > f***up is the assumption that all headers are in /usr/src/include. His return post confirmed it was a clean obj. Where did the rest of the answers go ? I have not had to deal with this since: r208258 | mm | 2010-05-18 05:59:09 -0400 (Tue, 18 May 2010) | 16 lines And have no way to test it out if it solves the problem but sure it could be worked through without the attitude & flames that you bring to this thread. > > DES Wow really! your getting that upset you have to start cussing. I just hope that because of your incorrect addition to what you say building the includes improperly is a f***up and being called out on, just like the other patch we've discussed that you so claim had two files in it that you can't own up to does not have anything to do with this. As to the point before you start pointing fingers as you are so gracious to do lately - The steps laid out are the steps I had once took to correct the similar problem. And I seem to be running on these systems fairly well mind you. If you would like to take your aggressions off-list Ill be more than willing to oblige. Praying for you, -- jhell From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 17:49:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADE121065674; Mon, 21 Jun 2010 17:49:43 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 6BBA58FC27; Mon, 21 Jun 2010 17:49:43 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 3D5E11FFC34; Mon, 21 Jun 2010 17:49:42 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 9A160844A3; Mon, 21 Jun 2010 19:47:31 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: jhell References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <4C1F8444.80002@dataix.net> <86mxuofj40.fsf@ds4.des.no> <4C1F99E6.30202@dataix.net> Date: Mon, 21 Jun 2010 19:47:31 +0200 In-Reply-To: <4C1F99E6.30202@dataix.net> (jhell@dataix.net's message of "Mon, 21 Jun 2010 12:57:10 -0400") Message-ID: <86aaqoffbg.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 17:49:43 -0000 jhell writes: > As to the point before you start pointing fingers as you are so gracious > to do lately - The steps laid out are the steps I had once took to > correct the similar problem. And I seem to be running on these systems > fairly well mind you. They are still wrong, and they will not solve his problem. All they will do is muddle the tracks and reduce our chances of ever finding out what the problem really is. > Praying for you, I'd rather you didn't. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 18:16:07 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35BA51065672; Mon, 21 Jun 2010 18:16:07 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 025318FC1F; Mon, 21 Jun 2010 18:16:06 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o5LIG5XD064170; Mon, 21 Jun 2010 14:16:05 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o5LIG5ZK064161; Mon, 21 Jun 2010 18:16:05 GMT (envelope-from tinderbox@freebsd.org) Date: Mon, 21 Jun 2010 18:16:05 GMT Message-Id: <201006211816.o5LIG5ZK064161@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on i386/i386 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 18:16:07 -0000 TB --- 2010-06-21 16:15:00 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-06-21 16:15:00 - starting HEAD tinderbox run for i386/i386 TB --- 2010-06-21 16:15:00 - cleaning the object tree TB --- 2010-06-21 16:15:40 - cvsupping the source tree TB --- 2010-06-21 16:15:40 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/i386/i386/supfile TB --- 2010-06-21 16:21:07 - building world TB --- 2010-06-21 16:21:07 - MAKEOBJDIRPREFIX=/obj TB --- 2010-06-21 16:21:07 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2010-06-21 16:21:07 - TARGET=i386 TB --- 2010-06-21 16:21:07 - TARGET_ARCH=i386 TB --- 2010-06-21 16:21:07 - TZ=UTC TB --- 2010-06-21 16:21:07 - __MAKE_CONF=/dev/null TB --- 2010-06-21 16:21:07 - cd /src TB --- 2010-06-21 16:21:07 - /usr/bin/make -B buildworld >>> World build started on Mon Jun 21 16:21:07 UTC 2010 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries >>> stage 4.3: make dependencies >>> stage 4.4: building everything >>> World build completed on Mon Jun 21 18:01:08 UTC 2010 TB --- 2010-06-21 18:01:08 - generating LINT kernel config TB --- 2010-06-21 18:01:08 - cd /src/sys/i386/conf TB --- 2010-06-21 18:01:08 - /usr/bin/make -B LINT TB --- 2010-06-21 18:01:08 - building LINT kernel TB --- 2010-06-21 18:01:08 - MAKEOBJDIRPREFIX=/obj TB --- 2010-06-21 18:01:08 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2010-06-21 18:01:08 - TARGET=i386 TB --- 2010-06-21 18:01:08 - TARGET_ARCH=i386 TB --- 2010-06-21 18:01:08 - TZ=UTC TB --- 2010-06-21 18:01:08 - __MAKE_CONF=/dev/null TB --- 2010-06-21 18:01:08 - cd /src TB --- 2010-06-21 18:01:08 - /usr/bin/make -B buildkernel KERNCONF=LINT >>> Kernel build for LINT started on Mon Jun 21 18:01:09 UTC 2010 >>> stage 1: configuring the kernel >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3.1: making dependencies >>> stage 3.2: building everything [...] :> hack.c cc -shared -nostdlib hack.c -o hack.So rm -f hack.c MAKE=/usr/bin/make sh /src/sys/conf/newvers.sh LINT cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DGPROF -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue vers.c linking kernel apm.o(.text+0x100a): In function `apm_attach': : undefined reference to `atrtcclock_disable' *** Error code 1 Stop in /obj/i386/src/sys/LINT. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2010-06-21 18:16:05 - WARNING: /usr/bin/make returned exit code 1 TB --- 2010-06-21 18:16:05 - ERROR: failed to build lint kernel TB --- 2010-06-21 18:16:05 - 5515.73 user 922.46 system 7264.84 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-i386-i386.full From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 18:29:08 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61FC2106566B for ; Mon, 21 Jun 2010 18:29:08 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 084FB8FC1B for ; Mon, 21 Jun 2010 18:29:07 +0000 (UTC) Received: (qmail 3450 invoked by uid 399); 21 Jun 2010 18:29:06 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 21 Jun 2010 18:29:06 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C1FAF70.2030308@FreeBSD.org> Date: Mon, 21 Jun 2010 11:29:04 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: FreeBSD Tinderbox References: <201006211816.o5LIG5ZK064161@freebsd-current.sentex.ca> In-Reply-To: <201006211816.o5LIG5ZK064161@freebsd-current.sentex.ca> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexander Motin , current@freebsd.org, i386@freebsd.org Subject: Re: [head tinderbox] failure on i386/i386 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 18:29:08 -0000 mav, could this be related to r209371? Doug On 06/21/10 11:16, FreeBSD Tinderbox wrote: > TB --- 2010-06-21 16:15:00 - tinderbox 2.6 running on freebsd-current.sentex.ca > TB --- 2010-06-21 16:15:00 - starting HEAD tinderbox run for i386/i386 > TB --- 2010-06-21 16:15:00 - cleaning the object tree > TB --- 2010-06-21 16:15:40 - cvsupping the source tree > TB --- 2010-06-21 16:15:40 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/i386/i386/supfile > TB --- 2010-06-21 16:21:07 - building world > TB --- 2010-06-21 16:21:07 - MAKEOBJDIRPREFIX=/obj > TB --- 2010-06-21 16:21:07 - PATH=/usr/bin:/usr/sbin:/bin:/sbin > TB --- 2010-06-21 16:21:07 - TARGET=i386 > TB --- 2010-06-21 16:21:07 - TARGET_ARCH=i386 > TB --- 2010-06-21 16:21:07 - TZ=UTC > TB --- 2010-06-21 16:21:07 - __MAKE_CONF=/dev/null > TB --- 2010-06-21 16:21:07 - cd /src > TB --- 2010-06-21 16:21:07 - /usr/bin/make -B buildworld >>>> World build started on Mon Jun 21 16:21:07 UTC 2010 >>>> Rebuilding the temporary build tree >>>> stage 1.1: legacy release compatibility shims >>>> stage 1.2: bootstrap tools >>>> stage 2.1: cleaning up the object tree >>>> stage 2.2: rebuilding the object tree >>>> stage 2.3: build tools >>>> stage 3: cross tools >>>> stage 4.1: building includes >>>> stage 4.2: building libraries >>>> stage 4.3: make dependencies >>>> stage 4.4: building everything >>>> World build completed on Mon Jun 21 18:01:08 UTC 2010 > TB --- 2010-06-21 18:01:08 - generating LINT kernel config > TB --- 2010-06-21 18:01:08 - cd /src/sys/i386/conf > TB --- 2010-06-21 18:01:08 - /usr/bin/make -B LINT > TB --- 2010-06-21 18:01:08 - building LINT kernel > TB --- 2010-06-21 18:01:08 - MAKEOBJDIRPREFIX=/obj > TB --- 2010-06-21 18:01:08 - PATH=/usr/bin:/usr/sbin:/bin:/sbin > TB --- 2010-06-21 18:01:08 - TARGET=i386 > TB --- 2010-06-21 18:01:08 - TARGET_ARCH=i386 > TB --- 2010-06-21 18:01:08 - TZ=UTC > TB --- 2010-06-21 18:01:08 - __MAKE_CONF=/dev/null > TB --- 2010-06-21 18:01:08 - cd /src > TB --- 2010-06-21 18:01:08 - /usr/bin/make -B buildkernel KERNCONF=LINT >>>> Kernel build for LINT started on Mon Jun 21 18:01:09 UTC 2010 >>>> stage 1: configuring the kernel >>>> stage 2.1: cleaning up the object tree >>>> stage 2.2: rebuilding the object tree >>>> stage 2.3: build tools >>>> stage 3.1: making dependencies >>>> stage 3.2: building everything > [...] > :> hack.c > cc -shared -nostdlib hack.c -o hack.So > rm -f hack.c > MAKE=/usr/bin/make sh /src/sys/conf/newvers.sh LINT > cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DGPROF -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue vers.c > linking kernel > apm.o(.text+0x100a): In function `apm_attach': > : undefined reference to `atrtcclock_disable' > *** Error code 1 > > Stop in /obj/i386/src/sys/LINT. > *** Error code 1 > > Stop in /src. > *** Error code 1 > > Stop in /src. > TB --- 2010-06-21 18:16:05 - WARNING: /usr/bin/make returned exit code 1 > TB --- 2010-06-21 18:16:05 - ERROR: failed to build lint kernel > TB --- 2010-06-21 18:16:05 - 5515.73 user 922.46 system 7264.84 real > > > http://tinderbox.freebsd.org/tinderbox-head-HEAD-i386-i386.full > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 18:31:40 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D8741065717; Mon, 21 Jun 2010 18:31:40 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id CEBD48FC13; Mon, 21 Jun 2010 18:31:39 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o5LIVdgF096255; Mon, 21 Jun 2010 14:31:39 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o5LIVdaV096254; Mon, 21 Jun 2010 18:31:39 GMT (envelope-from tinderbox@freebsd.org) Date: Mon, 21 Jun 2010 18:31:39 GMT Message-Id: <201006211831.o5LIVdaV096254@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on ia64/ia64 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 18:31:40 -0000 TB --- 2010-06-21 17:07:18 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-06-21 17:07:18 - starting HEAD tinderbox run for ia64/ia64 TB --- 2010-06-21 17:07:18 - cleaning the object tree TB --- 2010-06-21 17:07:36 - cvsupping the source tree TB --- 2010-06-21 17:07:36 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/ia64/ia64/supfile TB --- 2010-06-21 17:07:51 - building world TB --- 2010-06-21 17:07:51 - MAKEOBJDIRPREFIX=/obj TB --- 2010-06-21 17:07:51 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2010-06-21 17:07:51 - TARGET=ia64 TB --- 2010-06-21 17:07:51 - TARGET_ARCH=ia64 TB --- 2010-06-21 17:07:51 - TZ=UTC TB --- 2010-06-21 17:07:51 - __MAKE_CONF=/dev/null TB --- 2010-06-21 17:07:51 - cd /src TB --- 2010-06-21 17:07:51 - /usr/bin/make -B buildworld >>> World build started on Mon Jun 21 17:07:55 UTC 2010 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries >>> stage 4.3: make dependencies >>> stage 4.4: building everything >>> World build completed on Mon Jun 21 18:30:09 UTC 2010 TB --- 2010-06-21 18:30:09 - generating LINT kernel config TB --- 2010-06-21 18:30:09 - cd /src/sys/ia64/conf TB --- 2010-06-21 18:30:09 - /usr/bin/make -B LINT TB --- 2010-06-21 18:30:09 - building LINT kernel TB --- 2010-06-21 18:30:09 - MAKEOBJDIRPREFIX=/obj TB --- 2010-06-21 18:30:09 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2010-06-21 18:30:09 - TARGET=ia64 TB --- 2010-06-21 18:30:09 - TARGET_ARCH=ia64 TB --- 2010-06-21 18:30:09 - TZ=UTC TB --- 2010-06-21 18:30:09 - __MAKE_CONF=/dev/null TB --- 2010-06-21 18:30:09 - cd /src TB --- 2010-06-21 18:30:09 - /usr/bin/make -B buildkernel KERNCONF=LINT >>> Kernel build for LINT started on Mon Jun 21 18:30:09 UTC 2010 >>> stage 1: configuring the kernel >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3.1: making dependencies [...] awk -f /src/sys/tools/makeobjops.awk /src/sys/kgssapi/kgss_if.m -h awk -f /src/sys/tools/makeobjops.awk /src/sys/libkern/iconv_converter_if.m -h awk -f /src/sys/tools/makeobjops.awk /src/sys/opencrypto/cryptodev_if.m -h awk -f /src/sys/tools/makeobjops.awk /src/sys/dev/acpica/acpi_if.m -h rm -f .newdep /usr/bin/make -V CFILES -V SYSTEM_CFILES -V GEN_CFILES | MKDEP_CPP="cc -E" CC="cc" xargs mkdep -a -f .newdep -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -I/src/sys/contrib/ipfilter -I/src/sys/contrib/pf -I/src/sys/dev/ath -I/src/sys/dev/ath/ath_hal -I/src/sys/contrib/ngatm -I/src/sys/dev/twa -I/src/sys/gnu/fs/xfs/FreeBSD -I/src/sys/gnu/fs/xfs/FreeBSD/support -I/src/sys/gnu/fs/xfs -I/src/sys/contrib/opensolaris/compat -I/src/sys/dev/cxgb -I/src/sys/contrib/ia64/libuwx/src -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=15000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-builtin -mconstant-gp -ffixed-r13 -mfixed-range=f32-f127 -fpic -ffreestanding /src/sys/dev/acpica/acpi_hpet.c:34:22: error: opt_apic.h: No such file or directory mkdep: compile failed *** Error code 1 Stop in /obj/ia64/src/sys/LINT. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2010-06-21 18:31:39 - WARNING: /usr/bin/make returned exit code 1 TB --- 2010-06-21 18:31:39 - ERROR: failed to build lint kernel TB --- 2010-06-21 18:31:39 - 3947.28 user 661.32 system 5060.38 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-ia64-ia64.full From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 18:52:16 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B5DE106564A; Mon, 21 Jun 2010 18:52:16 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.31.29]) by mx1.freebsd.org (Postfix) with ESMTP id 84EF28FC13; Mon, 21 Jun 2010 18:52:15 +0000 (UTC) Received: from [78.34.140.134] (helo=r500.local) by smtprelay02.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1OQm6P-0008Qd-CW; Mon, 21 Jun 2010 20:52:13 +0200 Date: Mon, 21 Jun 2010 20:52:28 +0200 From: Fabian Keil To: Lawrence Stewart Message-ID: <20100621205228.0e5332cc@r500.local> In-Reply-To: <4C1EE644.3070105@freebsd.org> References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> <4C1E0E14.3090506@freebsd.org> <20100620151554.58e486db@r500.local> <20100620161242.59381341@r500.local> <20100620213601.050fcf3e@r500.local> <6CE5B32B-2C82-436D-82E3-489D2D22C7EA@lavabit.com> <4C1EE644.3070105@freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/G66arsCBtb_DrBlKhgyKUd_"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 18:52:16 -0000 --Sig_/G66arsCBtb_DrBlKhgyKUd_ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Lawrence Stewart wrote: > On 06/21/10 05:44, Rui Paulo wrote: > > > > On 20 Jun 2010, at 20:36, Fabian Keil wrote: > > > >> Fabian Keil wrote: > >> > >>> Fabian Keil wrote: > >> > >>>> My custom kernel normally doesn't have INVARIANTS and WITNESS > >>>> enabled, so I'll try to enable them next. > >>> > >>> The culprit seem to be non-default KTR settings in the kernel > >>> while loading alq as a module. > >> > >> Actually whether or not alq is loaded as a module doesn't > >> seem to matter, with: > >> > >> options KTR > >> options KTR_ENTRIES=3D262144 > >> options KTR_COMPILE=3D(KTR_SCHED) > >> options KTR_MASK=3D(KTR_SCHED) > >> options KTR_CPUMASK=3D0x3 > >> options ALQ > >> options KTR_ALQ > >> > >> enabling siftr panics the system, too. > > > > That's probably because your module was built with different compile ti= me options than the ones used in the kernel. These options may change struc= ture sizes, function parameters, etc. and that easily causes panics. >=20 > hmm I wonder if my instructions to build SIFTR manually are causing your= =20 > problems. Fabian, is the siftr.ko module you're loading built as part of= =20 > a "make buildkernel", or did you follow my instructions and "cd=20 > /sys/modules/siftr ; make ; kldload ./siftr.ko"? The latter. > If the latter is true, perhaps try and explicitly build SIFTR as part of= =20 > "make buildkernel" and see if loading the module built that way still=20 > triggers the panic when enabled (the module will be in=20 > /usr/obj//sys//modules//sys/modules/s= iftr/siftr.ko=20 > or if you "make installkernel" it'll be in /boot/kernel/kernel/siftr.ko). That seems to work. Fabian --Sig_/G66arsCBtb_DrBlKhgyKUd_ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwftPEACgkQBYqIVf93VJ1ZjQCghr/4lTHsXky8y4KkctgsjJiy 4AcAniqqNaVSIuEIPKzCnbYuUetrk4TX =nwK5 -----END PGP SIGNATURE----- --Sig_/G66arsCBtb_DrBlKhgyKUd_-- From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 19:20:02 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B7A9106564A for ; Mon, 21 Jun 2010 19:20:02 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 299FE8FC13 for ; Mon, 21 Jun 2010 19:20:00 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-8-131.flashcable.ch [91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id o5LJJvNp025233; Mon, 21 Jun 2010 21:19:59 +0200 (CEST) (envelope-from andreast-list@fgznet.ch) Message-ID: <4C1FBB5D.4000306@fgznet.ch> Date: Mon, 21 Jun 2010 21:19:57 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.10) Gecko/20100512 Lightning/1.0b1 Thunderbird/3.0.5 MIME-Version: 1.0 To: Andriy Gapon References: <4C1CFB72.5000806@fgznet.ch> <4C1D27F9.60709@icyb.net.ua> In-Reply-To: <4C1D27F9.60709@icyb.net.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: freebsd-current Subject: Re: only 3 of 4GB memory available on amd64 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 19:20:02 -0000 On 19.06.10 22:26, Andriy Gapon wrote: > on 19/06/2010 20:16 Andreas Tobler said the following: >> Hi all, >> >> I got my hands on a t60 with 4GB of RAM (BIOS displays it) >> >> And I installed 8.1-RC1 on it: >> >> FreeBSD 8.1-RC1 #0: Mon Jun 14 13:40:28 UTC 2010 >> root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >> Timecounter "i8254" frequency 1193182 Hz quality 0 >> CPU: Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz (1828.76-MHz >> K8-class CPU) >> Origin = "GenuineIntel" Id = 0x6f6 Family = 6 Model = f Stepping = 6 >> >> Features=0xbfebfbff >> >> Features2=0xe3bd >> AMD Features=0x20100800 >> AMD Features2=0x1 >> TSC: P-state invariant >> real memory = 4294967296 (4096 MB) >> avail memory = 3092344832 (2949 MB) >> ACPI APIC Table: >> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs >> FreeBSD/SMP: 1 package(s) x 2 core(s) >> cpu0 (BSP): APIC ID: 0 >> cpu1 (AP): APIC ID: 1 >> >> >> >> Do I need to configure something special to get the full 4GB of memory? >> >> I only found the PAE hint, but this is for x86 machines, right? > > Yes, PAE is for what we call in FreeBSD land "i386". > "x86" we use for both i386 and amd64. > > Now, to the rest. > I recently investigated this topic myself, so I can share what I learned. > The first thing you'd want to have is SMAP information. > You can get it at the loader prompt with 'smap' command. > It is also reported by kernel during a verbose boot, but it is only printed to > console; it is not saved to dmesg, because it is printed before msgbuf is created. > > Example of how SMAP information looks: > SMAP type=01 base=0000000000000000 end=000000000009f800 > SMAP type=02 base=00000000000f0000 end=0000000000100000 > SMAP type=02 base=00000000fec00000 end=0000000100000000 > SMAP type=02 base=00000000e0000000 end=00000000f0000000 > SMAP type=02 base=000000000009f800 end=00000000000a0000 > SMAP type=02 base=00000000bfdf0000 end=00000000bfe00000 > SMAP type=01 base=0000000000100000 end=00000000bfde0000 > SMAP type=03 base=00000000bfde3000 end=00000000bfdf0000 > SMAP type=04 base=00000000bfde0000 end=00000000bfde3000 > SMAP type=01 base=0000000100000000 end=0000000130000000 > > Type 1 ('01') is memory ranges free for OS use. > Note that the ranges could be unsorted. > > SMAP would give you an idea what is free for OS use and what is taken away for > BIOS and hardware needs. Also note that what's reported as "avail memory" is > smaller than sum of sizes of all unreserved regions. Some space is taken away > by FreeBSD virtual memory code to store some core page/memory management > information (~3%). Memory used by kernel and preloaded modules is also not > included into "avail memory". > > If you discover that your system reserves, in your opinion, too much memory, > then consider the following things. > 1. Some memory might be allocated as video adapter's aperture and/or video > adapter's memory in case of some integrated graphics solutions. > 2. Some memory addresses below 4GB are used for MMIO (memory mapped > input/output) - accessing those addresses is actually communicating with some > hardware rather than accessing DRAM. Some hardware+firmware combinations can > hoist (or remap) DRAM that corresponds to such an address range to a different > address range above 4G. If you examine last line of my sample SMAP output, then > you'll see that there is 756MB of "type 01" RAM above 4GB and that machine has > exactly 4GB of DRAM installed - this is MMIO range 0xd0000000-0x100000000 > hoisted to 0x100000000-0x130000000. > If your hardware doesn't support that option, then too bad - the memory is > "overshadowed" by MMIO and is effectively lost. > Sometimes hoisting option (under whatever name) has to be explicitly set in BIOS > configuration. Thanks for the explanation! > That's about all. > I am curious as to what you would discover about your system - please share with us. I'd like to, but how do I get this information out of my box? There is no serial line. The only way I know is getting a screen shot. Do you know another way? Unfortunately I do not have a docking station, there I guess I'd have a serial line. Also, sorry for the delay, I had to upgrade the bios in hope that the em0 is recognized properly, but no chance: em0: port 0x3000-0x301f mem 0xee000000-0xee01ffff irq 16 at device 0.0 on pci2 em0: attempting to allocate 1 MSI vectors (1 supported) msi: routing MSI IRQ 256 to local APIC 0 vector 49 em0: using IRQ 256 for MSI em0: Using MSI interrupt em0: The EEPROM Checksum Is Not Valid Thanks again! Andreas From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 19:20:46 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 278E9106566B; Mon, 21 Jun 2010 19:20:46 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C50448FC08; Mon, 21 Jun 2010 19:20:45 +0000 (UTC) Received: by iwn7 with SMTP id 7so4673943iwn.13 for ; Mon, 21 Jun 2010 12:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; bh=S4WUBFhZMt/iqt9493XkEWI3azEhoKeJeyHrHmtR4Eo=; b=cy1waM0kRvwNXpOm3eKbRwR1+PAZdenFiSWEqWVbmVTP7PBcJftGQv7ke6n6Dy5VLk U97hOusy2Lzjpa3MpU5WG91EvCH3OEXSQQ+MnaXsTjU5ZACyQgJsVfxs1drQV5EASfNR ZwybRFk0zEFmLFDdPoQhKeJwxcQiccE1lRW78= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:openpgp:content-type :content-transfer-encoding; b=efJZz5njI4SQs4JERBxK2M2OeEiBQZR14UjvJ4pk33eNMMOxy2GIf9N+ZOsqTF7bO/ zluCutJY6h0k5EeJDBvdmPtawzTdKBJtZcsz/2dfNqya8npq1iJ+tbpmeC485/deB9vJ 9NsJpukkpyN3ceQfXJWBGLf6/7ot8kBYhIOlg= Received: by 10.231.158.132 with SMTP id f4mr5529405ibx.52.1277148045057; Mon, 21 Jun 2010 12:20:45 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-128-180.dsl.klmzmi.sbcglobal.net [99.181.128.180]) by mx.google.com with ESMTPS id r12sm23872600ibi.8.2010.06.21.12.20.43 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 12:20:44 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C1FBB8A.6020907@dataix.net> Date: Mon, 21 Jun 2010 15:20:42 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100620 Thunderbird MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <4C1F8444.80002@dataix.net> <86mxuofj40.fsf@ds4.des.no> <4C1F99E6.30202@dataix.net> <86aaqoffbg.fsf@ds4.des.no> In-Reply-To: <86aaqoffbg.fsf@ds4.des.no> X-Enigmail-Version: 1.0.1 OpenPGP: id=89D8547E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 19:20:46 -0000 On 06/21/2010 13:47, Dag-Erling Smørgrav wrote: > jhell writes: >> As to the point before you start pointing fingers as you are so gracious >> to do lately - The steps laid out are the steps I had once took to >> correct the similar problem. And I seem to be running on these systems >> fairly well mind you. > > They are still wrong, and they will not solve his problem. All they > will do is muddle the tracks and reduce our chances of ever finding out > what the problem really is. Actually I apologize as I originally read your fix to what I posted as cd to /usr/src/includes where as you are correct with those build options for a cd /usr/src. I do think that a full depends and includes build for the whole tree is a little expensive in this case but it would work the same either way. Though with what you said above (second paragraph) I would believe that trying to correct this problem first by finding out if the problem was laid out in the includes directory first would have been one step possibly in the right direction to solving the problem as I am just trying to recall what had actually solved that import of lzma issue. This is the thread with the discussion: http://bit.ly/dCuhHK Why on earth this is breaking on some machines and not on others is weird. Maybe a possibility of having the xz- port installed in comparison to the ones that don't... I didn't have that much time to analyze it when it came about. I can say that after he tried the build after the includes directory build that the `lzma_physmem' error he was getting in the subject line disappeared and he was left with just having to update libarchive & liblzma. > >> Praying for you, > > I'd rather you didn't. In reference to: http://bit.ly/dy4VSb ;) Regards, -- jhell From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 19:36:19 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 416651065672 for ; Mon, 21 Jun 2010 19:36:19 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 84EE98FC15 for ; Mon, 21 Jun 2010 19:36:18 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA00214; Mon, 21 Jun 2010 22:35:48 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OQmmZ-000Mor-VJ; Mon, 21 Jun 2010 22:35:47 +0300 Message-ID: <4C1FBF12.8060301@icyb.net.ua> Date: Mon, 21 Jun 2010 22:35:46 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Andreas Tobler References: <4C1CFB72.5000806@fgznet.ch> <4C1D27F9.60709@icyb.net.ua> <4C1FBB5D.4000306@fgznet.ch> In-Reply-To: <4C1FBB5D.4000306@fgznet.ch> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current Subject: Re: only 3 of 4GB memory available on amd64 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 19:36:19 -0000 on 21/06/2010 22:19 Andreas Tobler said the following: > On 19.06.10 22:26, Andriy Gapon wrote: > I'd like to, but how do I get this information out of my box? There is > no serial line. The only way I know is getting a screen shot. Do you > know another way? > Unfortunately I do not have a docking station, there I guess I'd have a > serial line. Screenshot is fine by today's standards :-) Especially if you can OCR it by hand. Or large enough (very large!) SC_HISTORY_SIZE in kernel options (start with 1000) and moused. Or a tiny kernel module that I wrote that can reproduce SMAP info upon loading: http://people.freebsd.org/~avg/smap.diff Comes with no guarantee or warranty :) -- Andriy Gapon From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 20:27:54 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05F75106566B; Mon, 21 Jun 2010 20:27:54 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout030.mac.com (asmtpout030.mac.com [17.148.16.105]) by mx1.freebsd.org (Postfix) with ESMTP id DBD548FC22; Mon, 21 Jun 2010 20:27:53 +0000 (UTC) MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Received: from [172.24.241.142] (natint3.juniper.net [66.129.224.36]) by asmtp030.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L4D00713SUGLX10@asmtp030.mac.com>; Mon, 21 Jun 2010 13:27:53 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006210119 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-21_01:2010-02-06, 2010-06-21, 2010-06-20 signatures=0 From: Marcel Moolenaar In-reply-to: <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> Date: Mon, 21 Jun 2010 13:27:52 -0700 Content-transfer-encoding: quoted-printable Message-id: <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> To: Anton Shterenlikht X-Mailer: Apple Mail (2.1081) Cc: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:27:54 -0000 On Jun 21, 2010, at 8:04 AM, Anton Shterenlikht wrote: > On Mon, Jun 21, 2010 at 04:45:03PM +0200, Dag-Erling Sm=F8rgrav wrote: >> jhell writes: >>> Anton Shterenlikht writes: >>>> What do you mean by "updating your headers"? >>> cd /usr/src/include && make obj && make depend && make all && make = install >>=20 >> wrong. >>=20 >> % cd /usr/src >> % make obj >> % make cleandepend >> % make depend >> % make buildincludes >> % make installincludes >>=20 >> DES >> --=20 >> Dag-Erling Sm=F8rgrav - des@des.no >=20 > Sorry, just to take one step back, why has this become > necessary for this particular box? If /usr/obj is empty, > and "svn up", followed by "svn diff", doesn't show any > local changes, why can't I go straight to make buildworld? > In other words, why do my headers need updating on this > particular box, and not on other ia64 boxes? > I must've screwed something up, haven't I? Anton, My suggestion would be to destroy the sandbox entirely and simply checkout a new one from scratch, provided you're not sharing sandboxes across NFS. I would also manually destroy your object tree under /usr/obj (or whereever you have it) before doing the buildworld. It's not impossible (double negative to emphasize that the possibility may not be big enough to worry about, but that I don't want to go there), that you have some corruption that is not exposed by "svn diff", but that is causing the build-breakages. A clean slate helps... FYI, --=20 Marcel Moolenaar xcllnt@mac.com From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 20:59:12 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 824CA106566B; Mon, 21 Jun 2010 20:59:12 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 78FC48FC0A; Mon, 21 Jun 2010 20:59:11 +0000 (UTC) Received: by fxm7 with SMTP id 7so2540901fxm.13 for ; Mon, 21 Jun 2010 13:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=Paddd5JImWhWb17wWJnIOUDzARWfXXm0fI9XEzUWt4A=; b=IeJqSAqGspwPBdkzWFu2CA1sh7SgQAP2jyFWYoAj34fwRTsHRvYUm9aqUMuonlyki/ 6ucP5QFVU0ulrcHQGBjLHRz87B5DMapHdedxxzZt67F/wZuolH0T8m4LePzB/ECTYUv7 EMT3rvq6o+PgWYbDY9lAXntSxNbh4uarS8fYU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=DoKk3DJf/6OB2oAxOUhUEQKI50//tWIK97XJpPinABGbMULiad+fbgV5YdNp9epQGQ ylNd3cp1d/dHRB+/hr2SelFpFqBJcrMq7X35mNu8T+GqfV3i7EOIgVOYCOitr2TtPWoi w8TgZ8MncWBxNAmzsauKj25QOH2VuJFIw/kFI= Received: by 10.223.21.215 with SMTP id k23mr5411023fab.54.1277153950458; Mon, 21 Jun 2010 13:59:10 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id e16sm28241906fak.32.2010.06.21.13.59.08 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 13:59:09 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1FD29A.8010703@FreeBSD.org> Date: Mon, 21 Jun 2010 23:59:06 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Doug Barton References: <201006211816.o5LIG5ZK064161@freebsd-current.sentex.ca> <4C1FAF70.2030308@FreeBSD.org> In-Reply-To: <4C1FAF70.2030308@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: i386@freebsd.org, FreeBSD Tinderbox , current@freebsd.org Subject: Re: [head tinderbox] failure on i386/i386 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:59:12 -0000 Doug Barton wrote: > mav, could this be related to r209371? It is. Fixed. Thanks. > On 06/21/10 11:16, FreeBSD Tinderbox wrote: >> TB --- 2010-06-21 16:15:00 - tinderbox 2.6 running on >> freebsd-current.sentex.ca >> TB --- 2010-06-21 16:15:00 - starting HEAD tinderbox run for i386/i386 >> TB --- 2010-06-21 16:15:00 - cleaning the object tree >> TB --- 2010-06-21 16:15:40 - cvsupping the source tree >> TB --- 2010-06-21 16:15:40 - /usr/bin/csup -z -r 3 -g -L 1 -h >> cvsup.sentex.ca /tinderbox/HEAD/i386/i386/supfile >> TB --- 2010-06-21 16:21:07 - building world >> TB --- 2010-06-21 16:21:07 - MAKEOBJDIRPREFIX=/obj >> TB --- 2010-06-21 16:21:07 - PATH=/usr/bin:/usr/sbin:/bin:/sbin >> TB --- 2010-06-21 16:21:07 - TARGET=i386 >> TB --- 2010-06-21 16:21:07 - TARGET_ARCH=i386 >> TB --- 2010-06-21 16:21:07 - TZ=UTC >> TB --- 2010-06-21 16:21:07 - __MAKE_CONF=/dev/null >> TB --- 2010-06-21 16:21:07 - cd /src >> TB --- 2010-06-21 16:21:07 - /usr/bin/make -B buildworld >>>>> World build started on Mon Jun 21 16:21:07 UTC 2010 >>>>> Rebuilding the temporary build tree >>>>> stage 1.1: legacy release compatibility shims >>>>> stage 1.2: bootstrap tools >>>>> stage 2.1: cleaning up the object tree >>>>> stage 2.2: rebuilding the object tree >>>>> stage 2.3: build tools >>>>> stage 3: cross tools >>>>> stage 4.1: building includes >>>>> stage 4.2: building libraries >>>>> stage 4.3: make dependencies >>>>> stage 4.4: building everything >>>>> World build completed on Mon Jun 21 18:01:08 UTC 2010 >> TB --- 2010-06-21 18:01:08 - generating LINT kernel config >> TB --- 2010-06-21 18:01:08 - cd /src/sys/i386/conf >> TB --- 2010-06-21 18:01:08 - /usr/bin/make -B LINT >> TB --- 2010-06-21 18:01:08 - building LINT kernel >> TB --- 2010-06-21 18:01:08 - MAKEOBJDIRPREFIX=/obj >> TB --- 2010-06-21 18:01:08 - PATH=/usr/bin:/usr/sbin:/bin:/sbin >> TB --- 2010-06-21 18:01:08 - TARGET=i386 >> TB --- 2010-06-21 18:01:08 - TARGET_ARCH=i386 >> TB --- 2010-06-21 18:01:08 - TZ=UTC >> TB --- 2010-06-21 18:01:08 - __MAKE_CONF=/dev/null >> TB --- 2010-06-21 18:01:08 - cd /src >> TB --- 2010-06-21 18:01:08 - /usr/bin/make -B buildkernel KERNCONF=LINT >>>>> Kernel build for LINT started on Mon Jun 21 18:01:09 UTC 2010 >>>>> stage 1: configuring the kernel >>>>> stage 2.1: cleaning up the object tree >>>>> stage 2.2: rebuilding the object tree >>>>> stage 2.3: build tools >>>>> stage 3.1: making dependencies >>>>> stage 3.2: building everything >> [...] >> :> hack.c >> cc -shared -nostdlib hack.c -o hack.So >> rm -f hack.c >> MAKE=/usr/bin/make sh /src/sys/conf/newvers.sh LINT >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall >> -Wredundant-decls -Wnested-externs -Wstrict-prototypes >> -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef >> -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys >> -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS >> -include opt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 -DGPROF >> -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin >> -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx >> -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector -Werror -pg -mprofiler-epilogue vers.c >> linking kernel >> apm.o(.text+0x100a): In function `apm_attach': >> : undefined reference to `atrtcclock_disable' >> *** Error code 1 >> >> Stop in /obj/i386/src/sys/LINT. >> *** Error code 1 >> >> Stop in /src. >> *** Error code 1 >> >> Stop in /src. >> TB --- 2010-06-21 18:16:05 - WARNING: /usr/bin/make returned exit code 1 >> TB --- 2010-06-21 18:16:05 - ERROR: failed to build lint kernel >> TB --- 2010-06-21 18:16:05 - 5515.73 user 922.46 system 7264.84 real >> >> >> http://tinderbox.freebsd.org/tinderbox-head-HEAD-i386-i386.full -- Alexander Motin From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 21:29:42 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A6FA1065670 for ; Mon, 21 Jun 2010 21:29:42 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id CBFC28FC12 for ; Mon, 21 Jun 2010 21:29:41 +0000 (UTC) Received: (qmail 21105 invoked by uid 399); 21 Jun 2010 21:29:39 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 21 Jun 2010 21:29:39 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C1FD9BE.80102@FreeBSD.org> Date: Mon, 21 Jun 2010 14:29:34 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Alexander Motin References: <201006211816.o5LIG5ZK064161@freebsd-current.sentex.ca> <4C1FAF70.2030308@FreeBSD.org> <4C1FD29A.8010703@FreeBSD.org> In-Reply-To: <4C1FD29A.8010703@FreeBSD.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: i386@freebsd.org, FreeBSD Tinderbox , current@freebsd.org Subject: Re: [head tinderbox] failure on i386/i386 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 21:29:42 -0000 On 06/21/10 13:59, Alexander Motin wrote: > Doug Barton wrote: >> mav, could this be related to r209371? > > It is. Fixed. Thanks. Thank YOU for jumping on it so quickly. :) Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 21:41:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A279106564A for ; Mon, 21 Jun 2010 21:41:43 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 992F58FC20 for ; Mon, 21 Jun 2010 21:41:42 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-8-131.flashcable.ch [91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id o5LLfdS8059661; Mon, 21 Jun 2010 23:41:40 +0200 (CEST) (envelope-from andreast-list@fgznet.ch) Message-ID: <4C1FDC93.6010701@fgznet.ch> Date: Mon, 21 Jun 2010 23:41:39 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.10) Gecko/20100512 Lightning/1.0b1 Thunderbird/3.0.5 MIME-Version: 1.0 To: Andriy Gapon References: <4C1CFB72.5000806@fgznet.ch> <4C1D27F9.60709@icyb.net.ua> <4C1FBB5D.4000306@fgznet.ch> <4C1FBF12.8060301@icyb.net.ua> In-Reply-To: <4C1FBF12.8060301@icyb.net.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: freebsd-current Subject: Re: only 3 of 4GB memory available on amd64 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 21:41:43 -0000 On 21.06.10 21:35, Andriy Gapon wrote: > on 21/06/2010 22:19 Andreas Tobler said the following: >> On 19.06.10 22:26, Andriy Gapon wrote: >> I'd like to, but how do I get this information out of my box? There is >> no serial line. The only way I know is getting a screen shot. Do you >> know another way? >> Unfortunately I do not have a docking station, there I guess I'd have a >> serial line. > > Screenshot is fine by today's standards :-) Especially if you can OCR it by hand. It will end up in a png :) > Or large enough (very large!) SC_HISTORY_SIZE in kernel options (start with > 1000) and moused. I'll try that. > Or a tiny kernel module that I wrote that can reproduce SMAP info upon loading: > http://people.freebsd.org/~avg/smap.diff > Comes with no guarantee or warranty :) > This one too, I'll try it. But nevertheless my interest in this piece of HW has dropped. I got this t60 because the display is broken, someone broke the glass. This is no problem so far, but the issue that I can only access it via cardbus netif is boring me. Thanks for your hints! Andreas From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 23:26:16 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95342106564A for ; Mon, 21 Jun 2010 23:26:16 +0000 (UTC) (envelope-from alexbestms@uni-muenster.de) Received: from SECMAIL.UNI-MUENSTER.DE (SECMAIL.UNI-MUENSTER.DE [128.176.192.141]) by mx1.freebsd.org (Postfix) with ESMTP id 7F26A8FC14 for ; Mon, 21 Jun 2010 23:26:15 +0000 (UTC) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTP id 0912FBF409 for ; Tue, 22 Jun 2010 01:26:13 +0200 (CEST) Received: by vws1 with SMTP id 1so1874285vws.13 for ; Mon, 21 Jun 2010 16:26:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.44.147 with SMTP id a19mr3640914qaf.194.1277162772149; Mon, 21 Jun 2010 16:26:12 -0700 (PDT) Received: by 10.229.215.196 with HTTP; Mon, 21 Jun 2010 16:26:12 -0700 (PDT) Date: Tue, 22 Jun 2010 01:26:12 +0200 Message-ID: From: Alexander Best To: freebsd-current@FreeBSD.org Content-Type: multipart/mixed; boundary=00c09f9b06a75ab501048992a1ce Cc: Alex Keda , Jeff Roberson Subject: Re: SUJ problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 23:26:16 -0000 --00c09f9b06a75ab501048992a1ce Content-Type: text/plain; charset=ISO-8859-1 i experienced the same problem running r209391. this might have to do something with a fs being full. i saw these warnings during buildworld when eventuall / ran out of space: Jun 21 21:32:55 otaku kernel: pid 1398 (sakura), uid 1001 inumber 2661904 on /: filesystem full Jun 21 21:32:59 otaku kernel: pid 1398 (sakura), uid 1001 inumber 2661904 on /: filesystem full Jun 21 21:33:00 otaku kernel: pid 76033 (dd), uid 2 inumber 2591139 on /: filesystem full Jun 21 21:33:02 otaku kernel: pid 1398 (sakura), uid 1001 inumber 2661904 on /: filesystem full Jun 21 21:33:07 otaku kernel: pid 75215 (chrome), uid 1001 inumber 18205737 on /: filesystem full Jun 21 21:33:08 otaku kernel: pid 1467 (script), uid 1001 inumber 14226185 on /: filesystem full Jun 21 21:33:08 otaku kernel: pid 1398 (sakura), uid 1001 inumber 2661904 on /: filesystem full Jun 21 21:33:11 otaku kernel: pid 1398 (sakura), uid 1001 inumber 2661904 on /: filesystem full Jun 21 21:33:18 otaku kernel: pid 75215 (chrome), uid 1001 inumber 18205702 on /: filesystem full Jun 21 21:33:28 otaku kernel: pid 1398 (sakura), uid 1001 inumber 2661461 on /: filesystem full Jun 21 21:33:39 otaku kernel: pid 1398 (sakura), uid 1001 inumber 2661461 on /: filesystem full Jun 21 21:33:47 otaku kernel: pid 1398 (sakura), uid 1001 inumber 2661904 on /: filesystem full Jun 21 21:33:48 otaku kernel: pid 75215 (chrome), uid 1001 inumber 16086093 on /: filesystem full Jun 21 21:33:50 otaku kernel: pid 1398 (sakura), uid 1001 inumber 2661461 on /: filesystem full followed by lots of Jun 21 21:35:25 otaku kernel: bad block 7020785329444114652, ino 7468267 Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber 7468267 on /: bad block Jun 21 21:35:25 otaku kernel: bad block -315669439672768816, ino 7468267 Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber 7468267 on /: bad block Jun 21 21:35:25 otaku kernel: bad block -3220207053503867546, ino 7468267 Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber 7468267 on /: bad block Jun 21 21:35:25 otaku kernel: bad block -6419917778393221405, ino 7468267 Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber 7468267 on /: bad block Jun 21 21:35:25 otaku kernel: bad block 3919397040058727880, ino 7468267 Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber 7468267 on /: bad block Jun 21 21:35:25 otaku kernel: bad block -6888424595660707789, ino 7468267 Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber 7468267 on /: bad block Jun 21 21:35:25 otaku kernel: g_vfs_done():ufs/rootfs[READ(offset=100240429127958528, length=16384)]error = 5 Jun 21 21:35:25 otaku kernel: bad block -1173790944229704887, ino 7468267 Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber 7468267 on /: bad block Jun 21 21:35:25 otaku kernel: bad block 5537349803492323867, ino 7468267 Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber 7468267 on /: bad block Jun 21 21:35:25 otaku kernel: bad block 882554538064816358, ino 7468267 Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber 7468267 on /: bad block Jun 21 21:35:25 otaku kernel: bad block -2565060229441336925, ino 7468267 ~ 2 minutes later (see timestamp). i then did a `find / -inum 7468267` but couldn't find the file. i then did a clean reboot using `shutdown -r now`. the buffers got synched down to 0 however it said something like "/ cannot be unmounted filesystem busy". i then was thrown into single user mode due to the same problem alex kada reported. at some point i did a `mount -f /` and did `dmesg -a > /FEHLER`. strange thing is that everything seems to have been piped to that file twice. after that i did `fastboot` and freebsd came up with / being clean (although the last fsck report said / was marked dirty). i've attached the file. cheers. -- Alexander Best --00c09f9b06a75ab501048992a1ce Content-Type: text/plain; charset=US-ASCII; name="FEHLER.txt" Content-Disposition: attachment; filename="FEHLER.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gapxja8w0 Q29weXJpZ2h0IChjKSAxOTkyLTIwMTAgVGhlIEZyZWVCU0QgUHJvamVjdC4KQ29weXJpZ2h0IChj KSAxOTc5LCAxOTgwLCAxOTgzLCAxOTg2LCAxOTg4LCAxOTg5LCAxOTkxLCAxOTkyLCAxOTkzLCAx OTk0CglUaGUgUmVnZW50cyBvZiB0aGUgVW5pdmVyc2l0eSBvZiBDYWxpZm9ybmlhLiBBbGwgcmln aHRzIHJlc2VydmVkLgpGcmVlQlNEIGlzIGEgcmVnaXN0ZXJlZCB0cmFkZW1hcmsgb2YgVGhlIEZy ZWVCU0QgRm91bmRhdGlvbi4KRnJlZUJTRCA5LjAtQ1VSUkVOVCAjMCByMjA5MzkxOiBNb24gSnVu IDIxIDE3OjUzOjE0IENFU1QgMjAxMAogICAgcm9vdEBvdGFrdTovdXNyL29iai91c3Ivc3JjL3N5 cy9BUlVOREVMIGFtZDY0CkNQVTogSW50ZWwoUikgUGVudGl1bShSKSBEdWFsICBDUFUgIEUyMTYw ICBAIDEuODBHSHogKDE4MDAuMDQtTUh6IEs4LWNsYXNzIENQVSkKICBPcmlnaW4gPSAiR2VudWlu ZUludGVsIiAgSWQgPSAweDZmZCAgRmFtaWx5ID0gNiAgTW9kZWwgPSBmICBTdGVwcGluZyA9IDEz CiAgRmVhdHVyZXM9MHhiZmViZmJmZjxGUFUsVk1FLERFLFBTRSxUU0MsTVNSLFBBRSxNQ0UsQ1g4 LEFQSUMsU0VQLE1UUlIsUEdFLE1DQSxDTU9WLFBBVCxQU0UzNixDTEZMVVNILERUUyxBQ1BJLE1N WCxGWFNSLFNTRSxTU0UyLFNTLEhUVCxUTSxQQkU+CiAgRmVhdHVyZXMyPTB4ZTM5ZDxTU0UzLERU RVM2NCxNT04sRFNfQ1BMLEVTVCxUTTIsU1NTRTMsQ1gxNix4VFBSLFBEQ00+CiAgQU1EIEZlYXR1 cmVzPTB4MjAxMDA4MDA8U1lTQ0FMTCxOWCxMTT4KICBBTUQgRmVhdHVyZXMyPTB4MTxMQUhGPgog IFRTQzogUC1zdGF0ZSBpbnZhcmlhbnQKcmVhbCBtZW1vcnkgID0gMjE0NzQ4MzY0OCAoMjA0OCBN QikKYXZhaWwgbWVtb3J5ID0gMjA0NTE0OTE4NCAoMTk1MCBNQikKRXZlbnQgdGltZXIgIkxBUElD IiBmcmVxdWVuY3kgMCBIeiBxdWFsaXR5IDUwMApBQ1BJIEFQSUMgVGFibGU6IDxHQlQgICAgR0JU VUFDUEk+CkZyZWVCU0QvU01QOiBNdWx0aXByb2Nlc3NvciBTeXN0ZW0gRGV0ZWN0ZWQ6IDIgQ1BV cwpGcmVlQlNEL1NNUDogMSBwYWNrYWdlKHMpIHggMiBjb3JlKHMpCiBjcHUwIChCU1ApOiBBUElD IElEOiAgMAogY3B1MSAoQVApOiBBUElDIElEOiAgMQppb2FwaWMwOiBDaGFuZ2luZyBBUElDIElE IHRvIDIKaW9hcGljMCA8VmVyc2lvbiAyLjA+IGlycXMgMC0yMyBvbiBtb3RoZXJib2FyZAphY3Bp MDogPEdCVCBHQlRVQUNQST4gb24gbW90aGVyYm9hcmQKYWNwaTA6IFtJVEhSRUFEXQphY3BpMDog UG93ZXIgQnV0dG9uIChmaXhlZCkKYWNwaTA6IHJlc2VydmF0aW9uIG9mIDAsIGEwMDAwICgzKSBm YWlsZWQKYWNwaTA6IHJlc2VydmF0aW9uIG9mIDEwMDAwMCwgN2ZkZTAwMDAgKDMpIGZhaWxlZApU aW1lY291bnRlciAiQUNQSS1mYXN0IiBmcmVxdWVuY3kgMzU3OTU0NSBIeiBxdWFsaXR5IDEwMDAK YWNwaV90aW1lcjA6IDwyNC1iaXQgdGltZXIgYXQgMy41Nzk1NDVNSHo+IHBvcnQgMHg0MDgtMHg0 MGIgb24gYWNwaTAKY3B1MDogPEFDUEkgQ1BVPiBvbiBhY3BpMApjcHUxOiA8QUNQSSBDUFU+IG9u IGFjcGkwCmFjcGlfYnV0dG9uMDogPFBvd2VyIEJ1dHRvbj4gb24gYWNwaTAKcGNpYjA6IDxBQ1BJ IEhvc3QtUENJIGJyaWRnZT4gcG9ydCAweGNmOC0weGNmZiBvbiBhY3BpMApwY2kwOiA8QUNQSSBQ Q0kgYnVzPiBvbiBwY2liMApwY2liMTogPFBDSS1QQ0kgYnJpZGdlPiBpcnEgMTYgYXQgZGV2aWNl IDEuMCBvbiBwY2kwCnBjaTE6IDxQQ0kgYnVzPiBvbiBwY2liMQp2Z2FwY2kwOiA8VkdBLWNvbXBh dGlibGUgZGlzcGxheT4gcG9ydCAweGIwMDAtMHhiMDdmIG1lbSAweGY2MDAwMDAwLTB4ZjZmZmZm ZmYsMHhlMDAwMDAwMC0weGVmZmZmZmZmLDB4ZjQwMDAwMDAtMHhmNWZmZmZmZiBpcnEgMTYgYXQg ZGV2aWNlIDAuMCBvbiBwY2kxCm52aWRpYTA6IDxHZUZvcmNlIDk2MDAgR1Q+IG9uIHZnYXBjaTAK dmdhcGNpMDogY2hpbGQgbnZpZGlhMCByZXF1ZXN0ZWQgcGNpX2VuYWJsZV9idXNtYXN0ZXIKdmdh cGNpMDogY2hpbGQgbnZpZGlhMCByZXF1ZXN0ZWQgcGNpX2VuYWJsZV9pbwp2Z2FwY2kwOiBjaGls ZCBudmlkaWEwIHJlcXVlc3RlZCBwY2lfZW5hYmxlX2lvCm52aWRpYTA6IFtJVEhSRUFEXQp1aGNp MDogPEludGVsIDgyODAxSSAoSUNIOSkgVVNCIGNvbnRyb2xsZXI+IHBvcnQgMHhlMTAwLTB4ZTEx ZiBpcnEgMTYgYXQgZGV2aWNlIDI2LjAgb24gcGNpMAp1aGNpMDogW0lUSFJFQURdCnVzYnVzMDog PEludGVsIDgyODAxSSAoSUNIOSkgVVNCIGNvbnRyb2xsZXI+IG9uIHVoY2kwCnVoY2kxOiA8SW50 ZWwgODI4MDFJIChJQ0g5KSBVU0IgY29udHJvbGxlcj4gcG9ydCAweGUyMDAtMHhlMjFmIGlycSAy MSBhdCBkZXZpY2UgMjYuMSBvbiBwY2kwCnVoY2kxOiBbSVRIUkVBRF0KdXNidXMxOiA8SW50ZWwg ODI4MDFJIChJQ0g5KSBVU0IgY29udHJvbGxlcj4gb24gdWhjaTEKdWhjaTI6IDxJbnRlbCA4Mjgw MUkgKElDSDkpIFVTQiBjb250cm9sbGVyPiBwb3J0IDB4ZTAwMC0weGUwMWYgaXJxIDE4IGF0IGRl dmljZSAyNi4yIG9uIHBjaTAKdWhjaTI6IFtJVEhSRUFEXQp1c2J1czI6IDxJbnRlbCA4MjgwMUkg KElDSDkpIFVTQiBjb250cm9sbGVyPiBvbiB1aGNpMgplaGNpMDogPEludGVsIDgyODAxSSAoSUNI OSkgVVNCIDIuMCBjb250cm9sbGVyPiBtZW0gMHhmYTIwNTAwMC0weGZhMjA1M2ZmIGlycSAxOCBh dCBkZXZpY2UgMjYuNyBvbiBwY2kwCmVoY2kwOiBbSVRIUkVBRF0KdXNidXMzOiBFSENJIHZlcnNp b24gMS4wCnVzYnVzMzogPEludGVsIDgyODAxSSAoSUNIOSkgVVNCIDIuMCBjb250cm9sbGVyPiBv biBlaGNpMApoZGFjMDogPEludGVsIDgyODAxSSBIaWdoIERlZmluaXRpb24gQXVkaW8gQ29udHJv bGxlcj4gbWVtIDB4ZmEyMDAwMDAtMHhmYTIwM2ZmZiBpcnEgMjIgYXQgZGV2aWNlIDI3LjAgb24g cGNpMApoZGFjMDogSERBIERyaXZlciBSZXZpc2lvbjogMjAxMDAyMjZfMDE0MgpoZGFjMDogW0lU SFJFQURdCnBjaWIyOiA8QUNQSSBQQ0ktUENJIGJyaWRnZT4gaXJxIDE2IGF0IGRldmljZSAyOC4w IG9uIHBjaTAKcGNpMjogPEFDUEkgUENJIGJ1cz4gb24gcGNpYjIKcGNpYjM6IDxBQ1BJIFBDSS1Q Q0kgYnJpZGdlPiBpcnEgMTkgYXQgZGV2aWNlIDI4LjMgb24gcGNpMApwY2kzOiA8QUNQSSBQQ0kg YnVzPiBvbiBwY2liMwphaGNpMDogPEpNaWNyb24gSk1CMzYzIEFIQ0kgU0FUQSBjb250cm9sbGVy PiBtZW0gMHhmYTAwMDAwMC0weGZhMDAxZmZmIGlycSAxOSBhdCBkZXZpY2UgMC4wIG9uIHBjaTMK YWhjaTA6IFtJVEhSRUFEXQphaGNpMDogQUhDSSB2MS4wMCB3aXRoIDIgM0dicHMgcG9ydHMsIFBv cnQgTXVsdGlwbGllciBzdXBwb3J0ZWQKYWhjaWNoMDogPEFIQ0kgY2hhbm5lbD4gYXQgY2hhbm5l bCAwIG9uIGFoY2kwCmFoY2ljaDA6IFtJVEhSRUFEXQphaGNpY2gxOiA8QUhDSSBjaGFubmVsPiBh dCBjaGFubmVsIDEgb24gYWhjaTAKYWhjaWNoMTogW0lUSFJFQURdCmF0YXBjaTA6IDxKTWljcm9u IEpNQjM2MyBVRE1BMTMzIGNvbnRyb2xsZXI+IHBvcnQgMHhjMDAwLTB4YzAwNywweGMxMDAtMHhj MTAzLDB4YzIwMC0weGMyMDcsMHhjMzAwLTB4YzMwMywweGM0MDAtMHhjNDBmIGlycSAxNiBhdCBk ZXZpY2UgMC4xIG9uIHBjaTMKYXRhcGNpMDogW0lUSFJFQURdCmF0YTI6IDxBVEEgY2hhbm5lbCAw PiBvbiBhdGFwY2kwCmF0YTI6IFtJVEhSRUFEXQpwY2liNDogPEFDUEkgUENJLVBDSSBicmlkZ2U+ IGlycSAxNiBhdCBkZXZpY2UgMjguNCBvbiBwY2kwCnBjaTQ6IDxBQ1BJIFBDSSBidXM+IG9uIHBj aWI0CnVoY2kzOiA8SW50ZWwgODI4MDFJIChJQ0g5KSBVU0IgY29udHJvbGxlcj4gcG9ydCAweGUz MDAtMHhlMzFmIGlycSAyMyBhdCBkZXZpY2UgMjkuMCBvbiBwY2kwCnVoY2kzOiBbSVRIUkVBRF0K dXNidXM0OiA8SW50ZWwgODI4MDFJIChJQ0g5KSBVU0IgY29udHJvbGxlcj4gb24gdWhjaTMKdWhj aTQ6IDxJbnRlbCA4MjgwMUkgKElDSDkpIFVTQiBjb250cm9sbGVyPiBwb3J0IDB4ZTQwMC0weGU0 MWYgaXJxIDE5IGF0IGRldmljZSAyOS4xIG9uIHBjaTAKdWhjaTQ6IFtJVEhSRUFEXQp1c2J1czU6 IDxJbnRlbCA4MjgwMUkgKElDSDkpIFVTQiBjb250cm9sbGVyPiBvbiB1aGNpNAp1aGNpNTogPElu dGVsIDgyODAxSSAoSUNIOSkgVVNCIGNvbnRyb2xsZXI+IHBvcnQgMHhlNTAwLTB4ZTUxZiBpcnEg MTggYXQgZGV2aWNlIDI5LjIgb24gcGNpMAp1aGNpNTogW0lUSFJFQURdCnVzYnVzNjogPEludGVs IDgyODAxSSAoSUNIOSkgVVNCIGNvbnRyb2xsZXI+IG9uIHVoY2k1CmVoY2kxOiA8SW50ZWwgODI4 MDFJIChJQ0g5KSBVU0IgMi4wIGNvbnRyb2xsZXI+IG1lbSAweGZhMjA0MDAwLTB4ZmEyMDQzZmYg aXJxIDIzIGF0IGRldmljZSAyOS43IG9uIHBjaTAKZWhjaTE6IFtJVEhSRUFEXQp1c2J1czc6IEVI Q0kgdmVyc2lvbiAxLjAKdXNidXM3OiA8SW50ZWwgODI4MDFJIChJQ0g5KSBVU0IgMi4wIGNvbnRy b2xsZXI+IG9uIGVoY2kxCnBjaWI1OiA8QUNQSSBQQ0ktUENJIGJyaWRnZT4gYXQgZGV2aWNlIDMw LjAgb24gcGNpMApwY2k1OiA8QUNQSSBQQ0kgYnVzPiBvbiBwY2liNQphdGgwOiA8QXRoZXJvcyA1 MjEyPiBtZW0gMHhmYTEwMDAwMC0weGZhMTBmZmZmIGlycSAxOSBhdCBkZXZpY2UgMS4wIG9uIHBj aTUKYXRoMDogW0lUSFJFQURdCmF0aDA6IEFSMjQxMyBtYWMgNy45IFJGMjQxMyBwaHkgNC41Cmlz YWIwOiA8UENJLUlTQSBicmlkZ2U+IGF0IGRldmljZSAzMS4wIG9uIHBjaTAKaXNhMDogPElTQSBi dXM+IG9uIGlzYWIwCmFoY2kxOiA8SW50ZWwgSUNIOSBBSENJIFNBVEEgY29udHJvbGxlcj4gcG9y dCAweGU2MDAtMHhlNjA3LDB4ZTcwMC0weGU3MDMsMHhlODAwLTB4ZTgwNywweGU5MDAtMHhlOTAz LDB4ZWEwMC0weGVhMWYgbWVtIDB4ZmEyMDYwMDAtMHhmYTIwNjdmZiBpcnEgMTkgYXQgZGV2aWNl IDMxLjIgb24gcGNpMAphaGNpMTogW0lUSFJFQURdCmFoY2kxOiBBSENJIHYxLjIwIHdpdGggNiAz R2JwcyBwb3J0cywgUG9ydCBNdWx0aXBsaWVyIHN1cHBvcnRlZAphaGNpY2gyOiA8QUhDSSBjaGFu bmVsPiBhdCBjaGFubmVsIDAgb24gYWhjaTEKYWhjaWNoMjogW0lUSFJFQURdCmFoY2ljaDM6IDxB SENJIGNoYW5uZWw+IGF0IGNoYW5uZWwgMSBvbiBhaGNpMQphaGNpY2gzOiBbSVRIUkVBRF0KYWhj aWNoNDogPEFIQ0kgY2hhbm5lbD4gYXQgY2hhbm5lbCAyIG9uIGFoY2kxCmFoY2ljaDQ6IFtJVEhS RUFEXQphaGNpY2g1OiA8QUhDSSBjaGFubmVsPiBhdCBjaGFubmVsIDMgb24gYWhjaTEKYWhjaWNo NTogW0lUSFJFQURdCmFoY2ljaDY6IDxBSENJIGNoYW5uZWw+IGF0IGNoYW5uZWwgNCBvbiBhaGNp MQphaGNpY2g2OiBbSVRIUkVBRF0KYWhjaWNoNzogPEFIQ0kgY2hhbm5lbD4gYXQgY2hhbm5lbCA1 IG9uIGFoY2kxCmFoY2ljaDc6IFtJVEhSRUFEXQpwY2kwOiA8c2VyaWFsIGJ1cywgU01CdXM+IGF0 IGRldmljZSAzMS4zIChubyBkcml2ZXIgYXR0YWNoZWQpCmF0dGltZXIwOiA8QVQgdGltZXI+IHBv cnQgMHg0MC0weDQzIG9uIGFjcGkwClRpbWVjb3VudGVyICJpODI1NCIgZnJlcXVlbmN5IDExOTMx ODIgSHogcXVhbGl0eSAwCmF0dGltZXIwOiBbRklMVEVSXQpFdmVudCB0aW1lciAiaTgyNTQiIGZy ZXF1ZW5jeSAxMTkzMTgyIEh6IHF1YWxpdHkgMTAwCmhwZXQwOiA8SGlnaCBQcmVjaXNpb24gRXZl bnQgVGltZXI+IGlvbWVtIDB4ZmVkMDAwMDAtMHhmZWQwMDNmZiBpcnEgMCw4IG9uIGFjcGkwClRp bWVjb3VudGVyICJIUEVUIiBmcmVxdWVuY3kgMTQzMTgxODAgSHogcXVhbGl0eSA5MDAKaHBldDA6 IFtGSUxURVJdCkV2ZW50IHRpbWVyICJIUEVUIiBmcmVxdWVuY3kgMTQzMTgxODAgSHogcXVhbGl0 eSA0NTAKRXZlbnQgdGltZXIgIkhQRVQxIiBmcmVxdWVuY3kgMTQzMTgxODAgSHogcXVhbGl0eSA0 NDAKRXZlbnQgdGltZXIgIkhQRVQyIiBmcmVxdWVuY3kgMTQzMTgxODAgSHogcXVhbGl0eSA0NDAK RXZlbnQgdGltZXIgIkhQRVQzIiBmcmVxdWVuY3kgMTQzMTgxODAgSHogcXVhbGl0eSA0NDAKYXRy dGMwOiA8QVQgcmVhbHRpbWUgY2xvY2s+IHBvcnQgMHg3MC0weDczIG9uIGFjcGkwCmF0cnRjMDog W0ZJTFRFUl0KRXZlbnQgdGltZXIgIlJUQyIgZnJlcXVlbmN5IDMyNzY4IEh6IHF1YWxpdHkgMApv cm0wOiA8SVNBIE9wdGlvbiBST01zPiBhdCBpb21lbSAweGQwMDAwLTB4ZDI3ZmYsMHhkMzAwMC0w eGQ1ZmZmIG9uIGlzYTAKc2MwOiA8U3lzdGVtIGNvbnNvbGU+IGF0IGZsYWdzIDB4MTAwIG9uIGlz YTAKc2MwOiBWR0EgPDE2IHZpcnR1YWwgY29uc29sZXMsIGZsYWdzPTB4MzAwPgp2Z2EwOiA8R2Vu ZXJpYyBJU0EgVkdBPiBhdCBwb3J0IDB4M2MwLTB4M2RmIGlvbWVtIDB4YTAwMDAtMHhiZmZmZiBv biBpc2EwCmNvcmV0ZW1wMDogPENQVSBPbi1EaWUgVGhlcm1hbCBTZW5zb3JzPiBvbiBjcHUwCmVz dDA6IDxFbmhhbmNlZCBTcGVlZFN0ZXAgRnJlcXVlbmN5IENvbnRyb2w+IG9uIGNwdTAKZXN0OiBD UFUgc3VwcG9ydHMgRW5oYW5jZWQgU3BlZWRzdGVwLCBidXQgaXMgbm90IHJlY29nbml6ZWQuCmVz dDogY3B1X3ZlbmRvciBHZW51aW5lSW50ZWwsIG1zciA5MjUwOTI1MDYwMDA5MjUKZGV2aWNlX2F0 dGFjaDogZXN0MCBhdHRhY2ggcmV0dXJuZWQgNgpwNHRjYzA6IDxDUFUgRnJlcXVlbmN5IFRoZXJt YWwgQ29udHJvbD4gb24gY3B1MApjb3JldGVtcDE6IDxDUFUgT24tRGllIFRoZXJtYWwgU2Vuc29y cz4gb24gY3B1MQplc3QxOiA8RW5oYW5jZWQgU3BlZWRTdGVwIEZyZXF1ZW5jeSBDb250cm9sPiBv biBjcHUxCmVzdDogQ1BVIHN1cHBvcnRzIEVuaGFuY2VkIFNwZWVkc3RlcCwgYnV0IGlzIG5vdCBy ZWNvZ25pemVkLgplc3Q6IGNwdV92ZW5kb3IgR2VudWluZUludGVsLCBtc3IgOTI1MDkyNTA2MDAw OTI1CmRldmljZV9hdHRhY2g6IGVzdDEgYXR0YWNoIHJldHVybmVkIDYKcDR0Y2MxOiA8Q1BVIEZy ZXF1ZW5jeSBUaGVybWFsIENvbnRyb2w+IG9uIGNwdTEKU3RhcnRpbmcga2VybmVsIGV2ZW50IHRp bWVyczogTEFQSUMgQCAxMDAwSHosIEhQRVQgQCAxMjhIegpUaW1lY291bnRlcnMgdGljayBldmVy eSAxLjAwMCBtc2VjCmhkYWMwOiBIREEgQ29kZWMgIzI6IFJlYWx0ZWsgQUxDODg1CnVzYnVzMDog MTJNYnBzIEZ1bGwgU3BlZWQgVVNCIHYxLjAKdXNidXMxOiAxMk1icHMgRnVsbCBTcGVlZCBVU0Ig djEuMAp1c2J1czI6IDEyTWJwcyBGdWxsIFNwZWVkIFVTQiB2MS4wCnVzYnVzMzogNDgwTWJwcyBI aWdoIFNwZWVkIFVTQiB2Mi4wCnVzYnVzNDogMTJNYnBzIEZ1bGwgU3BlZWQgVVNCIHYxLjAKdXNi dXM1OiAxMk1icHMgRnVsbCBTcGVlZCBVU0IgdjEuMAp1c2J1czY6IDEyTWJwcyBGdWxsIFNwZWVk IFVTQiB2MS4wCnVzYnVzNzogNDgwTWJwcyBIaWdoIFNwZWVkIFVTQiB2Mi4wCnBjbTA6IDxIREEg UmVhbHRlayBBTEM4ODUgUENNICMwIEFuYWxvZz4gYXQgY2FkIDIgbmlkIDEgb24gaGRhYzAKcGNt MTogPEhEQSBSZWFsdGVrIEFMQzg4NSBQQ00gIzEgQW5hbG9nPiBhdCBjYWQgMiBuaWQgMSBvbiBo ZGFjMApwY20yOiA8SERBIFJlYWx0ZWsgQUxDODg1IFBDTSAjMiBEaWdpdGFsPiBhdCBjYWQgMiBu aWQgMSBvbiBoZGFjMAp1Z2VuMC4xOiA8SW50ZWw+IGF0IHVzYnVzMAp1aHViMDogPEludGVsIFVI Q0kgcm9vdCBIVUIsIGNsYXNzIDkvMCwgcmV2IDEuMDAvMS4wMCwgYWRkciAxPiBvbiB1c2J1czAK dWdlbjEuMTogPEludGVsPiBhdCB1c2J1czEKdWh1YjE6IDxJbnRlbCBVSENJIHJvb3QgSFVCLCBj bGFzcyA5LzAsIHJldiAxLjAwLzEuMDAsIGFkZHIgMT4gb24gdXNidXMxCnVnZW4yLjE6IDxJbnRl bD4gYXQgdXNidXMyCnVodWIyOiA8SW50ZWwgVUhDSSByb290IEhVQiwgY2xhc3MgOS8wLCByZXYg MS4wMC8xLjAwLCBhZGRyIDE+IG9uIHVzYnVzMgp1Z2VuMy4xOiA8SW50ZWw+IGF0IHVzYnVzMwp1 aHViMzogPEludGVsIEVIQ0kgcm9vdCBIVUIsIGNsYXNzIDkvMCwgcmV2IDIuMDAvMS4wMCwgYWRk ciAxPiBvbiB1c2J1czMKdWdlbjQuMTogPEludGVsPiBhdCB1c2J1czQKdWh1YjQ6IDxJbnRlbCBV SENJIHJvb3QgSFVCLCBjbGFzcyA5LzAsIHJldiAxLjAwLzEuMDAsIGFkZHIgMT4gb24gdXNidXM0 CnVnZW41LjE6IDxJbnRlbD4gYXQgdXNidXM1CnVodWI1OiA8SW50ZWwgVUhDSSByb290IEhVQiwg Y2xhc3MgOS8wLCByZXYgMS4wMC8xLjAwLCBhZGRyIDE+IG9uIHVzYnVzNQp1Z2VuNi4xOiA8SW50 ZWw+IGF0IHVzYnVzNgp1aHViNjogPEludGVsIFVIQ0kgcm9vdCBIVUIsIGNsYXNzIDkvMCwgcmV2 IDEuMDAvMS4wMCwgYWRkciAxPiBvbiB1c2J1czYKdWdlbjcuMTogPEludGVsPiBhdCB1c2J1czcK dWh1Yjc6IDxJbnRlbCBFSENJIHJvb3QgSFVCLCBjbGFzcyA5LzAsIHJldiAyLjAwLzEuMDAsIGFk ZHIgMT4gb24gdXNidXM3CnVodWIwOiAyIHBvcnRzIHdpdGggMiByZW1vdmFibGUsIHNlbGYgcG93 ZXJlZAp1aHViMTogMiBwb3J0cyB3aXRoIDIgcmVtb3ZhYmxlLCBzZWxmIHBvd2VyZWQKdWh1YjI6 IDIgcG9ydHMgd2l0aCAyIHJlbW92YWJsZSwgc2VsZiBwb3dlcmVkCnVodWI0OiAyIHBvcnRzIHdp dGggMiByZW1vdmFibGUsIHNlbGYgcG93ZXJlZAp1aHViNTogMiBwb3J0cyB3aXRoIDIgcmVtb3Zh YmxlLCBzZWxmIHBvd2VyZWQKdWh1YjY6IDIgcG9ydHMgd2l0aCAyIHJlbW92YWJsZSwgc2VsZiBw b3dlcmVkCmFkYTAgYXQgYWhjaWNoMiBidXMgMCBzY2J1czMgdGFyZ2V0IDAgbHVuIDAKYWRhMDog PFNBTVNVTkcgU1AyNTA0QyBWVDEwMC01MD4gQVRBLTcgU0FUQSAyLnggZGV2aWNlCmFkYTA6IDMw MC4wMDBNQi9zIHRyYW5zZmVycyAoU0FUQSAyLngsIFVETUE2LCBQSU8gODE5MmJ5dGVzKQphZGEw OiBDb21tYW5kIFF1ZXVlaW5nIGVuYWJsZWQKYWRhMDogMjM4NDc0TUIgKDQ4ODM5NTA1NSA1MTIg Ynl0ZSBzZWN0b3JzOiAxNkggNjNTL1QgMTYzODNDKQpjZDAgYXQgYXRhMiBidXMgMCBzY2J1czIg dGFyZ2V0IDAgbHVuIDAKY2QwOiA8SEwtRFQtU1QgRFZEUkFNIEdTQS1IMTBOIEpMMTI+IFJlbW92 YWJsZSBDRC1ST00gU0NTSS0wIGRldmljZSAKY2QwOiAzMy4zMDBNQi9zIHRyYW5zZmVycyAoVURN QTIsIEFUQVBJIDEyYnl0ZXMsIFBJTyA2NTUzNGJ5dGVzKQpjZDA6IEF0dGVtcHQgdG8gcXVlcnkg ZGV2aWNlIHNpemUgZmFpbGVkOiBOT1QgUkVBRFksIE1lZGl1bSBub3QgcHJlc2VudApTTVA6IEFQ IENQVSAjMSBMYXVuY2hlZCEKUm9vdCBtb3VudCB3YWl0aW5nIGZvcjogdXNidXM3IHVzYnVzMwp1 aHViMzogNiBwb3J0cyB3aXRoIDYgcmVtb3ZhYmxlLCBzZWxmIHBvd2VyZWQKdWh1Yjc6IDYgcG9y dHMgd2l0aCA2IHJlbW92YWJsZSwgc2VsZiBwb3dlcmVkClJvb3QgbW91bnQgd2FpdGluZyBmb3I6 IHVzYnVzMwp1Z2VuMy4yOiA8dmVuZG9yIDB4MDQyND4gYXQgdXNidXMzCnVodWI4OiA8dmVuZG9y IDB4MDQyNCBwcm9kdWN0IDB4MjUxNCwgY2xhc3MgOS8wLCByZXYgMi4wMC8wLjAwLCBhZGRyIDI+ IG9uIHVzYnVzMwpSb290IG1vdW50IHdhaXRpbmcgZm9yOiB1c2J1czMKdWh1Yjg6IDQgcG9ydHMg d2l0aCA0IHJlbW92YWJsZSwgc2VsZiBwb3dlcmVkClRyeWluZyB0byBtb3VudCByb290IGZyb20g dWZzOi9kZXYvdWZzL3Jvb3RmcwpXQVJOSU5HOiAvIHdhcyBub3QgcHJvcGVybHkgZGlzbW91bnRl ZAovOiBtb3VudCBwZW5kaW5nIGVycm9yOiBibG9ja3MgLTY1NDA4IGZpbGVzIDAKU2V0dGluZyBo b3N0dXVpZDogMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAxYTRkNGJiNGViLgpTZXR0aW5nIGhv c3RpZDogMHg1MmYzMzYyOC4KRW50cm9weSBoYXJ2ZXN0aW5nOgogaW50ZXJydXB0cwogZXRoZXJu ZXQKIHBvaW50X3RvX3BvaW50CnVnZW4xLjI6IDxEZWxsPiBhdCB1c2J1czEKdWtiZDA6IDxEZWxs IERlbGwgVVNCIEtleWJvYXJkLCBjbGFzcyAwLzAsIHJldiAxLjEwLzMuMDYsIGFkZHIgMj4gb24g dXNidXMxCmtiZDAgYXQgdWtiZDAKIGtpY2tzdGFydAouClN0YXJ0aW5nIGZpbGUgc3lzdGVtIGNo ZWNrczoKKiogU1UrSiBSZWNvdmVyaW5nIC9kZXYvdWZzL3Jvb3RmcwoqKiBSZWFkaW5nIDMzNTU0 NDMyIGJ5dGUgam91cm5hbCBmcm9tIGlub2RlIDMuCnVnZW4xLjM6IDxSYXplcj4gYXQgdXNidXMx CnVtczA6IDxSYXplciBSYXplciAxNjAwZHBpIE1vdXNlLCBjbGFzcyAwLzAsIHJldiAyLjAwLzIx LjAwLCBhZGRyIDM+IG9uIHVzYnVzMQp1bXMwOiA3IGJ1dHRvbnMgYW5kIFtYWVpdIGNvb3JkaW5h dGVzIElEPTAKKiogQnVpbGRpbmcgcmVjb3ZlcnkgdGFibGUuCioqIFJlc29sdmluZyB1bnJlZmVy ZW5jZWQgaW5vZGUgbGlzdC4KKiogUHJvY2Vzc2luZyBqb3VybmFsIGVudHJpZXMuCmZzY2s6IAov ZGV2L3Vmcy9yb290ZnM6IEFib3J0IHRyYXA6IDYKClVua25vd24gZXJyb3I7IGhlbHAhCkVSUk9S OiBBQk9SVElORyBCT09UIChzZW5kaW5nIFNJR1RFUk0gdG8gcGFyZW50KSEKSnVuIDIyIDAyOjU5 OjUwIGluaXQ6IC9iaW4vc2ggb24gL2V0Yy9yYyB0ZXJtaW5hdGVkIGFibm9ybWFsbHksIGdvaW5n IHRvIHNpbmdsZSB1c2VyIG1vZGUKRW50ZXIgcm9vdCBwYXNzd29yZCwgb3IgXkQgdG8gZ28gbXVs dGktdXNlcgpQYXNzd29yZDoKCkp1biAyMiAwMzowMDowMCBpbml0OiBzaW5nbGUtdXNlciBsb2dp biBmYWlsZWQKUGFzc3dvcmQ6CgpKdW4gMjIgMDM6MDA6MDEgaW5pdDogTlNTV0lUQ0goX25zZGlz cGF0Y2gpOiBuaXMsIHBhc3N3ZF9jb21wYXQsIGVuZHB3ZW50LCBub3QgZm91bmQsIGFuZCBubyBm YWxsYmFjayBwcm92aWRlZApFbnRlciBmdWxsIHBhdGhuYW1lIG9mIHNoZWxsIG9yIFJFVFVSTiBm b3IgCi9iaW4vc2gKOiAKIyAKZgpzCmMKawogCi8KCioqIC9kZXYvdWZzL3Jvb3RmcwoKVVNFIEpP VVJOQUw/PyBbeW5dIAoKKiogU1UrSiBSZWNvdmVyaW5nIC9kZXYvdWZzL3Jvb3RmcwoqKiBSZWFk aW5nIDMzNTU0NDMyIGJ5dGUgam91cm5hbCBmcm9tIGlub2RlIDMuCgpSRUNPVkVSPyBbeW5dIAoK KiogQnVpbGRpbmcgcmVjb3ZlcnkgdGFibGUuCioqIFJlc29sdmluZyB1bnJlZmVyZW5jZWQgaW5v ZGUgbGlzdC4KKiogUHJvY2Vzc2luZyBqb3VybmFsIGVudHJpZXMuCmZzY2s6IAovZGV2L3Vmcy9y b290ZnM6IEFib3J0IHRyYXA6IDYKCiMgCmYKcwpjCmsKIAovCgoqKiAvZGV2L3Vmcy9yb290ZnMK ClVTRSBKT1VSTkFMPz8gW3luXSAKCioqIFNraXBwaW5nIGpvdXJuYWwsIGZhbGxpbmcgdGhyb3Vn aCB0byBmdWxsIGZzY2sKKiogTGFzdCBNb3VudGVkIG9uIC8KKiogUm9vdCBmaWxlIHN5c3RlbQoq KiBQaGFzZSAxIC0gQ2hlY2sgQmxvY2tzIGFuZCBTaXplcwoqKiBQaGFzZSAyIC0gQ2hlY2sgUGF0 aG5hbWVzCioqIFBoYXNlIDMgLSBDaGVjayBDb25uZWN0aXZpdHkKKiogUGhhc2UgNCAtIENoZWNr IFJlZmVyZW5jZSBDb3VudHMKKiogUGhhc2UgNSAtIENoZWNrIEN5bCBncm91cHMKRlJFRSBCTEsg Q09VTlQoUykgV1JPTkcgSU4gU1VQRVJCTEsKU0FMVkFHRT8gW3luXSAKClNVTU1BUlkgSU5GT1JN QVRJT04gQkFEClNBTFZBR0U/IFt5bl0gCgpCTEsoUykgTUlTU0lORyBJTiBCSVQgTUFQUwpTQUxW QUdFPyBbeW5dIAoKNjI1ODUyIGZpbGVzLCA5NzE4NzcyOCB1c2VkLCAxNzAwNDc5MyBmcmVlICgy MTc5MjEgZnJhZ3MsIDIwOTgzNTkgYmxvY2tzLCAwLjIlIGZyYWdtZW50YXRpb24pCgoqKioqKiBG SUxFIFNZU1RFTSBNQVJLRUQgQ0xFQU4gKioqKioKCioqKioqIEZJTEUgU1lTVEVNIFdBUyBNT0RJ RklFRCAqKioqKgojIApcXkcKXF5HClxeRwpmCnMKYwprCiAKLwoKKiogL2Rldi91ZnMvcm9vdGZz CgpVU0UgSk9VUk5BTD8/IFt5bl0gCgoqKiBTVStKIFJlY292ZXJpbmcgL2Rldi91ZnMvcm9vdGZz CkpvdXJuYWwgdGltZXN0YW1wIGRvZXMgbm90IG1hdGNoIGZzIG1vdW50IHRpbWUKKiogU2tpcHBp bmcgam91cm5hbCwgZmFsbGluZyB0aHJvdWdoIHRvIGZ1bGwgZnNjawoqKiBMYXN0IE1vdW50ZWQg b24gLwoqKiBSb290IGZpbGUgc3lzdGVtCioqIFBoYXNlIDEgLSBDaGVjayBCbG9ja3MgYW5kIFNp emVzCgojIAoKKioqKiogRklMRSBTWVNURU0gTUFSS0VEIERJUlRZICoqKioqCgojIAptCm8KdQpu CnQKIAotCmYKIAovCgojIApmCnMKYwprCiAKJgpcXkhcXltbSwovCgoqKiAvZGV2L3Vmcy9yb290 ZnMgKE5PIFdSSVRFKQoKVVNFIEpPVVJOQUw/PyBubwoKKiogU2tpcHBpbmcgam91cm5hbCwgZmFs bGluZyB0aHJvdWdoIHRvIGZ1bGwgZnNjawpTRVRUSU5HIERJUlRZIEZMQUcgSU4gUkVBRF9PTkxZ IE1PREUKClVORVhQRUNURUQgU09GVCBVUERBVEUgSU5DT05TSVNURU5DWQoqKiBMYXN0IE1vdW50 ZWQgb24gLwoqKiBSb290IGZpbGUgc3lzdGVtCioqIFBoYXNlIDEgLSBDaGVjayBCbG9ja3MgYW5k IFNpemVzCgojIAp0CnUKbgplCmYKcwogCi0KcAogCi8KCnR1bmVmczogClBPU0lYLjFlIEFDTHM6 ICgtYSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkCgp0dW5lZnM6IApO RlN2NCBBQ0xzOiAoLU4pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxl ZAoKdHVuZWZzOiAKTUFDIG11bHRpbGFiZWw6ICgtbCkgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZGlzYWJsZWQKCnR1bmVmczogCnNvZnQgdXBkYXRlczogKC1uKSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGVuYWJsZWQKCnR1bmVmczogCnNvZnQgdXBkYXRlIGpvdXJuYWxp bmc6ICgtaikgICAgICAgICAgICAgICAgICAgICAgIGVuYWJsZWQKCnR1bmVmczogCmdqb3VybmFs OiAoLUopICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkCgp0dW5l ZnM6IAptYXhpbXVtIGJsb2NrcyBwZXIgZmlsZSBpbiBhIGN5bGluZGVyIGdyb3VwOiAoLWUpICAy MDQ4Cgp0dW5lZnM6IAphdmVyYWdlIGZpbGUgc2l6ZTogKC1mKSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAxNjM4NAoKdHVuZWZzOiAKYXZlcmFnZSBudW1iZXIgb2YgZmlsZXMgaW4gYSBkaXJl Y3Rvcnk6ICgtcykgICAgICAgNjQKCnR1bmVmczogCm1pbmltdW0gcGVyY2VudGFnZSBvZiBmcmVl IHNwYWNlOiAoLW0pICAgICAgICAgICAgIDglCgp0dW5lZnM6IApvcHRpbWl6YXRpb24gcHJlZmVy ZW5jZTogKC1vKSAgICAgICAgICAgICAgICAgICAgICB0aW1lCgp0dW5lZnM6IAp2b2x1bWUgbGFi ZWw6ICgtTCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb290ZnMKCiMgCmQKbQpl CnMKZwogCi0KYQoKQ29weXJpZ2h0IChjKSAxOTkyLTIwMTAgVGhlIEZyZWVCU0QgUHJvamVjdC4K Q29weXJpZ2h0IChjKSAxOTc5LCAxOTgwLCAxOTgzLCAxOTg2LCAxOTg4LCAxOTg5LCAxOTkxLCAx OTkyLCAxOTkzLCAxOTk0CglUaGUgUmVnZW50cyBvZiB0aGUgVW5pdmVyc2l0eSBvZiBDYWxpZm9y bmlhLiBBbGwgcmlnaHRzIHJlc2VydmVkLgpGcmVlQlNEIGlzIGEgcmVnaXN0ZXJlZCB0cmFkZW1h cmsgb2YgVGhlIEZyZWVCU0QgRm91bmRhdGlvbi4KRnJlZUJTRCA5LjAtQ1VSUkVOVCAjMCByMjA5 MzkxOiBNb24gSnVuIDIxIDE3OjUzOjE0IENFU1QgMjAxMAogICAgcm9vdEBvdGFrdTovdXNyL29i ai91c3Ivc3JjL3N5cy9BUlVOREVMIGFtZDY0CkNQVTogSW50ZWwoUikgUGVudGl1bShSKSBEdWFs ICBDUFUgIEUyMTYwICBAIDEuODBHSHogKDE4MDAuMDQtTUh6IEs4LWNsYXNzIENQVSkKICBPcmln aW4gPSAiR2VudWluZUludGVsIiAgSWQgPSAweDZmZCAgRmFtaWx5ID0gNiAgTW9kZWwgPSBmICBT dGVwcGluZyA9IDEzCiAgRmVhdHVyZXM9MHhiZmViZmJmZjxGUFUsVk1FLERFLFBTRSxUU0MsTVNS LFBBRSxNQ0UsQ1g4LEFQSUMsU0VQLE1UUlIsUEdFLE1DQSxDTU9WLFBBVCxQU0UzNixDTEZMVVNI LERUUyxBQ1BJLE1NWCxGWFNSLFNTRSxTU0UyLFNTLEhUVCxUTSxQQkU+CiAgRmVhdHVyZXMyPTB4 ZTM5ZDxTU0UzLERURVM2NCxNT04sRFNfQ1BMLEVTVCxUTTIsU1NTRTMsQ1gxNix4VFBSLFBEQ00+ CiAgQU1EIEZlYXR1cmVzPTB4MjAxMDA4MDA8U1lTQ0FMTCxOWCxMTT4KICBBTUQgRmVhdHVyZXMy PTB4MTxMQUhGPgogIFRTQzogUC1zdGF0ZSBpbnZhcmlhbnQKcmVhbCBtZW1vcnkgID0gMjE0NzQ4 MzY0OCAoMjA0OCBNQikKYXZhaWwgbWVtb3J5ID0gMjA0NTE0OTE4NCAoMTk1MCBNQikKRXZlbnQg dGltZXIgIkxBUElDIiBmcmVxdWVuY3kgMCBIeiBxdWFsaXR5IDUwMApBQ1BJIEFQSUMgVGFibGU6 IDxHQlQgICAgR0JUVUFDUEk+CkZyZWVCU0QvU01QOiBNdWx0aXByb2Nlc3NvciBTeXN0ZW0gRGV0 ZWN0ZWQ6IDIgQ1BVcwpGcmVlQlNEL1NNUDogMSBwYWNrYWdlKHMpIHggMiBjb3JlKHMpCiBjcHUw IChCU1ApOiBBUElDIElEOiAgMAogY3B1MSAoQVApOiBBUElDIElEOiAgMQppb2FwaWMwOiBDaGFu Z2luZyBBUElDIElEIHRvIDIKaW9hcGljMCA8VmVyc2lvbiAyLjA+IGlycXMgMC0yMyBvbiBtb3Ro ZXJib2FyZAphY3BpMDogPEdCVCBHQlRVQUNQST4gb24gbW90aGVyYm9hcmQKYWNwaTA6IFtJVEhS RUFEXQphY3BpMDogUG93ZXIgQnV0dG9uIChmaXhlZCkKYWNwaTA6IHJlc2VydmF0aW9uIG9mIDAs IGEwMDAwICgzKSBmYWlsZWQKYWNwaTA6IHJlc2VydmF0aW9uIG9mIDEwMDAwMCwgN2ZkZTAwMDAg KDMpIGZhaWxlZApUaW1lY291bnRlciAiQUNQSS1mYXN0IiBmcmVxdWVuY3kgMzU3OTU0NSBIeiBx dWFsaXR5IDEwMDAKYWNwaV90aW1lcjA6IDwyNC1iaXQgdGltZXIgYXQgMy41Nzk1NDVNSHo+IHBv cnQgMHg0MDgtMHg0MGIgb24gYWNwaTAKY3B1MDogPEFDUEkgQ1BVPiBvbiBhY3BpMApjcHUxOiA8 QUNQSSBDUFU+IG9uIGFjcGkwCmFjcGlfYnV0dG9uMDogPFBvd2VyIEJ1dHRvbj4gb24gYWNwaTAK cGNpYjA6IDxBQ1BJIEhvc3QtUENJIGJyaWRnZT4gcG9ydCAweGNmOC0weGNmZiBvbiBhY3BpMApw Y2kwOiA8QUNQSSBQQ0kgYnVzPiBvbiBwY2liMApwY2liMTogPFBDSS1QQ0kgYnJpZGdlPiBpcnEg MTYgYXQgZGV2aWNlIDEuMCBvbiBwY2kwCnBjaTE6IDxQQ0kgYnVzPiBvbiBwY2liMQp2Z2FwY2kw OiA8VkdBLWNvbXBhdGlibGUgZGlzcGxheT4gcG9ydCAweGIwMDAtMHhiMDdmIG1lbSAweGY2MDAw MDAwLTB4ZjZmZmZmZmYsMHhlMDAwMDAwMC0weGVmZmZmZmZmLDB4ZjQwMDAwMDAtMHhmNWZmZmZm ZiBpcnEgMTYgYXQgZGV2aWNlIDAuMCBvbiBwY2kxCm52aWRpYTA6IDxHZUZvcmNlIDk2MDAgR1Q+ IG9uIHZnYXBjaTAKdmdhcGNpMDogY2hpbGQgbnZpZGlhMCByZXF1ZXN0ZWQgcGNpX2VuYWJsZV9i dXNtYXN0ZXIKdmdhcGNpMDogY2hpbGQgbnZpZGlhMCByZXF1ZXN0ZWQgcGNpX2VuYWJsZV9pbwp2 Z2FwY2kwOiBjaGlsZCBudmlkaWEwIHJlcXVlc3RlZCBwY2lfZW5hYmxlX2lvCm52aWRpYTA6IFtJ VEhSRUFEXQp1aGNpMDogPEludGVsIDgyODAxSSAoSUNIOSkgVVNCIGNvbnRyb2xsZXI+IHBvcnQg MHhlMTAwLTB4ZTExZiBpcnEgMTYgYXQgZGV2aWNlIDI2LjAgb24gcGNpMAp1aGNpMDogW0lUSFJF QURdCnVzYnVzMDogPEludGVsIDgyODAxSSAoSUNIOSkgVVNCIGNvbnRyb2xsZXI+IG9uIHVoY2kw CnVoY2kxOiA8SW50ZWwgODI4MDFJIChJQ0g5KSBVU0IgY29udHJvbGxlcj4gcG9ydCAweGUyMDAt MHhlMjFmIGlycSAyMSBhdCBkZXZpY2UgMjYuMSBvbiBwY2kwCnVoY2kxOiBbSVRIUkVBRF0KdXNi dXMxOiA8SW50ZWwgODI4MDFJIChJQ0g5KSBVU0IgY29udHJvbGxlcj4gb24gdWhjaTEKdWhjaTI6 IDxJbnRlbCA4MjgwMUkgKElDSDkpIFVTQiBjb250cm9sbGVyPiBwb3J0IDB4ZTAwMC0weGUwMWYg aXJxIDE4IGF0IGRldmljZSAyNi4yIG9uIHBjaTAKdWhjaTI6IFtJVEhSRUFEXQp1c2J1czI6IDxJ bnRlbCA4MjgwMUkgKElDSDkpIFVTQiBjb250cm9sbGVyPiBvbiB1aGNpMgplaGNpMDogPEludGVs IDgyODAxSSAoSUNIOSkgVVNCIDIuMCBjb250cm9sbGVyPiBtZW0gMHhmYTIwNTAwMC0weGZhMjA1 M2ZmIGlycSAxOCBhdCBkZXZpY2UgMjYuNyBvbiBwY2kwCmVoY2kwOiBbSVRIUkVBRF0KdXNidXMz OiBFSENJIHZlcnNpb24gMS4wCnVzYnVzMzogPEludGVsIDgyODAxSSAoSUNIOSkgVVNCIDIuMCBj b250cm9sbGVyPiBvbiBlaGNpMApoZGFjMDogPEludGVsIDgyODAxSSBIaWdoIERlZmluaXRpb24g QXVkaW8gQ29udHJvbGxlcj4gbWVtIDB4ZmEyMDAwMDAtMHhmYTIwM2ZmZiBpcnEgMjIgYXQgZGV2 aWNlIDI3LjAgb24gcGNpMApoZGFjMDogSERBIERyaXZlciBSZXZpc2lvbjogMjAxMDAyMjZfMDE0 MgpoZGFjMDogW0lUSFJFQURdCnBjaWIyOiA8QUNQSSBQQ0ktUENJIGJyaWRnZT4gaXJxIDE2IGF0 IGRldmljZSAyOC4wIG9uIHBjaTAKcGNpMjogPEFDUEkgUENJIGJ1cz4gb24gcGNpYjIKcGNpYjM6 IDxBQ1BJIFBDSS1QQ0kgYnJpZGdlPiBpcnEgMTkgYXQgZGV2aWNlIDI4LjMgb24gcGNpMApwY2kz OiA8QUNQSSBQQ0kgYnVzPiBvbiBwY2liMwphaGNpMDogPEpNaWNyb24gSk1CMzYzIEFIQ0kgU0FU QSBjb250cm9sbGVyPiBtZW0gMHhmYTAwMDAwMC0weGZhMDAxZmZmIGlycSAxOSBhdCBkZXZpY2Ug MC4wIG9uIHBjaTMKYWhjaTA6IFtJVEhSRUFEXQphaGNpMDogQUhDSSB2MS4wMCB3aXRoIDIgM0di cHMgcG9ydHMsIFBvcnQgTXVsdGlwbGllciBzdXBwb3J0ZWQKYWhjaWNoMDogPEFIQ0kgY2hhbm5l bD4gYXQgY2hhbm5lbCAwIG9uIGFoY2kwCmFoY2ljaDA6IFtJVEhSRUFEXQphaGNpY2gxOiA8QUhD SSBjaGFubmVsPiBhdCBjaGFubmVsIDEgb24gYWhjaTAKYWhjaWNoMTogW0lUSFJFQURdCmF0YXBj aTA6IDxKTWljcm9uIEpNQjM2MyBVRE1BMTMzIGNvbnRyb2xsZXI+IHBvcnQgMHhjMDAwLTB4YzAw NywweGMxMDAtMHhjMTAzLDB4YzIwMC0weGMyMDcsMHhjMzAwLTB4YzMwMywweGM0MDAtMHhjNDBm IGlycSAxNiBhdCBkZXZpY2UgMC4xIG9uIHBjaTMKYXRhcGNpMDogW0lUSFJFQURdCmF0YTI6IDxB VEEgY2hhbm5lbCAwPiBvbiBhdGFwY2kwCmF0YTI6IFtJVEhSRUFEXQpwY2liNDogPEFDUEkgUENJ LVBDSSBicmlkZ2U+IGlycSAxNiBhdCBkZXZpY2UgMjguNCBvbiBwY2kwCnBjaTQ6IDxBQ1BJIFBD SSBidXM+IG9uIHBjaWI0CnVoY2kzOiA8SW50ZWwgODI4MDFJIChJQ0g5KSBVU0IgY29udHJvbGxl cj4gcG9ydCAweGUzMDAtMHhlMzFmIGlycSAyMyBhdCBkZXZpY2UgMjkuMCBvbiBwY2kwCnVoY2kz OiBbSVRIUkVBRF0KdXNidXM0OiA8SW50ZWwgODI4MDFJIChJQ0g5KSBVU0IgY29udHJvbGxlcj4g b24gdWhjaTMKdWhjaTQ6IDxJbnRlbCA4MjgwMUkgKElDSDkpIFVTQiBjb250cm9sbGVyPiBwb3J0 IDB4ZTQwMC0weGU0MWYgaXJxIDE5IGF0IGRldmljZSAyOS4xIG9uIHBjaTAKdWhjaTQ6IFtJVEhS RUFEXQp1c2J1czU6IDxJbnRlbCA4MjgwMUkgKElDSDkpIFVTQiBjb250cm9sbGVyPiBvbiB1aGNp NAp1aGNpNTogPEludGVsIDgyODAxSSAoSUNIOSkgVVNCIGNvbnRyb2xsZXI+IHBvcnQgMHhlNTAw LTB4ZTUxZiBpcnEgMTggYXQgZGV2aWNlIDI5LjIgb24gcGNpMAp1aGNpNTogW0lUSFJFQURdCnVz YnVzNjogPEludGVsIDgyODAxSSAoSUNIOSkgVVNCIGNvbnRyb2xsZXI+IG9uIHVoY2k1CmVoY2kx OiA8SW50ZWwgODI4MDFJIChJQ0g5KSBVU0IgMi4wIGNvbnRyb2xsZXI+IG1lbSAweGZhMjA0MDAw LTB4ZmEyMDQzZmYgaXJxIDIzIGF0IGRldmljZSAyOS43IG9uIHBjaTAKZWhjaTE6IFtJVEhSRUFE XQp1c2J1czc6IEVIQ0kgdmVyc2lvbiAxLjAKdXNidXM3OiA8SW50ZWwgODI4MDFJIChJQ0g5KSBV U0IgMi4wIGNvbnRyb2xsZXI+IG9uIGVoY2kxCnBjaWI1OiA8QUNQSSBQQ0ktUENJIGJyaWRnZT4g YXQgZGV2aWNlIDMwLjAgb24gcGNpMApwY2k1OiA8QUNQSSBQQ0kgYnVzPiBvbiBwY2liNQphdGgw OiA8QXRoZXJvcyA1MjEyPiBtZW0gMHhmYTEwMDAwMC0weGZhMTBmZmZmIGlycSAxOSBhdCBkZXZp Y2UgMS4wIG9uIHBjaTUKYXRoMDogW0lUSFJFQURdCmF0aDA6IEFSMjQxMyBtYWMgNy45IFJGMjQx MyBwaHkgNC41CmlzYWIwOiA8UENJLUlTQSBicmlkZ2U+IGF0IGRldmljZSAzMS4wIG9uIHBjaTAK aXNhMDogPElTQSBidXM+IG9uIGlzYWIwCmFoY2kxOiA8SW50ZWwgSUNIOSBBSENJIFNBVEEgY29u dHJvbGxlcj4gcG9ydCAweGU2MDAtMHhlNjA3LDB4ZTcwMC0weGU3MDMsMHhlODAwLTB4ZTgwNyww eGU5MDAtMHhlOTAzLDB4ZWEwMC0weGVhMWYgbWVtIDB4ZmEyMDYwMDAtMHhmYTIwNjdmZiBpcnEg MTkgYXQgZGV2aWNlIDMxLjIgb24gcGNpMAphaGNpMTogW0lUSFJFQURdCmFoY2kxOiBBSENJIHYx LjIwIHdpdGggNiAzR2JwcyBwb3J0cywgUG9ydCBNdWx0aXBsaWVyIHN1cHBvcnRlZAphaGNpY2gy OiA8QUhDSSBjaGFubmVsPiBhdCBjaGFubmVsIDAgb24gYWhjaTEKYWhjaWNoMjogW0lUSFJFQURd CmFoY2ljaDM6IDxBSENJIGNoYW5uZWw+IGF0IGNoYW5uZWwgMSBvbiBhaGNpMQphaGNpY2gzOiBb SVRIUkVBRF0KYWhjaWNoNDogPEFIQ0kgY2hhbm5lbD4gYXQgY2hhbm5lbCAyIG9uIGFoY2kxCmFo Y2ljaDQ6IFtJVEhSRUFEXQphaGNpY2g1OiA8QUhDSSBjaGFubmVsPiBhdCBjaGFubmVsIDMgb24g YWhjaTEKYWhjaWNoNTogW0lUSFJFQURdCmFoY2ljaDY6IDxBSENJIGNoYW5uZWw+IGF0IGNoYW5u ZWwgNCBvbiBhaGNpMQphaGNpY2g2OiBbSVRIUkVBRF0KYWhjaWNoNzogPEFIQ0kgY2hhbm5lbD4g YXQgY2hhbm5lbCA1IG9uIGFoY2kxCmFoY2ljaDc6IFtJVEhSRUFEXQpwY2kwOiA8c2VyaWFsIGJ1 cywgU01CdXM+IGF0IGRldmljZSAzMS4zIChubyBkcml2ZXIgYXR0YWNoZWQpCmF0dGltZXIwOiA8 QVQgdGltZXI+IHBvcnQgMHg0MC0weDQzIG9uIGFjcGkwClRpbWVjb3VudGVyICJpODI1NCIgZnJl cXVlbmN5IDExOTMxODIgSHogcXVhbGl0eSAwCmF0dGltZXIwOiBbRklMVEVSXQpFdmVudCB0aW1l ciAiaTgyNTQiIGZyZXF1ZW5jeSAxMTkzMTgyIEh6IHF1YWxpdHkgMTAwCmhwZXQwOiA8SGlnaCBQ cmVjaXNpb24gRXZlbnQgVGltZXI+IGlvbWVtIDB4ZmVkMDAwMDAtMHhmZWQwMDNmZiBpcnEgMCw4 IG9uIGFjcGkwClRpbWVjb3VudGVyICJIUEVUIiBmcmVxdWVuY3kgMTQzMTgxODAgSHogcXVhbGl0 eSA5MDAKaHBldDA6IFtGSUxURVJdCkV2ZW50IHRpbWVyICJIUEVUIiBmcmVxdWVuY3kgMTQzMTgx ODAgSHogcXVhbGl0eSA0NTAKRXZlbnQgdGltZXIgIkhQRVQxIiBmcmVxdWVuY3kgMTQzMTgxODAg SHogcXVhbGl0eSA0NDAKRXZlbnQgdGltZXIgIkhQRVQyIiBmcmVxdWVuY3kgMTQzMTgxODAgSHog cXVhbGl0eSA0NDAKRXZlbnQgdGltZXIgIkhQRVQzIiBmcmVxdWVuY3kgMTQzMTgxODAgSHogcXVh bGl0eSA0NDAKYXRydGMwOiA8QVQgcmVhbHRpbWUgY2xvY2s+IHBvcnQgMHg3MC0weDczIG9uIGFj cGkwCmF0cnRjMDogW0ZJTFRFUl0KRXZlbnQgdGltZXIgIlJUQyIgZnJlcXVlbmN5IDMyNzY4IEh6 IHF1YWxpdHkgMApvcm0wOiA8SVNBIE9wdGlvbiBST01zPiBhdCBpb21lbSAweGQwMDAwLTB4ZDI3 ZmYsMHhkMzAwMC0weGQ1ZmZmIG9uIGlzYTAKc2MwOiA8U3lzdGVtIGNvbnNvbGU+IGF0IGZsYWdz IDB4MTAwIG9uIGlzYTAKc2MwOiBWR0EgPDE2IHZpcnR1YWwgY29uc29sZXMsIGZsYWdzPTB4MzAw Pgp2Z2EwOiA8R2VuZXJpYyBJU0EgVkdBPiBhdCBwb3J0IDB4M2MwLTB4M2RmIGlvbWVtIDB4YTAw MDAtMHhiZmZmZiBvbiBpc2EwCmNvcmV0ZW1wMDogPENQVSBPbi1EaWUgVGhlcm1hbCBTZW5zb3Jz PiBvbiBjcHUwCmVzdDA6IDxFbmhhbmNlZCBTcGVlZFN0ZXAgRnJlcXVlbmN5IENvbnRyb2w+IG9u IGNwdTAKZXN0OiBDUFUgc3VwcG9ydHMgRW5oYW5jZWQgU3BlZWRzdGVwLCBidXQgaXMgbm90IHJl Y29nbml6ZWQuCmVzdDogY3B1X3ZlbmRvciBHZW51aW5lSW50ZWwsIG1zciA5MjUwOTI1MDYwMDA5 MjUKZGV2aWNlX2F0dGFjaDogZXN0MCBhdHRhY2ggcmV0dXJuZWQgNgpwNHRjYzA6IDxDUFUgRnJl cXVlbmN5IFRoZXJtYWwgQ29udHJvbD4gb24gY3B1MApjb3JldGVtcDE6IDxDUFUgT24tRGllIFRo ZXJtYWwgU2Vuc29ycz4gb24gY3B1MQplc3QxOiA8RW5oYW5jZWQgU3BlZWRTdGVwIEZyZXF1ZW5j eSBDb250cm9sPiBvbiBjcHUxCmVzdDogQ1BVIHN1cHBvcnRzIEVuaGFuY2VkIFNwZWVkc3RlcCwg YnV0IGlzIG5vdCByZWNvZ25pemVkLgplc3Q6IGNwdV92ZW5kb3IgR2VudWluZUludGVsLCBtc3Ig OTI1MDkyNTA2MDAwOTI1CmRldmljZV9hdHRhY2g6IGVzdDEgYXR0YWNoIHJldHVybmVkIDYKcDR0 Y2MxOiA8Q1BVIEZyZXF1ZW5jeSBUaGVybWFsIENvbnRyb2w+IG9uIGNwdTEKU3RhcnRpbmcga2Vy bmVsIGV2ZW50IHRpbWVyczogTEFQSUMgQCAxMDAwSHosIEhQRVQgQCAxMjhIegpUaW1lY291bnRl cnMgdGljayBldmVyeSAxLjAwMCBtc2VjCmhkYWMwOiBIREEgQ29kZWMgIzI6IFJlYWx0ZWsgQUxD ODg1CnVzYnVzMDogMTJNYnBzIEZ1bGwgU3BlZWQgVVNCIHYxLjAKdXNidXMxOiAxMk1icHMgRnVs bCBTcGVlZCBVU0IgdjEuMAp1c2J1czI6IDEyTWJwcyBGdWxsIFNwZWVkIFVTQiB2MS4wCnVzYnVz MzogNDgwTWJwcyBIaWdoIFNwZWVkIFVTQiB2Mi4wCnVzYnVzNDogMTJNYnBzIEZ1bGwgU3BlZWQg VVNCIHYxLjAKdXNidXM1OiAxMk1icHMgRnVsbCBTcGVlZCBVU0IgdjEuMAp1c2J1czY6IDEyTWJw cyBGdWxsIFNwZWVkIFVTQiB2MS4wCnVzYnVzNzogNDgwTWJwcyBIaWdoIFNwZWVkIFVTQiB2Mi4w CnBjbTA6IDxIREEgUmVhbHRlayBBTEM4ODUgUENNICMwIEFuYWxvZz4gYXQgY2FkIDIgbmlkIDEg b24gaGRhYzAKcGNtMTogPEhEQSBSZWFsdGVrIEFMQzg4NSBQQ00gIzEgQW5hbG9nPiBhdCBjYWQg MiBuaWQgMSBvbiBoZGFjMApwY20yOiA8SERBIFJlYWx0ZWsgQUxDODg1IFBDTSAjMiBEaWdpdGFs PiBhdCBjYWQgMiBuaWQgMSBvbiBoZGFjMAp1Z2VuMC4xOiA8SW50ZWw+IGF0IHVzYnVzMAp1aHVi MDogPEludGVsIFVIQ0kgcm9vdCBIVUIsIGNsYXNzIDkvMCwgcmV2IDEuMDAvMS4wMCwgYWRkciAx PiBvbiB1c2J1czAKdWdlbjEuMTogPEludGVsPiBhdCB1c2J1czEKdWh1YjE6IDxJbnRlbCBVSENJ IHJvb3QgSFVCLCBjbGFzcyA5LzAsIHJldiAxLjAwLzEuMDAsIGFkZHIgMT4gb24gdXNidXMxCnVn ZW4yLjE6IDxJbnRlbD4gYXQgdXNidXMyCnVodWIyOiA8SW50ZWwgVUhDSSByb290IEhVQiwgY2xh c3MgOS8wLCByZXYgMS4wMC8xLjAwLCBhZGRyIDE+IG9uIHVzYnVzMgp1Z2VuMy4xOiA8SW50ZWw+ IGF0IHVzYnVzMwp1aHViMzogPEludGVsIEVIQ0kgcm9vdCBIVUIsIGNsYXNzIDkvMCwgcmV2IDIu MDAvMS4wMCwgYWRkciAxPiBvbiB1c2J1czMKdWdlbjQuMTogPEludGVsPiBhdCB1c2J1czQKdWh1 YjQ6IDxJbnRlbCBVSENJIHJvb3QgSFVCLCBjbGFzcyA5LzAsIHJldiAxLjAwLzEuMDAsIGFkZHIg MT4gb24gdXNidXM0CnVnZW41LjE6IDxJbnRlbD4gYXQgdXNidXM1CnVodWI1OiA8SW50ZWwgVUhD SSByb290IEhVQiwgY2xhc3MgOS8wLCByZXYgMS4wMC8xLjAwLCBhZGRyIDE+IG9uIHVzYnVzNQp1 Z2VuNi4xOiA8SW50ZWw+IGF0IHVzYnVzNgp1aHViNjogPEludGVsIFVIQ0kgcm9vdCBIVUIsIGNs YXNzIDkvMCwgcmV2IDEuMDAvMS4wMCwgYWRkciAxPiBvbiB1c2J1czYKdWdlbjcuMTogPEludGVs PiBhdCB1c2J1czcKdWh1Yjc6IDxJbnRlbCBFSENJIHJvb3QgSFVCLCBjbGFzcyA5LzAsIHJldiAy LjAwLzEuMDAsIGFkZHIgMT4gb24gdXNidXM3CnVodWIwOiAyIHBvcnRzIHdpdGggMiByZW1vdmFi bGUsIHNlbGYgcG93ZXJlZAp1aHViMTogMiBwb3J0cyB3aXRoIDIgcmVtb3ZhYmxlLCBzZWxmIHBv d2VyZWQKdWh1YjI6IDIgcG9ydHMgd2l0aCAyIHJlbW92YWJsZSwgc2VsZiBwb3dlcmVkCnVodWI0 OiAyIHBvcnRzIHdpdGggMiByZW1vdmFibGUsIHNlbGYgcG93ZXJlZAp1aHViNTogMiBwb3J0cyB3 aXRoIDIgcmVtb3ZhYmxlLCBzZWxmIHBvd2VyZWQKdWh1YjY6IDIgcG9ydHMgd2l0aCAyIHJlbW92 YWJsZSwgc2VsZiBwb3dlcmVkCmFkYTAgYXQgYWhjaWNoMiBidXMgMCBzY2J1czMgdGFyZ2V0IDAg bHVuIDAKYWRhMDogPFNBTVNVTkcgU1AyNTA0QyBWVDEwMC01MD4gQVRBLTcgU0FUQSAyLnggZGV2 aWNlCmFkYTA6IDMwMC4wMDBNQi9zIHRyYW5zZmVycyAoU0FUQSAyLngsIFVETUE2LCBQSU8gODE5 MmJ5dGVzKQphZGEwOiBDb21tYW5kIFF1ZXVlaW5nIGVuYWJsZWQKYWRhMDogMjM4NDc0TUIgKDQ4 ODM5NTA1NSA1MTIgYnl0ZSBzZWN0b3JzOiAxNkggNjNTL1QgMTYzODNDKQpjZDAgYXQgYXRhMiBi dXMgMCBzY2J1czIgdGFyZ2V0IDAgbHVuIDAKY2QwOiA8SEwtRFQtU1QgRFZEUkFNIEdTQS1IMTBO IEpMMTI+IFJlbW92YWJsZSBDRC1ST00gU0NTSS0wIGRldmljZSAKY2QwOiAzMy4zMDBNQi9zIHRy YW5zZmVycyAoVURNQTIsIEFUQVBJIDEyYnl0ZXMsIFBJTyA2NTUzNGJ5dGVzKQpjZDA6IEF0dGVt cHQgdG8gcXVlcnkgZGV2aWNlIHNpemUgZmFpbGVkOiBOT1QgUkVBRFksIE1lZGl1bSBub3QgcHJl c2VudApTTVA6IEFQIENQVSAjMSBMYXVuY2hlZCEKUm9vdCBtb3VudCB3YWl0aW5nIGZvcjogdXNi dXM3IHVzYnVzMwp1aHViMzogNiBwb3J0cyB3aXRoIDYgcmVtb3ZhYmxlLCBzZWxmIHBvd2VyZWQK dWh1Yjc6IDYgcG9ydHMgd2l0aCA2IHJlbW92YWJsZSwgc2VsZiBwb3dlcmVkClJvb3QgbW91bnQg d2FpdGluZyBmb3I6IHVzYnVzMwp1Z2VuMy4yOiA8dmVuZG9yIDB4MDQyND4gYXQgdXNidXMzCnVo dWI4OiA8dmVuZG9yIDB4MDQyNCBwcm9kdWN0IDB4MjUxNCwgY2xhc3MgOS8wLCByZXYgMi4wMC8w LjAwLCBhZGRyIDI+IG9uIHVzYnVzMwpSb290IG1vdW50IHdhaXRpbmcgZm9yOiB1c2J1czMKdWh1 Yjg6IDQgcG9ydHMgd2l0aCA0IHJlbW92YWJsZSwgc2VsZiBwb3dlcmVkClRyeWluZyB0byBtb3Vu dCByb290IGZyb20gdWZzOi9kZXYvdWZzL3Jvb3RmcwpXQVJOSU5HOiAvIHdhcyBub3QgcHJvcGVy bHkgZGlzbW91bnRlZAovOiBtb3VudCBwZW5kaW5nIGVycm9yOiBibG9ja3MgLTY1NDA4IGZpbGVz IDAKU2V0dGluZyBob3N0dXVpZDogMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAxYTRkNGJiNGVi LgpTZXR0aW5nIGhvc3RpZDogMHg1MmYzMzYyOC4KRW50cm9weSBoYXJ2ZXN0aW5nOgogaW50ZXJy dXB0cwogZXRoZXJuZXQKIHBvaW50X3RvX3BvaW50CnVnZW4xLjI6IDxEZWxsPiBhdCB1c2J1czEK dWtiZDA6IDxEZWxsIERlbGwgVVNCIEtleWJvYXJkLCBjbGFzcyAwLzAsIHJldiAxLjEwLzMuMDYs IGFkZHIgMj4gb24gdXNidXMxCmtiZDAgYXQgdWtiZDAKIGtpY2tzdGFydAouClN0YXJ0aW5nIGZp bGUgc3lzdGVtIGNoZWNrczoKKiogU1UrSiBSZWNvdmVyaW5nIC9kZXYvdWZzL3Jvb3RmcwoqKiBS ZWFkaW5nIDMzNTU0NDMyIGJ5dGUgam91cm5hbCBmcm9tIGlub2RlIDMuCnVnZW4xLjM6IDxSYXpl cj4gYXQgdXNidXMxCnVtczA6IDxSYXplciBSYXplciAxNjAwZHBpIE1vdXNlLCBjbGFzcyAwLzAs IHJldiAyLjAwLzIxLjAwLCBhZGRyIDM+IG9uIHVzYnVzMQp1bXMwOiA3IGJ1dHRvbnMgYW5kIFtY WVpdIGNvb3JkaW5hdGVzIElEPTAKKiogQnVpbGRpbmcgcmVjb3ZlcnkgdGFibGUuCioqIFJlc29s dmluZyB1bnJlZmVyZW5jZWQgaW5vZGUgbGlzdC4KKiogUHJvY2Vzc2luZyBqb3VybmFsIGVudHJp ZXMuCmZzY2s6IAovZGV2L3Vmcy9yb290ZnM6IEFib3J0IHRyYXA6IDYKClVua25vd24gZXJyb3I7 IGhlbHAhCkVSUk9SOiBBQk9SVElORyBCT09UIChzZW5kaW5nIFNJR1RFUk0gdG8gcGFyZW50KSEK SnVuIDIyIDAyOjU5OjUwIGluaXQ6IC9iaW4vc2ggb24gL2V0Yy9yYyB0ZXJtaW5hdGVkIGFibm9y bWFsbHksIGdvaW5nIHRvIHNpbmdsZSB1c2VyIG1vZGUKRW50ZXIgcm9vdCBwYXNzd29yZCwgb3Ig XkQgdG8gZ28gbXVsdGktdXNlcgpQYXNzd29yZDoKCkp1biAyMiAwMzowMDowMCBpbml0OiBzaW5n bGUtdXNlciBsb2dpbiBmYWlsZWQKUGFzc3dvcmQ6CgpKdW4gMjIgMDM6MDA6MDEgaW5pdDogTlNT V0lUQ0goX25zZGlzcGF0Y2gpOiBuaXMsIHBhc3N3ZF9jb21wYXQsIGVuZHB3ZW50LCBub3QgZm91 bmQsIGFuZCBubyBmYWxsYmFjayBwcm92aWRlZApFbnRlciBmdWxsIHBhdGhuYW1lIG9mIHNoZWxs IG9yIFJFVFVSTiBmb3IgCi9iaW4vc2gKOiAKIyAKZgpzCmMKawogCi8KCioqIC9kZXYvdWZzL3Jv b3RmcwoKVVNFIEpPVVJOQUw/PyBbeW5dIAoKKiogU1UrSiBSZWNvdmVyaW5nIC9kZXYvdWZzL3Jv b3RmcwoqKiBSZWFkaW5nIDMzNTU0NDMyIGJ5dGUgam91cm5hbCBmcm9tIGlub2RlIDMuCgpSRUNP VkVSPyBbeW5dIAoKKiogQnVpbGRpbmcgcmVjb3ZlcnkgdGFibGUuCioqIFJlc29sdmluZyB1bnJl ZmVyZW5jZWQgaW5vZGUgbGlzdC4KKiogUHJvY2Vzc2luZyBqb3VybmFsIGVudHJpZXMuCmZzY2s6 IAovZGV2L3Vmcy9yb290ZnM6IEFib3J0IHRyYXA6IDYKCiMgCmYKcwpjCmsKIAovCgoqKiAvZGV2 L3Vmcy9yb290ZnMKClVTRSBKT1VSTkFMPz8gW3luXSAKCioqIFNraXBwaW5nIGpvdXJuYWwsIGZh bGxpbmcgdGhyb3VnaCB0byBmdWxsIGZzY2sKKiogTGFzdCBNb3VudGVkIG9uIC8KKiogUm9vdCBm aWxlIHN5c3RlbQoqKiBQaGFzZSAxIC0gQ2hlY2sgQmxvY2tzIGFuZCBTaXplcwoqKiBQaGFzZSAy IC0gQ2hlY2sgUGF0aG5hbWVzCioqIFBoYXNlIDMgLSBDaGVjayBDb25uZWN0aXZpdHkKKiogUGhh c2UgNCAtIENoZWNrIFJlZmVyZW5jZSBDb3VudHMKKiogUGhhc2UgNSAtIENoZWNrIEN5bCBncm91 cHMKRlJFRSBCTEsgQ09VTlQoUykgV1JPTkcgSU4gU1VQRVJCTEsKU0FMVkFHRT8gW3luXSAKClNV TU1BUlkgSU5GT1JNQVRJT04gQkFEClNBTFZBR0U/IFt5bl0gCgpCTEsoUykgTUlTU0lORyBJTiBC SVQgTUFQUwpTQUxWQUdFPyBbeW5dIAoKNjI1ODUyIGZpbGVzLCA5NzE4NzcyOCB1c2VkLCAxNzAw NDc5MyBmcmVlICgyMTc5MjEgZnJhZ3MsIDIwOTgzNTkgYmxvY2tzLCAwLjIlIGZyYWdtZW50YXRp b24pCgoqKioqKiBGSUxFIFNZU1RFTSBNQVJLRUQgQ0xFQU4gKioqKioKCioqKioqIEZJTEUgU1lT VEVNIFdBUyBNT0RJRklFRCAqKioqKgojIApcXF5HClxcXkcKXFxeRwpmCnMKYwprCiAKLwoKKiog L2Rldi91ZnMvcm9vdGZzCgpVU0UgSk9VUk5BTD8/IFt5bl0gCgoqKiBTVStKIFJlY292ZXJpbmcg L2Rldi91ZnMvcm9vdGZzCkpvdXJuYWwgdGltZXN0YW1wIGRvZXMgbm90IG1hdGNoIGZzIG1vdW50 IHRpbWUKKiogU2tpcHBpbmcgam91cm5hbCwgZmFsbGluZyB0aHJvdWdoIHRvIGZ1bGwgZnNjawoq KiBMYXN0IE1vdW50ZWQgb24gLwoqKiBSb290IGZpbGUgc3lzdGVtCioqIFBoYXNlIDEgLSBDaGVj ayBCbG9ja3MgYW5kIFNpemVzCgojIAoKKioqKiogRklMRSBTWVNURU0gTUFSS0VEIERJUlRZICoq KioqCgojIAptCm8KdQpuCnQKIAotCmYKIAovCgojIApmCnMKYwprCiAKJgpcXF5IXFxeW1tLCi8K CioqIC9kZXYvdWZzL3Jvb3RmcyAoTk8gV1JJVEUpCgpVU0UgSk9VUk5BTD8/IG5vCgoqKiBTa2lw cGluZyBqb3VybmFsLCBmYWxsaW5nIHRocm91Z2ggdG8gZnVsbCBmc2NrClNFVFRJTkcgRElSVFkg RkxBRyBJTiBSRUFEX09OTFkgTU9ERQoKVU5FWFBFQ1RFRCBTT0ZUIFVQREFURSBJTkNPTlNJU1RF TkNZCioqIExhc3QgTW91bnRlZCBvbiAvCioqIFJvb3QgZmlsZSBzeXN0ZW0KKiogUGhhc2UgMSAt IENoZWNrIEJsb2NrcyBhbmQgU2l6ZXMKCiMgCnQKdQpuCmUKZgpzCiAKLQpwCiAKLwoKdHVuZWZz OiAKUE9TSVguMWUgQUNMczogKC1hKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlz YWJsZWQKCnR1bmVmczogCk5GU3Y0IEFDTHM6ICgtTikgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGRpc2FibGVkCgp0dW5lZnM6IApNQUMgbXVsdGlsYWJlbDogKC1sKSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZAoKdHVuZWZzOiAKc29mdCB1cGRhdGVzOiAo LW4pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlZAoKdHVuZWZzOiAKc29m dCB1cGRhdGUgam91cm5hbGluZzogKC1qKSAgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlZAoK dHVuZWZzOiAKZ2pvdXJuYWw6ICgtSikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZGlzYWJsZWQKCnR1bmVmczogCm1heGltdW0gYmxvY2tzIHBlciBmaWxlIGluIGEgY3lsaW5k ZXIgZ3JvdXA6ICgtZSkgIDIwNDgKCnR1bmVmczogCmF2ZXJhZ2UgZmlsZSBzaXplOiAoLWYpICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDE2Mzg0Cgp0dW5lZnM6IAphdmVyYWdlIG51bWJlciBv ZiBmaWxlcyBpbiBhIGRpcmVjdG9yeTogKC1zKSAgICAgICA2NAoKdHVuZWZzOiAKbWluaW11bSBw ZXJjZW50YWdlIG9mIGZyZWUgc3BhY2U6ICgtbSkgICAgICAgICAgICAgOCUKCnR1bmVmczogCm9w dGltaXphdGlvbiBwcmVmZXJlbmNlOiAoLW8pICAgICAgICAgICAgICAgICAgICAgIHRpbWUKCnR1 bmVmczogCnZvbHVtZSBsYWJlbDogKC1MKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHJvb3RmcwoKIyAKZAptCmUKcwpnCiAKLQphCgojIApkbWVzZyAtYQogCj4KIAovCkYKRQpICkwK RQpSCgo= --00c09f9b06a75ab501048992a1ce-- From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 02:06:47 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D00CB106564A for ; Tue, 22 Jun 2010 02:06:47 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 578938FC12 for ; Tue, 22 Jun 2010 02:06:47 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 234B97E84A; Tue, 22 Jun 2010 12:06:45 +1000 (EST) Message-ID: <4C201AB4.6090708@freebsd.org> Date: Tue, 22 Jun 2010 12:06:44 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Fabian Keil References: <4C1492D0.6020704@freebsd.org> <4C1C3922.2050102@freebsd.org> <20100619195823.53a7baaa@r500.local> <4C1DED16.8020209@freebsd.org> <20100620131544.495ddecd@r500.local> <4C1E019F.6060802@freebsd.org> <20100620142841.4803dac3@r500.local> <4C1E0E14.3090506@freebsd.org> <20100620151554.58e486db@r500.local> <20100620161242.59381341@r500.local> <20100620213601.050fcf3e@r500.local> <6CE5B32B-2C82-436D-82E3-489D2D22C7EA@lavabit.com> <4C1EE644.3070105@freebsd.org> <20100621205228.0e5332cc@r500.local> In-Reply-To: <20100621205228.0e5332cc@r500.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [CFT] SIFTR - Statistical Information For TCP Research: Uncle Lawrence needs YOU! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 02:06:47 -0000 On 06/22/10 04:52, Fabian Keil wrote: > Lawrence Stewart wrote: > >> On 06/21/10 05:44, Rui Paulo wrote: >>> >>> On 20 Jun 2010, at 20:36, Fabian Keil wrote: >>> >>>> Fabian Keil wrote: >>>> >>>>> Fabian Keil wrote: >>>> >>>>>> My custom kernel normally doesn't have INVARIANTS and WITNESS >>>>>> enabled, so I'll try to enable them next. >>>>> >>>>> The culprit seem to be non-default KTR settings in the kernel >>>>> while loading alq as a module. >>>> >>>> Actually whether or not alq is loaded as a module doesn't >>>> seem to matter, with: >>>> >>>> options KTR >>>> options KTR_ENTRIES=262144 >>>> options KTR_COMPILE=(KTR_SCHED) >>>> options KTR_MASK=(KTR_SCHED) >>>> options KTR_CPUMASK=0x3 >>>> options ALQ >>>> options KTR_ALQ >>>> >>>> enabling siftr panics the system, too. >>> >>> That's probably because your module was built with different compile time options than the ones used in the kernel. These options may change structure sizes, function parameters, etc. and that easily causes panics. >> >> hmm I wonder if my instructions to build SIFTR manually are causing your >> problems. Fabian, is the siftr.ko module you're loading built as part of >> a "make buildkernel", or did you follow my instructions and "cd >> /sys/modules/siftr ; make ; kldload ./siftr.ko"? > > The latter. > >> If the latter is true, perhaps try and explicitly build SIFTR as part of >> "make buildkernel" and see if loading the module built that way still >> triggers the panic when enabled (the module will be in >> /usr/obj//sys//modules//sys/modules/siftr/siftr.ko >> or if you "make installkernel" it'll be in /boot/kernel/kernel/siftr.ko). > > That seems to work. Damn, well this is the first time I've encountered a problem like this whilst using SIFTR compiled standalone and I've been using it like that for almost 3 years. I guess the lack of KTR in the module build subtly influences the module in a way that allows it load but in a precarious way. How irritating. Rui you were right on the money! I will revise my testing instructions to build the module as part of a buildkernel to avoid potential problems like this. Thanks for helping get to the bottom of this and for the test feedback. Cheers, Lawrence From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 04:56:08 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7EB7106564A for ; Tue, 22 Jun 2010 04:56:08 +0000 (UTC) (envelope-from admin@lissyara.su) Received: from hosting.lissyara.su (hosting.lissyara.su [77.221.149.162]) by mx1.freebsd.org (Postfix) with ESMTP id 70BF88FC13 for ; Tue, 22 Jun 2010 04:56:07 +0000 (UTC) Received: from [195.93.240.106] (port=35235 helo=lissyara.moskb.local) by hosting.lissyara.su with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1OQvWn-0003Fe-Bh; Tue, 22 Jun 2010 08:56:05 +0400 Message-ID: <4C204265.7070305@lissyara.su> Date: Tue, 22 Jun 2010 08:56:05 +0400 From: Alex Keda User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; ru-RU; rv:1.8.1.23) Gecko/20091202 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: Alexander Best References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-White-List: YES X-Spam-Description: if spam count > 60 - this is spam X-Spam-Count: 0 X-Descriptions: powered by www.lissyara.su X-Bounce-ID: hosting.lissyara.su Cc: freebsd-current@FreeBSD.org, Jeff Roberson Subject: Re: SUJ problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 04:56:08 -0000 On 22.06.2010 03:26, Alexander Best wrote: > i experienced the same problem running r209391. this might have to do > something with a fs being full. i saw these warnings during buildworld > when eventuall / ran out of space: > > Jun 21 21:32:55 otaku kernel: pid 1398 (sakura), uid 1001 inumber > 2661904 on /: filesystem full > I have 160Gb disk used as one pat for / Only 16% space used... > Jun 21 21:32:59 otaku kernel: pid 1398 (sakura), uid 1001 inumber > 2661904 on /: filesystem full > Jun 21 21:33:00 otaku kernel: pid 76033 (dd), uid 2 inumber 2591139 on > /: filesystem full > Jun 21 21:33:02 otaku kernel: pid 1398 (sakura), uid 1001 inumber > 2661904 on /: filesystem full > Jun 21 21:33:07 otaku kernel: pid 75215 (chrome), uid 1001 inumber > 18205737 on /: filesystem full > Jun 21 21:33:08 otaku kernel: pid 1467 (script), uid 1001 inumber > 14226185 on /: filesystem full > Jun 21 21:33:08 otaku kernel: pid 1398 (sakura), uid 1001 inumber > 2661904 on /: filesystem full > Jun 21 21:33:11 otaku kernel: pid 1398 (sakura), uid 1001 inumber > 2661904 on /: filesystem full > Jun 21 21:33:18 otaku kernel: pid 75215 (chrome), uid 1001 inumber > 18205702 on /: filesystem full > Jun 21 21:33:28 otaku kernel: pid 1398 (sakura), uid 1001 inumber > 2661461 on /: filesystem full > Jun 21 21:33:39 otaku kernel: pid 1398 (sakura), uid 1001 inumber > 2661461 on /: filesystem full > Jun 21 21:33:47 otaku kernel: pid 1398 (sakura), uid 1001 inumber > 2661904 on /: filesystem full > Jun 21 21:33:48 otaku kernel: pid 75215 (chrome), uid 1001 inumber > 16086093 on /: filesystem full > Jun 21 21:33:50 otaku kernel: pid 1398 (sakura), uid 1001 inumber > 2661461 on /: filesystem full > > followed by lots of > > Jun 21 21:35:25 otaku kernel: bad block 7020785329444114652, ino 7468267 > Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber > 7468267 on /: bad block > Jun 21 21:35:25 otaku kernel: bad block -315669439672768816, ino 7468267 > Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber > 7468267 on /: bad block > Jun 21 21:35:25 otaku kernel: bad block -3220207053503867546, ino 7468267 > Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber > 7468267 on /: bad block > Jun 21 21:35:25 otaku kernel: bad block -6419917778393221405, ino 7468267 > Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber > 7468267 on /: bad block > Jun 21 21:35:25 otaku kernel: bad block 3919397040058727880, ino 7468267 > Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber > 7468267 on /: bad block > Jun 21 21:35:25 otaku kernel: bad block -6888424595660707789, ino 7468267 > Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber > 7468267 on /: bad block > Jun 21 21:35:25 otaku kernel: > g_vfs_done():ufs/rootfs[READ(offset=100240429127958528, > length=16384)]error = 5 > Jun 21 21:35:25 otaku kernel: bad block -1173790944229704887, ino 7468267 > Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber > 7468267 on /: bad block > Jun 21 21:35:25 otaku kernel: bad block 5537349803492323867, ino 7468267 > Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber > 7468267 on /: bad block > Jun 21 21:35:25 otaku kernel: bad block 882554538064816358, ino 7468267 > Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber > 7468267 on /: bad block > Jun 21 21:35:25 otaku kernel: bad block -2565060229441336925, ino 7468267 > > ~ 2 minutes later (see timestamp). i then did a `find / -inum 7468267` > but couldn't find the file. i then did a clean reboot using `shutdown > -r now`. the buffers got synched down to 0 however it said something > like "/ cannot be unmounted filesystem busy". > > i then was thrown into single user mode due to the same problem alex > kada reported. at some point i did a `mount -f /` and did `dmesg -a> > /FEHLER`. strange thing is that everything seems to have been piped to > that file twice. after that i did `fastboot` and freebsd came up with > / being clean (although the last fsck report said / was marked dirty). > i've attached the file. > > cheers. > > From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 09:10:16 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C49BC1065670 for ; Tue, 22 Jun 2010 09:10:16 +0000 (UTC) (envelope-from alexbestms@uni-muenster.de) Received: from SECMAIL.UNI-MUENSTER.DE (SECMAIL.UNI-MUENSTER.DE [128.176.192.141]) by mx1.freebsd.org (Postfix) with ESMTP id 567768FC15 for ; Tue, 22 Jun 2010 09:10:15 +0000 (UTC) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTP id 5BBC8BF436 for ; Tue, 22 Jun 2010 11:10:13 +0200 (CEST) Received: by vws1 with SMTP id 1so2594514vws.13 for ; Tue, 22 Jun 2010 02:10:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.35.150 with SMTP id p22mr4054466qad.251.1277197811719; Tue, 22 Jun 2010 02:10:11 -0700 (PDT) Received: by 10.229.215.196 with HTTP; Tue, 22 Jun 2010 02:10:11 -0700 (PDT) In-Reply-To: <4C204265.7070305@lissyara.su> References: <4C204265.7070305@lissyara.su> Date: Tue, 22 Jun 2010 11:10:11 +0200 Message-ID: From: Alexander Best To: Alex Keda Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current@freebsd.org, Jeff Roberson Subject: Re: SUJ problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 09:10:16 -0000 On Tue, Jun 22, 2010 at 6:56 AM, Alex Keda wrote: > On 22.06.2010 03:26, Alexander Best wrote: >> >> i experienced the same problem running r209391. this might have to do >> something with a fs being full. i saw these warnings during buildworld >> when eventuall / ran out of space: >> >> Jun 21 21:32:55 otaku kernel: pid 1398 (sakura), uid 1001 inumber >> 2661904 on /: filesystem full >> > > I have 160Gb disk used as one pat for / > Only 16% space used... i see. so it's not an issue with / being full. maybe commit r209408 takes care of the problem. i'll update my sources and see if the problem occurs again. cheers. alex > > >> Jun 21 21:32:59 otaku kernel: pid 1398 (sakura), uid 1001 inumber >> 2661904 on /: filesystem full >> Jun 21 21:33:00 otaku kernel: pid 76033 (dd), uid 2 inumber 2591139 on >> /: filesystem full >> Jun 21 21:33:02 otaku kernel: pid 1398 (sakura), uid 1001 inumber >> 2661904 on /: filesystem full >> Jun 21 21:33:07 otaku kernel: pid 75215 (chrome), uid 1001 inumber >> 18205737 on /: filesystem full >> Jun 21 21:33:08 otaku kernel: pid 1467 (script), uid 1001 inumber >> 14226185 on /: filesystem full >> Jun 21 21:33:08 otaku kernel: pid 1398 (sakura), uid 1001 inumber >> 2661904 on /: filesystem full >> Jun 21 21:33:11 otaku kernel: pid 1398 (sakura), uid 1001 inumber >> 2661904 on /: filesystem full >> Jun 21 21:33:18 otaku kernel: pid 75215 (chrome), uid 1001 inumber >> 18205702 on /: filesystem full >> Jun 21 21:33:28 otaku kernel: pid 1398 (sakura), uid 1001 inumber >> 2661461 on /: filesystem full >> Jun 21 21:33:39 otaku kernel: pid 1398 (sakura), uid 1001 inumber >> 2661461 on /: filesystem full >> Jun 21 21:33:47 otaku kernel: pid 1398 (sakura), uid 1001 inumber >> 2661904 on /: filesystem full >> Jun 21 21:33:48 otaku kernel: pid 75215 (chrome), uid 1001 inumber >> 16086093 on /: filesystem full >> Jun 21 21:33:50 otaku kernel: pid 1398 (sakura), uid 1001 inumber >> 2661461 on /: filesystem full >> >> followed by lots of >> >> Jun 21 21:35:25 otaku kernel: bad block 7020785329444114652, ino 7468267 >> Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber >> 7468267 on /: bad block >> Jun 21 21:35:25 otaku kernel: bad block -315669439672768816, ino 7468267 >> Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber >> 7468267 on /: bad block >> Jun 21 21:35:25 otaku kernel: bad block -3220207053503867546, ino 7468267 >> Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber >> 7468267 on /: bad block >> Jun 21 21:35:25 otaku kernel: bad block -6419917778393221405, ino 7468267 >> Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber >> 7468267 on /: bad block >> Jun 21 21:35:25 otaku kernel: bad block 3919397040058727880, ino 7468267 >> Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber >> 7468267 on /: bad block >> Jun 21 21:35:25 otaku kernel: bad block -6888424595660707789, ino 7468267 >> Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber >> 7468267 on /: bad block >> Jun 21 21:35:25 otaku kernel: >> g_vfs_done():ufs/rootfs[READ(offset=100240429127958528, >> length=16384)]error = 5 >> Jun 21 21:35:25 otaku kernel: bad block -1173790944229704887, ino 7468267 >> Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber >> 7468267 on /: bad block >> Jun 21 21:35:25 otaku kernel: bad block 5537349803492323867, ino 7468267 >> Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber >> 7468267 on /: bad block >> Jun 21 21:35:25 otaku kernel: bad block 882554538064816358, ino 7468267 >> Jun 21 21:35:25 otaku kernel: pid 16 (softdepflush), uid 0 inumber >> 7468267 on /: bad block >> Jun 21 21:35:25 otaku kernel: bad block -2565060229441336925, ino 7468267 >> >> ~ 2 minutes later (see timestamp). i then did a `find / -inum 7468267` >> but couldn't find the file. i then did a clean reboot using `shutdown >> -r now`. the buffers got synched down to 0 however it said something >> like "/ cannot be unmounted filesystem busy". >> >> i then was thrown into single user mode due to the same problem alex >> kada reported. at some point i did a `mount -f /` and did `dmesg -a> >> /FEHLER`. strange thing is that everything seems to have been piped to >> that file twice. after that i did `fastboot` and freebsd came up with >> / being clean (although the last fsck report said / was marked dirty). >> i've attached the file. >> >> cheers. >> >> > > -- Alexander Best From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 19:55:39 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89F701065674 for ; Tue, 22 Jun 2010 19:55:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 1CF288FC1E for ; Tue, 22 Jun 2010 19:55:38 +0000 (UTC) Received: (qmail 15060 invoked by uid 399); 22 Jun 2010 19:55:38 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Jun 2010 19:55:38 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C211538.1040808@FreeBSD.org> Date: Tue, 22 Jun 2010 12:55:36 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100621 Thunderbird/3.0.5 MIME-Version: 1.0 To: freebsd-current@FreeBSD.org X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alexander Motin Subject: Timer panic on boot (r209434) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 19:55:39 -0000 Howdy, I tried upgrading from r209351 to r209434 and got a panic related to the timer stuff while booting. You can see the panic and the backtrace here: http://people.freebsd.org/~dougb/timer-panic-1.jpg http://people.freebsd.org/~dougb/timer-panic-2.jpg http://people.freebsd.org/~dougb/timer-panic-3.jpg hth, Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 19:58:12 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D76B1065673 for ; Tue, 22 Jun 2010 19:58:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id F25E08FC13 for ; Tue, 22 Jun 2010 19:58:11 +0000 (UTC) Received: (qmail 18410 invoked by uid 399); 22 Jun 2010 19:58:11 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Jun 2010 19:58:11 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C2115D2.5080504@FreeBSD.org> Date: Tue, 22 Jun 2010 12:58:10 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100621 Thunderbird/3.0.5 MIME-Version: 1.0 To: freebsd-current@FreeBSD.org References: <4C211538.1040808@FreeBSD.org> In-Reply-To: <4C211538.1040808@FreeBSD.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alexander Motin Subject: Re: Timer panic on boot (r209434) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 19:58:12 -0000 On 06/22/10 12:55, Doug Barton wrote: > Howdy, > > I tried upgrading from r209351 to r209434 and got a panic related to the > timer stuff while booting. You can see the panic and the backtrace here: > > http://people.freebsd.org/~dougb/timer-panic-1.jpg > http://people.freebsd.org/~dougb/timer-panic-2.jpg > http://people.freebsd.org/~dougb/timer-panic-3.jpg Hmmm, that could use a little more detail. :) I have a Dell laptop with a core 2 duo processor, running 9-current SMP i386. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 20:11:17 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A88F1065678; Tue, 22 Jun 2010 20:11:17 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.freebsd.org (Postfix) with ESMTP id 707C38FC12; Tue, 22 Jun 2010 20:11:16 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=5L7go04Pwv0A:10 a=GQCbJdZ--msA:10 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=6I5d2MoRAAAA:8 a=cZiytllGAAAA:8 a=co-lk1d0aRPTRZKaQZsA:9 a=ctSAzfj0qWR95Mm0uo8A:7 a=aubw6X4oJen3x9cJAWhhvMwaHDEA:4 a=wPNLvfGTeEIA:10 a=SV7veod9ZcQA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1399275033; Tue, 22 Jun 2010 22:11:14 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org, "Sergey V. Dyatko" , Ted Faber Date: Tue, 22 Jun 2010 22:08:23 +0200 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <201003301510.58203.jhb@freebsd.org> <87bpe4ps9m.fsf@kobe.laptop> In-Reply-To: <87bpe4ps9m.fsf@kobe.laptop> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006222208.23271.hselasky@c2i.net> Cc: Giorgos Keramidas , Bruce Cran , freebsd-current@freebsd.org, Alexander Best Subject: Re: building world with debugging symbols [broken?] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 20:11:17 -0000 On Wednesday 31 March 2010 14:52:53 Giorgos Keramidas wrote: > On Tue, 30 Mar 2010 15:10:58 -0400, John Baldwin wrote: > > On Tuesday 30 March 2010 11:48:58 am Giorgos Keramidas wrote: > >> +.It Va DEBUG_FLAGS > >> +Defines a set of debugging flags that will be used to build all > >> userland +binaries under > >> +.Pa /usr/src . > >> +When > >> +.Va DEBUG_FLAGS > >> +is defined, the > >> +.Cm install > >> +and > >> +.Cm installworld > >> +targets install binaries from the current > >> +.Va MAKEOBJDIRPREFIX > >> +without stripping too, so that debugging information is retained in the > >> +installed binaries. > > > > I would drop the "too" and start 'so' on a new line (at least that is > > my interpretation of the line-break rules we use for mdoc). Other > > than that I think this looks fine. > > Fixed and committed in r205978. Thanks :) Hi, I've gotten several reports that cuse4bsd and other kernel modules built outside the kernel tree no longer load. Any clues about what is wrong? Is this a compiler issue, or has it got to do with missing/wrong symbols? For example one guy writes: On Tue, 22 Jun 2010 19:11:09 +0200 Hans Petter Selasky wrote: > On Tuesday 22 June 2010 18:06:58 Ted Faber wrote: > > FWIW, I'm seeing the same thing on 8.1-PRERELEASE csupped from > > yesterday. It's been going on foe a while, but I haven't been able > > to find the bug. > > > > (I was literally sitting down to type an e-mail about it when I saw > > this thread.) > > > > Same symptom: cuse4bsd loads but no device file appears in the /dev > > I also don't see the printfs from cuse_kern_init show up in the > > log. It seems like something's changed in the kernel module load > > path somehow. FWIW, the example in /usr/share/examples/kld/cdev/ > > doesn't work for me either. > > > > I've attached the verbose boot. Cuse4bsd is current from ports, > > recompiled after the new kernel install: > > > > $ pkg_info | grep cuse > > cuse4bsd-kmod-0.1.11 Cuse4BSD character device loopback driver for > > userspace > > > > Here's my loader.conf: > > > > $ cat /boot/loader.conf > > beastie_disable="YES" > > acpi_ibm_load="YES" > > snd_ich_load="YES" > > cuse4bsd_load="YES" > > > > The module is in the right place and seems to load: > > $ ls -l /boot/modules/ > > total 18 > > -r-xr-xr-x 1 root wheel 16505 Jun 21 19:02 cuse4bsd.ko > > $ kldstat > > Id Refs Address Size Name > > 1 36 0xc0400000 bb8ea8 kernel > > 2 1 0xc0fb9000 7224 snd_ich.ko > > 3 2 0xc0fc1000 577a4 sound.ko > > 4 1 0xc1019000 5244 acpi_ibm.ko > > 5 1 0xc101f000 4610 cuse4bsd.ko > > 6 1 0xc59c9000 8000 linprocfs.ko > > 7 1 0xc5a1d000 26000 linux.ko > > 8 1 0xc5b07000 11000 ipfw.ko > > 9 1 0xc5b18000 d000 libalias.ko > > 10 1 0xc5e2e000 2000 green_saver.ko > > 11 1 0xc5f0d000 68000 radeon.ko > > 12 1 0xc5f84000 14000 drm.ko > > > > $ uname -a > > FreeBSD praxis.lunabase.org 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE > > #38: Mon Jun 21 17:14:31 PDT 2010 > > root@praxis.lunabase.org:/usr/obj/usr/src/sys/GENERIC i386 > > > > I'm happy to try fixes or provide information. > > > > Are you sure the kernel sources are matched with your kernel. I find > this rather odd. > laptop# svn info Path: . URL: svn://svn.freebsd.by/base/head Repository Root: svn://svn.freebsd.by/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 209412 Node Kind: directory Schedule: normal Last Changed Author: delphij Last Changed Rev: 209408 Last Changed Date: 2010-06-22 03:26:07 +0300 (Tue, 22 Jun 2010) svn.freebsd.by - nearest svn mirror for me. [username@svn]~%crontab -l|grep svn 0 */2 * * * /usr/local/bin/svnsync sync file:///usr/local/repositories/freebsd/base/ %uname -a FreeBSD laptop.domain 9.0-CURRENT FreeBSD 9.0-CURRENT #7 r209412M: Tue Jun 22 11:23:15 EEST 2010 root@laptop.domain:/usr/obj/usr/src/sys/b450 i386 laptop# pwd /usr/src laptop# svn st laptop# > The Cuse4BSD printout is called from a SYSINIT. If sysinits don't > work then something fundamental is wrong. Also check: > > find /boot -name "cuse4bsd*" > laptop# find /boot -name 'cuse*' /boot/modules/cuse4bsd.ko laptop# > printf("Cuse4BSD v%d.%d.%d @ /dev/cuse\n", > (CUSE_VERSION >> 16) & 0xFF, (CUSE_VERSION >> 8) & 0xFF, > (CUSE_VERSION >> 0) & 0xFF); > } > > SYSINIT(cuse_kern_init, SI_SUB_DEVFS, SI_ORDER_ANY, cuse_kern_init, > 0); > --HPS From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 20:11:38 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40FB31065673; Tue, 22 Jun 2010 20:11:38 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 97F7B8FC0C; Tue, 22 Jun 2010 20:11:37 +0000 (UTC) Received: by fxm7 with SMTP id 7so3157554fxm.13 for ; Tue, 22 Jun 2010 13:11:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type; bh=7f0bJLQ1i/sq24lyvcLtrvRdVeMjn+nA6Y0Y9tiFSMA=; b=pHTqnKE0IIo7pwMM6yvpk/KTU/+Sh4GJGwwauplJzn/aiAvb063kZAE7/yxobTIchF 7eR4i37pjrPDEdedLwxEGeI6lBakdW5eNCbMnc79GwCCgmPbO0q9rp1RuG7YolY7m8gD h7x8RsBWkNm1BRKe3MRs8SOVXB60SGBTUHc4k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=UNpUNcT1uV6/SwyLF4cyIAE8I16U8PKwuLI02i2IJjefiZhuOI/a1ekUto/UsBFMUs PiMGV/KXVtSMcnlpT02pdYBfRidvexbyru1kDKRTibENwxBmbKv5j2du+jvjAcCp0WoA X2HuMuxKZbKV9jPtrWH8gt1emrqpGH0ikgtNU= Received: by 10.223.5.81 with SMTP id 17mr6717133fau.42.1277237496636; Tue, 22 Jun 2010 13:11:36 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 2sm30719354fav.25.2010.06.22.13.11.35 (version=SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 13:11:35 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C2118D1.3080903@FreeBSD.org> Date: Tue, 22 Jun 2010 23:10:57 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Doug Barton References: <4C211538.1040808@FreeBSD.org> <4C2115D2.5080504@FreeBSD.org> In-Reply-To: <4C2115D2.5080504@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: multipart/mixed; boundary="------------030706010608010307010605" Cc: freebsd-current@FreeBSD.org Subject: Re: Timer panic on boot (r209434) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 20:11:38 -0000 This is a multi-part message in MIME format. --------------030706010608010307010605 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Doug Barton wrote: > On 06/22/10 12:55, Doug Barton wrote: >> Howdy, >> >> I tried upgrading from r209351 to r209434 and got a panic related to the >> timer stuff while booting. You can see the panic and the backtrace here: >> >> http://people.freebsd.org/~dougb/timer-panic-1.jpg >> http://people.freebsd.org/~dougb/timer-panic-2.jpg >> http://people.freebsd.org/~dougb/timer-panic-3.jpg > > Hmmm, that could use a little more detail. :) I have a Dell laptop with > a core 2 duo processor, running 9-current SMP i386. Your ACPI seems reports that attimer uses IRQ2, instead of usual IRQ0. It is either a bug, or it is a very rare feature. I am not sure it is not a hack, but you may try attached patch. If it helps, it would be nice it you tried to use i8254 event timer, to check is this a bug or feature. -- Alexander Motin --------------030706010608010307010605 Content-Type: text/plain; name="norid.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="norid.patch" diff -ruNp sys/isa.prev/atrtc.c sys/isa/atrtc.c --- sys/isa.prev/atrtc.c 2010-06-22 23:01:13.000000000 +0300 +++ sys/isa/atrtc.c 2010-06-22 23:01:38.000000000 +0300 @@ -259,6 +259,7 @@ atrtc_attach(device_t dev) if (!atrtcclock_disable && (resource_int_value(device_get_name(dev), device_get_unit(dev), "clock", &i) != 0 || i != 0)) { + sc->intr_rid = -1; if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) { device_printf(dev,"Can't map interrupt.\n"); diff -ruNp sys/isa.prev/clock.c sys/isa/clock.c --- sys/isa.prev/clock.c 2010-06-22 20:19:00.000000000 +0300 +++ sys/isa/clock.c 2010-06-22 23:01:27.000000000 +0300 @@ -535,6 +535,7 @@ attimer_attach(device_t dev) tc_init(&sc->tc); if (resource_int_value(device_get_name(dev), device_get_unit(dev), "clock", &i) != 0 || i != 0) { + sc->intr_rid = -1; if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->intr_rid, 0, 0, 1, RF_ACTIVE))) { device_printf(dev,"Can't map interrupt.\n"); --------------030706010608010307010605-- From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 20:39:19 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44E2F106566B; Tue, 22 Jun 2010 20:39:19 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9CFCF8FC12; Tue, 22 Jun 2010 20:39:18 +0000 (UTC) Received: by ewy22 with SMTP id 22so294225ewy.13 for ; Tue, 22 Jun 2010 13:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=PZuo2Balgps3qu0i+qebpWyf34VcoRd1aleAb++jQ7g=; b=leGdtdkraWW3RdVcm/rfi07RZzUyYpWCUITkC+9NNwhJp2HyHYHg1lIC0Yuo3hhkFc bp2C23ZPeF9eTu4TY3SgiOU0w8lTIJBJ13CBfa0UCA7cI2o4F7ShO+cNl8xVTkteJkoh ALgi8CIaaVZ1Z4rQEfKFV5NsZoLF9lHLerkgg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=CUICRvGxcMXsD5Cr7lAu0oChdogOx3AouWjeTIslJA3Vr8n0l7C9E51k6zMNLe5ftR oqXWKohYbYHeqd8pdDjEITIapLIo5eStLXsGaRK3rISqb9+w4Rerk82g7Sieahs+l4de WCoYORHdVY7txrcUMkotJob8OrXA00pZ2b8dA= MIME-Version: 1.0 Received: by 10.213.31.132 with SMTP id y4mr1891437ebc.51.1277239157248; Tue, 22 Jun 2010 13:39:17 -0700 (PDT) Received: by 10.213.10.131 with HTTP; Tue, 22 Jun 2010 13:39:17 -0700 (PDT) In-Reply-To: <201006222208.23271.hselasky@c2i.net> References: <201003301510.58203.jhb@freebsd.org> <87bpe4ps9m.fsf@kobe.laptop> <201006222208.23271.hselasky@c2i.net> Date: Tue, 22 Jun 2010 16:39:17 -0400 Message-ID: From: Ryan Stone To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: Bruce Cran , "Sergey V. Dyatko" , freebsd-hackers@freebsd.org, Ted Faber , Alexander Best , freebsd-current@freebsd.org, Giorgos Keramidas Subject: Re: building world with debugging symbols [broken?] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 20:39:19 -0000 I saw similar behaviour a couple of years ago when I switched from using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules. The problem ended up being a change in the linker script used by GNU ld for linking kernel modules. It used to always put some magic symbols used by the linker to implement things like sysinits into the module. It was changed to only provide those symbols, which apparently means that the linker would discard those symbols if nothing referenced them(and nothing did reference them). I had to work around it by adding the following to my link line: -u __start_set_sysinit_set -u __start_set_sysuninit_set \ -u __start_set_sysctl_set -u __start_set_modmetadata_set \ -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ -u __stop_set_sysctl_set -u __stop_set_modmetadata_set From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 21:00:21 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D2201065672 for ; Tue, 22 Jun 2010 21:00:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id DEE5D8FC21 for ; Tue, 22 Jun 2010 21:00:20 +0000 (UTC) Received: (qmail 20347 invoked by uid 399); 22 Jun 2010 21:00:19 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Jun 2010 21:00:19 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C212460.1070200@FreeBSD.org> Date: Tue, 22 Jun 2010 14:00:16 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100621 Thunderbird/3.0.5 MIME-Version: 1.0 To: Alexander Motin References: <4C211538.1040808@FreeBSD.org> <4C2115D2.5080504@FreeBSD.org> <4C2118D1.3080903@FreeBSD.org> In-Reply-To: <4C2118D1.3080903@FreeBSD.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org Subject: Re: Timer panic on boot (r209434) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:00:21 -0000 On 06/22/10 13:10, Alexander Motin wrote: > Doug Barton wrote: >> On 06/22/10 12:55, Doug Barton wrote: >>> Howdy, >>> >>> I tried upgrading from r209351 to r209434 and got a panic related >>> to the timer stuff while booting. You can see the panic and the >>> backtrace here: >>> >>> http://people.freebsd.org/~dougb/timer-panic-1.jpg >>> http://people.freebsd.org/~dougb/timer-panic-2.jpg >>> http://people.freebsd.org/~dougb/timer-panic-3.jpg >> >> Hmmm, that could use a little more detail. :) I have a Dell laptop >> with a core 2 duo processor, running 9-current SMP i386. > > Your ACPI seems reports that attimer uses IRQ2, instead of usual > IRQ0. It is either a bug, or it is a very rare feature. > > I am not sure it is not a hack, but you may try attached patch. Ok, I updated to r209441, then applied your patch. FYI, I applied it in src/sys/x86/isa/ using -p2. This allowed me to boot, verbose dmesg is at http://people.freebsd.org/~dougb/dmesg-verbose-norid-patch.txt > If it helps, it would be nice it you tried to use i8254 event timer, > to check is this a bug or feature. Ok, I'm willing to give that a try if you tell me how. :) Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 21:07:31 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 327551065677 for ; Tue, 22 Jun 2010 21:07:31 +0000 (UTC) (envelope-from faber@zod.isi.edu) Received: from zod.isi.edu (zod.isi.edu [128.9.168.221]) by mx1.freebsd.org (Postfix) with ESMTP id 1182C8FC24 for ; Tue, 22 Jun 2010 21:07:30 +0000 (UTC) Received: from zod.isi.edu (localhost [127.0.0.1]) by zod.isi.edu (8.14.4/8.14.4) with ESMTP id o5ML7N8r021850; Tue, 22 Jun 2010 14:07:23 -0700 (PDT) (envelope-from faber@zod.isi.edu) Received: (from faber@localhost) by zod.isi.edu (8.14.4/8.14.4/Submit) id o5ML7LGU021849; Tue, 22 Jun 2010 14:07:21 -0700 (PDT) (envelope-from faber) Date: Tue, 22 Jun 2010 14:07:21 -0700 From: Ted Faber To: Ryan Stone Message-ID: <20100622210721.GC18012@zod.isi.edu> References: <201003301510.58203.jhb@freebsd.org> <87bpe4ps9m.fsf@kobe.laptop> <201006222208.23271.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="c3bfwLpm8qysLVxt" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-url: http://www.isi.edu/~faber Cc: Bruce Cran , "Sergey V. Dyatko" , freebsd-hackers@freebsd.org, Hans Petter Selasky , Alexander Best , freebsd-current@freebsd.org, Giorgos Keramidas Subject: Re: building world with debugging symbols [broken?] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:07:31 -0000 --c3bfwLpm8qysLVxt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 22, 2010 at 04:39:17PM -0400, Ryan Stone wrote: > I saw similar behaviour a couple of years ago when I switched from > using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules. > The problem ended up being a change in the linker script used by GNU > ld for linking kernel modules. It used to always put some magic > symbols used by the linker to implement things like sysinits into the > module. It was changed to only provide those symbols, which > apparently means that the linker would discard those symbols if > nothing referenced them(and nothing did reference them). I had to > work around it by adding the following to my link line: >=20 > -u __start_set_sysinit_set -u __start_set_sysuninit_set \ > -u __start_set_sysctl_set -u __start_set_modmetadata_set \ > -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ > -u __stop_set_sysctl_set -u __stop_set_modmetadata_set HPS: I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd port made the module and the result loads and creates the /dev/cuse file. Here's a diff relative to /usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.11 just so it's clear what I did. --- Makefile.kmod.orig 2010-02-11 03:28:02.000000000 -0800 +++ Makefile.kmod 2010-06-22 14:02:52.000000000 -0700 @@ -30,4 +30,10 @@ KMOD=3D cuse4bsd SRCS=3D cuse4bsd_kmod.c device_if.h bus_if.h vnode_if.h =20 +LDFLAGS +=3D -u __start_set_sysinit_set -u __start_set_sysuninit_set \ + -u __start_set_sysctl_set -u __start_set_modmetadata_set \ + -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ + -u __stop_set_sysctl_set -u __stop_set_modmetadata_set + + .include Running nm -o on the two modules, the difference seems to be that the -u results in some additional absolute symbols being defined: Bad module: $ nm -o /boot/modules/cuse4bsd.ko| grep sys /boot/modules/cuse4bsd.ko:0000275c r __set_sysinit_set_sym_cuse_kern_init_sys_init /boot/modules/cuse4bsd.ko:00002758 r __set_sysuninit_set_sym_cuse_kern_unin= it_sys_uninit /boot/modules/cuse4bsd.ko:00003194 d cuse_kern_init_sys_init /boot/modules/cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit Good module: $ nm -o ./cuse4bsd.ko | grep sys =2E/cuse4bsd.ko:000028cc r __set_sysinit_set_sym_cuse_kern_init_sys_init =2E/cuse4bsd.ko:000028c8 r __set_sysuninit_set_sym_cuse_kern_uninit_sys_uni= nit =2E/cuse4bsd.ko: U __start_set_sysctl_set =2E/cuse4bsd.ko:000028cc A __start_set_sysinit_set =2E/cuse4bsd.ko:000028c8 A __start_set_sysuninit_set =2E/cuse4bsd.ko: U __stop_set_sysctl_set =2E/cuse4bsd.ko:000028d0 A __stop_set_sysinit_set =2E/cuse4bsd.ko:000028cc A __stop_set_sysuninit_set =2E/cuse4bsd.ko:00003194 d cuse_kern_init_sys_init =2E/cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit --=20 Ted Faber http://www.isi.edu/~faber PGP: http://www.isi.edu/~faber/pubkeys.= asc Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#= SIG --c3bfwLpm8qysLVxt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwhJgkACgkQaUz3f+Zf+XsIHQCg01pjgmyQMtRhCxX5Vcecfmh6 oAEAoMjEQJnq4qzA5nrwpptyHFNnnJ+T =tM4z -----END PGP SIGNATURE----- --c3bfwLpm8qysLVxt-- From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 21:18:20 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 279C2106564A; Tue, 22 Jun 2010 21:18:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 810638FC15; Tue, 22 Jun 2010 21:18:19 +0000 (UTC) Received: by fxm7 with SMTP id 7so3196569fxm.13 for ; Tue, 22 Jun 2010 14:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=ADXElO8TEWIr/pwetOArim3Itdk+/155YDLYTF5WA5c=; b=Kwvj3C2b4fT+NY0hEbuNLnN2Nqmm3wc76AuROZc9MRMjUl02kvValhAv+gcq/53RXB EddzdUmgvymKeR335QXBddQ/MLKqNRUeXWyQ1omqn8VpKy9F/H1zppQSRr2z9JJZJGCU Na80VqAUQOPi4WTveGLnijCbSt1Hlq+oMvnEc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=wTVKzuZpPUNK1NRr84o29nczI5+A0xCUPbpj3S08tNvRvUXvLCljSwLRPB+ouWzOdr 02PeB73nIhxXDuRJsyqWRjHge6h4AhZCc9S/jiY8xdkIr7B+nufA3p8JkTl8Z4Fi8E2O Yth7lBKVpFYPvX7h941CkEhO48J4KX0ynC4wY= Received: by 10.223.92.153 with SMTP id r25mr6733863fam.76.1277241498327; Tue, 22 Jun 2010 14:18:18 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id o11sm30850912fal.43.2010.06.22.14.18.17 (version=SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 14:18:17 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C212873.5010807@FreeBSD.org> Date: Wed, 23 Jun 2010 00:17:39 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Doug Barton References: <4C211538.1040808@FreeBSD.org> <4C2115D2.5080504@FreeBSD.org> <4C2118D1.3080903@FreeBSD.org> <4C212460.1070200@FreeBSD.org> In-Reply-To: <4C212460.1070200@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org Subject: Re: Timer panic on boot (r209434) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:18:20 -0000 Doug Barton wrote: > On 06/22/10 13:10, Alexander Motin wrote: >> Doug Barton wrote: >>> On 06/22/10 12:55, Doug Barton wrote: >>>> Howdy, >>>> >>>> I tried upgrading from r209351 to r209434 and got a panic related >>>> to the timer stuff while booting. You can see the panic and the >>>> backtrace here: >>>> >>>> http://people.freebsd.org/~dougb/timer-panic-1.jpg >>>> http://people.freebsd.org/~dougb/timer-panic-2.jpg >>>> http://people.freebsd.org/~dougb/timer-panic-3.jpg >>> Hmmm, that could use a little more detail. :) I have a Dell laptop >>> with a core 2 duo processor, running 9-current SMP i386. >> Your ACPI seems reports that attimer uses IRQ2, instead of usual >> IRQ0. It is either a bug, or it is a very rare feature. >> >> I am not sure it is not a hack, but you may try attached patch. > > Ok, I updated to r209441, then applied your patch. FYI, I applied it in > src/sys/x86/isa/ using -p2. This allowed me to boot, verbose dmesg is at > http://people.freebsd.org/~dougb/dmesg-verbose-norid-patch.txt > >> If it helps, it would be nice it you tried to use i8254 event timer, >> to check is this a bug or feature. > > Ok, I'm willing to give that a try if you tell me how. :) Run `sysctl kern.eventtimer.timer2=i8254`, then after few seconds check messages to see if system liked this timer (it should fall back automatically if it's not), then check 'vmstat -ia' to see whether irq0 interrupts are arriving, then run 'systat -vm 1' to be absolutely sure. If `vmstat -ia` won't show irq0 interrupts, try to figure out what else can arrive instead of it. -- Alexander Motin From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 21:40:13 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 088FD1065675 for ; Tue, 22 Jun 2010 21:40:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id A499D8FC12 for ; Tue, 22 Jun 2010 21:40:12 +0000 (UTC) Received: (qmail 17069 invoked by uid 399); 22 Jun 2010 21:40:10 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Jun 2010 21:40:10 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C212DB9.6030308@FreeBSD.org> Date: Tue, 22 Jun 2010 14:40:09 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100621 Thunderbird/3.0.5 MIME-Version: 1.0 To: Alexander Motin References: <4C211538.1040808@FreeBSD.org> <4C2115D2.5080504@FreeBSD.org> <4C2118D1.3080903@FreeBSD.org> <4C212460.1070200@FreeBSD.org> <4C212873.5010807@FreeBSD.org> In-Reply-To: <4C212873.5010807@FreeBSD.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org Subject: Re: Timer panic on boot (r209434) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:40:13 -0000 On 06/22/10 14:17, Alexander Motin wrote: > Run `sysctl kern.eventtimer.timer2=i8254`, then after few seconds check > messages to see if system liked this timer (it should fall back > automatically if it's not), Seems ok. Here is what I got on the console, no error messages in /var/log/all. sysctl kern.eventtimer.timer2=i8254 kern.eventtimer.timer2: HPET1Starting kernel event timers: HPET @ 100Hz, i8254 @ 128Hz -> i8254 t_delta 16.01a20d312197c8b0 too long > then check 'vmstat -ia' to see whether irq0 interrupts are arriving, This also seems fine: interrupt total rate ??? 0 0 irq1: atkbd0 3448 1 stray irq1 0 0 irq0: attimer0 15756 6 stray irq0 0 0 irq3: 0 0 stray irq3 0 0 The total for irq0 is going up consistently. > then run 'systat -vm 1' to be absolutely sure. That also seemed fine. Here is a sample: 104 hpet0 uhci If I did nothing but stare at the screen the value was fairly consistently 100, with occasional values of 99 or 107. Once I started moving the mouse it jumped around a little, but stabilized again when I left the mouse alone. Should I continue using the HPET timer? Is it "better" in some way? Anything else I can do to help? Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 21:59:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 785AB106564A; Tue, 22 Jun 2010 21:59:52 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id CB86F8FC08; Tue, 22 Jun 2010 21:59:51 +0000 (UTC) Received: by fxm7 with SMTP id 7so3215963fxm.13 for ; Tue, 22 Jun 2010 14:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=jEClbIQClkuvY+ipuVsLv1nnzVVURSdZNW4VkM8KZeg=; b=qPd5/RIqOs+xDrA6Fpbiyo4qEoUgCbCD2A1T9g6AdEpI+yUpcAwpR8DfXyNipMWiDh GoX/mLa+3Hg+wdx0Z2aliaX1ynxoRkEvUsrFEsoU89Dd82EaspS1fskX4RNewO8AYAeo 8MyobrkrGtoBRQuA0rpihG5oqNGsD+HfXVemw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=QXULLpUZ5vjSqFZWzCxEpmGvh2/Qh4L+r9ypzU2OxOLH/cJKuMJaoC+ouT1SfcKSiX /uy7Y7DScUeBrREB7vCK01FSdy3jy0p/pVAG6I2WbaqGdbxDlPO2Fhutdx+HKAsI6S0N OHSIMUnTq1ex5+KvNIw+gU+8IfptRp6viyuFo= Received: by 10.223.35.12 with SMTP id n12mr6796652fad.35.1277243990689; Tue, 22 Jun 2010 14:59:50 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id j23sm30930221faa.26.2010.06.22.14.59.49 (version=SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 14:59:50 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C21322F.9080009@FreeBSD.org> Date: Wed, 23 Jun 2010 00:59:11 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Doug Barton References: <4C211538.1040808@FreeBSD.org> <4C2115D2.5080504@FreeBSD.org> <4C2118D1.3080903@FreeBSD.org> <4C212460.1070200@FreeBSD.org> <4C212873.5010807@FreeBSD.org> <4C212DB9.6030308@FreeBSD.org> In-Reply-To: <4C212DB9.6030308@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org Subject: Re: Timer panic on boot (r209434) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:59:52 -0000 Doug Barton wrote: > On 06/22/10 14:17, Alexander Motin wrote: >> Run `sysctl kern.eventtimer.timer2=i8254`, then after few seconds check >> messages to see if system liked this timer (it should fall back >> automatically if it's not), > > Seems ok. Here is what I got on the console, no error messages in > /var/log/all. > > sysctl kern.eventtimer.timer2=i8254 > kern.eventtimer.timer2: HPET1Starting kernel event timers: HPET @ 100Hz, > i8254 @ > 128Hz > -> i8254 > t_delta 16.01a20d312197c8b0 too long > >> then check 'vmstat -ia' to see whether irq0 interrupts are arriving, > > This also seems fine: > > interrupt total rate > ??? 0 0 > irq1: atkbd0 3448 1 > stray irq1 0 0 > irq0: attimer0 15756 6 > stray irq0 0 0 > irq3: 0 0 > stray irq3 0 0 > > The total for irq0 is going up consistently. OK, thanks. It means that your ACPI is lying for some reason. I'll probably commit this patch tomorrow. > Should I continue using the HPET timer? As you wish. > Is it "better" in some way? Comparing to what? Comparing to LAPIC - it is not dying in C3. Comparing to RTC - if is faster and much more flexible. Comparing to i8254 - it can work per-CPU and supports one-shot mode, both not very important now, but should benefit later. > Anything else I can do to help? Find any more issues to fix. :) As you have latest HEAD, you may try my latest addition (r209440) - HPET "legacy route" support. It should allow HPET to work per-CPU on your hardware. To enable it, add such lines to /boot/loader.conf: hint.atrtc.0.clock=0 hint.attimer.0.clock=0 hint.hpet.0.legacy_route=1 -- Alexander Motin From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 22:24:06 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 973DE106566B for ; Tue, 22 Jun 2010 22:24:06 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (core.vx.sk [188.40.32.143]) by mx1.freebsd.org (Postfix) with ESMTP id CC8C28FC1B for ; Tue, 22 Jun 2010 22:24:05 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id B841DD4CB0 for ; Wed, 23 Jun 2010 00:04:30 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VjgLaKCCDPiR for ; Wed, 23 Jun 2010 00:04:28 +0200 (CEST) Received: from [10.9.8.1] (chello085216227216.chello.sk [85.216.227.216]) by mail.vx.sk (Postfix) with ESMTPSA id 5220ED4C9E for ; Wed, 23 Jun 2010 00:04:28 +0200 (CEST) Message-ID: <4C21336F.1060507@FreeBSD.org> Date: Wed, 23 Jun 2010 00:04:31 +0200 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: freebsd-current@FreeBSD.org X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=windows-1250 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: CFT: ZFS v15 patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 22:24:06 -0000 Dear developers, I would like to do a call for testing for my ZFS v15 patch. As the user/group quotas feature is too much attractive for my needs, I couldn't resist and have created (and debugged + tested) a ZFS v15 patch for head (applies cleanly against stable/8 as well). It is a backport of several onnv-revisions, always consulting pjd's p4 tree and includes four post-9396 related user/groupquota bugfixes. The bootcode (zfsimpl.h) is properly updated to support v15 as well, the python part is modified (paths, smb support, ioctls). The patch, list of imported revisions and a preliminary but working version of the pyzfs port can be downloaded from this link: http://people.freebsd.org/~mm/patches/zfs/v15/ You can download 8.1-RC1-amd64 with zfsv15 (incl. boot support) mfsBSD ISOs from here: http://mfsbsd.vx.sk/iso/8.1rc1-zfsv15.iso (without symbols, 98.7M) http://mfsbsd.vx.sk/iso/8.1rc1-zfsv15-debug.iso (with symbols, 187.5M) Login/password into the ISOs: root/mfsroot run "zfsinstall" for a zfs-on-root installation (don't forget -V 15 if trying to install) The amd64 ISO's may be tested in virtualbox or real-world systems as well. Regarding new ioctl's: I have added all new ioctl's in the patch as new ones (numbers 49 to 52). This makes the old kernel module work with new library / utilities (tested) or any other binary that references these ioctl's. Regarding the python port: The current port installs the library into PYTHON_SITELIBDIR and pyzfs.py into /usr/lib/zfs/ Later, we may install all necessary sources and pyzfs.py and the port may be a full-dummy that doesn't need kernel/world sources. Version 15 introduces user and group quota accounting and could be a very good step in preparation towards v26. The code runs impressingly stable (I didn't manage to reproduce any panics or deadlocks yet after polishing). It would be very great if this could get widely tested. I guess we could go with this code in direction stable/8 (head first), because it is backwards compatible (zfs and zpool work with older kernel module - only new features don't work, the same for the boot changes, boot from older pools is supported). Any ideas, suggetions, and bug reports are welcome! Cheers, mm From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 00:08:51 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C526106566B for ; Wed, 23 Jun 2010 00:08:51 +0000 (UTC) (envelope-from nlmills@g.clemson.edu) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id AF2858FC08 for ; Wed, 23 Jun 2010 00:08:50 +0000 (UTC) Received: by gwb11 with SMTP id 11so453453gwb.13 for ; Tue, 22 Jun 2010 17:08:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.182.11 with SMTP id j11mr5936113anp.171.1277250069355; Tue, 22 Jun 2010 16:41:09 -0700 (PDT) Received: by 10.100.47.12 with HTTP; Tue, 22 Jun 2010 16:41:09 -0700 (PDT) Date: Tue, 22 Jun 2010 19:41:09 -0400 Message-ID: From: Nicholas Mills To: freebsd-current@freebsd.org Content-Type: multipart/mixed; boundary=001636c92c60ac5dbf0489a6f469 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: panic during boot on 8.0-RELEASE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: nlmills@clemson.edu List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 00:08:51 -0000 --001636c92c60ac5dbf0489a6f469 Content-Type: text/plain; charset=ISO-8859-1 Hey all, Screenshot of panic message is attached. Machine is a VM running under Parallels Server Bare Metal 4. The cdrom device was enabled but not connected during boot. System was attempting to boot into single user mode. This occurred after a fresh install of 8.0-RELEASE. Let me know how I can provide more useful info. Thanks, Nick --001636c92c60ac5dbf0489a6f469-- From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 00:41:00 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD67E1065670; Wed, 23 Jun 2010 00:41:00 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id DDE838FC13; Wed, 23 Jun 2010 00:40:59 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=9zy2FLL-uPcA:10 a=yQWWgrYGNuUA:10 a=kj9zAlcOel0A:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=IGmblQ1dLY3wUGMpuGUA:9 a=EPc1bLlpiiolXB59LsWQj2YinIsA:4 a=CjuIK1q_8ugA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1368958191; Wed, 23 Jun 2010 02:40:58 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Wed, 23 Jun 2010 02:38:06 +0200 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'( =?utf-8?q?=3B=5FIjlA=3A=0A=09hGE=2E=2EEw?=, =?utf-8?q?XAQ*o=23=5C/M=7ESC=3DS1-f9=7BEzRfT=27=7CHhll5Q=5Dha5Bt-s=7CoTlKM?= =?utf-8?q?usi=3A1e=5BwJl=7Dkd=7DGR=0A=09Z0adGx-x=5F0zGbZj=27e?=(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201006230238.06831.hselasky@c2i.net> Cc: freebsd-current@freebsd.org Subject: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 00:41:00 -0000 Hi, I'm creating a new thread on this issue. On Tue, Jun 22, 2010 at 04:39:17PM -0400, Ryan Stone wrote: > I saw similar behaviour a couple of years ago when I switched from > using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules. > The problem ended up being a change in the linker script used by GNU > ld for linking kernel modules. It used to always put some magic > symbols used by the linker to implement things like sysinits into the > module. It was changed to only provide those symbols, which > apparently means that the linker would discard those symbols if > nothing referenced them(and nothing did reference them). I had to > work around it by adding the following to my link line: > > -u __start_set_sysinit_set -u __start_set_sysuninit_set \ > -u __start_set_sysctl_set -u __start_set_modmetadata_set \ > -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ > -u __stop_set_sysctl_set -u __stop_set_modmetadata_set It appears many kmods are broken because the linker is stripping away static data declared with the section attribute in FreeBSD 8.1-RC1. I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd port made the module and the result loads and creates the /dev/cuse file. Here's a diff relative to /usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.11 just so it's clear what I did. --- Makefile.kmod.orig 2010-02-11 03:28:02.000000000 -0800 +++ Makefile.kmod 2010-06-22 14:02:52.000000000 -0700 @@ -30,4 +30,10 @@ KMOD= cuse4bsd SRCS= cuse4bsd_kmod.c device_if.h bus_if.h vnode_if.h +LDFLAGS += -u __start_set_sysinit_set -u __start_set_sysuninit_set \ + -u __start_set_sysctl_set -u __start_set_modmetadata_set \ + -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ + -u __stop_set_sysctl_set -u __stop_set_modmetadata_set + + .include Running nm -o on the two modules, the difference seems to be that the -u results in some additional absolute symbols being defined: Bad module: $ nm -o /boot/modules/cuse4bsd.ko| grep sys /boot/modules/cuse4bsd.ko:0000275c r __set_sysinit_set_sym_cuse_kern_init_sys_init /boot/modules/cuse4bsd.ko:00002758 r __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit /boot/modules/cuse4bsd.ko:00003194 d cuse_kern_init_sys_init /boot/modules/cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit Good module: $ nm -o ./cuse4bsd.ko | grep sys ./cuse4bsd.ko:000028cc r __set_sysinit_set_sym_cuse_kern_init_sys_init ./cuse4bsd.ko:000028c8 r __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit ./cuse4bsd.ko: U __start_set_sysctl_set ./cuse4bsd.ko:000028cc A __start_set_sysinit_set ./cuse4bsd.ko:000028c8 A __start_set_sysuninit_set ./cuse4bsd.ko: U __stop_set_sysctl_set ./cuse4bsd.ko:000028d0 A __stop_set_sysinit_set ./cuse4bsd.ko:000028cc A __stop_set_sysuninit_set ./cuse4bsd.ko:00003194 d cuse_kern_init_sys_init ./cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit --HPS From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 04:07:01 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 619731065670; Wed, 23 Jun 2010 04:07:01 +0000 (UTC) (envelope-from faber@zod.isi.edu) Received: from zod.isi.edu (zod.isi.edu [128.9.168.221]) by mx1.freebsd.org (Postfix) with ESMTP id 4518E8FC0A; Wed, 23 Jun 2010 04:07:00 +0000 (UTC) Received: from zod.isi.edu (localhost [127.0.0.1]) by zod.isi.edu (8.14.4/8.14.4) with ESMTP id o5N46v9T025900; Tue, 22 Jun 2010 21:06:57 -0700 (PDT) (envelope-from faber@zod.isi.edu) Received: (from faber@localhost) by zod.isi.edu (8.14.4/8.14.4/Submit) id o5N46uIs025899; Tue, 22 Jun 2010 21:06:56 -0700 (PDT) (envelope-from faber) Date: Tue, 22 Jun 2010 21:06:56 -0700 From: Ted Faber To: Hans Petter Selasky Message-ID: <20100623040656.GC23023@zod.isi.edu> References: <201006230238.06831.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PuGuTyElPB9bOcsM" Content-Disposition: inline In-Reply-To: <201006230238.06831.hselasky@c2i.net> User-Agent: Mutt/1.4.2.3i X-url: http://www.isi.edu/~faber Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 04:07:01 -0000 --PuGuTyElPB9bOcsM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 23, 2010 at 02:38:06AM +0200, Hans Petter Selasky wrote: > It appears many kmods are broken because the linker is stripping away sta= tic=20 > data declared with the section attribute in FreeBSD 8.1-RC1. >=20 > >=20 > I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd port > made the module and the result loads and creates the /dev/cuse file. Hi. I'm the fellow in Hans's .... If someone's looking into this, it's worth mentioning that the sample cdev kmodule in /usr/share/examples/kld/cdev/ also exhibits the behavior. On my 8.1-PRERELEASE system that module does not create the /dev/cedv device, but if you add the line=20 LDFLAGS +=3D -u __start_set_sysinit_set -u __start_set_sysuninit_set \ -u __start_set_sysctl_set -u __start_set_modmetadata_set \ -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ -u __stop_set_sysctl_set -u __stop_set_modmetadata_set right before the=20 =2Einclude in /usr/share/examples/kld/cdev/module/Makefile and remake everything, the module creates the /dev/cdev file when it's loaded. That magical line was suggested by Ryan Stone in another thread: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D120718+0+current/freebsd-hac= kers Happy hunting, and I'm happy to test patches or provide more information. --=20 Ted Faber http://www.isi.edu/~faber PGP: http://www.isi.edu/~faber/pubkeys.= asc Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#= SIG --PuGuTyElPB9bOcsM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwhiGAACgkQaUz3f+Zf+XvhngCgm+78NGZnUFXI4z9hJu8fe+H3 CzEAn31VtQ6ByJMglAxKmRIDk/7SUqpF =LPYM -----END PGP SIGNATURE----- --PuGuTyElPB9bOcsM-- From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 06:16:44 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38308106566B for ; Wed, 23 Jun 2010 06:16:44 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8698C8FC13 for ; Wed, 23 Jun 2010 06:16:39 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA12825; Wed, 23 Jun 2010 09:16:02 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ORJFi-0003AA-7N; Wed, 23 Jun 2010 09:16:02 +0300 Message-ID: <4C21A69E.2050800@icyb.net.ua> Date: Wed, 23 Jun 2010 09:15:58 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: nlmills@clemson.edu References: In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: panic during boot on 8.0-RELEASE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 06:16:44 -0000 on 23/06/2010 02:41 Nicholas Mills said the following: > Hey all, > > Screenshot of panic message is attached. Machine is a VM running under > Parallels Server Bare Metal 4. The cdrom device was enabled but not > connected during boot. System was attempting to boot into single user mode. > This occurred after a fresh install of 8.0-RELEASE. > > Let me know how I can provide more useful info. ENOATTACHMENTDETECTED Please post links, upload possibilities are numerous nowadays. -- Andriy Gapon From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 06:47:59 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA9FE1065670; Wed, 23 Jun 2010 06:47:59 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9BE808FC0C; Wed, 23 Jun 2010 06:47:58 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA14089; Wed, 23 Jun 2010 09:47:54 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ORJkX-0003DI-WF; Wed, 23 Jun 2010 09:47:54 +0300 Message-ID: <4C21AE18.4050400@icyb.net.ua> Date: Wed, 23 Jun 2010 09:47:52 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Hans Petter Selasky References: <201006230238.06831.hselasky@c2i.net> In-Reply-To: <201006230238.06831.hselasky@c2i.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 06:47:59 -0000 on 23/06/2010 03:38 Hans Petter Selasky said the following: > Hi, > > I'm creating a new thread on this issue. > > On Tue, Jun 22, 2010 at 04:39:17PM -0400, Ryan Stone wrote: >> I saw similar behaviour a couple of years ago when I switched from >> using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules. >> The problem ended up being a change in the linker script used by GNU >> ld for linking kernel modules. It used to always put some magic >> symbols used by the linker to implement things like sysinits into the >> module. It was changed to only provide those symbols, which >> apparently means that the linker would discard those symbols if >> nothing referenced them(and nothing did reference them). I had to >> work around it by adding the following to my link line: >> >> -u __start_set_sysinit_set -u __start_set_sysuninit_set \ >> -u __start_set_sysctl_set -u __start_set_modmetadata_set \ >> -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ >> -u __stop_set_sysctl_set -u __stop_set_modmetadata_set > > It appears many kmods are broken because the linker is stripping away static > data declared with the section attribute in FreeBSD 8.1-RC1. > > > > I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd port > made the module and the result loads and creates the /dev/cuse file. > > Here's a diff relative to > /usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.11 just so > it's clear what I did. > > > --- Makefile.kmod.orig 2010-02-11 03:28:02.000000000 -0800 > +++ Makefile.kmod 2010-06-22 14:02:52.000000000 -0700 > @@ -30,4 +30,10 @@ > KMOD= cuse4bsd > SRCS= cuse4bsd_kmod.c device_if.h bus_if.h vnode_if.h > > +LDFLAGS += -u __start_set_sysinit_set -u __start_set_sysuninit_set \ > + -u __start_set_sysctl_set -u __start_set_modmetadata_set \ > + -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ > + -u __stop_set_sysctl_set -u __stop_set_modmetadata_set > + > + > .include > > Running nm -o on the two modules, the difference seems to be that the -u > results in some additional absolute symbols being defined: > > Bad module: > $ nm -o /boot/modules/cuse4bsd.ko| grep sys > /boot/modules/cuse4bsd.ko:0000275c r > __set_sysinit_set_sym_cuse_kern_init_sys_init > /boot/modules/cuse4bsd.ko:00002758 r > __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit > /boot/modules/cuse4bsd.ko:00003194 d cuse_kern_init_sys_init > /boot/modules/cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit I am not sure if this analysis is correct. I tested on head and stable/8 and my nm output is exactly like above ("bad module"), still the module loads fine and creates /dev/cuse. I don't think there were any recent changes related to build infrastructure or linker in 8.1. Please consider other possibilities. > Good module: > > $ nm -o ./cuse4bsd.ko | grep sys > ./cuse4bsd.ko:000028cc r __set_sysinit_set_sym_cuse_kern_init_sys_init > ./cuse4bsd.ko:000028c8 r __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit > ./cuse4bsd.ko: U __start_set_sysctl_set > ./cuse4bsd.ko:000028cc A __start_set_sysinit_set > ./cuse4bsd.ko:000028c8 A __start_set_sysuninit_set > ./cuse4bsd.ko: U __stop_set_sysctl_set > ./cuse4bsd.ko:000028d0 A __stop_set_sysinit_set > ./cuse4bsd.ko:000028cc A __stop_set_sysuninit_set > ./cuse4bsd.ko:00003194 d cuse_kern_init_sys_init > ./cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit > > -- Andriy Gapon From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 06:55:21 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4961E106566C; Wed, 23 Jun 2010 06:55:21 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id 710DA8FC1A; Wed, 23 Jun 2010 06:55:20 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=nXlDabneoW0A:10 a=uEzv4HemXiYA:10 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=Czt-lxB3K3gCxCdIjiAA:9 a=doJ4I_PN3phXl2CbSDgA:7 a=cNb5hjClQZjlamADw7sB3-yCQ_MA:4 a=wPNLvfGTeEIA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1369002294; Wed, 23 Jun 2010 08:55:18 +0200 From: Hans Petter Selasky To: Andriy Gapon Date: Wed, 23 Jun 2010 08:52:26 +0200 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> In-Reply-To: <4C21AE18.4050400@icyb.net.ua> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006230852.26536.hselasky@c2i.net> Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 06:55:21 -0000 On Wednesday 23 June 2010 08:47:52 Andriy Gapon wrote: > on 23/06/2010 03:38 Hans Petter Selasky said the following: > > Hi, > > > > I'm creating a new thread on this issue. > > > > On Tue, Jun 22, 2010 at 04:39:17PM -0400, Ryan Stone wrote: > >> I saw similar behaviour a couple of years ago when I switched from > >> using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules. > >> The problem ended up being a change in the linker script used by GNU > >> ld for linking kernel modules. It used to always put some magic > >> symbols used by the linker to implement things like sysinits into the > >> module. It was changed to only provide those symbols, which > >> apparently means that the linker would discard those symbols if > >> nothing referenced them(and nothing did reference them). I had to > >> work around it by adding the following to my link line: > >> > >> -u __start_set_sysinit_set -u __start_set_sysuninit_set \ > >> -u __start_set_sysctl_set -u __start_set_modmetadata_set \ > >> -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ > >> -u __stop_set_sysctl_set -u __stop_set_modmetadata_set > > > > It appears many kmods are broken because the linker is stripping away > > static data declared with the section attribute in FreeBSD 8.1-RC1. > > > > > > > > I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd port > > made the module and the result loads and creates the /dev/cuse file. > > > > Here's a diff relative to > > /usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.11 just so > > it's clear what I did. > > > > > > --- Makefile.kmod.orig 2010-02-11 03:28:02.000000000 -0800 > > +++ Makefile.kmod 2010-06-22 14:02:52.000000000 -0700 > > @@ -30,4 +30,10 @@ > > KMOD= cuse4bsd > > SRCS= cuse4bsd_kmod.c device_if.h bus_if.h vnode_if.h > > > > +LDFLAGS += -u __start_set_sysinit_set -u __start_set_sysuninit_set \ > > + -u __start_set_sysctl_set -u __start_set_modmetadata_set \ > > + -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ > > + -u __stop_set_sysctl_set -u __stop_set_modmetadata_set > > + > > + > > .include > > > > Running nm -o on the two modules, the difference seems to be that the -u > > results in some additional absolute symbols being defined: > > > > Bad module: > > $ nm -o /boot/modules/cuse4bsd.ko| grep sys > > /boot/modules/cuse4bsd.ko:0000275c r > > __set_sysinit_set_sym_cuse_kern_init_sys_init > > /boot/modules/cuse4bsd.ko:00002758 r > > __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit > > /boot/modules/cuse4bsd.ko:00003194 d cuse_kern_init_sys_init > > /boot/modules/cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit > > I am not sure if this analysis is correct. > I tested on head and stable/8 and my nm output is exactly like above ("bad > module"), still the module loads fine and creates /dev/cuse. > > I don't think there were any recent changes related to build infrastructure > or linker in 8.1. > > Please consider other possibilities. I installed PC-BSD 8.1-RC1 and the stock cuse4bsd module is broken. Andriy, make sure that you re-make the toolchain before building the module in question. Also I think you have to: cd /usr/src ; make buildenv TARGET_ARCH=xxx_target Then you cd to the module directory and type make. --HPS From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 07:02:13 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8B66106564A; Wed, 23 Jun 2010 07:02:13 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B30078FC15; Wed, 23 Jun 2010 07:02:12 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA14342; Wed, 23 Jun 2010 10:02:09 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ORJyK-0003EY-KN; Wed, 23 Jun 2010 10:02:08 +0300 Message-ID: <4C21B170.2030903@icyb.net.ua> Date: Wed, 23 Jun 2010 10:02:08 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Hans Petter Selasky References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> In-Reply-To: <201006230852.26536.hselasky@c2i.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 07:02:13 -0000 on 23/06/2010 09:52 Hans Petter Selasky said the following: > On Wednesday 23 June 2010 08:47:52 Andriy Gapon wrote: >> on 23/06/2010 03:38 Hans Petter Selasky said the following: >>> Hi, >>> >>> I'm creating a new thread on this issue. >>> >>> On Tue, Jun 22, 2010 at 04:39:17PM -0400, Ryan Stone wrote: >>>> I saw similar behaviour a couple of years ago when I switched from >>>> using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules. >>>> The problem ended up being a change in the linker script used by GNU >>>> ld for linking kernel modules. It used to always put some magic >>>> symbols used by the linker to implement things like sysinits into the >>>> module. It was changed to only provide those symbols, which >>>> apparently means that the linker would discard those symbols if >>>> nothing referenced them(and nothing did reference them). I had to >>>> work around it by adding the following to my link line: >>>> >>>> -u __start_set_sysinit_set -u __start_set_sysuninit_set \ >>>> -u __start_set_sysctl_set -u __start_set_modmetadata_set \ >>>> -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ >>>> -u __stop_set_sysctl_set -u __stop_set_modmetadata_set >>> It appears many kmods are broken because the linker is stripping away >>> static data declared with the section attribute in FreeBSD 8.1-RC1. >>> >>> >>> >>> I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd port >>> made the module and the result loads and creates the /dev/cuse file. >>> >>> Here's a diff relative to >>> /usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.11 just so >>> it's clear what I did. >>> >>> >>> --- Makefile.kmod.orig 2010-02-11 03:28:02.000000000 -0800 >>> +++ Makefile.kmod 2010-06-22 14:02:52.000000000 -0700 >>> @@ -30,4 +30,10 @@ >>> KMOD= cuse4bsd >>> SRCS= cuse4bsd_kmod.c device_if.h bus_if.h vnode_if.h >>> >>> +LDFLAGS += -u __start_set_sysinit_set -u __start_set_sysuninit_set \ >>> + -u __start_set_sysctl_set -u __start_set_modmetadata_set \ >>> + -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ >>> + -u __stop_set_sysctl_set -u __stop_set_modmetadata_set >>> + >>> + >>> .include >>> >>> Running nm -o on the two modules, the difference seems to be that the -u >>> results in some additional absolute symbols being defined: >>> >>> Bad module: >>> $ nm -o /boot/modules/cuse4bsd.ko| grep sys >>> /boot/modules/cuse4bsd.ko:0000275c r >>> __set_sysinit_set_sym_cuse_kern_init_sys_init >>> /boot/modules/cuse4bsd.ko:00002758 r >>> __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit >>> /boot/modules/cuse4bsd.ko:00003194 d cuse_kern_init_sys_init >>> /boot/modules/cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit >> I am not sure if this analysis is correct. >> I tested on head and stable/8 and my nm output is exactly like above ("bad >> module"), still the module loads fine and creates /dev/cuse. >> >> I don't think there were any recent changes related to build infrastructure >> or linker in 8.1. >> >> Please consider other possibilities. > > I installed PC-BSD 8.1-RC1 and the stock cuse4bsd module is broken. I don't dispute that it is found broken in particular environments, I just think that the analysis could be incorrect. > Andriy, > make sure that you re-make the toolchain before building the module in > question. Also I think you have to: > > cd /usr/src ; make buildenv TARGET_ARCH=xxx_target > > Then you cd to the module directory and type make. I don't think that this is needed when _not_ cross-building for a different architecture. -- Andriy Gapon From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 07:09:41 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFCC21065670 for ; Wed, 23 Jun 2010 07:09:41 +0000 (UTC) (envelope-from nlmills@g.clemson.edu) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.211.181]) by mx1.freebsd.org (Postfix) with ESMTP id 959A98FC0A for ; Wed, 23 Jun 2010 07:09:40 +0000 (UTC) Received: by ywh11 with SMTP id 11so4109031ywh.7 for ; Wed, 23 Jun 2010 00:09:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.75.16 with SMTP id c16mr6311195anl.193.1277276979292; Wed, 23 Jun 2010 00:09:39 -0700 (PDT) Received: by 10.100.47.12 with HTTP; Wed, 23 Jun 2010 00:09:39 -0700 (PDT) In-Reply-To: <4C21A69E.2050800@icyb.net.ua> References: <4C21A69E.2050800@icyb.net.ua> Date: Wed, 23 Jun 2010 03:09:39 -0400 Message-ID: From: Nicholas Mills To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-current@freebsd.org Subject: Re: panic during boot on 8.0-RELEASE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: nlmills@clemson.edu List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 07:09:41 -0000 I've since disabled the cdrom drive in Parallels as it was causing all sorts of errors. On Wed, Jun 23, 2010 at 2:15 AM, Andriy Gapon wrote: > on 23/06/2010 02:41 Nicholas Mills said the following: > > Hey all, > > > > Screenshot of panic message is attached. Machine is a VM running under > > Parallels Server Bare Metal 4. The cdrom device was enabled but not > > connected during boot. System was attempting to boot into single user > mode. > > This occurred after a fresh install of 8.0-RELEASE. > > > > Let me know how I can provide more useful info. > > ENOATTACHMENTDETECTED > Please post links, upload possibilities are numerous nowadays. > http://www.parl.clemson.edu/~nlmills/Screenshot.png > > -- > Andriy Gapon > From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 07:11:05 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B17691065676; Wed, 23 Jun 2010 07:11:05 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A51C48FC08; Wed, 23 Jun 2010 07:11:04 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA14541; Wed, 23 Jun 2010 10:11:01 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ORK6u-0003FL-If; Wed, 23 Jun 2010 10:11:00 +0300 Message-ID: <4C21B383.2000602@icyb.net.ua> Date: Wed, 23 Jun 2010 10:10:59 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Hans Petter Selasky References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> In-Reply-To: <4C21B170.2030903@icyb.net.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 07:11:05 -0000 on 23/06/2010 10:02 Andriy Gapon said the following: > I don't dispute that it is found broken in particular environments, I just think > that the analysis could be incorrect. Which also brings the question - what arch(s) is affected? I tested on amd64. -- Andriy Gapon From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 07:15:37 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DEAD1065691 for ; Wed, 23 Jun 2010 07:15:37 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6B8508FC1F for ; Wed, 23 Jun 2010 07:15:36 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA14703; Wed, 23 Jun 2010 10:15:26 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ORKBC-0003Gd-9F; Wed, 23 Jun 2010 10:15:26 +0300 Message-ID: <4C21B48D.50703@icyb.net.ua> Date: Wed, 23 Jun 2010 10:15:25 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: nlmills@clemson.edu References: <4C21A69E.2050800@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: panic during boot on 8.0-RELEASE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 07:15:37 -0000 on 23/06/2010 10:09 Nicholas Mills said the following: > http://www.parl.clemson.edu/~nlmills/Screenshot.png Ah, no stack trace. Unfortunately, this looks undebuggable as it is. Custom kernel with debug options is needed. -- Andriy Gapon From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 07:29:01 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09DBD106564A for ; Wed, 23 Jun 2010 07:29:01 +0000 (UTC) (envelope-from nlmills@g.clemson.edu) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id B62CA8FC1B for ; Wed, 23 Jun 2010 07:29:00 +0000 (UTC) Received: by gwb11 with SMTP id 11so608728gwb.13 for ; Wed, 23 Jun 2010 00:28:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.182.11 with SMTP id j11mr6294590anp.171.1277278138882; Wed, 23 Jun 2010 00:28:58 -0700 (PDT) Received: by 10.100.47.12 with HTTP; Wed, 23 Jun 2010 00:28:58 -0700 (PDT) In-Reply-To: <4C21B48D.50703@icyb.net.ua> References: <4C21A69E.2050800@icyb.net.ua> <4C21B48D.50703@icyb.net.ua> Date: Wed, 23 Jun 2010 03:28:58 -0400 Message-ID: From: Nicholas Mills To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-current@freebsd.org Subject: Re: panic during boot on 8.0-RELEASE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: nlmills@clemson.edu List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 07:29:01 -0000 I was afraid someone would say that, because it's been very difficult to reproduce the issue. Happens maybe 1 out of every 8 reboots. I'll give it a look tomorrow and see what I can find. Just to be clear, I should send you the output of the "where" command in ddb? On Wed, Jun 23, 2010 at 3:15 AM, Andriy Gapon wrote: > on 23/06/2010 10:09 Nicholas Mills said the following: > > http://www.parl.clemson.edu/~nlmills/Screenshot.png > > Ah, no stack trace. Unfortunately, this looks undebuggable as it is. > Custom kernel with debug options is needed. > > -- > Andriy Gapon > From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 07:32:24 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17DFA106567D; Wed, 23 Jun 2010 07:32:24 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.swip.net [212.247.154.65]) by mx1.freebsd.org (Postfix) with ESMTP id 70F028FC28; Wed, 23 Jun 2010 07:32:22 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=nXlDabneoW0A:10 a=uEzv4HemXiYA:10 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=mSBxGRa38I5jodgpOH8A:9 a=I6Cbr6VEyAYYEzE6qtglDhQepVEA:4 a=wPNLvfGTeEIA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1418686487; Wed, 23 Jun 2010 09:32:21 +0200 From: Hans Petter Selasky To: Andriy Gapon Date: Wed, 23 Jun 2010 09:29:30 +0200 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <201006230238.06831.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> In-Reply-To: <4C21B383.2000602@icyb.net.ua> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006230929.30410.hselasky@c2i.net> Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 07:32:24 -0000 On Wednesday 23 June 2010 09:10:59 Andriy Gapon wrote: > on 23/06/2010 10:02 Andriy Gapon said the following: > > I don't dispute that it is found broken in particular environments, I > > just think that the analysis could be incorrect. Ok. > > Which also brings the question - what arch(s) is affected? > I tested on amd64. > I tested on i386. --HPS From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 08:33:05 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88C98106566B for ; Wed, 23 Jun 2010 08:33:05 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C9AB08FC2E for ; Wed, 23 Jun 2010 08:33:04 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA17495; Wed, 23 Jun 2010 11:32:54 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ORLOA-0003W0-2O; Wed, 23 Jun 2010 11:32:54 +0300 Message-ID: <4C21C6B3.90102@icyb.net.ua> Date: Wed, 23 Jun 2010 11:32:51 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: nlmills@clemson.edu References: <4C21A69E.2050800@icyb.net.ua> <4C21B48D.50703@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: panic during boot on 8.0-RELEASE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 08:33:06 -0000 on 23/06/2010 10:28 Nicholas Mills said the following: > I was afraid someone would say that, because it's been very difficult to > reproduce the issue. Happens maybe 1 out of every 8 reboots. I'll give > it a look tomorrow and see what I can find. > > Just to be clear, I should send you the output of the "where" command in > ddb? Yes, that should get things going. -- Andriy Gapon From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 13:05:40 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 404131065676; Wed, 23 Jun 2010 13:05:40 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id E98738FC1A; Wed, 23 Jun 2010 13:05:39 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORPe3-0004bH-UF; Wed, 23 Jun 2010 14:05:38 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORPe3-0002Yq-6B; Wed, 23 Jun 2010 14:05:35 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5ND5YOZ069942; Wed, 23 Jun 2010 14:05:34 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5ND5YKG069941; Wed, 23 Jun 2010 14:05:34 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Wed, 23 Jun 2010 14:05:34 +0100 From: Anton Shterenlikht To: Marcel Moolenaar Message-ID: <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 13:05:40 -0000 On Mon, Jun 21, 2010 at 01:27:52PM -0700, Marcel Moolenaar wrote: >=20 > On Jun 21, 2010, at 8:04 AM, Anton Shterenlikht wrote: >=20 > > On Mon, Jun 21, 2010 at 04:45:03PM +0200, Dag-Erling Sm=F8rgrav wrote: > >> jhell writes: > >>> Anton Shterenlikht writes: > >>>> What do you mean by "updating your headers"? > >>> cd /usr/src/include && make obj && make depend && make all && make in= stall > >>=20 > >> wrong. > >>=20 > >> % cd /usr/src > >> % make obj > >> % make cleandepend > >> % make depend > >> % make buildincludes > >> % make installincludes > >>=20 > >> DES > >> --=20 > >> Dag-Erling Sm=F8rgrav - des@des.no > >=20 > > Sorry, just to take one step back, why has this become > > necessary for this particular box? If /usr/obj is empty, > > and "svn up", followed by "svn diff", doesn't show any > > local changes, why can't I go straight to make buildworld? > > In other words, why do my headers need updating on this > > particular box, and not on other ia64 boxes? > > I must've screwed something up, haven't I? >=20 > Anton, >=20 > My suggestion would be to destroy the sandbox entirely > and simply checkout a new one from scratch, provided > you're not sharing sandboxes across NFS. I would also > manually destroy your object tree under /usr/obj (or > whereever you have it) before doing the buildworld. >=20 > It's not impossible (double negative to emphasize that > the possibility may not be big enough to worry about, > but that I don't want to go there), that you have some > corruption that is not exposed by "svn diff", but that > is causing the build-breakages. A clean slate helps... Marcel, I did just that - removed the whole of /usr/src and started from scratch. I got the same error as before: cc -static -o rescue rescue.o cat.lo chflags.lo chio.lo chmod.lo cp.lo date= =2Elo dd.lo df.lo echo.lo ed.lo exp .lo getfacl.lo hostname.lo kenv.lo kill= =2Elo ln.lo ls.lo mkdir.lo mv.lo pkill.lo ps.lo pwd.lo realpath.lo rm.l rm= dir.lo setfacl.lo sh.lo stty.lo sync.lo test.lo rcp.lo csh.lo atacontrol.lo= badsect.lo camcontrol.lo ccdc nfig.lo clri.lo devfs.lo dmesg.lo dump.lo du= mpfs.lo dumpon.lo fsck.lo fsck_ffs.lo fsck_msdosfs.lo fsdb.lo fs rand.lo gb= de.lo geom.lo ifconfig.lo init.lo kldconfig.lo kldload.lo kldstat.lo kldunl= oad.lo ldconfig.lo md5. o mdconfig.lo mdmfs.lo mknod.lo mount.lo mount_cd96= 60.lo mount_msdosfs.lo mount_nfs.lo mount_ntfs.lo mount_n llfs.lo mount_udf= =2Elo mount_unionfs.lo newfs.lo newfs_msdos.lo nos-tun.lo ping.lo reboot.lo= restore.lo rcorde .lo route.lo routed.lo rtquery.lo rtsol.lo savecore.lo s= pppcontrol.lo swapon.lo sysctl.lo tunefs.lo umount.l atmconfig.lo ping6.lo= ipf.lo zfs.lo zpool.lo mca.lo dhclient.lo head.lo mt.lo sed.lo tail.lo tee= =2Elo gzip.lo bzip2.lo xz.lo tar.lo vi.lo id.lo chroot.lo chown.lo /usr/obj= /usr/src/rescue/rescue/../librescue/exec.o /usr obj/usr/src/rescue/rescue/.= =2E/librescue/getusershell.o /usr/obj/usr/src/rescue/rescue/../librescue/lo= gin_clas .o /usr/obj/usr/src/rescue/rescue/../librescue/popen.o /usr/obj/us= r/src/rescue/rescue/../librescue/rcmdsh.o usr/obj/usr/src/rescue/rescue/..= /librescue/sysctl.o /usr/obj/usr/src/rescue/rescue/../librescue/system.o -l= c ypt -ledit -lkvm -ll -ltermcap -lutil -lalias -lcam -lcurses -ldevstat -l= ipsec -lipx -lzfs -lnvpair -luutil lavl -lgeom -lbsdxml -ljail -lkiconv -l= md -lreadline -lsbuf -lufs -lz -lbz2 -llzma -larchive -lcrypto -lm xz.lo(.text+0x5202): In function `hardware_init': : undefined reference to `lzma_physmem' I think it's possible that at some point, in anger, I did "make installworld" after a failed, or otherwise interrupted "make buildworld". Perhaps I got an inconsistent set of binaries as a result... Would that explain an error like this? PS: I'm now at # svn info Path: . URL: svn://svn.freebsd.org/base/head Repository Root: svn://svn.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 209429 Node Kind: directory Schedule: normal Last Changed Author: rwatson Last Changed Rev: 209429 Last Changed Date: 2010-06-22 11:46:57 +0100 (Tue, 22 Jun 2010) many thanks anton --=20 Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 13:07:10 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC5B5106564A for ; Wed, 23 Jun 2010 13:07:10 +0000 (UTC) (envelope-from cristiano.deana@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 508708FC25 for ; Wed, 23 Jun 2010 13:07:09 +0000 (UTC) Received: by fxm7 with SMTP id 7so3536169fxm.13 for ; Wed, 23 Jun 2010 06:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=/1xI3wbbnAP088NQZTcSL+ZdaWOk7mFXEWcDB4DQ9Kc=; b=HGXkykFfCJWastnI7Vec7pHdxxWF8OKBrvDAf8YoRVP3oulPYWt2CpYdhWyk2ppXvt csMIzFzjvt+MqKLgYr7YpyRsV2NfN4HOmDLDI0ZEN9+NLma+2zrEiAgTd/DUyANP4F3d gr8Rwg+69WzSt8dIJlIcTOdaSFKgZ4pMnvrFI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Vpy4ujg8VvGof30/34wNk0aBZRp4jX1mNYt3zfrKtc0HLx9BiTbqCwUX0w6wmCWNul FO86jkx/yK2xYYS4DrbgjbflTIr9Wqjpdf6TxkZ7bojqq1KkVTa+TsVqCVdYoOzp0t0j ZPZqY6Y7EK+uYkzs9slk5EaSNdxjzOZ960XW8= MIME-Version: 1.0 Received: by 10.223.101.81 with SMTP id b17mr7578755fao.17.1277296735470; Wed, 23 Jun 2010 05:38:55 -0700 (PDT) Received: by 10.223.117.204 with HTTP; Wed, 23 Jun 2010 05:38:55 -0700 (PDT) Date: Wed, 23 Jun 2010 14:38:55 +0200 Message-ID: From: Cristiano Deana To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Problem with buildworld with CLANG X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 13:07:10 -0000 # uname -a FreeBSD test 9.0-CURRENT FreeBSD 9.0-CURRENT #3: Tue Jun 22 16:04:38 CEST 2010 root@test:/usr/obj/usr/src/sys/GENERIC amd64 # cat /etc/src.conf #NO_WERROR= #WERROR= CC= clang CXX= clang++ sources from this morning, i got this error: clang -O2 -pipe -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa -DINET6 -I/usr/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libc/../../contrib/tzcode/stdtime -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING -DSYMBOL_VERSIONING -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libc/sys/stack_protector.c /usr/src/lib/libc/sys/stack_protector.c:88:19: error: format string is not a string literal (potentially insecure) [-Wformat-security] syslog(LOG_CRIT, msg); ^~~ 1 error generated. *** Error code 1 -- Cris, member of G.U.F.I Italian FreeBSD User Group http://www.gufi.org/ From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 13:13:29 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD0F9106564A for ; Wed, 23 Jun 2010 13:13:29 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 950BD8FC08 for ; Wed, 23 Jun 2010 13:13:29 +0000 (UTC) Received: by gwb11 with SMTP id 11so745032gwb.13 for ; Wed, 23 Jun 2010 06:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=WcZLNPJgf/VBIxyvbXTriF9H5CW9mKIBIAkkL3sB/hk=; b=oOjrn2mY5+NV8Z62NAuscTlHBDPzj1Xda047DdaCHWR3JKYjkuvK4NIegEEDOl0jm+ Zldty53GW1MDYeGSwOo2ToRH2w7ny4EYiTxCD/K/GJyB4eMiKlKYbG4jdqCbLlFTIXbO k1s8QDvecZwkUjocn/JbaAOHQdpHUHtM64pPg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Y4ltqhp0pA8AQc+KviOwhoMnKqNSJd3Il3dcjCRDv6bN8rgcJ1MvgQe2prPw38qNdL Lcr4VMz6lNyFo78tlGXTv3pzlKGGDcMsNgnqZNXC+JsL01tiGOylxOateERsKMj6fbED 6UbSxG2xIzsxtv4jAX/+UHKKc2ljAegDkXFAs= MIME-Version: 1.0 Received: by 10.150.66.4 with SMTP id o4mr7528088yba.225.1277298808741; Wed, 23 Jun 2010 06:13:28 -0700 (PDT) Sender: r.c.ladan@gmail.com Received: by 10.151.49.11 with HTTP; Wed, 23 Jun 2010 06:13:28 -0700 (PDT) In-Reply-To: References: Date: Wed, 23 Jun 2010 15:13:28 +0200 X-Google-Sender-Auth: 9FyLKMJHWows4UjbD8LTCeBVmko Message-ID: From: =?ISO-8859-1?Q?Ren=E9_Ladan?= To: Cristiano Deana Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: Problem with buildworld with CLANG X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 13:13:29 -0000 2010/6/23 Cristiano Deana : > # uname -a > FreeBSD test 9.0-CURRENT FreeBSD 9.0-CURRENT #3: Tue Jun 22 16:04:38 > CEST 2010 =A0 =A0 root@test:/usr/obj/usr/src/sys/GENERIC =A0amd64 > > # cat /etc/src.conf > #NO_WERROR=3D > #WERROR=3D > CC=3D =A0 =A0 clang > CXX=3D =A0 =A0clang++ > > sources from this morning, i got this error: > [.. error ..] If you are using HEAD sources, then an error-free build with clang is not guaranteed. There is a separate branch of HEAD, clangbsd, which can be built (almost) completely with clang, see http://wiki.freebsd.org/BuildingFreeBSDWithClang Rene From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 13:15:50 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CE15106566C for ; Wed, 23 Jun 2010 13:15:50 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 23D678FC2B for ; Wed, 23 Jun 2010 13:15:49 +0000 (UTC) Received: by fxm7 with SMTP id 7so3544854fxm.13 for ; Wed, 23 Jun 2010 06:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=IknK3DQUMQU9LmuO5et/hpA6zxhs+SdOLvK19Yc6ZmM=; b=sRyW9jM3LkYnhCR+BWGr+0u0bjyDyfVyGg+WSVCNti+Alv1FNB88qGrWgGlibCoyh9 JTFBDz4wVXypyQI8PJHpRF+VzEI5RfzLDp7uofI8j7zZGKyOlb1fDwBks8StEQwslvVv 1rB9GYJmnoSPR9G/OouZ/rlqqw5z0mtwwf/uU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=mw1HVkjpXgJ7iV9B4LhEBkKnJ2JUO+N1ty1utDvXw8CLcnBkrRReiIdfiZO0BDgQUn SkQ1HWcaEn/fILpxvpyXcEAFMdp6PvRmclj6fF6BNZylLI/i4mhzVJu0my0TurnO2tWA EtdaNg2la2pXGGkEKWD9DNK+cZoquo3i+DP64= MIME-Version: 1.0 Received: by 10.239.185.131 with SMTP id c3mr542896hbh.193.1277298948871; Wed, 23 Jun 2010 06:15:48 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Wed, 23 Jun 2010 06:15:48 -0700 (PDT) In-Reply-To: References: Date: Wed, 23 Jun 2010 14:15:48 +0100 Message-ID: From: Tom Evans To: Cristiano Deana Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: Problem with buildworld with CLANG X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 13:15:50 -0000 On Wed, Jun 23, 2010 at 1:38 PM, Cristiano Deana wrote: > # uname -a > FreeBSD test 9.0-CURRENT FreeBSD 9.0-CURRENT #3: Tue Jun 22 16:04:38 > CEST 2010 =C2=A0 =C2=A0 root@test:/usr/obj/usr/src/sys/GENERIC =C2=A0amd6= 4 > > # cat /etc/src.conf > #NO_WERROR=3D > #WERROR=3D > CC=3D =C2=A0 =C2=A0 clang > CXX=3D =C2=A0 =C2=A0clang++ > > sources from this morning, i got this error: > > clang -O2 -pipe =C2=A0-I/usr/src/lib/libc/include > -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS > -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa > -DINET6 -I/usr/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv > -D_ACL_PRIVATE -DPOSIX_MISTAKE > -I/usr/src/lib/libc/../../contrib/tzcode/stdtime > -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES > -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING > -DSYMBOL_VERSIONING -std=3Dgnu99 =C2=A0-Wsystem-headers -Werror -Wall > -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c > /usr/src/lib/libc/sys/stack_protector.c > /usr/src/lib/libc/sys/stack_protector.c:88:19: error: format string is > not a string literal (potentially insecure) [-Wformat-security] > =C2=A0 =C2=A0 =C2=A0 =C2=A0syslog(LOG_CRIT, msg); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ^~~ > 1 error generated. > *** Error code 1 > Top of the '[TESTING] Clang..' email: > hi, > > ClangBSD was updated to LLVM/clang revision 104832 which is what we aim t= o import > into HEAD in roughly a week. We would like the initial import to be as pa= inless > as possible and therefore we ask you to test ClangBSD to assure that the = revision > we are importing does not have some really embarassing bugs. > > How to do it (on i386 and amd64): > > 0) install fresh devel/llvm-devel port > > 1) svn co http://svn.freebsd.org/base/projects/clangbsd src > > 2) echo NO_WERROR=3D >> /etc/src.conf ; echo WERROR=3D >> /etc/src.conf > > 3) cd src && make buildworld So uncomment your src.conf lines that are incompatible. Cheers Tom From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 14:22:30 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF4D5106564A; Wed, 23 Jun 2010 14:22:30 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id AA4D58FC0C; Wed, 23 Jun 2010 14:22:30 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id A77151FFC33; Wed, 23 Jun 2010 14:22:29 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id DEBC1845D5; Wed, 23 Jun 2010 16:20:18 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> Date: Wed, 23 Jun 2010 16:20:18 +0200 In-Reply-To: <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> (Anton Shterenlikht's message of "Wed, 23 Jun 2010 14:05:34 +0100") Message-ID: <86d3vhomot.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Marcel Moolenaar , freebsd-ia64@freebsd.org, freebsd-current@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 14:22:31 -0000 Anton Shterenlikht writes: > I think it's possible that at some point, in anger, I did "make > installworld" after a failed, or otherwise interrupted "make > buildworld". Perhaps I got an inconsistent set of binaries as a > result... Would that explain an error like this? No, because at this point buildworld is using the toolchain and libraries that it built earlier. Can you do % find /usr/obj/usr/src -name liblzma.a There should be at least one in /usr/obj/usr/src/lib/liblzma and one in /usr/obj/usr/src/tmp/usr/lib, and they should be identical. Next, do % nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem and show us the result. While you're at it, do this as well: % nm /usr/lib/liblzma.a | grep physmem DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 14:43:34 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CE45106566C for ; Wed, 23 Jun 2010 14:43:34 +0000 (UTC) (envelope-from kris@pcbsd.org) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4588FC20 for ; Wed, 23 Jun 2010 14:43:34 +0000 (UTC) Received: from mail.ixsystems.com (localhost [127.0.0.1]) by mail.iXsystems.com (Postfix) with ESMTP id C3AE8A6643E; Wed, 23 Jun 2010 07:43:33 -0700 (PDT) Received: from mail.iXsystems.com ([127.0.0.1]) by mail.ixsystems.com (mail.ixsystems.com [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 63578-09; Wed, 23 Jun 2010 07:43:33 -0700 (PDT) Received: from [192.168.0.55] (unknown [75.131.46.136]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id D88F3A66429; Wed, 23 Jun 2010 07:43:32 -0700 (PDT) Message-ID: <4C221D93.6020800@pcbsd.org> Date: Wed, 23 Jun 2010 10:43:31 -0400 From: Kris Moore User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100414 Thunderbird/3.0.4 MIME-Version: 1.0 To: Hans Petter Selasky References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> In-Reply-To: <201006230852.26536.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, Andriy Gapon Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 14:43:34 -0000 On 06/23/2010 02:52, Hans Petter Selasky wrote: > On Wednesday 23 June 2010 08:47:52 Andriy Gapon wrote: > >> on 23/06/2010 03:38 Hans Petter Selasky said the following: >> >>> Hi, >>> >>> I'm creating a new thread on this issue. >>> >>> On Tue, Jun 22, 2010 at 04:39:17PM -0400, Ryan Stone wrote: >>> >>>> I saw similar behaviour a couple of years ago when I switched from >>>> using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules. >>>> The problem ended up being a change in the linker script used by GNU >>>> ld for linking kernel modules. It used to always put some magic >>>> symbols used by the linker to implement things like sysinits into the >>>> module. It was changed to only provide those symbols, which >>>> apparently means that the linker would discard those symbols if >>>> nothing referenced them(and nothing did reference them). I had to >>>> work around it by adding the following to my link line: >>>> >>>> -u __start_set_sysinit_set -u __start_set_sysuninit_set \ >>>> -u __start_set_sysctl_set -u __start_set_modmetadata_set \ >>>> -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ >>>> -u __stop_set_sysctl_set -u __stop_set_modmetadata_set >>>> >>> It appears many kmods are broken because the linker is stripping away >>> static data declared with the section attribute in FreeBSD 8.1-RC1. >>> >>> >>> >>> I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd port >>> made the module and the result loads and creates the /dev/cuse file. >>> >>> Here's a diff relative to >>> /usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.11 just so >>> it's clear what I did. >>> >>> >>> --- Makefile.kmod.orig 2010-02-11 03:28:02.000000000 -0800 >>> +++ Makefile.kmod 2010-06-22 14:02:52.000000000 -0700 >>> @@ -30,4 +30,10 @@ >>> KMOD= cuse4bsd >>> SRCS= cuse4bsd_kmod.c device_if.h bus_if.h vnode_if.h >>> >>> +LDFLAGS += -u __start_set_sysinit_set -u __start_set_sysuninit_set \ >>> + -u __start_set_sysctl_set -u __start_set_modmetadata_set \ >>> + -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ >>> + -u __stop_set_sysctl_set -u __stop_set_modmetadata_set >>> + >>> + >>> .include >>> >>> Running nm -o on the two modules, the difference seems to be that the -u >>> results in some additional absolute symbols being defined: >>> >>> Bad module: >>> $ nm -o /boot/modules/cuse4bsd.ko| grep sys >>> /boot/modules/cuse4bsd.ko:0000275c r >>> __set_sysinit_set_sym_cuse_kern_init_sys_init >>> /boot/modules/cuse4bsd.ko:00002758 r >>> __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit >>> /boot/modules/cuse4bsd.ko:00003194 d cuse_kern_init_sys_init >>> /boot/modules/cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit >>> >> I am not sure if this analysis is correct. >> I tested on head and stable/8 and my nm output is exactly like above ("bad >> module"), still the module loads fine and creates /dev/cuse. >> >> I don't think there were any recent changes related to build infrastructure >> or linker in 8.1. >> >> Please consider other possibilities. >> > I installed PC-BSD 8.1-RC1 and the stock cuse4bsd module is broken. Andriy, > make sure that you re-make the toolchain before building the module in > question. Also I think you have to: > > cd /usr/src ; make buildenv TARGET_ARCH=xxx_target > > Then you cd to the module directory and type make. > > --HPS > Are you going to be updating the port soon to fix the build? We're just doing a regular "make install" on the cuse4bsd-kmod port for our RC1 build, and it would be nice to have this fixed for 8.1-Release. -- Kris Moore PC-BSD Software iXsystems From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 14:58:38 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 013B4106566B for ; Wed, 23 Jun 2010 14:58:38 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.swip.net [212.247.154.161]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6178FC1C for ; Wed, 23 Jun 2010 14:58:36 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=nXlDabneoW0A:10 a=uEzv4HemXiYA:10 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=_-VI2dNxeZ1EX8AoQcgA:9 a=SUjKCEx6vo7bk_F_oCIA:7 a=h9oNJ8-_25veWjD1XBcogByiemcA:4 a=wPNLvfGTeEIA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1374035822; Wed, 23 Jun 2010 16:58:34 +0200 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Wed, 23 Jun 2010 16:55:43 +0200 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <201006230238.06831.hselasky@c2i.net> <201006230852.26536.hselasky@c2i.net> <4C221D93.6020800@pcbsd.org> In-Reply-To: <4C221D93.6020800@pcbsd.org> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006231655.43671.hselasky@c2i.net> Cc: Andriy Gapon , Kris Moore Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 14:58:38 -0000 On Wednesday 23 June 2010 16:43:31 Kris Moore wrote: > On 06/23/2010 02:52, Hans Petter Selasky wrote: > > On Wednesday 23 June 2010 08:47:52 Andriy Gapon wrote: > >> on 23/06/2010 03:38 Hans Petter Selasky said the following: > >>> Hi, > >>> > >>> I'm creating a new thread on this issue. > >>> > >>> On Tue, Jun 22, 2010 at 04:39:17PM -0400, Ryan Stone wrote: > >>>> I saw similar behaviour a couple of years ago when I switched from > >>>> using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules. > >>>> The problem ended up being a change in the linker script used by GNU > >>>> ld for linking kernel modules. It used to always put some magic > >>>> symbols used by the linker to implement things like sysinits into the > >>>> module. It was changed to only provide those symbols, which > >>>> apparently means that the linker would discard those symbols if > >>>> nothing referenced them(and nothing did reference them). I had to > >>>> work around it by adding the following to my link line: > >>>> > >>>> -u __start_set_sysinit_set -u __start_set_sysuninit_set \ > >>>> -u __start_set_sysctl_set -u __start_set_modmetadata_set \ > >>>> -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ > >>>> -u __stop_set_sysctl_set -u __stop_set_modmetadata_set > >>> > >>> It appears many kmods are broken because the linker is stripping away > >>> static data declared with the section attribute in FreeBSD 8.1-RC1. > >>> > >>> > >>> > >>> I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd > >>> port made the module and the result loads and creates the /dev/cuse > >>> file. > >>> > >>> Here's a diff relative to > >>> /usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.11 just so > >>> it's clear what I did. > >>> > >>> > >>> --- Makefile.kmod.orig 2010-02-11 03:28:02.000000000 -0800 > >>> +++ Makefile.kmod 2010-06-22 14:02:52.000000000 -0700 > >>> @@ -30,4 +30,10 @@ > >>> KMOD= cuse4bsd > >>> SRCS= cuse4bsd_kmod.c device_if.h bus_if.h vnode_if.h > >>> > >>> +LDFLAGS += -u __start_set_sysinit_set -u __start_set_sysuninit_set \ > >>> + -u __start_set_sysctl_set -u __start_set_modmetadata_set \ > >>> + -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ > >>> + -u __stop_set_sysctl_set -u __stop_set_modmetadata_set > >>> + > >>> + > >>> .include > >>> > >>> Running nm -o on the two modules, the difference seems to be that the > >>> -u results in some additional absolute symbols being defined: > >>> > >>> Bad module: > >>> $ nm -o /boot/modules/cuse4bsd.ko| grep sys > >>> /boot/modules/cuse4bsd.ko:0000275c r > >>> __set_sysinit_set_sym_cuse_kern_init_sys_init > >>> /boot/modules/cuse4bsd.ko:00002758 r > >>> __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit > >>> /boot/modules/cuse4bsd.ko:00003194 d cuse_kern_init_sys_init > >>> /boot/modules/cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit > >> > >> I am not sure if this analysis is correct. > >> I tested on head and stable/8 and my nm output is exactly like above > >> ("bad module"), still the module loads fine and creates /dev/cuse. > >> > >> I don't think there were any recent changes related to build > >> infrastructure or linker in 8.1. > >> > >> Please consider other possibilities. > > > > I installed PC-BSD 8.1-RC1 and the stock cuse4bsd module is broken. > > Andriy, make sure that you re-make the toolchain before building the > > module in question. Also I think you have to: > > > > cd /usr/src ; make buildenv TARGET_ARCH=xxx_target > > > > Then you cd to the module directory and type make. > > > > --HPS > > Are you going to be updating the port soon to fix the build? We're just > doing a regular "make install" on the cuse4bsd-kmod port for our RC1 > build, and it would be nice to have this fixed for 8.1-Release. > Hi, Not unless there is a bug in my module. I'm a little bit busy right now, though I think that other modules like "fuse.ko" might be affected aswell. Could you try to make a cuse4bsd build on a stock 8-stable and compare the resulting cuse4bsd.ko (i386 build) like described earlier in this thread. Or something like this: objdump -D -x cuse4bsd.ko > a.txt objdump -D -x cuse4bsd.ko > b.txt diff -u a.txt b.txt What compiler did you bundle with the PCBSD 8.1 RC1 and how did you build the cuse4bsd ports module? Did you use something like clang? I haven't checked too much yet, but it appears that like Andriy is reporting that it's not a problem for everyone. When booting PCBSD 8.1 RC1 you will see warnings from the webcamd rc.d. --HPS From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 15:01:10 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA261065674; Wed, 23 Jun 2010 15:01:10 +0000 (UTC) (envelope-from faber@zod.isi.edu) Received: from zod.isi.edu (zod.isi.edu [128.9.168.221]) by mx1.freebsd.org (Postfix) with ESMTP id B02A28FC1A; Wed, 23 Jun 2010 15:01:10 +0000 (UTC) Received: from zod.isi.edu (localhost [127.0.0.1]) by zod.isi.edu (8.14.4/8.14.4) with ESMTP id o5NF16oL031766; Wed, 23 Jun 2010 08:01:06 -0700 (PDT) (envelope-from faber@zod.isi.edu) Received: (from faber@localhost) by zod.isi.edu (8.14.4/8.14.4/Submit) id o5NF15M2031765; Wed, 23 Jun 2010 08:01:05 -0700 (PDT) (envelope-from faber) Date: Wed, 23 Jun 2010 08:01:05 -0700 From: Ted Faber To: Andriy Gapon Message-ID: <20100623150105.GA31578@zod.isi.edu> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <4C21B383.2000602@icyb.net.ua> User-Agent: Mutt/1.4.2.3i X-url: http://www.isi.edu/~faber Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Hans Petter Selasky Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 15:01:10 -0000 --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 23, 2010 at 10:10:59AM +0300, Andriy Gapon wrote: > on 23/06/2010 10:02 Andriy Gapon said the following: > > I don't dispute that it is found broken in particular environments, I j= ust think > > that the analysis could be incorrect. >=20 > Which also brings the question - what arch(s) is affected? > I tested on amd64. Right. I'm i386 and I have the problem. Good point! --=20 Ted Faber http://www.isi.edu/~faber PGP: http://www.isi.edu/~faber/pubkeys.= asc Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#= SIG --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwiIbEACgkQaUz3f+Zf+Xvi7ACfc2Zo1cR7TxJ+GcNW+sE0zcG0 sWcAoJ2pKpJ5jd1vBqSErY/oSRDOLUCj =9Swq -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c-- From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 15:03:47 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B0EB1065675; Wed, 23 Jun 2010 15:03:47 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id A67A08FC14; Wed, 23 Jun 2010 15:03:46 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 25so426869eya.9 for ; Wed, 23 Jun 2010 08:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=kS5qWBKNlUi/Cq6inyK4bZ3ozNVp33lDveAPWAJGns8=; b=P+DmexcM8JQXoXwYzsVfDXycOg/k8JizvVc74eIB8OsDyd/RVfjyhhJVv0mIzthx8V tldLp9Tac5K8Z/s1TU+JeykDb5VFG4rS6EMKGH+cUtGjlCjrD1nIejuwc0Rh6TqumoUj 6SkkFTq8lw1UTZ0riPzTJU/VuBOE/uO0cwkho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=n5exZO6RkY9njU/QOhyWckZDrRhQAKvWi5laXU/Q16HeQakvluTvW1ptTcK/KqwU1M peSOMlZltdfIbcKi9D6u3PLC97BjdK6BFUh5PcmA+HDxTGzw4mytpzj44pKwMk63uCIw +x8NCZuNgqcaECApNQDsIBS/h7qOhW2gRCG/g= MIME-Version: 1.0 Received: by 10.213.32.136 with SMTP id c8mr1796601ebd.38.1277305425285; Wed, 23 Jun 2010 08:03:45 -0700 (PDT) Received: by 10.213.10.131 with HTTP; Wed, 23 Jun 2010 08:03:45 -0700 (PDT) In-Reply-To: <4C21B383.2000602@icyb.net.ua> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> Date: Wed, 23 Jun 2010 11:03:45 -0400 Message-ID: From: Ryan Stone To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Hans Petter Selasky Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 15:03:47 -0000 On Wed, Jun 23, 2010 at 3:10 AM, Andriy Gapon wrote: > > Which also brings the question - what arch(s) is affected? > I tested on amd64. This should explain it. It looks to me like i386 uses kern/link_elf.c as its linker, while amd64 uses kern/link_elf_obj.c. link_elf.c can only find the sections containing the sysinits(and some related things) via the magic symbols. link_elf_obj.c seems to understand ELF objects much better and doesn't need those symbols to be present. It just looks up the section that contains the sysinits directly via the ELF metadata that is already present. As far as I can tell, amd64 is the only arch in the tree that uses link_elf_obj.c, so all other arches may be affected. I have to admit that I'm more than a little surprised that this problem does not affect modules that in src, but maybe that's because I don't know all that much about FreeBSD's build infrastructure. Are the src modules being linked with a linker script that is not being used for out-of-src modules? Are the people affected by this not using the base compiler to build ports?(I see that this affects PC-BSD as well, and I'd be a little surprised to learn that it wasn't using the base compiler). The link line that I gave was a hack. The proper solution is to use a linker script that unconditionally puts the magic symbols in. From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 15:18:57 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2F9D106566C for ; Wed, 23 Jun 2010 15:18:57 +0000 (UTC) (envelope-from kris@pcbsd.org) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) by mx1.freebsd.org (Postfix) with ESMTP id A44418FC1C for ; Wed, 23 Jun 2010 15:18:56 +0000 (UTC) Received: from mail.ixsystems.com (localhost [127.0.0.1]) by mail.iXsystems.com (Postfix) with ESMTP id 48916A6643E; Wed, 23 Jun 2010 08:18:56 -0700 (PDT) Received: from mail.iXsystems.com ([127.0.0.1]) by mail.ixsystems.com (mail.ixsystems.com [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 65727-05; Wed, 23 Jun 2010 08:18:56 -0700 (PDT) Received: from [192.168.0.55] (unknown [75.131.46.136]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id A40CBA6640C; Wed, 23 Jun 2010 08:18:55 -0700 (PDT) Message-ID: <4C2225DD.3030408@pcbsd.org> Date: Wed, 23 Jun 2010 11:18:53 -0400 From: Kris Moore User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100414 Thunderbird/3.0.4 MIME-Version: 1.0 To: Hans Petter Selasky References: <201006230238.06831.hselasky@c2i.net> <201006230852.26536.hselasky@c2i.net> <4C221D93.6020800@pcbsd.org> <201006231655.43671.hselasky@c2i.net> In-Reply-To: <201006231655.43671.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, Andriy Gapon Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 15:18:57 -0000 On 06/23/2010 10:55, Hans Petter Selasky wrote: > > Hi, > > Not unless there is a bug in my module. I'm a little bit busy right now, > though I think that other modules like "fuse.ko" might be affected aswell. > > Could you try to make a cuse4bsd build on a stock 8-stable and compare the > resulting cuse4bsd.ko (i386 build) like described earlier in this thread. > > Or something like this: > > objdump -D -x cuse4bsd.ko> a.txt > objdump -D -x cuse4bsd.ko> b.txt > > diff -u a.txt b.txt > I'll have to try that on another system, all amd64 here, and rebuilding the port gives identical cuse4bsd.ko to what we already include in system. > What compiler did you bundle with the PCBSD 8.1 RC1 and how did you build the > cuse4bsd ports module? Did you use something like clang? > > The system is just regular FreeBSD 8.1-RC1, no clang or other funky make options. The port was built with in a chroot environment with the stock FreeBSD 8.1-RC1 loaded in it. > I haven't checked too much yet, but it appears that like Andriy is reporting > that it's not a problem for everyone. When booting PCBSD 8.1 RC1 you will see > warnings from the webcamd rc.d. > > --HPS > Yea, i see the error messages here as well, but only on my laptop. My desktops use the same build, but don't throw the error, even though cuse4bsd is loaded. (Of course they don't have a webcam connected, which I'm sure is part of it) -- Kris Moore PC-BSD Software iXsystems From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 15:40:46 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DC72106566C; Wed, 23 Jun 2010 15:40:46 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 485D68FC14; Wed, 23 Jun 2010 15:40:44 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA28330; Wed, 23 Jun 2010 18:40:30 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4C222AED.2070802@icyb.net.ua> Date: Wed, 23 Jun 2010 18:40:29 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100517) MIME-Version: 1.0 To: Ryan Stone References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Hans Petter Selasky Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 15:40:46 -0000 on 23/06/2010 18:03 Ryan Stone said the following: > On Wed, Jun 23, 2010 at 3:10 AM, Andriy Gapon wrote: >> Which also brings the question - what arch(s) is affected? >> I tested on amd64. > > This should explain it. It looks to me like i386 uses kern/link_elf.c > as its linker, while amd64 uses kern/link_elf_obj.c. link_elf.c can > only find the sections containing the sysinits(and some related > things) via the magic symbols. link_elf_obj.c seems to understand ELF > objects much better and doesn't need those symbols to be present. It > just looks up the section that contains the sysinits directly via the > ELF metadata that is already present. Yes, you are absolutely correct. This comes from the fact that amd64 uses simple objects files (aka .o) as kernel modules and i386 uses full-blow dso. > As far as I can tell, amd64 is the only arch in the tree that uses > link_elf_obj.c, so all other arches may be affected. > > I have to admit that I'm more than a little surprised that this > problem does not affect modules that in src, but maybe that's because > I don't know all that much about FreeBSD's build infrastructure. Are > the src modules being linked with a linker script that is not being > used for out-of-src modules? No, we don't have any special linker script for modules. > Are the people affected by this not > using the base compiler to build ports?(I see that this affects PC-BSD > as well, and I'd be a little surprised to learn that it wasn't using > the base compiler). I think that even out-of-base modules still use the same module build infrastructure (bsd.kmod.mk). At least this is the case for cuse4bsd. > The link line that I gave was a hack. The proper solution is to use a > linker script that unconditionally puts the magic symbols in. Module link process on i386 is like this (simplified): 1) combine object files into a single object file mod.kld ld -r -o mod.kld 1.o 2.o 2) convert it to dso ld -Bshareable -d -warn-common -o mod.ko mod.kld I believe that __start/__stop symbols for sections should be automatically added at step 2 by linker. Reference: http://sourceware.org/binutils/docs/ld/Orphan-Sections.html#Orphan-Sections -- Andriy Gapon From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 15:45:35 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F2521065679; Wed, 23 Jun 2010 15:45:35 +0000 (UTC) (envelope-from faber@zod.isi.edu) Received: from zod.isi.edu (zod.isi.edu [128.9.168.221]) by mx1.freebsd.org (Postfix) with ESMTP id 29A088FC0A; Wed, 23 Jun 2010 15:45:34 +0000 (UTC) Received: from zod.isi.edu (localhost [127.0.0.1]) by zod.isi.edu (8.14.4/8.14.4) with ESMTP id o5NFjVAW032385; Wed, 23 Jun 2010 08:45:31 -0700 (PDT) (envelope-from faber@zod.isi.edu) Received: (from faber@localhost) by zod.isi.edu (8.14.4/8.14.4/Submit) id o5NFjVq2032384; Wed, 23 Jun 2010 08:45:31 -0700 (PDT) (envelope-from faber) Date: Wed, 23 Jun 2010 08:45:31 -0700 From: Ted Faber To: Ryan Stone Message-ID: <20100623154531.GB31578@zod.isi.edu> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bn2rw/3z4jIqBvZU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-url: http://www.isi.edu/~faber Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Andriy Gapon , Hans Petter Selasky Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 15:45:35 -0000 --Bn2rw/3z4jIqBvZU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 23, 2010 at 11:03:45AM -0400, Ryan Stone wrote: > I have to admit that I'm more than a little surprised that this > problem does not affect modules that in src, but maybe that's because > I don't know all that much about FreeBSD's build infrastructure. Are > the src modules being linked with a linker script that is not being > used for out-of-src modules? Are the people affected by this not > using the base compiler to build ports?(I see that this affects PC-BSD > as well, and I'd be a little surprised to learn that it wasn't using > the base compiler). I had the problem on i386, base compiler. It also affects the sample module in /usr/share/examples/kld/cdev/ which also uses the base compiler, if you want a case w/o th eports infrastructure. --=20 Ted Faber http://www.isi.edu/~faber PGP: http://www.isi.edu/~faber/pubkeys.= asc Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#= SIG --Bn2rw/3z4jIqBvZU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwiLBsACgkQaUz3f+Zf+XuPygCg40gyhhu/+2i+s0SYz/0aKmJ5 hCwAoMRjg6s0ViTgHUa2lDLIzYXhYKgl =bMIb -----END PGP SIGNATURE----- --Bn2rw/3z4jIqBvZU-- From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 15:52:30 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DD801065672 for ; Wed, 23 Jun 2010 15:52:30 +0000 (UTC) (envelope-from cristiano.deana@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id B0F0F8FC12 for ; Wed, 23 Jun 2010 15:52:29 +0000 (UTC) Received: by fxm7 with SMTP id 7so3703694fxm.13 for ; Wed, 23 Jun 2010 08:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=YvqSP0EptOjiw8XI/es25FI1927s+ewOF5/3aRygOwQ=; b=POPq8Wk1lGSgWaCSox1B6DWRMuGlmJ8/ggO+JbTy4J+kzhdsWBADMBIF7Lvy9qvAY/ WGopltps/KIFow6PCBzXGL36rTOVtSLN4k2n55VQzmjUbnbCl4sF22JhKumwN6uyoOkh IU8Ez8yEafR7Q1WqSqMFOzg6RMNdcPqPxOT84= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=R2vlyhcK9SAg+WtPhtOkj3GQ+RvbW9GYral1wqLEG0nhbc7QrVtcsATVpV7Ch4Bz95 WrWZztESlaCVPPCW+CVua3kjKdJRGto+dB2d2ESW920cEkMzFQyzrvbIJE7kYw+WHMC1 STzjyGTD+tidvGZZJxEPxDGdRWovkGSh0dHDU= MIME-Version: 1.0 Received: by 10.223.105.129 with SMTP id t1mr59948fao.12.1277308348480; Wed, 23 Jun 2010 08:52:28 -0700 (PDT) Received: by 10.223.117.204 with HTTP; Wed, 23 Jun 2010 08:52:28 -0700 (PDT) In-Reply-To: References: Date: Wed, 23 Jun 2010 17:52:28 +0200 Message-ID: From: Cristiano Deana To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: Problem with buildworld with CLANG X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 15:52:30 -0000 On Wed, Jun 23, 2010 at 3:15 PM, Tom Evans wrote: > Top of the '[TESTING] Clang..' email: > >> hi, >> >> ClangBSD was updated to LLVM/clang revision 104832 which is what we aim to import >> into HEAD in roughly a week. We would like the initial import to be as painless >> as possible and therefore we ask you to test ClangBSD to assure that the revision >> we are importing does not have some really embarassing bugs. >> >> How to do it (on i386 and amd64): >> 1) svn co http://svn.freebsd.org/base/projects/clangbsd src i already did it and it worked, two weeks ago. now i wanted to try with clan in system >> 2) echo NO_WERROR= >> /etc/src.conf ; echo WERROR= >> /etc/src.conf > So uncomment your src.conf lines that are incompatible. forgot to tell before. i tried with and without those lines. -- Cris, member of G.U.F.I Italian FreeBSD User Group http://www.gufi.org/ From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 16:44:08 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34AFA106564A for ; Wed, 23 Jun 2010 16:44:08 +0000 (UTC) (envelope-from bw@exodus.desync.com) Received: from exodus.desync.com (desync.com [IPv6:2607:f178::165]) by mx1.freebsd.org (Postfix) with ESMTP id EDE8A8FC0C for ; Wed, 23 Jun 2010 16:44:07 +0000 (UTC) Received: from exodus.desync.com (localhost [127.0.0.1]) by exodus.desync.com (8.14.4/8.14.4) with ESMTP id o5NGi1Rr008787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 23 Jun 2010 12:44:01 -0400 (EDT) (envelope-from bw@exodus.desync.com) Received: (from bw@localhost) by exodus.desync.com (8.14.4/8.14.4/Submit) id o5NGi1Wx008785 for freebsd-current@freebsd.org; Wed, 23 Jun 2010 12:44:01 -0400 (EDT) (envelope-from bw) Date: Wed, 23 Jun 2010 12:44:01 -0400 From: ben wilber To: freebsd-current Message-ID: <20100623164401.GA7914@exodus.desync.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Angst-Level: High Subject: zfs panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 16:44:08 -0000 Hi, Since at least r208174, I've been getting the following panic every few days on my fairly heavily loaded amd64 machine: panic: _sx_xlock_hard: recursed on non-recursive sx buf_hash_table.ht_locks[i].ht_lock @ /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/c ommon/fs/zfs/arc.c:1626 The machine has 36 disks behind mfi(4), plus some SATA L2ARC. This panic is sometimes preempted by "kmem_map too small", so I apologize in advance if this is caused by memory shortage. From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 17:09:54 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42EC7106566B for ; Wed, 23 Jun 2010 17:09:54 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout3.yahoo.com (mrout3.yahoo.com [216.145.54.173]) by mx1.freebsd.org (Postfix) with ESMTP id 2E6568FC14 for ; Wed, 23 Jun 2010 17:09:53 +0000 (UTC) Received: from [127.0.0.1] (cheese.corp.yahoo.com [216.145.50.99]) by mrout3.yahoo.com (8.13.8/8.13.8/y.out) with ESMTP id o5NH9FpJ037439 for ; Wed, 23 Jun 2010 10:09:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=subject:from:reply-to:to:content-type:date:message-id: mime-version:x-mailer:content-transfer-encoding; b=lgobLbVezUBTdFsAhtMFczEEd56W9s3Kl2JE8eMKWZvBD0ANqoJ6qoSrg3PBIbVL From: Sean Bruno To: freebsd-current Content-Type: text/plain; charset="UTF-8" Date: Wed, 23 Jun 2010 10:09:15 -0700 Message-ID: <1277312955.2478.18.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) Content-Transfer-Encoding: 7bit Subject: No issues, just informative QEMU boot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sbruno@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 17:09:54 -0000 With the large amount of churn in key parts of FreeBSD ongoing, I thought I'd post a dmesg from a booting FreeBSD Current instance I use all the time. This is under KVM/QEMU on Fedora 12. there's some interesting things relating to timers and such. booted with boot.config set to -v Sean Copyright (c) 1992-2010 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #0 r209470: Wed Jun 23 09:21:57 PDT 2010 sbruno@test:/mnt/nfs/fbsd/head/sys/amd64/compile/SEAN amd64 WARNING: WITNESS option enabled, expect reduced performance. Preloaded elf kernel "/boot/kernel/kernel" at 0xffffffff80b61000. Calibrating TSC clock ... TSC clock: 2527049714 Hz CPU: QEMU Virtual CPU version 0.11.0 (2527.05-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x623 Family = 6 Model = 2 Stepping = 3 Features=0x783fbfd Features2=0x80000001> AMD Features=0x20100800 real memory = 2147483648 (2048 MB) Physical memory chunk(s): 0x0000000000001000 - 0x000000000009afff, 630784 bytes (154 pages) 0x0000000000b8f000 - 0x000000007c38ffff, 2071990272 bytes (505857 pages) avail memory = 2059124736 (1963 MB) Event timer "LAPIC" frequency 0 Hz quality 500 ACPI APIC Table: INTR: Adding local APIC 1 as a target FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs FreeBSD/SMP: 2 package(s) x 1 core(s) cpu0 (BSP): APIC ID: 0 cpu1 (AP): APIC ID: 1 APIC: CPU 0 has ACPI ID 0 APIC: CPU 1 has ACPI ID 1 x86bios: IVT 0x000000-0x0004ff at 0xffffff0000000000 x86bios: SSEG 0x010000-0x01ffff at 0xffffff800000d000 x86bios: EBDA 0x09f000-0x09ffff at 0xffffff000009f000 x86bios: ROM 0x0a0000-0x0effff at 0xffffff00000a0000 ULE: setup cpu 0 ULE: setup cpu 1 ACPI: RSDP 0xfbd40 00014 (v0 QEMU ) ACPI: RSDT 0x7fff0000 00034 (v1 QEMU QEMURSDT 00000001 QEMU 00000001) ACPI: FACP 0x7fff01b4 00074 (v1 QEMU QEMUFACP 00000001 QEMU 00000001) ACPI: DSDT 0x7fff0280 01DD4 (v1 BXPC BXDSDT 00000001 INTL 20090123) ACPI: FACS 0x7fff0240 00040 ACPI: SSDT 0x7fff2054 009E3 (v1 BXPC BXSSDT 00000001 INTL 20090123) ACPI: APIC 0x7fff2a38 000EA (v1 QEMU QEMUAPIC 00000001 QEMU 00000001) ACPI: HPET 0x7fff2b90 00038 (v1 QEMU QEMUHPET 00000001 QEMU 00000001) MADT: Found IO APIC ID 2, Interrupt 0 at 0xfec00000 ioapic0: Changing APIC ID to 2 ioapic0: Routing external 8259A's -> intpin 0 MADT: Interrupt override: source 0, irq 2 ioapic0: Routing IRQ 0 -> intpin 2 MADT: Interrupt override: source 5, irq 5 ioapic0: intpin 5 trigger: level MADT: Interrupt override: source 9, irq 9 ioapic0: intpin 9 trigger: level MADT: Interrupt override: source 10, irq 10 ioapic0: intpin 10 trigger: level MADT: Interrupt override: source 11, irq 11 ioapic0: intpin 11 trigger: level ioapic0 irqs 0-23 on motherboard cpu0 BSP: ID: 0x00000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 cmci: 0x00000000 random: io: nfslock: pseudo-device kbd: new array size 4 kbd1 at kbdmux0 mem: null: acpi0: on motherboard ioapic0: routing intpin 9 (ISA IRQ 9) to lapic 0 vector 48 acpi0: [MPSAFE] acpi0: [ITHREAD] acpi0: Power Button (fixed) acpi_bus_number: root bus has no _BBN, assuming 0 AcpiOsDerivePciId: \\_SB_.PCI0.PX13.P13C -> bus 0 dev 1 func 3 acpi_bus_number: root bus has no _BBN, assuming 0 AcpiOsDerivePciId: \\_SB_.PCI0.ISA_.P40C -> bus 0 dev 1 func 0 ACPI timer: 0/190 0/188 0/2068 0/2143 0/760 0/2019 0/141 0/139 0/1745 0/135 -> 0 Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0 cpu0: on acpi0 cpu0: switching to generic Cx mode cpu1: on acpi0 pci_link0: Index IRQ Rtd Ref IRQs Initial Probe 0 10 N 0 5 10 11 Validation 0 10 N 0 5 10 11 After Disable 0 255 N 0 5 10 11 pci_link1: Index IRQ Rtd Ref IRQs Initial Probe 0 10 N 0 5 10 11 Validation 0 10 N 0 5 10 11 After Disable 0 255 N 0 5 10 11 pci_link2: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 5 10 11 Validation 0 11 N 0 5 10 11 After Disable 0 255 N 0 5 10 11 pci_link3: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 5 10 11 Validation 0 11 N 0 5 10 11 After Disable 0 255 N 0 5 10 11 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 hpet0: vendor 0x8086, rev 0x1, 100000000Hz 64bit, 3 timers, legacy route hpet0: t0: irqs 0x00000004 (0), 64bit, periodic hpet0: t1: irqs 0x00000004 (0), 64bit, periodic hpet0: t2: irqs 0x00000004 (0), 64bit, periodic Timecounter "HPET" frequency 100000000 Hz quality 900 pcib0: port 0xcf8-0xcff on acpi0 ACPI: Found matching pin for 0.1.INTA at func 3: 9 pci_link0: BIOS IRQ 9 does not match initial IRQ 10 ACPI: Found matching pin for 0.1.INTD at func 2: 11 ACPI: Found matching pin for 0.3.INTA at func 0: 11 ACPI: Found matching pin for 0.4.INTA at func 0: 11 ACPI: Found matching pin for 0.5.INTA at func 0: 10 pci_link0: BIOS IRQ 10 for 0.5.INTA does not match previous BIOS IRQ 9 pci0: on pcib0 pci0: domain=0, physical bus=0 found-> vendor=0x8086, dev=0x1237, revid=0x02 domain=0, bus=0, slot=0, func=0 class=06-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0000, statreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) found-> vendor=0x8086, dev=0x7000, revid=0x00 domain=0, bus=0, slot=1, func=0 class=06-01-00, hdrtype=0x00, mfdev=1 cmdreg=0x0007, statreg=0x0200, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) found-> vendor=0x8086, dev=0x7010, revid=0x00 domain=0, bus=0, slot=1, func=1 class=01-01-80, hdrtype=0x00, mfdev=0 cmdreg=0x0001, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) map[20]: type I/O Port, range 32, base 0xc000, size 4, enabled found-> vendor=0x8086, dev=0x7020, revid=0x01 domain=0, bus=0, slot=1, func=2 class=0c-03-00, hdrtype=0x00, mfdev=0 cmdreg=0x0005, statreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=d, irq=11 map[20]: type I/O Port, range 32, base 0xc020, size 5, enabled pcib0: matched entry for 0.1.INTD (src \\_SB_.LNKD:0) pcib0: slot 1 INTD routed to irq 11 via \\_SB_.LNKD found-> vendor=0x8086, dev=0x7113, revid=0x03 domain=0, bus=0, slot=1, func=3 class=06-80-00, hdrtype=0x00, mfdev=0 cmdreg=0x0000, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=9 pcib0: matched entry for 0.1.INTA (src \\_SB_.LNKA:0) pcib0: slot 1 INTA routed to irq 9 via \\_SB_.LNKA found-> vendor=0x1013, dev=0x00b8, revid=0x00 domain=0, bus=0, slot=2, func=0 class=03-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0003, statreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) map[10]: type Prefetchable Memory, range 32, base 0xf0000000, size 25, enabled map[14]: type Memory, range 32, base 0xf2000000, size 12, enabled found-> vendor=0x8086, dev=0x100e, revid=0x03 domain=0, bus=0, slot=3, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0407, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 map[10]: type Memory, range 32, base 0xf2020000, size 17, enabled map[14]: type I/O Port, range 32, base 0xc040, size 6, enabled pcib0: matched entry for 0.3.INTA (src \\_SB_.LNKC:0) pcib0: slot 3 INTA routed to irq 11 via \\_SB_.LNKC found-> vendor=0x1274, dev=0x5000, revid=0x00 domain=0, bus=0, slot=4, func=0 class=04-01-00, hdrtype=0x00, mfdev=0 cmdreg=0x0001, statreg=0x0400, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x0c (3000 ns), maxlat=0x80 (32000 ns) intpin=a, irq=11 map[10]: type I/O Port, range 32, base 0xc100, size 8, enabled pcib0: matched entry for 0.4.INTA (src \\_SB_.LNKD:0) pcib0: slot 4 INTA routed to irq 11 via \\_SB_.LNKD found-> vendor=0x1af4, dev=0x1002, revid=0x00 domain=0, bus=0, slot=5, func=0 class=05-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0001, statreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=10 map[10]: type I/O Port, range 32, base 0xc200, size 5, enabled pcib0: matched entry for 0.5.INTA (src \\_SB_.LNKA:0) pcib0: slot 5 INTA routed to irq 9 via \\_SB_.LNKA isab0: at device 1.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc000-0xc00f at device 1.1 on pci0 ata0: on atapci0 ata0: reset tp1 mask=03 ostat0=50 ostat1=00 ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00 ata0: stat1=0x00 err=0x00 lsb=0xff msb=0xff ata0: reset tp2 stat0=50 stat1=00 devices=0x1 ioapic0: routing intpin 14 (ISA IRQ 14) to lapic 0 vector 49 ata0: [MPSAFE] ata0: [ITHREAD] ata1: on atapci0 ata1: reset tp1 mask=03 ostat0=00 ostat1=00 ata1: stat0=0x00 err=0x01 lsb=0x14 msb=0xeb ata1: stat1=0x00 err=0x00 lsb=0xff msb=0xff ata1: reset tp2 stat0=00 stat1=00 devices=0x10000 ioapic0: routing intpin 15 (ISA IRQ 15) to lapic 0 vector 50 ata1: [MPSAFE] ata1: [ITHREAD] uhci0: port 0xc020-0xc03f irq 11 at device 1.2 on pci0 ioapic0: routing intpin 11 (ISA IRQ 11) to lapic 0 vector 51 uhci0: [MPSAFE] uhci0: [ITHREAD] usbus0: controller did not stop usbus0: on uhci0 pci0: at device 1.3 (no driver attached) vgapci0: mem 0xf0000000-0xf1ffffff,0xf2000000-0xf2000fff at device 2.0 on pci0 em0: port 0xc040-0xc07f mem 0xf2020000-0xf203ffff irq 11 at device 3.0 on pci0 em0: [FILTER] em0: bpf attached em0: Ethernet address: 52:54:00:3d:e6:07 em0: Link is up 1000 Mbps Full Duplex pci0: at device 4.0 (no driver attached) pci0: at device 5.0 (no driver attached) atrtc0: port 0x70-0x71,0x72-0x77 irq 8 on acpi0 atrtc0: registered as a time-of-day clock (resolution 1000000us) ioapic0: routing intpin 8 (ISA IRQ 8) to lapic 0 vector 52 atrtc0: [MPSAFE] atrtc0: [FILTER] Event timer "RTC" frequency 32768 Hz quality 0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 atkbd: the current kbd controller command byte 0061 atkbd: keyboard ID 0x41ab (2) kbd0 at atkbd0 kbd0: atkbd0, AT 101/102 (2), config:0x0, flags:0x3d0000 ioapic0: routing intpin 1 (ISA IRQ 1) to lapic 0 vector 53 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: unable to allocate IRQ psmcpnp0: irq 12 on acpi0 psm0: current command byte:0061 psm0: irq 12 on atkbdc0 ioapic0: routing intpin 12 (ISA IRQ 12) to lapic 0 vector 54 psm0: [GIANT-LOCKED] psm0: [ITHREAD] psm0: model IntelliMouse Explorer, device ID 4-00, 5 buttons psm0: config:00000000, flags:00000008, packet size:4 psm0: syncmask:08, syncbits:00 fdc0: port 0x3f2-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fdc0: does not respond device_attach: fdc0 attach returned 6 uart0: port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 ioapic0: routing intpin 4 (ISA IRQ 4) to lapic 0 vector 55 uart0: [FILTER] uart0: fast interrupt acpi0: wakeup code va 0xffffff8000112000 pa 0x4000 isa_probe_children: disabling PnP devices atkbdc: atkbdc0 already exists; skipping it atrtc: atrtc0 already exists; skipping it fdc: fdc0 already exists; skipping it sc: sc0 already exists; skipping it uart: uart0 already exists; skipping it isa_probe_children: probing non-PnP devices sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> sc0: fb0, kbd1, terminal emulator: scteken (teken terminal) vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 ppc0 failed to probe at irq 7 on isa0 uart1: failed to probe at port 0x2f8-0x2ff irq 3 on isa0 isa_probe_children: probing PnP devices Device configuration finished. Reducing kern.maxvnodes 132666 -> 100000 procfs registered Timecounter "TSC" frequency 2527049714 Hz quality -100 Starting kernel event timers: LAPIC @ 100Hz, RTC @ 128Hz lapic: Divisor 2, Frequency 500309917 Hz Timecounters tick every 10.000 msec vlan: initialized, using hash tables with chaining lo0: bpf attached ata0: Identifying devices: 00000001 ata0: New devices: 00000001 ata0-master: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 wire usbus0: 12Mbps Full Speed USB v1.0 ad0: setting WDMA2 ad0: 10240MB at ata0-master WDMA2 ad0: 20971520 sectors [20805C/16H/63S] 16 sectors/interrupt 1 depth queue ugen0.1: at usbus0 uhub0: on usbus0 GEOM: new disk ad0 ad0: Intel check1 failed ad0: Adaptec check1 failed ad0: LSI (v3) check1 failed ad0: LSI (v2) check1 failed ad0: FreeBSD check1 failed ata1: Identifying devices: 00010000 ata1: New devices: 00010000 ata1-master: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=40 wire acd0: setting WDMA2 acd0: CDROM drive at ata1 as master acd0: read 689KB/s (689KB/s), 512KB buffer, WDMA2 acd0: Reads: acd0: Writes: acd0: Audio: play, 2 volume levels acd0: Mechanism: ejectable tray, unlocked acd0: Medium: no/blank disc ATA PseudoRAID loaded SMP: AP CPU #1 Launched! cpu1 AP: ID: 0x01000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 cmci: 0x00000000 ioapic0: routing intpin 4 (ISA IRQ 4) to lapic 1 vector 48 ioapic0: routing intpin 11 (ISA IRQ 11) to lapic 1 vector 49 ioapic0: routing intpin 14 (ISA IRQ 14) to lapic 1 vector 50 WARNING: WITNESS option enabled, expect reduced performance. Root mount waiting for: usbus0 uhub0: 2 ports with 2 removable, self powered Trying to mount root from ufs:/dev/ad0s1a ct_to_ts([2010-06-23 16:48:08]) = 1277311688.000000000 start_init: trying /sbin/init From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 17:54:30 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DE63106564A for ; Wed, 23 Jun 2010 17:54:30 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout2.yahoo.com (mrout2.yahoo.com [216.145.54.172]) by mx1.freebsd.org (Postfix) with ESMTP id 414058FC16 for ; Wed, 23 Jun 2010 17:54:30 +0000 (UTC) Received: from [127.0.0.1] (cheese.corp.yahoo.com [216.145.50.99]) by mrout2.yahoo.com (8.13.8/8.13.8/y.out) with ESMTP id o5NHrPJM010545 for ; Wed, 23 Jun 2010 10:53:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=subject:from:reply-to:to:content-type:date:message-id: mime-version:x-mailer:content-transfer-encoding; b=U0NCh543GDzIw3tJ9VAcqMCLT+Gj/wx+LKRBK7+RManR8e4UymaWcwCRGpiGqzEn From: Sean Bruno To: freebsd-current Content-Type: text/plain; charset="UTF-8" Date: Wed, 23 Jun 2010 10:53:25 -0700 Message-ID: <1277315605.2478.22.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) Content-Transfer-Encoding: 7bit Subject: Deadlock with kgmon -p X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sbruno@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 17:54:30 -0000 Trying to track down a nasty with regard to Xen stuff and am now experiencing deadlocks on -current with a kernel configured with -g -ppp. The lockup will happen when I attempt to get the profiling data via kgmon -p. Not sure when this broke, but it's definitely broken in stable-7 as well as -current. Ideas? Sean From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 18:00:26 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47C3C1065780 for ; Wed, 23 Jun 2010 18:00:26 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id DFC658FC1D for ; Wed, 23 Jun 2010 18:00:23 +0000 (UTC) Received: from [192.168.221.2] (remotevpn [192.168.221.2]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o5NI0MaV024799 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 23 Jun 2010 11:00:23 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4C224BB1.8000104@feral.com> Date: Wed, 23 Jun 2010 11:00:17 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <1277315605.2478.22.camel@localhost.localdomain> In-Reply-To: <1277315605.2478.22.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.3 (ns1.feral.com [192.168.221.1]); Wed, 23 Jun 2010 11:00:23 -0700 (PDT) Subject: Re: Deadlock with kgmon -p X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 18:00:26 -0000 On 6/23/2010 10:53 AM, Sean Bruno wrote: > Trying to track down a nasty with regard to Xen stuff and am now > experiencing deadlocks on -current with a kernel configured with -g > -ppp. > > The lockup will happen when I attempt to get the profiling data via > kgmon -p. > > Not sure when this broke, but it's definitely broken in stable-7 as well > as -current. Ideas? > > Dunno about anyone else's experience, but I can't get amd64 stable-7 kernels on forward to even finish booting if built with config -pp. From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 18:24:15 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E2EE106567D for ; Wed, 23 Jun 2010 18:24:15 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout2.yahoo.com (mrout2.yahoo.com [216.145.54.172]) by mx1.freebsd.org (Postfix) with ESMTP id 77A988FC15 for ; Wed, 23 Jun 2010 18:24:15 +0000 (UTC) Received: from [127.0.0.1] (cheese.corp.yahoo.com [216.145.50.99]) by mrout2.yahoo.com (8.13.8/8.13.8/y.out) with ESMTP id o5NINRmT019441; Wed, 23 Jun 2010 11:23:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=subject:from:reply-to:to:cc:in-reply-to:references: content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=xeMcWYH+ySXPrHHLAdpWJZcIJdfkp1FwfnvBTZxfgecPVh5hond/L/JY5BdDd6yB From: Sean Bruno To: Matthew Jacob In-Reply-To: <4C224BB1.8000104@feral.com> References: <1277315605.2478.22.camel@localhost.localdomain> <4C224BB1.8000104@feral.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 23 Jun 2010 11:23:26 -0700 Message-ID: <1277317406.2478.24.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) Content-Transfer-Encoding: 7bit Cc: "freebsd-current@freebsd.org" Subject: Re: Deadlock with kgmon -p X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sbruno@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 18:24:15 -0000 On Wed, 2010-06-23 at 13:00 -0500, Matthew Jacob wrote: > On 6/23/2010 10:53 AM, Sean Bruno wrote: > > Trying to track down a nasty with regard to Xen stuff and am now > > experiencing deadlocks on -current with a kernel configured with -g > > -ppp. > > > > The lockup will happen when I attempt to get the profiling data via > > kgmon -p. > > > > Not sure when this broke, but it's definitely broken in stable-7 as well > > as -current. Ideas? > > > > > > Dunno about anyone else's experience, but I can't get amd64 stable-7 > kernels on forward to even finish booting if built with config -pp. "config -p" *seems* to be ok at the moment on 7 and -Current Sean From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 18:33:32 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FB911065674 for ; Wed, 23 Jun 2010 18:33:32 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 33B798FC26 for ; Wed, 23 Jun 2010 18:33:31 +0000 (UTC) Received: from [192.168.221.2] (remotevpn [192.168.221.2]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o5NIXEjt025898 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 23 Jun 2010 11:33:31 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4C225364.6030300@feral.com> Date: Wed, 23 Jun 2010 11:33:08 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Sean Bruno References: <1277315605.2478.22.camel@localhost.localdomain> <4C224BB1.8000104@feral.com> <1277317174.2478.23.camel@localhost.localdomain> In-Reply-To: <1277317174.2478.23.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.3 (ns1.feral.com [192.168.221.1]); Wed, 23 Jun 2010 11:33:31 -0700 (PDT) Cc: "freebsd-current@freebsd.org" Subject: Re: Deadlock with kgmon -p X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 18:33:32 -0000 Yes. Using it as we speak. > "config -p" *seems* to be ok at the moment on 7 and -Current > > Sean > > From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 18:33:39 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33C66106564A for ; Wed, 23 Jun 2010 18:33:39 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id 8F7CC8FC22 for ; Wed, 23 Jun 2010 18:33:38 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 25so441419eya.9 for ; Wed, 23 Jun 2010 11:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=UBLLokaxwVwjyf9dJsBGavFb35radwFXbwhDPpyfzk0=; b=xccWcxGq8B42xCSbIi2ZkboSJNoiYy2TIhef0+fBhoNFYmpWb+QB1eD4077kZ80PLh jg4I0F0j0EZoIlgC4suACi0mXAVPuRRelMzsS6iPH25OqUzQFFMMESpllQXyn+zTTITe cIVBHFejTQ4Q98DUfN9vR4fwTLQP8E8M9fRdE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=SE3Wbh2vKrL4cfPcmafv/qP+tZW0V0Y0+u3kfdWyoyLBMDPbcElGCj9vaD2eTuZX+D 7Adtn9zWI5FyHvZx0PiTKMz+YlYfy+IEXLtsaiNPJI84MdG7hdL6LaszwJQ0hskqwBIV zU4E40/+Au2n6C4LZPoOP4tCK04450Tual1to= MIME-Version: 1.0 Received: by 10.213.7.12 with SMTP id b12mr1857898ebb.52.1277318017373; Wed, 23 Jun 2010 11:33:37 -0700 (PDT) Received: by 10.213.10.131 with HTTP; Wed, 23 Jun 2010 11:33:37 -0700 (PDT) In-Reply-To: <1277317406.2478.24.camel@localhost.localdomain> References: <1277315605.2478.22.camel@localhost.localdomain> <4C224BB1.8000104@feral.com> <1277317406.2478.24.camel@localhost.localdomain> Date: Wed, 23 Jun 2010 14:33:37 -0400 Message-ID: From: Ryan Stone To: sbruno@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-current@freebsd.org" , Matthew Jacob Subject: Re: Deadlock with kgmon -p X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 18:33:39 -0000 I can't help you with the problems with gprof, but Fabien Thomas has been working on support for software-triggered pmc events. He posted a patch here: http://groups.google.com/group/pmctools-discuss/browse_thread/thread/1eb4fa78c7ab8522 You could try this out to use pmcstat to profile your application using the soft-clock event. From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 20:01:40 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B43C21065673 for ; Wed, 23 Jun 2010 20:01:40 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1528FC08 for ; Wed, 23 Jun 2010 20:01:39 +0000 (UTC) Received: by fxm7 with SMTP id 7so3889728fxm.13 for ; Wed, 23 Jun 2010 13:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=p3bQas7I8Jt3ODwfr9aB2krNEtmc60AvQd2PqQr7iJo=; b=YE4gR1aQW2uk5yNd0wz780J5rAl/Xy9o+3RwUcwqMCR18lQ/E849AbuWGRuGDrN7W5 jZgOMh6nWuZt/MYH3shuUfIoMD7b9ZBSbZY7lPvpLzRTmnvyfmOUjw6ZpRSzbNdS/iHF dDoHrxAcsTw0ZpdyEV1g7nLZ2X30BB5J3SZRk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=bRzwEZYexo/m9QV5DuEuEa6REsqu3MqDDRjzbj8b/e3dPcYX7bhgC/tTN54ppsCqkK K8QihEitvsPM6RKYa8a8qOn1Yot7baVgRnydXCGA+aFRJfxZXf2RHjmkRCNw7GGkaOnr pKIBNmhuPDnJyy/5cc0S1sergjR1d4+IG4Fjw= Received: by 10.223.29.156 with SMTP id q28mr8205021fac.77.1277323299003; Wed, 23 Jun 2010 13:01:39 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id e16sm33322302fak.32.2010.06.23.13.01.37 (version=SSLv3 cipher=RC4-MD5); Wed, 23 Jun 2010 13:01:38 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C2267FA.9010909@FreeBSD.org> Date: Wed, 23 Jun 2010 23:00:58 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Sean Bruno References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: FreeBSD-Current Subject: Re: No issues, just informative QEMU boot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 20:01:40 -0000 Sean Bruno wrote: > With the large amount of churn in key parts of FreeBSD ongoing, I > thought I'd post a dmesg from a booting FreeBSD Current instance I use > all the time. This is under KVM/QEMU on Fedora 12. > > there's some interesting things relating to timers and such. Thanks. I've noticed one thing there: QEMU seems don't enumerate i8254 timer device over ACPI. I was wondering if such systems exist, and now I see one. Luckily there is enough other timers to work fine without it. You may also try to check two HPET timers working in even more fresh "legacy route" mode by adding to /boot/loader.conf: hint.atrtc.0.clock=0 hint.attimer.0.clock=0 hint.hpet.0.legacy_route=1 -- Alexander Motin From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 20:47:46 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2221065672 for ; Wed, 23 Jun 2010 20:47:46 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 3355C8FC0C for ; Wed, 23 Jun 2010 20:47:46 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id EECC2A58F43; Thu, 24 Jun 2010 04:47:44 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id dEhx4ae5hVeb; Thu, 24 Jun 2010 04:47:38 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 00232A584C4; Thu, 24 Jun 2010 04:47:36 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=rNlGPeHkAp5fC2U0iz6zXv/Vrg+yTyoBvVhizwvVhEshCyxEs7d0HfODQc0uhXo9m Opz+7Iq0dfZmLDe4XHC8g== Message-ID: <4C2272E5.2090901@delphij.net> Date: Wed, 23 Jun 2010 13:47:33 -0700 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.10) Gecko/20100621 Thunderbird/3.0.5 ThunderBrowse/3.2.8.1 MIME-Version: 1.0 To: ben wilber References: <20100623164401.GA7914@exodus.desync.com> In-Reply-To: <20100623164401.GA7914@exodus.desync.com> X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current Subject: Re: zfs panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 20:47:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi, Ben, On 2010/06/23 09:44, ben wilber wrote: > Hi, > > Since at least r208174, I've been getting the following panic every few days on > my fairly heavily loaded amd64 machine: > > panic: _sx_xlock_hard: recursed on non-recursive sx buf_hash_table.ht_locks[i].ht_lock @ /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/c > ommon/fs/zfs/arc.c:1626 > > The machine has 36 disks behind mfi(4), plus some SATA L2ARC. This > panic is sometimes preempted by "kmem_map too small", so I apologize in > advance if this is caused by memory shortage. Any chance to obtain a backtrace for the panic? Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iQEcBAEBCAAGBQJMInLlAAoJEATO+BI/yjfB2GMH+wUzic+knneIShCqZJltR9Xe WyvEvMAkzEqg+4quLbDT8n5fge/wLY6NKODDwHCNOwku3HQqwon+lQpA9YqiWplm MH+x+Nxa8evE/Fc84Xl8ajgjzWVqAfGWl6mhruBCjeVf/oY3ZujiX9mCPNKMzDU/ 86To+UkeiQfVHDcwh8xDp+vIb+QvYEyKY1cmqi4Uu1nojAGBgCPs3ISUG0/834/J H0pv+CeAi3zlDzeOSUBtpf2RutJ/oH1MuyHoB1LORk1FPVe3WvbGx+lpQonoedta UVZqYeAqpliTbqQOXfrl7+6g0bqnCobyri8YNtyLS2h6NsA05lclYEbTJyR9QgI= =JTmj -----END PGP SIGNATURE----- From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 20:53:57 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86CD81065670; Wed, 23 Jun 2010 20:53:57 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout3.yahoo.com (mrout3.yahoo.com [216.145.54.173]) by mx1.freebsd.org (Postfix) with ESMTP id 6EC8C8FC0C; Wed, 23 Jun 2010 20:53:57 +0000 (UTC) Received: from [127.0.0.1] (cheese.corp.yahoo.com [216.145.50.99]) by mrout3.yahoo.com (8.13.8/8.13.8/y.out) with ESMTP id o5NKrPhM002015; Wed, 23 Jun 2010 13:53:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=subject:from:reply-to:to:cc:in-reply-to:references: content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=k5ApKoEeT73RXukpv3skCLHNbdkrGExt5xa397UQ8HhQR/LhoNHDLnPwoo/K4d3U From: Sean Bruno To: Alexander Motin In-Reply-To: <4C2267FA.9010909@FreeBSD.org> References: <4C2267FA.9010909@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" Date: Wed, 23 Jun 2010 13:53:25 -0700 Message-ID: <1277326405.2478.33.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) Content-Transfer-Encoding: 7bit Cc: FreeBSD-Current Subject: Re: No issues, just informative QEMU boot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sbruno@FreeBSD.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 20:53:57 -0000 On Wed, 2010-06-23 at 15:00 -0500, Alexander Motin wrote: > hint.atrtc.0.clock=0 > hint.attimer.0.clock=0 > hint.hpet.0.legacy_route=1 after adding those to the VM: Copyright (c) 1992-2010 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #2 r209470: Wed Jun 23 11:15:21 PDT 2010 sbruno@test:/mnt/nfs/fbsd/head/sys/amd64/compile/SEAN amd64 WARNING: WITNESS option enabled, expect reduced performance. Preloaded elf kernel "/boot/kernel/kernel" at 0xffffffff80b72000. Calibrating TSC clock ... TSC clock: 2527057361 Hz CPU: QEMU Virtual CPU version 0.11.0 (2527.06-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x623 Family = 6 Model = 2 Stepping = 3 Features=0x783fbfd Features2=0x80000001> AMD Features=0x20100800 real memory = 2147483648 (2048 MB) Physical memory chunk(s): 0x0000000000001000 - 0x000000000009afff, 630784 bytes (154 pages) 0x0000000000ba0000 - 0x000000007c38ffff, 2071920640 bytes (505840 pages) avail memory = 2059055104 (1963 MB) Event timer "LAPIC" frequency 0 Hz quality 500 ACPI APIC Table: INTR: Adding local APIC 1 as a target FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs FreeBSD/SMP: 2 package(s) x 1 core(s) cpu0 (BSP): APIC ID: 0 cpu1 (AP): APIC ID: 1 APIC: CPU 0 has ACPI ID 0 APIC: CPU 1 has ACPI ID 1 x86bios: IVT 0x000000-0x0004ff at 0xffffff0000000000 x86bios: SSEG 0x010000-0x01ffff at 0xffffff800000d000 x86bios: EBDA 0x09f000-0x09ffff at 0xffffff000009f000 x86bios: ROM 0x0a0000-0x0effff at 0xffffff00000a0000 ULE: setup cpu 0 ULE: setup cpu 1 ACPI: RSDP 0xfbd40 00014 (v0 QEMU ) ACPI: RSDT 0x7fff0000 00034 (v1 QEMU QEMURSDT 00000001 QEMU 00000001) ACPI: FACP 0x7fff01b4 00074 (v1 QEMU QEMUFACP 00000001 QEMU 00000001) ACPI: DSDT 0x7fff0280 01DD4 (v1 BXPC BXDSDT 00000001 INTL 20090123) ACPI: FACS 0x7fff0240 00040 ACPI: SSDT 0x7fff2054 009E3 (v1 BXPC BXSSDT 00000001 INTL 20090123) ACPI: APIC 0x7fff2a38 000EA (v1 QEMU QEMUAPIC 00000001 QEMU 00000001) ACPI: HPET 0x7fff2b90 00038 (v1 QEMU QEMUHPET 00000001 QEMU 00000001) MADT: Found IO APIC ID 2, Interrupt 0 at 0xfec00000 ioapic0: Changing APIC ID to 2 ioapic0: Routing external 8259A's -> intpin 0 MADT: Interrupt override: source 0, irq 2 ioapic0: Routing IRQ 0 -> intpin 2 MADT: Interrupt override: source 5, irq 5 ioapic0: intpin 5 trigger: level MADT: Interrupt override: source 9, irq 9 ioapic0: intpin 9 trigger: level MADT: Interrupt override: source 10, irq 10 ioapic0: intpin 10 trigger: level MADT: Interrupt override: source 11, irq 11 ioapic0: intpin 11 trigger: level ioapic0 irqs 0-23 on motherboard cpu0 BSP: ID: 0x00000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 cmci: 0x00000000 random: io: nfslock: pseudo-device kbd: new array size 4 kbd1 at kbdmux0 mem: null: acpi0: on motherboard ioapic0: routing intpin 9 (ISA IRQ 9) to lapic 0 vector 48 acpi0: [MPSAFE] acpi0: [ITHREAD] acpi0: Power Button (fixed) acpi_bus_number: root bus has no _BBN, assuming 0 AcpiOsDerivePciId: \\_SB_.PCI0.PX13.P13C -> bus 0 dev 1 func 3 acpi_bus_number: root bus has no _BBN, assuming 0 AcpiOsDerivePciId: \\_SB_.PCI0.ISA_.P40C -> bus 0 dev 1 func 0 ACPI timer: 0/211 0/1431 0/166 0/168 0/38700 0/22874 0/2046 0/22171 0/204 0/579 -> 0 Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0 cpu0: on acpi0 cpu0: switching to generic Cx mode cpu1: on acpi0 pci_link0: Index IRQ Rtd Ref IRQs Initial Probe 0 10 N 0 5 10 11 Validation 0 10 N 0 5 10 11 After Disable 0 255 N 0 5 10 11 pci_link1: Index IRQ Rtd Ref IRQs Initial Probe 0 10 N 0 5 10 11 Validation 0 10 N 0 5 10 11 After Disable 0 255 N 0 5 10 11 pci_link2: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 5 10 11 Validation 0 11 N 0 5 10 11 After Disable 0 255 N 0 5 10 11 pci_link3: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 5 10 11 Validation 0 11 N 0 5 10 11 After Disable 0 255 N 0 5 10 11 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 hpet0: vendor 0x8086, rev 0x1, 100000000Hz 64bit, 3 timers, legacy route hpet0: t0: irqs 0x00000004 (0), 64bit, periodic hpet0: t1: irqs 0x00000004 (0), 64bit, periodic hpet0: t2: irqs 0x00000004 (0), 64bit, periodic Timecounter "HPET" frequency 100000000 Hz quality 900 ioapic0: routing intpin 2 (ISA IRQ 0) to lapic 0 vector 49 hpet0: [MPSAFE] hpet0: [FILTER] ioapic0: routing intpin 8 (ISA IRQ 8) to lapic 0 vector 50 hpet0: [MPSAFE] hpet0: [FILTER] Event timer "HPET" frequency 100000000 Hz quality 550 pcib0: port 0xcf8-0xcff on acpi0 ACPI: Found matching pin for 0.1.INTA at func 3: 9 pci_link0: BIOS IRQ 9 does not match initial IRQ 10 ACPI: Found matching pin for 0.1.INTD at func 2: 11 ACPI: Found matching pin for 0.3.INTA at func 0: 11 ACPI: Found matching pin for 0.4.INTA at func 0: 11 ACPI: Found matching pin for 0.5.INTA at func 0: 10 pci_link0: BIOS IRQ 10 for 0.5.INTA does not match previous BIOS IRQ 9 pci0: on pcib0 pci0: domain=0, physical bus=0 found-> vendor=0x8086, dev=0x1237, revid=0x02 domain=0, bus=0, slot=0, func=0 class=06-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0000, statreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) found-> vendor=0x8086, dev=0x7000, revid=0x00 domain=0, bus=0, slot=1, func=0 class=06-01-00, hdrtype=0x00, mfdev=1 cmdreg=0x0007, statreg=0x0200, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) found-> vendor=0x8086, dev=0x7010, revid=0x00 domain=0, bus=0, slot=1, func=1 class=01-01-80, hdrtype=0x00, mfdev=0 cmdreg=0x0001, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) map[20]: type I/O Port, range 32, base 0xc000, size 4, enabled found-> vendor=0x8086, dev=0x7020, revid=0x01 domain=0, bus=0, slot=1, func=2 class=0c-03-00, hdrtype=0x00, mfdev=0 cmdreg=0x0005, statreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=d, irq=11 map[20]: type I/O Port, range 32, base 0xc020, size 5, enabled pcib0: matched entry for 0.1.INTD (src \\_SB_.LNKD:0) pcib0: slot 1 INTD routed to irq 11 via \\_SB_.LNKD found-> vendor=0x8086, dev=0x7113, revid=0x03 domain=0, bus=0, slot=1, func=3 class=06-80-00, hdrtype=0x00, mfdev=0 cmdreg=0x0000, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=9 pcib0: matched entry for 0.1.INTA (src \\_SB_.LNKA:0) pcib0: slot 1 INTA routed to irq 9 via \\_SB_.LNKA found-> vendor=0x1013, dev=0x00b8, revid=0x00 domain=0, bus=0, slot=2, func=0 class=03-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0003, statreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) map[10]: type Prefetchable Memory, range 32, base 0xf0000000, size 25, enabled map[14]: type Memory, range 32, base 0xf2000000, size 12, enabled found-> vendor=0x8086, dev=0x100e, revid=0x03 domain=0, bus=0, slot=3, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0407, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 map[10]: type Memory, range 32, base 0xf2020000, size 17, enabled map[14]: type I/O Port, range 32, base 0xc040, size 6, enabled pcib0: matched entry for 0.3.INTA (src \\_SB_.LNKC:0) pcib0: slot 3 INTA routed to irq 11 via \\_SB_.LNKC found-> vendor=0x1274, dev=0x5000, revid=0x00 domain=0, bus=0, slot=4, func=0 class=04-01-00, hdrtype=0x00, mfdev=0 cmdreg=0x0001, statreg=0x0400, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x0c (3000 ns), maxlat=0x80 (32000 ns) intpin=a, irq=11 map[10]: type I/O Port, range 32, base 0xc100, size 8, enabled pcib0: matched entry for 0.4.INTA (src \\_SB_.LNKD:0) pcib0: slot 4 INTA routed to irq 11 via \\_SB_.LNKD found-> vendor=0x1af4, dev=0x1002, revid=0x00 domain=0, bus=0, slot=5, func=0 class=05-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0001, statreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=10 map[10]: type I/O Port, range 32, base 0xc200, size 5, enabled pcib0: matched entry for 0.5.INTA (src \\_SB_.LNKA:0) pcib0: slot 5 INTA routed to irq 9 via \\_SB_.LNKA isab0: at device 1.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc000-0xc00f at device 1.1 on pci0 ata0: on atapci0 ata0: reset tp1 mask=03 ostat0=50 ostat1=00 ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00 ata0: stat1=0x00 err=0x00 lsb=0xff msb=0xff ata0: reset tp2 stat0=50 stat1=00 devices=0x1 ioapic0: routing intpin 14 (ISA IRQ 14) to lapic 0 vector 51 ata0: [MPSAFE] ata0: [ITHREAD] ata1: on atapci0 ata1: reset tp1 mask=03 ostat0=00 ostat1=00 ata1: stat0=0x00 err=0x01 lsb=0x14 msb=0xeb ata1: stat1=0x00 err=0x00 lsb=0xff msb=0xff ata1: reset tp2 stat0=00 stat1=00 devices=0x10000 ioapic0: routing intpin 15 (ISA IRQ 15) to lapic 0 vector 52 ata1: [MPSAFE] ata1: [ITHREAD] uhci0: port 0xc020-0xc03f irq 11 at device 1.2 on pci0 ioapic0: routing intpin 11 (ISA IRQ 11) to lapic 0 vector 53 uhci0: [MPSAFE] uhci0: [ITHREAD] usbus0: controller did not stop usbus0: on uhci0 pci0: at device 1.3 (no driver attached) vgapci0: mem 0xf0000000-0xf1ffffff,0xf2000000-0xf2000fff at device 2.0 on pci0 em0: port 0xc040-0xc07f mem 0xf2020000-0xf203ffff irq 11 at device 3.0 on pci0 em0: [FILTER] em0: bpf attached em0: Ethernet address: 52:54:00:3d:e6:07 em0: Link is up 1000 Mbps Full Duplex pci0: at device 4.0 (no driver attached) pci0: at device 5.0 (no driver attached) atrtc0: port 0x70-0x71,0x72-0x77 irq 8 on acpi0 atrtc0: registered as a time-of-day clock (resolution 1000000us) atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 atkbd: the current kbd controller command byte 0061 atkbd: keyboard ID 0x41ab (2) kbd0 at atkbd0 kbd0: atkbd0, AT 101/102 (2), config:0x0, flags:0x3d0000 ioapic0: routing intpin 1 (ISA IRQ 1) to lapic 0 vector 54 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: unable to allocate IRQ psmcpnp0: irq 12 on acpi0 psm0: current command byte:0061 psm0: irq 12 on atkbdc0 ioapic0: routing intpin 12 (ISA IRQ 12) to lapic 0 vector 55 psm0: [GIANT-LOCKED] psm0: [ITHREAD] psm0: model IntelliMouse Explorer, device ID 4-00, 5 buttons psm0: config:00000000, flags:00000008, packet size:4 psm0: syncmask:08, syncbits:00 fdc0: port 0x3f2-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fdc0: does not respond device_attach: fdc0 attach returned 6 uart0: port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 ioapic0: routing intpin 4 (ISA IRQ 4) to lapic 0 vector 56 uart0: [FILTER] uart0: fast interrupt acpi0: wakeup code va 0xffffff8000112000 pa 0x4000 isa_probe_children: disabling PnP devices atkbdc: atkbdc0 already exists; skipping it atrtc: atrtc0 already exists; skipping it fdc: fdc0 already exists; skipping it sc: sc0 already exists; skipping it uart: uart0 already exists; skipping it isa_probe_children: probing non-PnP devices sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> sc0: fb0, kbd1, terminal emulator: scteken (teken terminal) vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 ppc0 failed to probe at irq 7 on isa0 uart1: failed to probe at port 0x2f8-0x2ff irq 3 on isa0 isa_probe_children: probing PnP devices Device configuration finished. Reducing kern.maxvnodes 132662 -> 100000 procfs registered Timecounter "TSC" frequency 2527057361 Hz quality -100 Starting kernel event timers: HPET @ 100Hz, LAPIC @ 128Hz lapic: Divisor 2, Frequency 500021395 Hz Event timer "LAPIC" is dead. Starting kernel event timers: HPET @ 400Hz, NONE @ 0Hz Timecounters tick every 10.000 msec vlan: initialized, using hash tables with chaining lo0: bpf attached Profiling kernel, textsize=4602064 [ffffffff8016be00..ffffffff805cf6d0] ata0: Identifying devices: 00000001 ata0: New devices: 00000001 ata0-master: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 wire usbus0: 12Mbps Full Speed USB v1.0 ad0: setting WDMA2 ad0: 10240MB at ata0-master WDMA2 ad0: 20971520 sectors [20805C/16H/63S] 16 sectors/interrupt 1 depth queue GEOM: new disk ad0 ad0: Intel check1 failed ugen0.1: at usbus0 uhub0: on usbus0 ad0: Adaptec check1 failed ad0: LSI (v3) check1 failed ad0: LSI (v2) check1 failed ad0: FreeBSD check1 failed ata1: Identifying devices: 00010000 ata1: New devices: 00010000 ata1-master: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=40 wire acd0: setting WDMA2 acd0: CDROM drive at ata1 as master acd0: read 689KB/s (689KB/s), 512KB buffer, WDMA2 acd0: Reads: acd0: Writes: acd0: Audio: play, 2 volume levels acd0: Mechanism: ejectable tray, unlocked acd0: Medium: no/blank disc ATA PseudoRAID loaded SMP: AP CPU #1 Launched! cpu1 AP: ID: 0x01000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 cmci: 0x00000000 ioapic0: routing intpin 4 (ISA IRQ 4) to lapic 1 vector 48 ioapic0: routing intpin 8 (ISA IRQ 8) to lapic 1 vector 49 ioapic0: routing intpin 11 (ISA IRQ 11) to lapic 1 vector 50 ioapic0: routing intpin 14 (ISA IRQ 14) to lapic 1 vector 51 WARNING: WITNESS option enabled, expect reduced performance. Root mount waiting for: usbus0 uhub0: 2 ports with 2 removable, self powered Trying to mount root from ufs:/dev/ad0s1a ct_to_ts([2010-06-23 20:42:33]) = 1277325753.000000000 start_init: trying /sbin/init From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 21:01:49 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64AF5106566C for ; Wed, 23 Jun 2010 21:01:49 +0000 (UTC) (envelope-from bw@exodus.desync.com) Received: from exodus.desync.com (desync.com [IPv6:2607:f178::165]) by mx1.freebsd.org (Postfix) with ESMTP id 27D1F8FC1E for ; Wed, 23 Jun 2010 21:01:48 +0000 (UTC) Received: from exodus.desync.com (localhost [127.0.0.1]) by exodus.desync.com (8.14.4/8.14.4) with ESMTP id o5NL1XWi011192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Jun 2010 17:01:33 -0400 (EDT) (envelope-from bw@exodus.desync.com) Received: (from bw@localhost) by exodus.desync.com (8.14.4/8.14.4/Submit) id o5NL1XOu011191; Wed, 23 Jun 2010 17:01:33 -0400 (EDT) (envelope-from bw) Date: Wed, 23 Jun 2010 17:01:33 -0400 From: ben wilber To: d@delphij.net Message-ID: <20100623210133.GA10694@exodus.desync.com> References: <20100623164401.GA7914@exodus.desync.com> <4C2272E5.2090901@delphij.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C2272E5.2090901@delphij.net> X-Angst-Level: High Cc: freebsd-current Subject: Re: zfs panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 21:01:49 -0000 On Wed, Jun 23, 2010 at 01:47:33PM -0700, Xin LI wrote: > > > > panic: _sx_xlock_hard: recursed on non-recursive sx buf_hash_table.ht_locks[i].ht_lock @ /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/c > > ommon/fs/zfs/arc.c:1626 > > Any chance to obtain a backtrace for the panic? >From r209229: db:0:kdb.enter.default> bt Tracing pid 3233 tid 100396 td 0xffffff013600f000 kdb_enter() at kdb_enter+0x3d panic() at panic+0x1c8 _sx_xlock_hard() at _sx_xlock_hard+0x93 _sx_xlock() at _sx_xlock+0xaa arc_buf_remove_ref() at arc_buf_remove_ref+0x7b dbuf_rele() at dbuf_rele+0x15d zfs_freebsd_reclaim() at zfs_freebsd_reclaim+0xe1 VOP_RECLAIM_APV() at VOP_RECLAIM_APV+0xe8 vgonel() at vgonel+0x186 vnlru_free() at vnlru_free+0x2f4 vfs_lowmem() at vfs_lowmem+0x31 kmem_malloc() at kmem_malloc+0x12c page_alloc() at page_alloc+0x18 keg_alloc_slab() at keg_alloc_slab+0xe6 keg_fetch_slab() at keg_fetch_slab+0x18e zone_fetch_slab() at zone_fetch_slab+0x4f uma_zalloc_arg() at uma_zalloc_arg+0x56b arc_get_data_buf() at arc_get_data_buf+0xaa arc_read_nolock() at arc_read_nolock+0x1cb arc_read() at arc_read+0x71 dbuf_read() at dbuf_read+0x4ea dmu_buf_hold_array_by_dnode() at dmu_buf_hold_array_by_dnode+0x119 dmu_buf_hold_array() at dmu_buf_hold_array+0x57 dmu_read_uio() at dmu_read_uio+0x3f zfs_freebsd_read() at zfs_freebsd_read+0x558 VOP_READ_APV() at VOP_READ_APV+0xe2 vn_read() at vn_read+0x1d0 dofileread() at dofileread+0x97 kern_preadv() at kern_preadv+0x6a pread() at pread+0x52 syscallenter() at syscallenter+0x217 syscall() at syscall+0x39 Xfast_syscall() at Xfast_syscall+0xe1 --- syscall (475, FreeBSD ELF64, pread), rip = 0x80100c14c, rsp = 0x7fffffbfeb48, rbp = 0x2 --- Thanks. From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 01:15:14 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8FE61065672; Thu, 24 Jun 2010 01:15:14 +0000 (UTC) (envelope-from faber@zod.isi.edu) Received: from zod.isi.edu (zod.isi.edu [128.9.168.221]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA038FC0A; Thu, 24 Jun 2010 01:15:14 +0000 (UTC) Received: from zod.isi.edu (localhost [127.0.0.1]) by zod.isi.edu (8.14.4/8.14.4) with ESMTP id o5O1FAUT038142; Wed, 23 Jun 2010 18:15:10 -0700 (PDT) (envelope-from faber@zod.isi.edu) Received: (from faber@localhost) by zod.isi.edu (8.14.4/8.14.4/Submit) id o5O1F95A038141; Wed, 23 Jun 2010 18:15:09 -0700 (PDT) (envelope-from faber) Date: Wed, 23 Jun 2010 18:15:09 -0700 From: Ted Faber To: Ryan Stone Message-ID: <20100624011509.GI31578@zod.isi.edu> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dp9QYJgVRVEW2bsm" Content-Disposition: inline In-Reply-To: <20100623154531.GB31578@zod.isi.edu> User-Agent: Mutt/1.4.2.3i X-url: http://www.isi.edu/~faber Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Andriy Gapon , Hans Petter Selasky Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 01:15:14 -0000 --dp9QYJgVRVEW2bsm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 23, 2010 at 08:45:31AM -0700, Ted Faber wrote: > On Wed, Jun 23, 2010 at 11:03:45AM -0400, Ryan Stone wrote: > > I have to admit that I'm more than a little surprised that this > > problem does not affect modules that in src, but maybe that's because > > I don't know all that much about FreeBSD's build infrastructure. Are > > the src modules being linked with a linker script that is not being > > used for out-of-src modules? Are the people affected by this not > > using the base compiler to build ports?(I see that this affects PC-BSD > > as well, and I'd be a little surprised to learn that it wasn't using > > the base compiler). >=20 > I had the problem on i386, base compiler. It also affects the sample > module in /usr/share/examples/kld/cdev/ which also uses the base > compiler, if you want a case w/o the ports infrastructure. Just so it gets into Google: Andriy Gapon went a few rounds of debugging with me and it turns out that the problem was that the binutils port had installed a loader in /usr/local/bin/ld that was incompatible with the module system. (/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr commands from cupsd, though it's evidently a bit of a dangerous idea.) Basically if the linker you're using to compile isn't /usr/bin/ld you may have problems building kernel modules. The easiest way to detect this is to get the -v output (version number) from the linker in use and compare it against /usr/bin/ld . I was able to do that by adding LDFLAGS +=3D -v to the Makefile in question. Thanks Andriy! --=20 Ted Faber http://www.isi.edu/~faber PGP: http://www.isi.edu/~faber/pubkeys.= asc Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#= SIG --dp9QYJgVRVEW2bsm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwisZ0ACgkQaUz3f+Zf+Xs5SQCgxZaxZsOwnaWgUBtmXj2qcclK vnQAoKEzudwhmeqM4zGw8DQc58il68xd =ht3Z -----END PGP SIGNATURE----- --dp9QYJgVRVEW2bsm-- From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 01:36:22 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD4A3106566B for ; Thu, 24 Jun 2010 01:36:22 +0000 (UTC) (envelope-from eng.mufic@gmail.com) Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by mx1.freebsd.org (Postfix) with ESMTP id 399E28FC14 for ; Thu, 24 Jun 2010 01:36:21 +0000 (UTC) Received: by wwb24 with SMTP id 24so1258304wwb.13 for ; Wed, 23 Jun 2010 18:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=X5SpNat18Q1kKLu4bLwAyh6YP9gvizkSmJOj96JmJXs=; b=cbG4cxNMDNif5456VUkQ7KrAaQaKbvSuWSu/8eodMoz1+yXRtp42qSCq+TIuE2oouQ ZVTnVHHinqSS54ZoC18AqDOf0PvK+cvTNAaL3rYZRXqUWbLW3wv7qUVOaX1uWFwVgo5z IOF8KWqGTOikaRxJKj8cTY04gtbckZ3Oi3hm8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=SVn8ZJKdby2PqPKxJpdt8efGsRzanZj5310sNv8SaI9w2YiwyTZ83OGlNK0CHrENM5 0zZ2rByC72PHqIs1I3QLMiaD5Q4kM13f67QkP3k+im+spTOU0eq5di7hUBkqpXoNRDlC Zwj4mYg5o1YoCJKP3fYzXdH531nG6u21u2Cuo= MIME-Version: 1.0 Received: by 10.216.160.70 with SMTP id t48mr3208318wek.82.1277343381040; Wed, 23 Jun 2010 18:36:21 -0700 (PDT) Sender: eng.mufic@gmail.com Received: by 10.216.52.145 with HTTP; Wed, 23 Jun 2010 18:36:20 -0700 (PDT) In-Reply-To: <20100612100006.000073fa@unknown> References: <20100612100006.000073fa@unknown> Date: Thu, 24 Jun 2010 04:36:20 +0300 X-Google-Sender-Auth: 47B02MGKjlsAQDkr6y-bWgzuzVg Message-ID: From: Mohammed Farrag To: Bruce Cran Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Chargen , freebsd-hackers@freebsd.org, Matt Thyer , freebsd-current@freebsd.org, Mohammed@freebsd.org Subject: Re: I need reply in Embedded FreeBSD Kernel Theme X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 01:36:22 -0000 hi sorry for being late in reply but I had some problems in the last week. I hope u still remeber what I was talking about :) @chargen Thanx for ur reply. Embedded computer systems permeate all aspects of our daily lives. Alarm clocks, coffee makers, digital watches, cell phones, and automobiles are just a few of the devices that make use of embedded systems. The design and development of such systems is unique, because the design constraints are different for each system. I supposed a new design for reducing the size of the kernel to be able to work in such an environment which has some constraints make it does not have the ability to get large memory, large storage devices or others. ///////////////////////////// as far as your document goes: "We will unload all the drivers that indicated with zeros in the module metadata file. That would make the OS to be a few of Megabytes." unload? what is the logic here? I'm sorry but what is the real gain here, ////////////////////// The configuration file is dependent on the kernel (which is included as a compiled kernel). If I unload these unneeded drivers, I decrease the size of the compiled kernel So it will have the ability to work in more constrained environment and that is suitable to work for Operating Systems for small chips for embedded systems. As the Internet grew, the requirements of embedded systems also began to grow in complexity. In addition to solving classic embedded systems problems, system designers were required to add connectivity for sending and receiving data or providing an automated method for software upgrades. Rather than increase the development effort, system designers have moved toward using third-party hardware and evaluating open source software. Thanx Chargen @ andrew Thanx for your reply. I appreciate your effort to download the document. Regarding the uploading of the document to that site, I am sorry for that but I tried to attach it with the email but it was refused because its size was too large. I did not send it in the text part because the text format and tables will be lost. I am sorry for that. ///////////////////////////////////////////////////////// After a couple of quick readings, I'm not sure I correctly understand what you plan to achieve. It sounds like you are trying to achive something like hardware specific dynamic module loading (like in Solaris, for example), but then it also sounds like you are trying to build a kernel based on a generated config which somehow involves building a tiny binary hardware profile built from POST data. Are you compiling a kernel at some point rather than just generating a loader.conf for modules in order to minimise the running size? //////////////////////////////////////////////////////// This approach will combine the two both. It will build a kernel based on a generated config which somehow involves building a tiny binary hardware profile built from POST data. It also will use hardware specific dynamic module loading because I don't have to load all the drivers for devices connected to the machine. I will use this dynamic module loading at the start-up only not at the run time because some considerations of the embedded systems for chips not being to load modules and change how to work at run time. that would make power problems. //////////////////////////////////////////////////////// I was most confused by We will unload all the drivers that indicated with zeros in the > module metadata file. That would make the OS to be a > few of Megabytes. > Whether you are compiling a kernel for the (chosen) hardware based on a generated kernel or loader config, I don't see a sensible case in which you would ever need to "unload" any driver. /////////////////////////////////////////////////////////////// yeah I know it is not sensible but I wrote it as a result of what I supposed before so it has no meaning. just a result to clarify what I reduced here. Thanx for ur sympathy and I will be glad to send you my next file to get ur comments about. //////////////////////////////////////////////////////////////// As much fun as it is spending hours manually tweaking and testing a kernel config for each system and deciding what modules to use, I like the idea of a one time guided process based on accurately identified hardware to build an optimal kernel, so I hope that's what you're proposing. ////////////////////////////////////////////////////////////////// Actually, I am deciding many time guided process based on accurately identified hardware to build an optimal kernel because I think this is more dynamic for considerations of changing the purpose of the embedded system. I mean sometimes u may need to perform deterministic operation in this boot so u do not have to load all drivers which there will be a lot of unneeded drivers of them at this boot process. I will determine the dependencies to provide optimal kernel. Thanx Andrew @ Matt Thanx for ur reply Matt. ///////////////////////////////////////////////////// FreeBSD is already a very modular system and the traditional way (a traditional way) to build for embedded systems is to follow the NanoBSD build method (tools included in the source tree) with a stripped down kernel in which you only load the modules your hardware requires using the FreeBSD loader (or after the initial boot). //////////////////////////////////////////////////// yeah I read about that. My mentor suggested that before and my idea is very close to NanoBSD but I don't know if the freebsd loader will load the moduls based on the hardware requirements or user requirements. I will be glad to reply me. //////////////////////////////////////////////// However my Soekris net4801 board still takes about 2.5 minutes to boot and I think time could be saved by parallel probing of hardware where possible. //////////////////////////////////////////////////// I think parallel probing is not providing in many boards. It's supported for the new borders only (correct me if I am wrong). I have to develop something which can be used in most of embedded systems. /////////////////////////////////////////////////// I'd vote for more work on FreeBSD's existing boot method rather than an entirely new implementation. What problem are you trying to solve Mohammed ? ////////////////////////////// I am not going to change in the main boot process. I am only changing the how of including the kernel in the configuration file. that is it and everything will be done as it is in the current freebsd. no more. That would save space and that is what I need to reduce the size of kernel in memory. @ bruce Thanx for ur reply. From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 07:23:42 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 525AA1065674; Thu, 24 Jun 2010 07:23:42 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id A5AE88FC0A; Thu, 24 Jun 2010 07:23:41 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id d23so1366885fga.13 for ; Thu, 24 Jun 2010 00:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=Q2iSCSQC9mSdOqAwFZbZlxA4ONqUc/1iUsV1QipqdEY=; b=MfYmk7bp+RRanpfyjxX/LCWVV2ZkYNQNiNEMly1QaxxzmenONP84piBCdYWd2vS7PY yuZKBkeR8m1WbT3faB1iUybpMEPfXsuJsa+KsF/fV69meexTGVwn2kFkQvc1cwnT0ui0 O103XeZggIqml0g61WEeBZw+lx4nhdMdf525E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=WaxrrIPGXu9C24ix1OTc3dLWQM5KwqZWSafLv7VkGKt+/n6uNu2wL/tI/VGekBBXgZ PjFGWjcxJrd25l1lRL8xRNZcSjzexyl2ohOvvvFaazSjV87rpSd2WQ1SjPHyzoHAkC8k OUAPtWAlpABMfE/yIpXI3wJK0HEziEmQPy5WI= Received: by 10.87.70.19 with SMTP id x19mr14931955fgk.14.1277364220283; Thu, 24 Jun 2010 00:23:40 -0700 (PDT) Received: from ernst.jennejohn.org (p578E35A0.dip.t-dialin.net [87.142.53.160]) by mx.google.com with ESMTPS id 18sm14769353fks.35.2010.06.24.00.23.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 24 Jun 2010 00:23:39 -0700 (PDT) Date: Thu, 24 Jun 2010 09:23:37 +0200 From: Gary Jennejohn To: Ted Faber Message-ID: <20100624092337.6bed1f45@ernst.jennejohn.org> In-Reply-To: <20100624011509.GI31578@zod.isi.edu> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 07:23:42 -0000 On Wed, 23 Jun 2010 18:15:09 -0700 Ted Faber wrote: > (/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr > commands from cupsd, though it's evidently a bit of a dangerous idea.) > [trimmed Cc] I use cupsd and have these settings to get around using the base system lp stuff: in /etc/src.conf - WITHOUT_LPR=yes and these symbolic links in /usr/bin lrwxr-xr-x 1 root wheel 17 Mar 18 2009 /usr/bin/lp -> /usr/local/bin/lp lrwxr-xr-x 1 root wheel 24 Mar 18 2009 /usr/bin/lpoptions -> /usr/local/bin/lpoptions lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpq -> /usr/local/bin/lpq lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpr -> /usr/local/bin/lpr lrwxr-xr-x 1 root wheel 19 Mar 18 2009 /usr/bin/lprm -> /usr/local/bin/lprm lrwxr-xr-x 1 root wheel 21 Mar 18 2009 /usr/bin/lpstat -> /usr/local/bin/lpstat and /usr/bin is _before_ /usr/local/bin in my PATH. --- Gary Jennejohn From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 08:26:19 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DE43106566B; Thu, 24 Jun 2010 08:26:19 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirj.bris.ac.uk (dirj.bris.ac.uk [137.222.10.78]) by mx1.freebsd.org (Postfix) with ESMTP id EC19C8FC0C; Thu, 24 Jun 2010 08:26:18 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirj.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORhlJ-0005jr-Nc; Thu, 24 Jun 2010 09:26:17 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORhlJ-0000GX-H4; Thu, 24 Jun 2010 09:26:17 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5O8QHRw009301; Thu, 24 Jun 2010 09:26:17 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5O8QHjg009300; Thu, 24 Jun 2010 09:26:17 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 24 Jun 2010 09:26:17 +0100 From: Anton Shterenlikht To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100624082616.GA9272@mech-cluster241.men.bris.ac.uk> References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <86eig0filf.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <86eig0filf.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@freebsd.org, Anton Shterenlikht , freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 08:26:19 -0000 On Mon, Jun 21, 2010 at 06:36:44PM +0200, Dag-Erling Sm=F8rgrav wrote: > Anton Shterenlikht writes: > > I've r209203 kernel on ia64 box. > > Now I'm trying to rebuild world to r209240. > > I get these errors. >=20 > There is absolutely nothing between those two revisions that would > explain the errors you're getting. Are you absolutely sure those are > the correct revision numbers? Have you tried checking out a clean copy > of r209203 and building + installing that before trying to build r209240 > again? sorry for the delay. I got a clean copy of r209203, and got the same error on buildworld: cc -static -o rescue rescue.o cat.lo chflags.lo chio.lo chmod.lo cp.lo date= =2Elo dd.lo df.lo echo.lo ed.lo exp .lo getfacl.lo hostname.lo kenv.lo kill= =2Elo ln.lo ls.lo mkdir.lo mv.lo pkill.lo ps.lo pwd.lo realpath.lo rm.l rm= dir.lo setfacl.lo sh.lo stty.lo sync.lo test.lo rcp.lo csh.lo atacontrol.lo= badsect.lo camcontrol.lo ccdc nfig.lo clri.lo devfs.lo dmesg.lo dump.lo du= mpfs.lo dumpon.lo fsck.lo fsck_ffs.lo fsck_msdosfs.lo fsdb.lo fs rand.lo gb= de.lo geom.lo ifconfig.lo init.lo kldconfig.lo kldload.lo kldstat.lo kldunl= oad.lo ldconfig.lo md5. o mdconfig.lo mdmfs.lo mknod.lo mount.lo mount_cd96= 60.lo mount_msdosfs.lo mount_nfs.lo mount_ntfs.lo mount_n llfs.lo mount_udf= =2Elo mount_unionfs.lo newfs.lo newfs_msdos.lo nos-tun.lo ping.lo reboot.lo= restore.lo rcorde .lo route.lo routed.lo rtquery.lo rtsol.lo savecore.lo s= pppcontrol.lo swapon.lo sysctl.lo tunefs.lo umount.l atmconfig.lo ping6.lo= ipf.lo zfs.lo zpool.lo mca.lo dhclient.lo head.lo mt.lo sed.lo tail.lo tee= =2Elo gzip.lo bzip2.lo xz.lo tar.lo vi.lo id.lo chroot.lo chown.lo /usr/obj= /usr/src/rescue/rescue/../librescue/exec.o /usr obj/usr/src/rescue/rescue/.= =2E/librescue/getusershell.o /usr/obj/usr/src/rescue/rescue/../librescue/lo= gin_clas .o /usr/obj/usr/src/rescue/rescue/../librescue/popen.o /usr/obj/us= r/src/rescue/rescue/../librescue/rcmdsh.o usr/obj/usr/src/rescue/rescue/..= /librescue/sysctl.o /usr/obj/usr/src/rescue/rescue/../librescue/system.o -l= c ypt -ledit -lkvm -ll -ltermcap -lutil -lalias -lcam -lcurses -ldevstat -l= ipsec -lipx -lzfs -lnvpair -luutil lavl -lgeom -lbsdxml -ljail -lkiconv -l= md -lreadline -lsbuf -lufs -lz -lbz2 -llzma -larchive -lcrypto -lm xz.lo(.text+0x5202): In function `hardware_init': : undefined reference to `lzma_physmem' # svn info Path: . URL: svn://svn.freebsd.org/base/head Repository Root: svn://svn.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 209203 Node Kind: directory Schedule: normal Last Changed Author: edwin Last Changed Rev: 209201 Last Changed Date: 2010-06-15 12:37:33 +0100 (Tue, 15 Jun 2010) many thanks for your help anton --=20 Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 08:30:40 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22462106566B for ; Thu, 24 Jun 2010 08:30:40 +0000 (UTC) (envelope-from dalroi@solfertje.student.utwente.nl) Received: from solfertje.student.utwente.nl (solfertje.student.utwente.nl [130.89.167.40]) by mx1.freebsd.org (Postfix) with ESMTP id C79258FC13 for ; Thu, 24 Jun 2010 08:30:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by solfertje.student.utwente.nl (Postfix) with SMTP id 387148063 for ; Thu, 24 Jun 2010 10:30:38 +0200 (CEST) Received: from hollewijn.internal (hollewijn.internal [10.236.150.4]) by solfertje.student.utwente.nl (Postfix) with ESMTP id 591D78061; Thu, 24 Jun 2010 10:30:27 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Alban Hertroys In-Reply-To: <20100624092337.6bed1f45@ernst.jennejohn.org> Date: Thu, 24 Jun 2010 10:30:26 +0200 Content-Transfer-Encoding: 8bit Message-Id: <6E6E5D74-018C-4E65-80BD-BC9E5A71D4F8@solfertje.student.utwente.nl> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> To: gljennjohn@googlemail.com X-Mailer: Apple Mail (2.1081) X-DSPAM-Result: Innocent X-DSPAM-Processed: Thu Jun 24 10:30:37 2010 X-DSPAM-Confidence: 1.0000 X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 909,4c2317ad286211131610927 X-DSPAM-Factors: 27, References*<201006230852.26536.hselasky, 0.40000, using+the, 0.40000, /usr/local/bin, 0.40000, From*Alban, 0.40000, 09+0700, 0.40000, system+>, 0.40000, References*c2i.net>+<4C21B170.2030903, 0.40000, Subject*FreeBSD+8.1, 0.40000, Mime-Version*Message, 0.40000, 18+Mar, 0.40000, 18+Mar, 0.40000, an, 0.40000, Cc*isi.edu>, 0.40000, from, 0.40000, I+guess, 0.40000, easier, 0.40000, of, 0.40000, of, 0.40000, References*icyb.net.ua>, 0.40000, References*icyb.net.ua>, 0.40000, though+it's, 0.40000, Message-Id*80BD, 0.40000, Subject*RC1+(solved)], 0.40000, Received*ESMTP, 0.40000, system+(7, 0.40000, them?, 0.40000, preceeds, 0.40000 Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Ted Faber Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 08:30:40 -0000 On 24 Jun 2010, at 9:23, Gary Jennejohn wrote: > On Wed, 23 Jun 2010 18:15:09 -0700 > Ted Faber wrote: > >> (/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr >> commands from cupsd, though it's evidently a bit of a dangerous idea.) >> > [trimmed Cc] > > I use cupsd and have these settings to get around using the base system > lp stuff: > > in /etc/src.conf - WITHOUT_LPR=yes > > and these symbolic links in /usr/bin > lrwxr-xr-x 1 root wheel 17 Mar 18 2009 /usr/bin/lp -> /usr/local/bin/lp > lrwxr-xr-x 1 root wheel 24 Mar 18 2009 /usr/bin/lpoptions -> /usr/local/bin/lpoptions > lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpq -> /usr/local/bin/lpq > lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpr -> /usr/local/bin/lpr > lrwxr-xr-x 1 root wheel 19 Mar 18 2009 /usr/bin/lprm -> /usr/local/bin/lprm > lrwxr-xr-x 1 root wheel 21 Mar 18 2009 /usr/bin/lpstat -> /usr/local/bin/lpstat > > and /usr/bin is _before_ /usr/local/bin in my PATH. Wouldn't it be easier to alias those commands instead of physically replacing them? In my .tcshrc I have: alias lp /usr/local/bin/lp alias lpq /usr/local/bin/lpq alias lpr /usr/local/bin/lpr alias lprm /usr/local/bin/lprm I only have /usr/local/bin/lpoptions on my system (7-STABLE), so I guess that's exclusive to CUPS, hence no need for me to alias it. Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. !DSPAM:909,4c2317ad286211131610927! From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 08:36:38 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DCC9106566C; Thu, 24 Jun 2010 08:36:38 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 43D9C8FC0C; Thu, 24 Jun 2010 08:36:38 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORhvI-0005nm-UA; Thu, 24 Jun 2010 09:36:37 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORhvI-0005Cs-Je; Thu, 24 Jun 2010 09:36:36 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5O8aaZE009371; Thu, 24 Jun 2010 09:36:36 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5O8aZIx009370; Thu, 24 Jun 2010 09:36:35 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 24 Jun 2010 09:36:35 +0100 From: Anton Shterenlikht To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86d3vhomot.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Marcel Moolenaar , Anton Shterenlikht , freebsd-ia64@freebsd.org, freebsd-current@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 08:36:38 -0000 On Wed, Jun 23, 2010 at 04:20:18PM +0200, Dag-Erling Smørgrav wrote: > Anton Shterenlikht writes: > > I think it's possible that at some point, in anger, I did "make > > installworld" after a failed, or otherwise interrupted "make > > buildworld". Perhaps I got an inconsistent set of binaries as a > > result... Would that explain an error like this? > > No, because at this point buildworld is using the toolchain and > libraries that it built earlier. sorry for the delay On a clean copy of r209203 > Can you do > > % find /usr/obj/usr/src -name liblzma.a > > There should be at least one in /usr/obj/usr/src/lib/liblzma and one in > /usr/obj/usr/src/tmp/usr/lib, and they should be identical. seems so: # find /usr/obj/usr/src -name liblzma.a /usr/obj/usr/src/tmp/usr/lib/liblzma.a /usr/obj/usr/src/lib/liblzma/liblzma.a # diff /usr/obj/usr/src/tmp/usr/lib/liblzma.a /usr/obj/usr/src/lib/liblzma/liblzma.a # > Next, do > > % nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem > > and show us the result. # nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem hardware_physmem.o: 0000000000000000 T lzma_physmem U lzma_tuklib_physmem tuklib_physmem.o: 0000000000000000 T lzma_tuklib_physmem # > While you're at it, do this as well: > > % nm /usr/lib/liblzma.a | grep physmem # nm /usr/lib/liblzma.a | grep physmem nm: '/usr/lib/liblzma.a': No such file # Did you mean /usr/local/lib/liblzma.a ? # nm /usr/local/lib/liblzma.a|grep physmem # On my other 2 ia64 boxes, where I don't have this problem, the output of the last command is the same. many thanks anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 08:38:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 968FF106566C; Thu, 24 Jun 2010 08:38:43 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id E7F1D8FC08; Thu, 24 Jun 2010 08:38:42 +0000 (UTC) Received: by fxm7 with SMTP id 7so4224021fxm.13 for ; Thu, 24 Jun 2010 01:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=ho6qVI2+3uWqYx5NAlOR2f6c+yRbWbK6p9vpCQ5BSs8=; b=kAsArPprJi2AgSVV5y7pp+kc55oOCoXSaCmr7mabXuXuP9KJkX8tJkvY4Xc4yuhpuC T86fF6Q1oA6POfqfuyIqcweSaL/nEpnY6bhxfUFCT/Qbg6tSACFx8ChxxOm5MB2vfVBv Eh52K8pYmSk2HEdkDrVYtTXeTqRGW3Uhg6LsM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=PauUETJ7LYXYpAAfdeUSBFFYMvxI29n80aX0//4iWIJilWCog25oM3nGBiqsn/YwA8 XNqsRFaMPrhNqnK5jvZEzvSx9PTOegQt+6P32cEZ4qeiJzKCIDnJ58bliSGdp59TcqWO wi398KxvUtH9oA9XUb1SYtWDXxxT0mKpCZzuA= Received: by 10.87.2.15 with SMTP id e15mr14897944fgi.23.1277368721734; Thu, 24 Jun 2010 01:38:41 -0700 (PDT) Received: from ernst.jennejohn.org (p578E35A0.dip.t-dialin.net [87.142.53.160]) by mx.google.com with ESMTPS id k29sm14900412fkk.45.2010.06.24.01.38.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 24 Jun 2010 01:38:41 -0700 (PDT) Date: Thu, 24 Jun 2010 10:38:39 +0200 From: Gary Jennejohn To: Alban Hertroys Message-ID: <20100624103839.56d77563@ernst.jennejohn.org> In-Reply-To: <6E6E5D74-018C-4E65-80BD-BC9E5A71D4F8@solfertje.student.utwente.nl> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <6E6E5D74-018C-4E65-80BD-BC9E5A71D4F8@solfertje.student.utwente.nl> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Ted Faber Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 08:38:43 -0000 On Thu, 24 Jun 2010 10:30:26 +0200 Alban Hertroys wrote: > On 24 Jun 2010, at 9:23, Gary Jennejohn wrote: > > > On Wed, 23 Jun 2010 18:15:09 -0700 > > Ted Faber wrote: > > > >> (/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr > >> commands from cupsd, though it's evidently a bit of a dangerous idea.) > >> > > [trimmed Cc] > > > > I use cupsd and have these settings to get around using the base system > > lp stuff: > > > > in /etc/src.conf - WITHOUT_LPR=yes > > > > and these symbolic links in /usr/bin > > lrwxr-xr-x 1 root wheel 17 Mar 18 2009 /usr/bin/lp -> /usr/local/bin/lp > > lrwxr-xr-x 1 root wheel 24 Mar 18 2009 /usr/bin/lpoptions -> /usr/local/bin/lpoptions > > lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpq -> /usr/local/bin/lpq > > lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpr -> /usr/local/bin/lpr > > lrwxr-xr-x 1 root wheel 19 Mar 18 2009 /usr/bin/lprm -> /usr/local/bin/lprm > > lrwxr-xr-x 1 root wheel 21 Mar 18 2009 /usr/bin/lpstat -> /usr/local/bin/lpstat > > > > and /usr/bin is _before_ /usr/local/bin in my PATH. > > > Wouldn't it be easier to alias those commands instead of physically replacing them? > In my .tcshrc I have: > > alias lp /usr/local/bin/lp > alias lpq /usr/local/bin/lpq > alias lpr /usr/local/bin/lpr > alias lprm /usr/local/bin/lprm > > I only have /usr/local/bin/lpoptions on my system (7-STABLE), so I guess that's exclusive to CUPS, hence no need for me to alias it. > That's a valid option, of course. My thought was that the base lp isn't being installed anyway so it's just as simple to use symbolic links. -- Gary Jennejohn From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 08:40:02 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A65C21065686; Thu, 24 Jun 2010 08:40:02 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id F3EBB8FC17; Thu, 24 Jun 2010 08:40:01 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so1410655fgb.13 for ; Thu, 24 Jun 2010 01:40:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=rI+CN0Xvf0lLktdVKBc1hEm21c0Gd2+laUl3GG2tf9M=; b=mX49cMipIqU+uBQQj3CY7k/nzzlUJsRH+9gJ01/m5tXOqNH3ITEqroF0xU05vEH3SN +XyS2bQjAtCwDc9STYYJLT8+yPd0jgCBRxpuAMGvrnmCnRhG5n+Qn4gEQ+xzNfPuNLt8 cARCwFtmJ05MvT6quUTC4Xr6okEvA/dqeV67o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=OJSQRCJ7VOh8iDSa0JDfrWnR7yXrlAqtFOexgh2pBgfApdYx3iHNROjntHNt+MiMGp WFHTDjxViG+eMrHJO3giOhEaUGTmhhPPieWzmIpxap9wkphsk8AiDVKzdvjB7LLnvKOn AgWqYPdFk6fHZxyL0wvRoTl2o2kA5SAXwKUsw= MIME-Version: 1.0 Received: by 10.239.192.74 with SMTP id d10mr685595hbi.74.1277368800631; Thu, 24 Jun 2010 01:40:00 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Thu, 24 Jun 2010 01:40:00 -0700 (PDT) In-Reply-To: <20100624092337.6bed1f45@ernst.jennejohn.org> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> Date: Thu, 24 Jun 2010 09:40:00 +0100 Message-ID: From: Tom Evans To: gljennjohn@googlemail.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Ted Faber Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 08:40:02 -0000 On Thu, Jun 24, 2010 at 8:23 AM, Gary Jennejohn wrote: > On Wed, 23 Jun 2010 18:15:09 -0700 > Ted Faber wrote: > >> (/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr >> commands from cupsd, though it's evidently a bit of a dangerous idea.) >> > [trimmed Cc] > > I use cupsd and have these settings to get around using the base system > lp stuff: > > in /etc/src.conf - WITHOUT_LPR=3Dyes > > and these symbolic links in /usr/bin > lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A017 Mar 18 =C2=A02= 009 /usr/bin/lp -> /usr/local/bin/lp > lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A024 Mar 18 =C2=A02= 009 /usr/bin/lpoptions -> /usr/local/bin/lpoptions > lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A018 Mar 18 =C2=A02= 009 /usr/bin/lpq -> /usr/local/bin/lpq > lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A018 Mar 18 =C2=A02= 009 /usr/bin/lpr -> /usr/local/bin/lpr > lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A019 Mar 18 =C2=A02= 009 /usr/bin/lprm -> /usr/local/bin/lprm > lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A021 Mar 18 =C2=A02= 009 /usr/bin/lpstat -> /usr/local/bin/lpstat > > and /usr/bin is _before_ /usr/local/bin in my PATH. > > =C2=A0--- > Gary Jennejohn I also have this in make.conf: CUPS_OVERWRITE_BASE=3Dyes WITHOUT_LPR=3Dyes which print/cups-base uses to do make any lpr related binaries in /usr/bin non-executable, so they are skipped over and the cups specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just stops LPR being built by buildworld. Cheers Tom From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 08:47:45 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72D6D1065674 for ; Thu, 24 Jun 2010 08:47:45 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 02A5D8FC1E for ; Thu, 24 Jun 2010 08:47:44 +0000 (UTC) Received: by fxm7 with SMTP id 7so4231674fxm.13 for ; Thu, 24 Jun 2010 01:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=4IwKq2NMxIr7d7STX/3YPM0KnxGd/KNA6gBBzXi0J/4=; b=o1ng0B95Qbr9Y52v9MihEcEGm/mrXhlMpYSAGNBVgDyc/oxuboiSSwUY7BUYKadUzv An2raRnGpKNZ2D+Ang7LiJzkXCXHMQzreswV86NoJ1X07OotUQfjjcUiK893pcmYRkrp JTXM93CHed+PooyEfJs/oiQJXfeurqUC/BvEk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=JNBVHcqV4k6HNlio9TVg0Sig0WaoGFXF/Uz+taRDwH4eeihjwdcvQV6t0uBgqGl2LP +fSpt5t+uuNE6eM8dPWVAETOTHj6S/WHux1yh6FZsLdQZp2z41C1hEv1J/91AG5qB+sY 0I1/bRmt9cRvRb6vJoePFZ8WiDaaOUE72hwqM= MIME-Version: 1.0 Received: by 10.239.133.6 with SMTP id 6mr701044hbt.130.1277369263681; Thu, 24 Jun 2010 01:47:43 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Thu, 24 Jun 2010 01:47:43 -0700 (PDT) In-Reply-To: <20100623210133.GA10694@exodus.desync.com> References: <20100623164401.GA7914@exodus.desync.com> <4C2272E5.2090901@delphij.net> <20100623210133.GA10694@exodus.desync.com> Date: Thu, 24 Jun 2010 09:47:43 +0100 Message-ID: From: Tom Evans To: ben wilber Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current , d@delphij.net Subject: Re: zfs panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 08:47:45 -0000 On Wed, Jun 23, 2010 at 10:01 PM, ben wilber wrote: > On Wed, Jun 23, 2010 at 01:47:33PM -0700, Xin LI wrote: >> > >> > panic: _sx_xlock_hard: recursed on non-recursive sx buf_hash_table.ht_= locks[i].ht_lock @ /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/= uts/c >> > ommon/fs/zfs/arc.c:1626 >> >> Any chance to obtain a backtrace for the panic? > > >From r209229: > > db:0:kdb.enter.default> =C2=A0bt > Tracing pid 3233 tid 100396 td 0xffffff013600f000 > kdb_enter() at kdb_enter+0x3d > panic() at panic+0x1c8 > _sx_xlock_hard() at _sx_xlock_hard+0x93 > _sx_xlock() at _sx_xlock+0xaa > arc_buf_remove_ref() at arc_buf_remove_ref+0x7b > dbuf_rele() at dbuf_rele+0x15d > zfs_freebsd_reclaim() at zfs_freebsd_reclaim+0xe1 > VOP_RECLAIM_APV() at VOP_RECLAIM_APV+0xe8 > vgonel() at vgonel+0x186 > vnlru_free() at vnlru_free+0x2f4 > vfs_lowmem() at vfs_lowmem+0x31 > kmem_malloc() at kmem_malloc+0x12c > page_alloc() at page_alloc+0x18 > keg_alloc_slab() at keg_alloc_slab+0xe6 > keg_fetch_slab() at keg_fetch_slab+0x18e > zone_fetch_slab() at zone_fetch_slab+0x4f > uma_zalloc_arg() at uma_zalloc_arg+0x56b > arc_get_data_buf() at arc_get_data_buf+0xaa > arc_read_nolock() at arc_read_nolock+0x1cb > arc_read() at arc_read+0x71 > dbuf_read() at dbuf_read+0x4ea > dmu_buf_hold_array_by_dnode() at dmu_buf_hold_array_by_dnode+0x119 > dmu_buf_hold_array() at dmu_buf_hold_array+0x57 > dmu_read_uio() at dmu_read_uio+0x3f > zfs_freebsd_read() at zfs_freebsd_read+0x558 > VOP_READ_APV() at VOP_READ_APV+0xe2 > vn_read() at vn_read+0x1d0 > dofileread() at dofileread+0x97 > kern_preadv() at kern_preadv+0x6a > pread() at pread+0x52 > syscallenter() at syscallenter+0x217 > syscall() at syscall+0x39 > Xfast_syscall() at Xfast_syscall+0xe1 > --- syscall (475, FreeBSD ELF64, pread), rip =3D 0x80100c14c, rsp =3D 0x7= fffffbfeb48, rbp =3D 0x2 --- > > Thanks. I notice the traceback is in the UMA zone allocaor. Did it used to be stabl= e? ZFS recently changed to using the UMA allocator, and I found this made my system less reliable. Does disabling this help? Add this to /boot/loader.conf: vfs.zfs.zio.use_uma=3D0 Cheers Tom From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 08:51:09 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89790106564A; Thu, 24 Jun 2010 08:51:09 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 45A168FC18; Thu, 24 Jun 2010 08:51:08 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 3E9D11FFC33; Thu, 24 Jun 2010 08:51:08 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 6D46F845D8; Thu, 24 Jun 2010 10:48:57 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Andriy Gapon References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <4C222AED.2070802@icyb.net.ua> Date: Thu, 24 Jun 2010 10:48:57 +0200 In-Reply-To: <4C222AED.2070802@icyb.net.ua> (Andriy Gapon's message of "Wed, 23 Jun 2010 18:40:29 +0300") Message-ID: <86zkykak92.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Ryan Stone , Hans Petter Selasky Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 08:51:09 -0000 Andriy Gapon writes: > Yes, you are absolutely correct. This comes from the fact that amd64 use= s simple > objects files (aka .o) as kernel modules and i386 uses full-blow dso. The obvious question is: since, as I understand, amd64's solution is superior, what would it take to switch to .o on other platforms? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 09:13:34 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B864B106564A; Thu, 24 Jun 2010 09:13:34 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 7096B8FC0A; Thu, 24 Jun 2010 09:13:34 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 5F6EF1FFC33; Thu, 24 Jun 2010 09:13:33 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 7171C845D8; Thu, 24 Jun 2010 11:11:22 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> Date: Thu, 24 Jun 2010 11:11:22 +0200 In-Reply-To: <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> (Anton Shterenlikht's message of "Thu, 24 Jun 2010 09:36:35 +0100") Message-ID: <86vd98aj7p.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Marcel Moolenaar , freebsd-ia64@freebsd.org, freebsd-current@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 09:13:34 -0000 Anton Shterenlikht writes: > # find /usr/obj/usr/src -name liblzma.a > /usr/obj/usr/src/tmp/usr/lib/liblzma.a > /usr/obj/usr/src/lib/liblzma/liblzma.a > # diff /usr/obj/usr/src/tmp/usr/lib/liblzma.a /usr/obj/usr/src/lib/liblzm= a/liblzma.a > # > # nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem > hardware_physmem.o: > 0000000000000000 T lzma_physmem > U lzma_tuklib_physmem > tuklib_physmem.o: > 0000000000000000 T lzma_tuklib_physmem > #=20 > # nm /usr/lib/liblzma.a | grep physmem > nm: '/usr/lib/liblzma.a': No such file > # > > Did you mean /usr/local/lib/liblzma.a ? No, I meant /usr/lib/liblzma.a. Do you have any other compilers installed? On a machine where make buildworld failed, do % cd /usr/src % make buildenv % echo $PATH % which cc % cc --version % strings $(which cc) | grep -w tmp DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 09:21:51 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4AC8106566C for ; Thu, 24 Jun 2010 09:21:51 +0000 (UTC) (envelope-from areilly@bigpond.net.au) Received: from nschwmtas05p.mx.bigpond.com (nschwmtas05p.mx.bigpond.com [61.9.189.149]) by mx1.freebsd.org (Postfix) with ESMTP id 1B57D8FC0C for ; Thu, 24 Jun 2010 09:21:50 +0000 (UTC) Received: from nschwotgx02p.mx.bigpond.com ([124.188.161.100]) by nschwmtas05p.mx.bigpond.com with ESMTP id <20100624092149.XUCB12312.nschwmtas05p.mx.bigpond.com@nschwotgx02p.mx.bigpond.com>; Thu, 24 Jun 2010 09:21:49 +0000 Received: from duncan.reilly.home ([124.188.161.100]) by nschwotgx02p.mx.bigpond.com with ESMTP id <20100624092148.DWEN2131.nschwotgx02p.mx.bigpond.com@duncan.reilly.home>; Thu, 24 Jun 2010 09:21:48 +0000 Date: Thu, 24 Jun 2010 19:21:48 +1000 From: Andrew Reilly To: Gary Jennejohn Message-ID: <20100624092148.GA6948@duncan.reilly.home> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100624092337.6bed1f45@ernst.jennejohn.org> User-Agent: Mutt/1.4.2.3i X-Authentication-Info: Submitted using SMTP AUTH LOGIN at nschwotgx02p.mx.bigpond.com from [124.188.161.100] using ID areilly@bigpond.net.au at Thu, 24 Jun 2010 09:21:48 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A090208.4C2323AD.0081,ss=1,fgs=0 X-SIH-MSG-ID: qR40ENL9TAD0zmQs0WyzOwJxyArnqyN48Z4QX81loRIGTUDCp8DeQ9rHK+ZRu8u4xDxIJhqMNGMhaajtTY3Rs9mK Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Ted Faber Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 09:21:51 -0000 On Thu, Jun 24, 2010 at 09:23:37AM +0200, Gary Jennejohn wrote: > in /etc/src.conf - WITHOUT_LPR=yes > > and these symbolic links in /usr/bin > lrwxr-xr-x 1 root wheel 17 Mar 18 2009 /usr/bin/lp -> /usr/local/bin/lp > lrwxr-xr-x 1 root wheel 24 Mar 18 2009 /usr/bin/lpoptions -> /usr/local/bin/lpoptions > lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpq -> /usr/local/bin/lpq > lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpr -> /usr/local/bin/lpr > lrwxr-xr-x 1 root wheel 19 Mar 18 2009 /usr/bin/lprm -> /usr/local/bin/lprm > lrwxr-xr-x 1 root wheel 21 Mar 18 2009 /usr/bin/lpstat -> /usr/local/bin/lpstat > > and /usr/bin is _before_ /usr/local/bin in my PATH. Since you have /usr/local/bin in your path, why bother with the symlinks at all? Your shell will find them in their new locations just fine. You'll want to remove the old ones from /usr/bin, but make delete-old will probably do that nicely anyway. Cheers, -- Andrew From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 09:24:35 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFEF9106564A for ; Thu, 24 Jun 2010 09:24:35 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9F58FC18 for ; Thu, 24 Jun 2010 09:24:35 +0000 (UTC) Received: by fxm7 with SMTP id 7so4263460fxm.13 for ; Thu, 24 Jun 2010 02:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=ikaHOGWT/EhhHEsjIYOF9AyNYjWTokCLsnBRqtC3mD0=; b=Qbgc57h34gene06+BgQCl4ZuMewpIJy3FSUVTMIOx0T2jX1UgUBifc6WaNEGfYWhCR vCZfKDmn5SZtJKQOPa+JI7HI6qs3iKyTUN4BUhvtNcZwPxPKOKI7ZYJP5vWVs55MHU+R SE+qf4k6isdbE8VR6KBS2LwRopBeLNHvE34eQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=cE1P2VFzRMwuuRl+pbou+4qznic4MggN1YiTRuxYU0e3RIYe0fSRT+MYWEQNlnYRt/ D3tXS4F6k5jnsulxM1jSWuoXFFT7magghzph3Fr/Oo6h5fJSvpLBay5TYRW8lHBH+6kv XEwtc+6w6V1Qh+bIxX1MbO2dTvdO41iaHkZ20= MIME-Version: 1.0 Received: by 10.239.133.6 with SMTP id 6mr704253hbt.130.1277371474161; Thu, 24 Jun 2010 02:24:34 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Thu, 24 Jun 2010 02:24:34 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Jun 2010 10:24:34 +0100 Message-ID: From: Tom Evans To: Cristiano Deana Content-Type: text/plain; charset=UTF-8 Cc: freebsd-current@freebsd.org Subject: Re: Problem with buildworld with CLANG X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 09:24:36 -0000 On Wed, Jun 23, 2010 at 4:52 PM, Cristiano Deana wrote: > On Wed, Jun 23, 2010 at 3:15 PM, Tom Evans wrote: > >> Top of the '[TESTING] Clang..' email: >> >>> hi, >>> >>> ClangBSD was updated to LLVM/clang revision 104832 which is what we aim to import >>> into HEAD in roughly a week. We would like the initial import to be as painless >>> as possible and therefore we ask you to test ClangBSD to assure that the revision >>> we are importing does not have some really embarassing bugs. >>> >>> How to do it (on i386 and amd64): > >>> 1) svn co http://svn.freebsd.org/base/projects/clangbsd src > > i already did it and it worked, two weeks ago. > now i wanted to try with clan in system > >>> 2) echo NO_WERROR= >> /etc/src.conf ; echo WERROR= >> /etc/src.conf > >> So uncomment your src.conf lines that are incompatible. > > forgot to tell before. i tried with and without those lines. > The error in your first email was clearly a warning being promoted to an error, so either you had a different error on your build with NO_WERROR/WERROR, or your NO_WERROR/WERROR settings were not being respected. Please retry with NO_WERROR/WERROR set in /etc/src.conf, and show the resulting error. Cheers Tom From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 09:32:56 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D93C9106564A; Thu, 24 Jun 2010 09:32:56 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3C3958FC13; Thu, 24 Jun 2010 09:32:55 +0000 (UTC) Received: by fxm7 with SMTP id 7so4270498fxm.13 for ; Thu, 24 Jun 2010 02:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=YWYDR/Btt1npoaO286toFqRz2vPujAfzeJ7K0KfP4AE=; b=IbHnv9cH1eMoc2cejlj7Oy8a5K0eJMEiKdodbouYv4pKXht8mw8feNyA12DzdNz+S4 umcuiqrbzeScYxpBVbMIrHeRf9+/m4+Vwlbsab0ZzKyuAKrCz08VIGNOBYtc+E8WMy1i P0sXfBE/E5kJRWIfC6ACe8skLgCseHgZMNm5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Zyf2c21M3n41lHV4oXbVi4M+9bc5OsgWb1UNb7m7B62kAwTc7NF+RL1YXkMUYIixrm cmLndmCmRcyhFauCpbdaNPXxn4O9CYK7eeAdYbJNx9oIzST2S1wom6umrH2q/aPRuXrG Xa+oVSCVf4+ASOuxAuJcVqCjzkcHAWbPiLnXM= MIME-Version: 1.0 Received: by 10.239.189.133 with SMTP id t5mr663989hbh.4.1277371974985; Thu, 24 Jun 2010 02:32:54 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Thu, 24 Jun 2010 02:32:54 -0700 (PDT) In-Reply-To: <20100624092148.GA6948@duncan.reilly.home> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624092148.GA6948@duncan.reilly.home> Date: Thu, 24 Jun 2010 10:32:54 +0100 Message-ID: From: Tom Evans To: Andrew Reilly Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Ted Faber Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 09:32:57 -0000 On Thu, Jun 24, 2010 at 10:21 AM, Andrew Reilly wr= ote: > On Thu, Jun 24, 2010 at 09:23:37AM +0200, Gary Jennejohn wrote: >> in /etc/src.conf - WITHOUT_LPR=3Dyes >> >> and these symbolic links in /usr/bin >> lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A017 Mar 18 =C2=A0= 2009 /usr/bin/lp -> /usr/local/bin/lp >> lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A024 Mar 18 =C2=A0= 2009 /usr/bin/lpoptions -> /usr/local/bin/lpoptions >> lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A018 Mar 18 =C2=A0= 2009 /usr/bin/lpq -> /usr/local/bin/lpq >> lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A018 Mar 18 =C2=A0= 2009 /usr/bin/lpr -> /usr/local/bin/lpr >> lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A019 Mar 18 =C2=A0= 2009 /usr/bin/lprm -> /usr/local/bin/lprm >> lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A0 =C2=A0 =C2=A021 Mar 18 =C2=A0= 2009 /usr/bin/lpstat -> /usr/local/bin/lpstat >> >> and /usr/bin is _before_ /usr/local/bin in my PATH. > > Since you have /usr/local/bin in your path, why bother with > the symlinks at all? =C2=A0Your shell will find them in their new > locations just fine. =C2=A0You'll want to remove the old ones from > /usr/bin, but make delete-old will probably do that nicely > anyway. > > Cheers, > > -- > Andrew make delete-old removes old deprecated files, not files that weren't built because of src.conf options. It definitely will not remove the lpr binaries from /usr/bin if they exist there. There already is a proper solution for this: if you want to have LPR from CUPS, and don't want to use LPR from base, then you set these settings in make.conf: CUPS_OVERWRITE_BASE=3Dyes WITHOUT_LPR=3Dyes With these, lpr in base will not be built, and print/cups-base will deactivate any base system lpr binaries that are installed. It's documented in the FreeBSD CUPS article here: http://www.freebsd.org/doc/en/articles/cups/article.html#PRINTING-CUPS-PORT= S-KNOBS Cheers Tom From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 09:45:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 662B11065670 for ; Thu, 24 Jun 2010 09:45:52 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: from andxor.it (relay.andxor.it [195.223.2.3]) by mx1.freebsd.org (Postfix) with SMTP id 945B68FC24 for ; Thu, 24 Jun 2010 09:45:51 +0000 (UTC) Received: (qmail 87398 invoked from network); 24 Jun 2010 09:45:50 -0000 Received: from unknown (HELO ale.andxor.it) (192.168.2.5) by andxor.it with SMTP; 24 Jun 2010 09:45:50 -0000 Message-ID: <4C23294E.1050100@FreeBSD.org> Date: Thu, 24 Jun 2010 11:45:50 +0200 From: Alex Dupre User-Agent: Thunderbird 2.0.0.22 (X11/20090624) MIME-Version: 1.0 To: Tom Evans References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624092148.GA6948@duncan.reilly.home> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Andrew Reilly Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 09:45:52 -0000 Tom Evans ha scritto: > make delete-old removes old deprecated files, not files that weren't > built because of src.conf options. I think you are wrong: http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/build/mk/OptionalObsoleteFiles.inc?rev=1.66 -- Alex Dupre From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 09:59:27 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E421106564A; Thu, 24 Jun 2010 09:59:27 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id 6F57B8FC0A; Thu, 24 Jun 2010 09:59:26 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so1435620fgb.13 for ; Thu, 24 Jun 2010 02:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=OETNN9oAMS9L6PAu25StahjezZCuzdaQv/FKCxxjyUg=; b=eFgQBlHICak79e+h9RI9SP2cy9Pszv/TQI+Ed6ygJAomw/izIW2HEzohhgTFwEJzj4 z1vL2+ZXU3CbJ6qU2cvDwL0wYlDBdfHYKz82pwAvjxJ/olRRFwecUaGMQUf0irTkdUHb 9e0Pdo5g0c2WbIrxrm7spU4Kw/O7soxjXIKGE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=WfNFx8MIgoAqL6I6RLkhNfW9y3OabvLwpj4lvEOW3dWoK0+KYIf7n/pqnh4rOzRl95 R8mMoR7bis3NxFPsnsZoOMtChfJ9/lxTDt+StXd8R+a+xHAYdprX8aFkseehfHfi4jaM +WeVmV9dzxyPQzkdthnC5+co68tOdvCWBIMeQ= MIME-Version: 1.0 Received: by 10.239.168.68 with SMTP id j4mr611820hbe.187.1277373565138; Thu, 24 Jun 2010 02:59:25 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Thu, 24 Jun 2010 02:59:25 -0700 (PDT) In-Reply-To: <4C23294E.1050100@FreeBSD.org> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624092148.GA6948@duncan.reilly.home> <4C23294E.1050100@FreeBSD.org> Date: Thu, 24 Jun 2010 10:59:25 +0100 Message-ID: From: Tom Evans To: Alex Dupre Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Andrew Reilly Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 09:59:27 -0000 On Thu, Jun 24, 2010 at 10:45 AM, Alex Dupre wrote: > Tom Evans ha scritto: >> make delete-old removes old deprecated files, not files that weren't >> built because of src.conf options. > > I think you are wrong: > http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/build/mk/OptionalObsoleteFiles.inc?rev=1.66 > > -- > Alex Dupre > Meh, OK. It didn't used to, there was a discussion about this about 6 months ago, and yes, check the history of that file. This support was added in February, nothing in /usr/src/UPDATING about it.. Still, besides the point. There is one supported way to get cups-base lpr used instead of base lpr, and it's got not much to do with 'make delete-old'. http://www.freebsd.org/doc/en/articles/cups/article.html#PRINTING-CUPS-PORTS-KNOBS Cheers Tom From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 10:25:50 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A38710656C1 for ; Thu, 24 Jun 2010 10:25:50 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 0548F8FC15 for ; Thu, 24 Jun 2010 10:25:48 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id CD3A5216835; Thu, 24 Jun 2010 13:25:42 +0300 (EEST) Date: Thu, 24 Jun 2010 13:25:42 +0300 From: Jaakko Heinonen To: ben wilber Message-ID: <20100624102542.GA4668@a91-153-117-195.elisa-laajakaista.fi> References: <20100623164401.GA7914@exodus.desync.com> <4C2272E5.2090901@delphij.net> <20100623210133.GA10694@exodus.desync.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100623210133.GA10694@exodus.desync.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current , d@delphij.net Subject: Re: zfs panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 10:25:50 -0000 On 2010-06-23, ben wilber wrote: > > > panic: _sx_xlock_hard: recursed on non-recursive sx buf_hash_table.ht_locks[i].ht_lock @ /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/c > > > ommon/fs/zfs/arc.c:1626 > > > > Any chance to obtain a backtrace for the panic? > > >From r209229: > > db:0:kdb.enter.default> bt > Tracing pid 3233 tid 100396 td 0xffffff013600f000 > kdb_enter() at kdb_enter+0x3d > panic() at panic+0x1c8 > _sx_xlock_hard() at _sx_xlock_hard+0x93 > _sx_xlock() at _sx_xlock+0xaa > arc_buf_remove_ref() at arc_buf_remove_ref+0x7b > dbuf_rele() at dbuf_rele+0x15d > zfs_freebsd_reclaim() at zfs_freebsd_reclaim+0xe1 > VOP_RECLAIM_APV() at VOP_RECLAIM_APV+0xe8 > vgonel() at vgonel+0x186 > vnlru_free() at vnlru_free+0x2f4 > vfs_lowmem() at vfs_lowmem+0x31 I believe that this has been fixed in r209260. -- Jaakko From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 10:34:01 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 767391065677; Thu, 24 Jun 2010 10:34:01 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 30BEC8FC14; Thu, 24 Jun 2010 10:34:00 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 809381FFC33; Thu, 24 Jun 2010 10:33:59 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id A5B4F845D6; Thu, 24 Jun 2010 12:31:48 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> Date: Thu, 24 Jun 2010 12:31:48 +0200 In-Reply-To: <86vd98aj7p.fsf@ds4.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?= =?utf-8?Q?rav=22's?= message of "Thu, 24 Jun 2010 11:11:22 +0200") Message-ID: <8639wcafhn.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Marcel Moolenaar , freebsd-ia64@freebsd.org, freebsd-current@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 10:34:01 -0000 Dag-Erling Sm=C3=B8rgrav writes: > On a machine where make buildworld failed, do > > % cd /usr/src > % make buildenv > % echo $PATH > % which cc > % cc --version > % strings $(which cc) | grep -w tmp instead of that last line: % cc -dumpspecs (still in buildenv) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 10:57:28 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50FF106566C; Thu, 24 Jun 2010 10:57:28 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 6CA4F8FC1A; Thu, 24 Jun 2010 10:57:28 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORk7b-0007lr-3Q; Thu, 24 Jun 2010 11:57:27 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORk7a-0006KG-Q4; Thu, 24 Jun 2010 11:57:26 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5OAvQRq010483; Thu, 24 Jun 2010 11:57:26 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5OAvQ02010476; Thu, 24 Jun 2010 11:57:26 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 24 Jun 2010 11:57:26 +0100 From: Anton Shterenlikht To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100624105726.GB10082@mech-cluster241.men.bris.ac.uk> References: <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86vd98aj7p.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 10:57:28 -0000 On Thu, Jun 24, 2010 at 11:11:22AM +0200, Dag-Erling Smørgrav wrote: > Anton Shterenlikht writes: > > # find /usr/obj/usr/src -name liblzma.a > > /usr/obj/usr/src/tmp/usr/lib/liblzma.a > > /usr/obj/usr/src/lib/liblzma/liblzma.a > > # diff /usr/obj/usr/src/tmp/usr/lib/liblzma.a /usr/obj/usr/src/lib/liblzma/liblzma.a > > # > > # nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem > > hardware_physmem.o: > > 0000000000000000 T lzma_physmem > > U lzma_tuklib_physmem > > tuklib_physmem.o: > > 0000000000000000 T lzma_tuklib_physmem > > # > > # nm /usr/lib/liblzma.a | grep physmem > > nm: '/usr/lib/liblzma.a': No such file > > # > > > > Did you mean /usr/local/lib/liblzma.a ? > > No, I meant /usr/lib/liblzma.a. This file doesn't exist on either of my other two ia64 boxes, where this problem is not present. > > Do you have any other compilers installed? No, I don't think so, gcc from ports don't build on ia64, at least 43/44/45 don't. I haven't tried 46 yet. Obviosly clang doesn't build either. > > On a machine where make buildworld failed, do > > % cd /usr/src > % make buildenv > % echo $PATH > % which cc > % cc --version > % strings $(which cc) | grep -w tmp # cd /usr/src/ # make buildenv Entering world for ia64:ia64 # echo $PATH /usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin # which cc /usr/obj/usr/src/tmp/usr/bin/cc # cc --version cc (GCC) 4.2.1 20070719 [FreeBSD] Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # strings $(which cc) | grep -w tmp /usr/obj/usr/src/tmp/usr/bin/ /usr/obj/usr/src/tmp/usr/libdata/gcc/ /usr/obj/usr/src/tmp/usr/lib/ /usr/obj/usr/src/tmp/usr/libexec/ /usr/obj/usr/src/tmp/usr /var/tmp/ /var/tmp /usr/tmp /tmp # Compare this with the output from another ia64 -current, where this problem is not present: > cd /usr/src/ > make buildenv Entering world for ia64:ia64 $ echo $PATH /usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin $ which cc /usr/obj/usr/src/tmp/usr/bin/cc $ cc --version cc (GCC) 4.2.1 20070719 [FreeBSD] Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ strings $(which cc) | grep -w tmp /usr/obj/usr/src/tmp/usr/bin/ /usr/obj/usr/src/tmp/usr/libdata/gcc/ /usr/obj/usr/src/tmp/usr/lib/ /usr/obj/usr/src/tmp/usr/libexec/ /usr/obj/usr/src/tmp/usr /var/tmp/ /var/tmp /usr/tmp /tmp $ which seems identical. many thanks anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 11:05:14 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86FBB106564A; Thu, 24 Jun 2010 11:05:14 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 3BAFF8FC16; Thu, 24 Jun 2010 11:05:13 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORkF6-0000Y8-Np; Thu, 24 Jun 2010 12:05:13 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORkF6-000440-95; Thu, 24 Jun 2010 12:05:12 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5OB5CAC036162; Thu, 24 Jun 2010 12:05:12 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5OB5BFI036161; Thu, 24 Jun 2010 12:05:11 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 24 Jun 2010 12:05:11 +0100 From: Anton Shterenlikht To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100624110511.GD10082@mech-cluster241.men.bris.ac.uk> References: <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> <8639wcafhn.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8639wcafhn.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@FreeBSD.org, Marcel Moolenaar , Anton Shterenlikht , freebsd-ia64@FreeBSD.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 11:05:14 -0000 On Thu, Jun 24, 2010 at 12:31:48PM +0200, Dag-Erling Smørgrav wrote: > Dag-Erling Smørgrav writes: > > On a machine where make buildworld failed, do > > > > % cd /usr/src > > % make buildenv > > % echo $PATH > > % which cc > > % cc --version > > % strings $(which cc) | grep -w tmp > > instead of that last line: > > % cc -dumpspecs > > (still in buildenv) $ cd /usr/src $ make buildenv Entering world for ia64:ia64 $ echo $PATH /usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin $ which cc /usr/obj/usr/src/tmp/usr/bin/cc $ cc --version cc (GCC) 4.2.1 20070719 [FreeBSD] Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cc -dumpspecs *asm: -x %{mconstant-gp} %{mauto-pic} %(asm_extra) *asm_debug: %{g*:--gdwarf2} *asm_final: *asm_options: %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O} *invoke_as: %{!S:-o %|.s | as %(asm_options) %m.s %A } *cpp: %(cpp_cpu) %(cpp_arch) %{!ansi:%{!std=c89:%{!std=iso9899.1990:%{!std=iso9899.199409:-D_LONGLONG}}}} %{posix:-D_POSIX_SOURCE} *cpp_options: %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} %{save-temps:-fpch-preprocess} *cpp_debug_options: %{d*} *cpp_unique_options: %{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{fmudflap:-D_MUDFLAP -include mf-runtime.h} %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h} %{E|M|MM:%W{o*}} *trad_capable_cpp: cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp} *cc1: %{G*} *cc1_options: %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants} %{coverage:-fprofile-arcs -ftest-coverage} *cc1plus: *link_gcc_c_sequence: %G %L %G *link_ssp: %{fstack-protector:} *endfile: %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s *link: %{!static:--eh-frame-hdr} %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} %{assert*} %{R*} %{rpath*} %{defsym*} %{shared:-Bshareable %{h*} %{soname*}} %{symbolic:-Bsymbolic} %{!shared: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} %{static:-Bstatic}} *lib: %{!shared: %{!pg: %{pthread:-lpthread} -lc} %{pg: %{pthread:-lpthread_p} -lc_p}} %{shared: %{pthread:-lpthread} -lc} %{fstack-protector|fstack-protector-all:-lssp_nonshared} *mfwrap: %{static: %{fmudflap|fmudflapth: --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc --wrap=mmap --wrap=munmap --wrap=alloca} %{fmudflapth: --wrap=pthread_create}} %{fmudflap|fmudflapth: --wrap=main} *mflib: %{fmudflap|fmudflapth: -export-dynamic} *link_gomp: *libgcc: %{pg:%{pg: -lgcc_p;:-lgcc} %{pg: -lgcc_eh_p;:-lgcc_eh}} %{!pg:%{static|static-libgcc|pg:%{pg: -lgcc_p;:-lgcc} %{pg: -lgcc_eh_p;:-lgcc_eh}}%{!static:%{!static-libgcc:%{!shared-libgcc:%{pg: -lgcc_p;:-lgcc} --as-needed -lgcc_s --no-as-needed}%{shared-libgcc:-lgcc_s%{!shared: %{pg: -lgcc_p;:-lgcc}}}}}} *startfile: %{!shared: %{pg:gcrt1.o%s} %{!pg: %{p:gcrt1.o%s} %{!p: %{profile:gcrt1.o%s} %{!profile: %{pie: Scrt1.o%s;:crt1.o%s}}}}} crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} *switches_need_spaces: *cross_compile: 0 *version: 4.2.1 *multilib: . ; *multilib_defaults: *multilib_extra: *multilib_matches: *multilib_exclusions: *multilib_options: *linker: collect2 *link_libgcc: %D *md_exec_prefix: *md_startfile_prefix: *md_startfile_prefix_1: *startfile_prefix_spec: /usr/obj/usr/src/tmp/usr/lib/ *sysroot_spec: --sysroot=%R *sysroot_suffix_spec: *sysroot_hdrs_suffix_spec: *asm_extra: *fbsd_dynamic_linker: /libexec/ld-elf.so.1 *link_command: %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*} %(mfwrap) %(link_libgcc) %o %{fopenmp: -lgomp} %(mflib) %{fprofile-arcs|fprofile-generate|coverage:-lgcov} %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}} $ many thanks anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 11:33:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89C45106566C; Thu, 24 Jun 2010 11:33:52 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirj.bris.ac.uk (dirj.bris.ac.uk [137.222.10.78]) by mx1.freebsd.org (Postfix) with ESMTP id 408238FC14; Thu, 24 Jun 2010 11:33:51 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirj.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORkgp-0002EO-6W; Thu, 24 Jun 2010 12:33:51 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORkgp-0005EE-1t; Thu, 24 Jun 2010 12:33:51 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5OBXoXA071584; Thu, 24 Jun 2010 12:33:50 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5OBXo9T071583; Thu, 24 Jun 2010 12:33:50 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 24 Jun 2010 12:33:50 +0100 From: Anton Shterenlikht To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100624113350.GA54493@mech-cluster241.men.bris.ac.uk> References: <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> <20100624105726.GB10082@mech-cluster241.men.bris.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100624105726.GB10082@mech-cluster241.men.bris.ac.uk> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 11:33:52 -0000 On Thu, Jun 24, 2010 at 11:57:26AM +0100, Anton Shterenlikht wrote: > On Thu, Jun 24, 2010 at 11:11:22AM +0200, Dag-Erling Smørgrav wrote: > > Anton Shterenlikht writes: > > > # find /usr/obj/usr/src -name liblzma.a > > > /usr/obj/usr/src/tmp/usr/lib/liblzma.a > > > /usr/obj/usr/src/lib/liblzma/liblzma.a > > > # diff /usr/obj/usr/src/tmp/usr/lib/liblzma.a /usr/obj/usr/src/lib/liblzma/liblzma.a > > > # > > > # nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem > > > hardware_physmem.o: > > > 0000000000000000 T lzma_physmem > > > U lzma_tuklib_physmem > > > tuklib_physmem.o: > > > 0000000000000000 T lzma_tuklib_physmem > > > # > > > # nm /usr/lib/liblzma.a | grep physmem > > > nm: '/usr/lib/liblzma.a': No such file > > > # > > > > > > Did you mean /usr/local/lib/liblzma.a ? > > > > No, I meant /usr/lib/liblzma.a. > > This file doesn't exist on either of > my other two ia64 boxes, where this problem > is not present. I appologise. The file does exist on the other 2 ia64 boxes: % nm /usr/lib/liblzma.a | grep physmem hardware_physmem.o: 0000000000000000 T lzma_physmem U lzma_tuklib_physmem tuklib_physmem.o: 0000000000000000 T lzma_tuklib_physmem % sorry about this, I looked in the wrong place. > > > > Do you have any other compilers installed? > > No, I don't think so, gcc from ports don't build > on ia64, at least 43/44/45 don't. I haven't > tried 46 yet. Obviosly clang doesn't build either. > > > > > On a machine where make buildworld failed, do > > > > % cd /usr/src > > % make buildenv > > % echo $PATH > > % which cc > > % cc --version > > % strings $(which cc) | grep -w tmp > > > # cd /usr/src/ > # make buildenv > Entering world for ia64:ia64 > # echo $PATH > /usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin > # which cc > /usr/obj/usr/src/tmp/usr/bin/cc > # cc --version > cc (GCC) 4.2.1 20070719 [FreeBSD] > Copyright (C) 2007 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > # strings $(which cc) | grep -w tmp > /usr/obj/usr/src/tmp/usr/bin/ > /usr/obj/usr/src/tmp/usr/libdata/gcc/ > /usr/obj/usr/src/tmp/usr/lib/ > /usr/obj/usr/src/tmp/usr/libexec/ > /usr/obj/usr/src/tmp/usr > /var/tmp/ > /var/tmp > /usr/tmp > /tmp > # > > Compare this with the output from another ia64 -current, > where this problem is not present: > I rechecked this again, seems correct. % cd /usr/src/ % make buildenv Entering world for ia64:ia64 $ echo $PATH /usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin $ which cc /usr/obj/usr/src/tmp/usr/bin/cc $ cc --version cc (GCC) 4.2.1 20070719 [FreeBSD] Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ strings $(which cc) | grep -w tmp /usr/obj/usr/src/tmp/usr/bin/ /usr/obj/usr/src/tmp/usr/libdata/gcc/ /usr/obj/usr/src/tmp/usr/lib/ /usr/obj/usr/src/tmp/usr/libexec/ /usr/obj/usr/src/tmp/usr /var/tmp/ /var/tmp /usr/tmp /tmp $ many thanks anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 12:43:42 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 217701065673 for ; Thu, 24 Jun 2010 12:43:42 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id CB3648FC1A for ; Thu, 24 Jun 2010 12:43:40 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORlmN-0006Ls-VO for freebsd-current@freebsd.org; Thu, 24 Jun 2010 13:43:40 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORlmN-0007UZ-OF for freebsd-current@freebsd.org; Thu, 24 Jun 2010 13:43:39 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5OChcNh040028 for ; Thu, 24 Jun 2010 13:43:38 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5OChcM7040025 for freebsd-current@freebsd.org; Thu, 24 Jun 2010 13:43:38 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 24 Jun 2010 13:43:38 +0100 From: Anton Shterenlikht To: freebsd-current@freebsd.org Message-ID: <20100624124338.GA39566@mech-cluster241.men.bris.ac.uk> References: <20100616165909.GA55995@mech-cluster241.men.bris.ac.uk> <4C190513.20309@infracaninophile.co.uk> <20100616171531.GA56202@mech-cluster241.men.bris.ac.uk> <4C1912CB.9000609@infracaninophile.co.uk> <20100617092102.GA90168@mech-cluster241.men.bris.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100617092102.GA90168@mech-cluster241.men.bris.ac.uk> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: r209244 ia64 and r209229 amd64 -> ntpq: write to localhost failed: Network is unreachable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 12:43:42 -0000 On Thu, Jun 17, 2010 at 10:21:02AM +0100, Anton Shterenlikht wrote: > On Wed, Jun 16, 2010 at 07:07:07PM +0100, Matthew Seaman wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > On 16/06/2010 18:15:32, Anton Shterenlikht wrote: > > > On Wed, Jun 16, 2010 at 06:08:35PM +0100, Matthew Seaman wrote: > > >> -----BEGIN PGP SIGNED MESSAGE----- > > >> Hash: SHA1 > > >> > > >> On 16/06/2010 17:59:10, Anton Shterenlikht wrote: > > >>> After a recent upgrade to r209156 I get this error: > > >>> > > >>> $ ntpq -p > > >>> ntpq: write to localhost failed: Network is unreachable > > >>> > > >>> Please advise > > >> > > >> What does 'ifconfig -a' and 'netstat -rn' say? > > > > > > $ ifconfig -a > > > em0: flags=8843 metric 0 mtu 1500 > > > options=209b > > > ether 00:13:21:5b:05:1c > > > inet 137.222.187.28 netmask 0xffffff00 broadcast 137.222.187.255 > > > inet6 fe80::213:21ff:fe5b:51c%em0 prefixlen 64 scopeid 0x1 > > > nd6 options=29 > > > media: Ethernet autoselect (1000baseT ) > > > status: active > > > em1: flags=8802 metric 0 mtu 1500 > > > options=209b > > > ether 00:13:21:5b:05:1d > > > media: Ethernet autoselect (100baseTX ) > > > status: active > > > lo0: flags=8049 metric 0 mtu 16384 > > > options=3 > > > inet 127.0.0.1 netmask 0xff000000 > > > inet6 ::1 prefixlen 128 > > > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 > > > nd6 options=21 > > > > > > $ netstat -rn > > > Routing tables > > > > > > Internet: > > > Destination Gateway Flags Refs Use Netif Expire > > > default 137.222.187.250 UGS 0 65512 em0 > > > 127.0.0.1 link#3 UH 0 293 lo0 > > > 137.222.187.0/24 link#1 U 0 10861 em0 > > > 137.222.187.28 link#1 UHS 0 0 lo0 > > > > > > Internet6: > > > Destination Gateway Flags Netif Expire > > > ::/96 ::1 UGRS lo0 > > > ::1 ::1 UH lo0 > > > ::ffff:0.0.0.0/96 ::1 UGRS lo0 > > > fe80::/10 ::1 UGRS lo0 > > > fe80::%em0/64 link#1 U em0 > > > fe80::213:21ff:fe5b:51c%em0 link#1 UHS lo0 > > > fe80::%lo0/64 link#3 U lo0 > > > fe80::1%lo0 link#3 UHS lo0 > > > ff01:1::/32 fe80::213:21ff:fe5b:51c%em0 U em0 > > > ff01:3::/32 ::1 U lo0 > > > ff02::/16 ::1 UGRS lo0 > > > ff02::%em0/32 fe80::213:21ff:fe5b:51c%em0 U em0 > > > ff02::%lo0/32 ::1 U lo0 > > > > > > > > > > > >> What happens if you try and ping localhost? > > > > > > $ ping -c5 localhost > > > PING localhost (127.0.0.1): 56 data bytes > > > 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.109 ms > > > 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.103 ms > > > 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.060 ms > > > 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.059 ms > > > 64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.059 ms > > > > > > --- localhost ping statistics --- > > > 5 packets transmitted, 5 packets received, 0.0% packet loss > > > round-trip min/avg/max/stddev = 0.059/0.078/0.109/0.023 ms > > > > Nothing obviously wrong there. Perhaps ntpd is not running? > > (Not sure quite why that should cause an error message about > > reachability of localhost: I suppose it's not completely unreasonable > > though.) > > > > If ntpd is running, then try restarting it. If the problem still > > persists, then it looks like you've found a bug. > > # ps ax | grep ntp > 55043 ?? Rs 0:00.02 /usr/sbin/ntpd -c /etc/ntp.conf -p /var/run/ntpd.pid -f /var/db/ntpd.drif > 55050 0 R+ 0:00.00 grep ntp > # ntpq -p > ntpq: write to localhost failed: Network is unreachable > # /etc/rc.d/ntpd restart > Stopping ntpd. > Waiting for PIDS: 55043. > Starting ntpd. > # ps ax | grep ntp > 55113 ?? Ss 0:00.02 /usr/sbin/ntpd -c /etc/ntp.conf -p /var/run/ntpd.pid -f /var/db/ntpd.drif > 55127 0 R+ 0:00.00 grep ntp > # ntpq -p > ntpq: write to localhost failed: Network is unreachable > # just to ask if anybody else is seeing this on ia64 or amd64? I'm using /etc/ntp.conf as supplied, no modifications. Seems to work ok on i386 r209398 sparc64 r204991M ia64 r209203 but gives the above error on amd64 r209229 ia64 r209244 many thanks anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 12:56:45 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECC77106564A; Thu, 24 Jun 2010 12:56:45 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id A87B98FC0C; Thu, 24 Jun 2010 12:56:45 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id AAA701FFC33; Thu, 24 Jun 2010 12:56:44 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id D4A73845D6; Thu, 24 Jun 2010 14:54:33 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> <20100624105726.GB10082@mech-cluster241.men.bris.ac.uk> Date: Thu, 24 Jun 2010 14:54:33 +0200 In-Reply-To: <20100624105726.GB10082@mech-cluster241.men.bris.ac.uk> (Anton Shterenlikht's message of "Thu, 24 Jun 2010 11:57:26 +0100") Message-ID: <86y6e48uba.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 12:56:46 -0000 Anton Shterenlikht writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Anton Shterenlikht writes: > > > Did you mean /usr/local/lib/liblzma.a ? > > No, I meant /usr/lib/liblzma.a. > This file doesn't exist on either of my other two ia64 boxes, where > this problem is not present. I still meant /usr/lib/liblzma.a. If it does not exist, those machines are not running the FreeBSD version you said they were. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 13:00:24 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52623106564A; Thu, 24 Jun 2010 13:00:24 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0DADB8FC18; Thu, 24 Jun 2010 13:00:23 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 1853E1FFC35; Thu, 24 Jun 2010 13:00:23 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 49EF08452D; Thu, 24 Jun 2010 14:58:12 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> <8639wcafhn.fsf@ds4.des.no> <20100624110511.GD10082@mech-cluster241.men.bris.ac.uk> Date: Thu, 24 Jun 2010 14:58:12 +0200 In-Reply-To: <20100624110511.GD10082@mech-cluster241.men.bris.ac.uk> (Anton Shterenlikht's message of "Thu, 24 Jun 2010 12:05:11 +0100") Message-ID: <86tyos8u57.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@FreeBSD.org, Marcel Moolenaar , freebsd-ia64@FreeBSD.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 13:00:24 -0000 Anton Shterenlikht writes: > *startfile_prefix_spec: > /usr/obj/usr/src/tmp/usr/lib/ OK % cd /usr/src % make buildenv % cd rescue/rescue % make I expect this to produce the same error as before; if not, there is something seriously wrong. Now copy the last command make tried to run (cc -static ...), add -v before -static (cc -v -static ...) and run it. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 13:21:55 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C5B21065675; Thu, 24 Jun 2010 13:21:55 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa]) by mx1.freebsd.org (Postfix) with ESMTP id D8A7F8FC0A; Thu, 24 Jun 2010 13:21:54 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 257A32A28CD4; Thu, 24 Jun 2010 15:21:54 +0200 (CEST) Date: Thu, 24 Jun 2010 15:21:54 +0200 From: Ed Schouten To: Andrew Reilly Message-ID: <20100624132154.GT2179@hoeg.nl> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624092148.GA6948@duncan.reilly.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2tWkrNKppd65XSnD" Content-Disposition: inline In-Reply-To: <20100624092148.GA6948@duncan.reilly.home> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 13:21:55 -0000 --2tWkrNKppd65XSnD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Andrew Reilly wrote: > On Thu, Jun 24, 2010 at 09:23:37AM +0200, Gary Jennejohn wrote: > > in /etc/src.conf - WITHOUT_LPR=3Dyes > >=20 > > and these symbolic links in /usr/bin > > lrwxr-xr-x 1 root wheel 17 Mar 18 2009 /usr/bin/lp -> /usr/loca= l/bin/lp > > lrwxr-xr-x 1 root wheel 24 Mar 18 2009 /usr/bin/lpoptions -> /u= sr/local/bin/lpoptions > > lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpq -> /usr/loc= al/bin/lpq > > lrwxr-xr-x 1 root wheel 18 Mar 18 2009 /usr/bin/lpr -> /usr/loc= al/bin/lpr > > lrwxr-xr-x 1 root wheel 19 Mar 18 2009 /usr/bin/lprm -> /usr/lo= cal/bin/lprm > > lrwxr-xr-x 1 root wheel 21 Mar 18 2009 /usr/bin/lpstat -> /usr/= local/bin/lpstat > >=20 > > and /usr/bin is _before_ /usr/local/bin in my PATH. >=20 > Since you have /usr/local/bin in your path, why bother with > the symlinks at all? Your shell will find them in their new > locations just fine. You'll want to remove the old ones from > /usr/bin, but make delete-old will probably do that nicely > anyway. In theory, yes. In practice, no. Just for fun, remove your /usr/sbin/sendmail while having Postfix's /usr/local/sbin/sendmail installed. It simply won't work. If I remember correctly, you won't even receive the periodic(8) emails. Nowadays it's probably better, but I remember in the old days GNOME would always print through /usr/bin/lpr, even when CUPS is installed. --=20 Ed Schouten WWW: http://80386.nl/ --2tWkrNKppd65XSnD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAkwjW/IACgkQ52SDGA2eCwWhnwCeOZsoyNCKkpXCQNkmHuIYDbdo UpMAnRevo7UfWpC6p3puyYUqsKbAYZGE =lUUd -----END PGP SIGNATURE----- --2tWkrNKppd65XSnD-- From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 13:33:49 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60AE8106564A for ; Thu, 24 Jun 2010 13:33:49 +0000 (UTC) (envelope-from cristiano.deana@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id E28B48FC14 for ; Thu, 24 Jun 2010 13:33:48 +0000 (UTC) Received: by fxm7 with SMTP id 7so4459024fxm.13 for ; Thu, 24 Jun 2010 06:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=g1opfarA6MXDhKJIOeHelekcUcxcE3MfRAZdflALWAg=; b=IwindQ7G11otxxt2LhioRWpeXsIjjpIo9WaJkHLM5k57XmFVisbcQriULu0wx+higY 3nmmyCmL8FBlOMGFrbbEktaikJFtTZi9LCqdj5SxsGtZJXh5b4TYIvEQ/Okel2eVvfMA RBQSWNllrrNp8fUVflI7Uv6VPbXqkskyYGiCI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qD9SKoRabP6wM3PGWllGLQ+hlkkYYip7mYrPHEBekOC2gdavrJd+ou0nX7wdiqO38m Ijt4KlRrDBD8BXfriIl+OTuz/mgdGqjwF6m9gDs7ioNFvD1FZPlt9KUNC2oLQTD+vOHv 6PF4tkIDgj0UG6MfNexFUfAkydf/Ae/2DR5LM= MIME-Version: 1.0 Received: by 10.223.26.154 with SMTP id e26mr9401485fac.57.1277386427305; Thu, 24 Jun 2010 06:33:47 -0700 (PDT) Received: by 10.223.117.204 with HTTP; Thu, 24 Jun 2010 06:33:47 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Jun 2010 15:33:47 +0200 Message-ID: From: Cristiano Deana To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: Problem with buildworld with CLANG X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 13:33:49 -0000 On Thu, Jun 24, 2010 at 11:24 AM, Tom Evans wrote: > The error in your first email was clearly a warning being promoted to > an error, so either you had a different error on your build with > NO_WERROR/WERROR, or your NO_WERROR/WERROR settings were not being > respected. Please retry with NO_WERROR/WERROR set in /etc/src.conf, > and show the resulting error. Last lines: /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst.c:135:2: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'unsigned int' R1(D,A,B,C,X( 4), 5,0x5A827999L); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst.c:60: /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_locl.h:108:4: note: instantiated from: a=ROTATE(a,s); };\ ^ /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst.c:135:2: note: instantiated from: R1(D,A,B,C,X( 4), 5,0x5A827999L); ^ ~ /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst.c:135:5: note: instantiated from: R1(D,A,B,C,X( 4), 5,0x5A827999L); ^ /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst.c:136:2: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'unsigned int' R1(C,D,A,B,X( 8), 9,0x5A827999L); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst.c:60: /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_locl.h:108:4: note: instantiated from: a=ROTATE(a,s); };\ ^ /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst.c:136:2: note: instantiated from: R1(C,D,A,B,X( 8), 9,0x5A827999L); ^ ~ /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst.c:136:5: note: instantiated from: R1(C,D,A,B,X( 8), 9,0x5A827999L); ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 4 warnings and 20 errors generated. *** Error code 1 Stop in /usr/src/secure/lib/libcrypto. *** Error code 1 -- Cris, member of G.U.F.I Italian FreeBSD User Group http://www.gufi.org/ From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 13:42:03 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E7A91065670 for ; Thu, 24 Jun 2010 13:42:03 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5B58FC18 for ; Thu, 24 Jun 2010 13:42:03 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e1f1:8066:6d95:b7de] (unknown [IPv6:2001:7b8:3a7:0:e1f1:8066:6d95:b7de]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0D7825C43; Thu, 24 Jun 2010 15:42:02 +0200 (CEST) Message-ID: <4C2360AC.9070309@andric.com> Date: Thu, 24 Jun 2010 15:42:04 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.4) Gecko/20100619 Lanikai/3.1.1pre MIME-Version: 1.0 To: Cristiano Deana References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: Problem with buildworld with CLANG X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 13:42:03 -0000 On 2010-06-24 15:33, Cristiano Deana wrote: > Last lines: > > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst.c:135:2: > error: unsupported inline asm: input with type 'unsigned long' > matching output with type > 'unsigned int' > R1(D,A,B,C,X( 4), 5,0x5A827999L); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Don't try building head with clang, it is not possible yet. Use clangbsd instead. :) From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 13:42:18 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96868106564A for ; Thu, 24 Jun 2010 13:42:18 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 224108FC0A for ; Thu, 24 Jun 2010 13:42:17 +0000 (UTC) Received: by fxm7 with SMTP id 7so4464328fxm.13 for ; Thu, 24 Jun 2010 06:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=wxcBjdAQNr9LUuLL6MnedUqcH3SBw45SbUB2uMP4LUc=; b=Z3pQq0Qt7ptJQyaPbiHXw+IBHc1IDFAnkFzOvo8PrOadYDvXbX+WxI7YUox1sOV8Vl qrcddgbvsir6ITCEh1LrY4FoKWsZ3fm7k/wanaZAtMHj7U2zlZXUcPYPeNpgOqegzQvm iu5uE33VS1C11WCTL55Jici617TcPjE1xPvY8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Jld6nI0C0xWtD+xxQpl0twlp0/i36qZBKrRTg+7R7ogT5BJalB587jwra+Litfy5kL o2IM7OXaQz3JyzSzQ+8Cqv937jBcz7OmFVTE9jBmmryJIrINg3mPm181KklLHbgP2qAA eEPWFXGxy+s+FU49lukrADvj44DOib7ugAiYs= MIME-Version: 1.0 Received: by 10.239.191.210 with SMTP id c18mr690228hbi.16.1277386936843; Thu, 24 Jun 2010 06:42:16 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Thu, 24 Jun 2010 06:42:16 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Jun 2010 14:42:16 +0100 Message-ID: From: Tom Evans To: Cristiano Deana Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: Problem with buildworld with CLANG X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 13:42:18 -0000 On Thu, Jun 24, 2010 at 2:33 PM, Cristiano Deana wrote: > On Thu, Jun 24, 2010 at 11:24 AM, Tom Evans wr= ote: > >> The error in your first email was clearly a warning being promoted to >> an error, so either you had a different error on your build with >> NO_WERROR/WERROR, or your NO_WERROR/WERROR settings were not being >> respected. Please retry with NO_WERROR/WERROR set in /etc/src.conf, >> and show the resulting error. > > Last lines: > > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst= .c:135:2: > error: unsupported inline asm: input with type 'unsigned long' > matching output with type > =C2=A0 =C2=A0 =C2=A0'unsigned int' > =C2=A0 =C2=A0 =C2=A0 =C2=A0R1(D,A,B,C,X( 4), 5,0x5A827999L); > =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst= .c:60: > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_locl= .h:108:4: > note: instantiated from: > =C2=A0 =C2=A0 =C2=A0 =C2=A0a=3DROTATE(a,s); };\ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^ > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst= .c:135:2: > note: instantiated from: > =C2=A0 =C2=A0 =C2=A0 =C2=A0R1(D,A,B,C,X( 4), 5,0x5A827999L); > =C2=A0 =C2=A0 =C2=A0 =C2=A0^ =C2=A0~ > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst= .c:135:5: > note: instantiated from: > =C2=A0 =C2=A0 =C2=A0 =C2=A0R1(D,A,B,C,X( 4), 5,0x5A827999L); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^ > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst= .c:136:2: > error: unsupported inline asm: input with type 'unsigned long' > matching output with type > =C2=A0 =C2=A0 =C2=A0'unsigned int' > =C2=A0 =C2=A0 =C2=A0 =C2=A0R1(C,D,A,B,X( 8), 9,0x5A827999L); > =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst= .c:60: > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_locl= .h:108:4: > note: instantiated from: > =C2=A0 =C2=A0 =C2=A0 =C2=A0a=3DROTATE(a,s); };\ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^ > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst= .c:136:2: > note: instantiated from: > =C2=A0 =C2=A0 =C2=A0 =C2=A0R1(C,D,A,B,X( 8), 9,0x5A827999L); > =C2=A0 =C2=A0 =C2=A0 =C2=A0^ =C2=A0~ > /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/md4/md4_dgst= .c:136:5: > note: instantiated from: > =C2=A0 =C2=A0 =C2=A0 =C2=A0R1(C,D,A,B,X( 8), 9,0x5A827999L); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^ > fatal error: too many errors emitted, stopping now [-ferror-limit=3D] > 4 warnings and 20 errors generated. > *** Error code 1 > > Stop in /usr/src/secure/lib/libcrypto. > *** Error code 1 > > So thats a completely different error than you had been reporting. I'm afraid I don't know enough about clang to help with that one. Cheers Tom From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 13:45:51 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7857106568C; Thu, 24 Jun 2010 13:45:51 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa]) by mx1.freebsd.org (Postfix) with ESMTP id 5F6188FC1D; Thu, 24 Jun 2010 13:45:51 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id AA91B2A28CD4; Thu, 24 Jun 2010 15:45:50 +0200 (CEST) Date: Thu, 24 Jun 2010 15:45:50 +0200 From: Ed Schouten To: Mike Meyer Message-ID: <20100624134550.GU2179@hoeg.nl> References: <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624092148.GA6948@duncan.reilly.home> <20100624132154.GT2179@hoeg.nl> <20100624094408.68d13c41@bhuda.mired.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HKOZ/JADkehwFk9I" Content-Disposition: inline In-Reply-To: <20100624094408.68d13c41@bhuda.mired.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Andrew Reilly Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 13:45:51 -0000 --HKOZ/JADkehwFk9I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Mike Meyer wrote: > Maybe it's time for /usr/sbin/lpwrapper, to do the same thing for > print systems? In my opinion, we should just rename mailwrapper to whateverwrapper and list the lpr programs in there as well. --=20 Ed Schouten WWW: http://80386.nl/ --HKOZ/JADkehwFk9I Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAkwjYY4ACgkQ52SDGA2eCwVbWQCeP8v27W35CiH6navZhCjk4DZs VXkAmgNZ7hANskD+PO/r96YKxgslQdFz =8jPV -----END PGP SIGNATURE----- --HKOZ/JADkehwFk9I-- From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 13:59:08 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E264A1065670; Thu, 24 Jun 2010 13:59:08 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE438FC16; Thu, 24 Jun 2010 13:59:08 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 89AA41FFC33; Thu, 24 Jun 2010 13:59:07 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id B266B8452D; Thu, 24 Jun 2010 15:56:56 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ed Schouten References: <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624092148.GA6948@duncan.reilly.home> <20100624132154.GT2179@hoeg.nl> <20100624094408.68d13c41@bhuda.mired.org> <20100624134550.GU2179@hoeg.nl> Date: Thu, 24 Jun 2010 15:56:56 +0200 In-Reply-To: <20100624134550.GU2179@hoeg.nl> (Ed Schouten's message of "Thu, 24 Jun 2010 15:45:50 +0200") Message-ID: <86pqzg8rfb.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Mike Meyer , Andrew Reilly , freebsd-current@freebsd.org Subject: Re: using cupsd instead of base lpr X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 13:59:09 -0000 Ed Schouten writes: > In my opinion, we should just rename mailwrapper to whateverwrapper > and list the lpr programs in there as well. Take a look at /etc/alternatives in any Debian-based Linux distro... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 14:45:09 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD0331065673 for ; Thu, 24 Jun 2010 14:45:09 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 79B078FC15 for ; Thu, 24 Jun 2010 14:45:08 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORnfv-0006SU-Nf; Thu, 24 Jun 2010 15:45:07 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORnfv-0006B6-Ea; Thu, 24 Jun 2010 15:45:07 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5OEj7BG027261; Thu, 24 Jun 2010 15:45:07 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5OEj7fv027260; Thu, 24 Jun 2010 15:45:07 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 24 Jun 2010 15:45:07 +0100 From: Anton Shterenlikht To: Dimitry Andric , freebsd-current@freebsd.org Message-ID: <20100624144506.GA27247@mech-cluster241.men.bris.ac.uk> References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <86eig0filf.fsf@ds4.des.no> <20100624082616.GA9272@mech-cluster241.men.bris.ac.uk> <4C2325B4.5030204@andric.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <4C2325B4.5030204@andric.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 14:45:09 -0000 On Thu, Jun 24, 2010 at 11:30:28AM +0200, Dimitry Andric wrote: > On 2010-06-24 10:26, Anton Shterenlikht wrote: > > I got a clean copy of r209203, and got the same error on buildworld: > >=20 > > cc -static -o rescue rescue.o cat.lo chflags.lo chio.lo chmod.lo cp.lo = date.lo dd.lo df.lo echo.lo ed.lo exp .lo getfacl.lo hostname.lo kenv.lo ki= ll.lo ln.lo ls.lo mkdir.lo mv.lo pkill.lo ps.lo pwd.lo realpath.lo rm.l rm= dir.lo setfacl.lo sh.lo stty.lo sync.lo test.lo rcp.lo csh.lo atacontrol.lo= badsect.lo camcontrol.lo ccdc nfig.lo clri.lo devfs.lo dmesg.lo dump.lo du= mpfs.lo dumpon.lo fsck.lo fsck_ffs.lo fsck_msdosfs.lo fsdb.lo fs rand.lo gb= de.lo geom.lo ifconfig.lo init.lo kldconfig.lo kldload.lo kldstat.lo kldunl= oad.lo ldconfig.lo md5. o mdconfig.lo mdmfs.lo mknod.lo mount.lo mount_cd96= 60.lo mount_msdosfs.lo mount_nfs.lo mount_ntfs.lo mount_n llfs.lo mount_udf= =2Elo mount_unionfs.lo newfs.lo newfs_msdos.lo nos-tun.lo ping.lo reboot.lo= restore.lo rcorde .lo route.lo routed.lo rtquery.lo rtsol.lo savecore.lo s= pppcontrol.lo swapon.lo sysctl.lo tunefs.lo umount.l atmconfig.lo ping6.lo= ipf.lo zfs.lo zpool.lo mca.lo dhclient.lo head.lo mt.lo sed.lo tail.lo tee= =2Elo gzip.lo bzip2. > lo xz.lo tar.lo vi.lo id.lo chroot.lo chown.lo /usr/obj/usr/src/rescue/re= scue/../librescue/exec.o /usr obj/usr/src/rescue/rescue/../librescue/getuse= rshell.o /usr/obj/usr/src/rescue/rescue/../librescue/login_clas .o /usr/obj= /usr/src/rescue/rescue/../librescue/popen.o /usr/obj/usr/src/rescue/rescue/= =2E./librescue/rcmdsh.o usr/obj/usr/src/rescue/rescue/../librescue/sysctl.= o /usr/obj/usr/src/rescue/rescue/../librescue/system.o -lc ypt -ledit -lkvm= -ll -ltermcap -lutil -lalias -lcam -lcurses -ldevstat -lipsec -lipx -lzfs = -lnvpair -luutil lavl -lgeom -lbsdxml -ljail -lkiconv -lmd -lreadline -lsb= uf -lufs -lz -lbz2 -llzma -larchive -lcrypto -lm > > xz.lo(.text+0x5202): In function `hardware_init': >=20 > Anton, can you please upload a (compressed) copy of the full buildworld > log somewhere? http://seis.bris.ac.uk/~mexas/buildworld-ia64-r209203.log.bz2 many thanks anton --=20 Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 15:11:24 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 658BE106564A; Thu, 24 Jun 2010 15:11:24 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirj.bris.ac.uk (dirj.bris.ac.uk [137.222.10.78]) by mx1.freebsd.org (Postfix) with ESMTP id 1CE228FC14; Thu, 24 Jun 2010 15:11:23 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirj.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORo5K-0006vp-2K; Thu, 24 Jun 2010 16:11:22 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORo5J-0005Is-Og; Thu, 24 Jun 2010 16:11:21 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5OFBLjN033056; Thu, 24 Jun 2010 16:11:21 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5OFBLj1033055; Thu, 24 Jun 2010 16:11:21 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 24 Jun 2010 16:11:21 +0100 From: Anton Shterenlikht To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100624151121.GA29609@mech-cluster241.men.bris.ac.uk> References: <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> <8639wcafhn.fsf@ds4.des.no> <20100624110511.GD10082@mech-cluster241.men.bris.ac.uk> <86tyos8u57.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86tyos8u57.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@FreeBSD.org, freebsd-ia64@FreeBSD.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 15:11:24 -0000 On Thu, Jun 24, 2010 at 02:58:12PM +0200, Dag-Erling Smørgrav wrote: > Anton Shterenlikht writes: > > *startfile_prefix_spec: > > /usr/obj/usr/src/tmp/usr/lib/ > > OK > > % cd /usr/src > % make buildenv > % cd rescue/rescue > % make > > I expect this to produce the same error as before; if not, there is > something seriously wrong. the error is different... echo fsck_ffs: /usr/lib/libc.a /usr/lib/libufs.a >> .depend cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c dir.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c ea.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c fsutil.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c inode.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c main.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c pass1.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c pass1b.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c pass2.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c pass3.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c pass4.c cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c pass5.c cc1: warnings being treated as errors pass5.c: In function 'pass5': pass5.c:263: warning: implicit declaration of function 'ffs_fragacct' *** Error code 1 Stop in /usr/src/sbin/fsck_ffs. *** Error code 1 Stop in /usr/src/rescue/rescue. *** Error code 1 In case it matters, I currently have CFLAGS= -O1 COPTFLAGS= -O1 in /etc/make.conf But I tried commenting these options out - same result: cc -O2 -pipe -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c pass5.c cc1: warnings being treated as errors pass5.c: In function 'pass5': pass5.c:263: warning: implicit declaration of function 'ffs_fragacct' *** Error code 1 > > Now copy the last command make tried to run (cc -static ...), add -v > before -static (cc -v -static ...) and run it. I guess this is no longer relevant since I get a different error now? many thanks -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 15:17:33 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E008106564A; Thu, 24 Jun 2010 15:17:33 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101]) by mx1.freebsd.org (Postfix) with ESMTP id 19A0C8FC18; Thu, 24 Jun 2010 15:17:32 +0000 (UTC) MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Received: from [10.119.214.170] (166-205-136-135.mobile.mymmode.com [166.205.136.135]) by asmtp026.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L4I007L7YGE8V00@asmtp026.mac.com>; Thu, 24 Jun 2010 08:17:16 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006240086 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-24_02:2010-02-06, 2010-06-24, 2010-06-24 signatures=0 References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> In-reply-to: <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> Content-transfer-encoding: quoted-printable Message-id: <1A1C9482-2E4B-4AD7-975C-7D1A30A2D9E7@mac.com> X-Mailer: iPhone Mail (8A293) From: Marcel Moolenaar Date: Thu, 24 Jun 2010 08:16:52 -0700 To: Anton Shterenlikht Cc: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , "freebsd-current@freebsd.org" , Anton Shterenlikht , "freebsd-ia64@freebsd.org" Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 15:17:33 -0000 Sorry for the top post: Anton, Can check if you have /usr/local/lib/liblzma on your other machines. I have t= his nagging feeling that you're picking up a library outside of your object t= ree. Also: can you send the contents of /etc/make.conf Thx --=20 Marcel (Mobile) On Jun 24, 2010, at 1:36 AM, Anton Shterenlikht wrote:= > On Wed, Jun 23, 2010 at 04:20:18PM +0200, Dag-Erling Sm=C3=B8rgrav wrote: >> Anton Shterenlikht writes: >>> I think it's possible that at some point, in anger, I did "make >>> installworld" after a failed, or otherwise interrupted "make >>> buildworld". Perhaps I got an inconsistent set of binaries as a >>> result... Would that explain an error like this? >>=20 >> No, because at this point buildworld is using the toolchain and >> libraries that it built earlier. >=20 > sorry for the delay >=20 > On a clean copy of r209203 >=20 >> Can you do >>=20 >> % find /usr/obj/usr/src -name liblzma.a >>=20 >> There should be at least one in /usr/obj/usr/src/lib/liblzma and one in >> /usr/obj/usr/src/tmp/usr/lib, and they should be identical. >=20 > seems so: >=20 > # find /usr/obj/usr/src -name liblzma.a > /usr/obj/usr/src/tmp/usr/lib/liblzma.a > /usr/obj/usr/src/lib/liblzma/liblzma.a > # diff /usr/obj/usr/src/tmp/usr/lib/liblzma.a /usr/obj/usr/src/lib/liblzma= /liblzma.a > #=20 >=20 >> Next, do >>=20 >> % nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem >>=20 >> and show us the result. >=20 > # nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem > hardware_physmem.o: > 0000000000000000 T lzma_physmem > U lzma_tuklib_physmem > tuklib_physmem.o: > 0000000000000000 T lzma_tuklib_physmem > #=20 >=20 >> While you're at it, do this as well: >>=20 >> % nm /usr/lib/liblzma.a | grep physmem >=20 > # nm /usr/lib/liblzma.a | grep physmem > nm: '/usr/lib/liblzma.a': No such file > # >=20 > Did you mean /usr/local/lib/liblzma.a ? >=20 > # nm /usr/local/lib/liblzma.a|grep physmem > # >=20 >=20 > On my other 2 ia64 boxes, where I don't have > this problem, the output of the last command > is the same. >=20 >=20 > many thanks > anton >=20 > --=20 > Anton Shterenlikht > Room 2.6, Queen's Building > Mech Eng Dept > Bristol University > University Walk, Bristol BS8 1TR, UK > Tel: +44 (0)117 331 5944 > Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 15:30:18 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA0EB106567B; Thu, 24 Jun 2010 15:30:18 +0000 (UTC) (envelope-from faber@zod.isi.edu) Received: from zod.isi.edu (zod.isi.edu [128.9.168.221]) by mx1.freebsd.org (Postfix) with ESMTP id 8AEAC8FC14; Thu, 24 Jun 2010 15:30:18 +0000 (UTC) Received: from zod.isi.edu (localhost [127.0.0.1]) by zod.isi.edu (8.14.4/8.14.4) with ESMTP id o5OFTv9a046629; Thu, 24 Jun 2010 08:30:17 -0700 (PDT) (envelope-from faber@zod.isi.edu) Received: (from faber@localhost) by zod.isi.edu (8.14.4/8.14.4/Submit) id o5OFTvCM046628; Thu, 24 Jun 2010 08:29:57 -0700 (PDT) (envelope-from faber) Date: Thu, 24 Jun 2010 08:29:57 -0700 From: Ted Faber To: Tom Evans Message-ID: <20100624152957.GA46600@zod.isi.edu> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-url: http://www.isi.edu/~faber Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 15:30:18 -0000 --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 24, 2010 at 09:40:00AM +0100, Tom Evans wrote: > I also have this in make.conf: > CUPS_OVERWRITE_BASE=3Dyes > WITHOUT_LPR=3Dyes >=20 > which print/cups-base uses to do make any lpr related binaries in > /usr/bin non-executable, so they are skipped over and the cups > specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just > stops LPR being built by buildworld. The clear winner, and one I was unaware of. Thanks, Tom. --=20 Ted Faber http://www.isi.edu/~faber PGP: http://www.isi.edu/~faber/pubkeys.= asc Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#= SIG --IJpNTDwzlM2Ie8A6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwjefUACgkQaUz3f+Zf+XtTkACffwzLDDbJSJDS9rCVq9tokT+j PLwAn2VYDIHaPus7s7w/6wphOSWPbbjZ =+UKw -----END PGP SIGNATURE----- --IJpNTDwzlM2Ie8A6-- From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 15:47:32 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB721106566B; Thu, 24 Jun 2010 15:47:32 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 6F46F8FC15; Thu, 24 Jun 2010 15:47:32 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1ORoeI-0002Wl-Od; Thu, 24 Jun 2010 16:47:30 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ORoeI-0000S9-GO; Thu, 24 Jun 2010 16:47:30 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5OFlU1o033259; Thu, 24 Jun 2010 16:47:30 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5OFlUAR033258; Thu, 24 Jun 2010 16:47:30 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 24 Jun 2010 16:47:30 +0100 From: Anton Shterenlikht To: Marcel Moolenaar Message-ID: <20100624154729.GA33214@mech-cluster241.men.bris.ac.uk> References: <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <1A1C9482-2E4B-4AD7-975C-7D1A30A2D9E7@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1A1C9482-2E4B-4AD7-975C-7D1A30A2D9E7@mac.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , "freebsd-current@freebsd.org" , Anton Shterenlikht , "freebsd-ia64@freebsd.org" Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 15:47:32 -0000 On Thu, Jun 24, 2010 at 08:16:52AM -0700, Marcel Moolenaar wrote: > Sorry for the top post: > > Anton, > > Can check if you have /usr/local/lib/liblzma on your other machines. I have this nagging feeling that you're picking up a library outside of your object tree. Marcel On as28 and as221 I get: $ ls /usr/local/lib/liblzma* ls: /usr/local/lib/liblzma*: No such file or directory $ ls /usr/lib/liblzma* /usr/lib/liblzma.a /usr/lib/liblzma.so /usr/lib/liblzma.so.5 /usr/lib/liblzma_p.a $ However, on the problem box it's the other way round: $ ls /usr/local/lib/liblzma* /usr/local/lib/liblzma.a /usr/local/lib/liblzma.so /usr/local/lib/liblzma.la /usr/local/lib/liblzma.so.0 $ ls /usr/lib/liblzma* ls: /usr/lib/liblzma*: No such file or directory $ > > Also: can you send the contents of /etc/make.conf > /etc/make.conf is identical (save for the time in the perl comment line) on all three boxes: $ cat /etc/make.conf SENDMAIL_CFLAGS=-I/usr/local/include/sasl -DSASL SENDMAIL_LDFLAGS=-L/usr/local/lib SENDMAIL_LDADD=-lsasl2 CFLAGS= -O1 COPTFLAGS= -O1 # added by use.perl 2010-05-17 10:55:29 PERL_VERSION=5.10.1 $ many thanks anton > > > -- > Marcel (Mobile) > > On Jun 24, 2010, at 1:36 AM, Anton Shterenlikht wrote: > > > On Wed, Jun 23, 2010 at 04:20:18PM +0200, Dag-Erling Smørgrav wrote: > >> Anton Shterenlikht writes: > >>> I think it's possible that at some point, in anger, I did "make > >>> installworld" after a failed, or otherwise interrupted "make > >>> buildworld". Perhaps I got an inconsistent set of binaries as a > >>> result... Would that explain an error like this? > >> > >> No, because at this point buildworld is using the toolchain and > >> libraries that it built earlier. > > > > sorry for the delay > > > > On a clean copy of r209203 > > > >> Can you do > >> > >> % find /usr/obj/usr/src -name liblzma.a > >> > >> There should be at least one in /usr/obj/usr/src/lib/liblzma and one in > >> /usr/obj/usr/src/tmp/usr/lib, and they should be identical. > > > > seems so: > > > > # find /usr/obj/usr/src -name liblzma.a > > /usr/obj/usr/src/tmp/usr/lib/liblzma.a > > /usr/obj/usr/src/lib/liblzma/liblzma.a > > # diff /usr/obj/usr/src/tmp/usr/lib/liblzma.a /usr/obj/usr/src/lib/liblzma/liblzma.a > > # > > > >> Next, do > >> > >> % nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem > >> > >> and show us the result. > > > > # nm /usr/obj/usr/src/lib/liblzma/liblzma.a | grep physmem > > hardware_physmem.o: > > 0000000000000000 T lzma_physmem > > U lzma_tuklib_physmem > > tuklib_physmem.o: > > 0000000000000000 T lzma_tuklib_physmem > > # > > > >> While you're at it, do this as well: > >> > >> % nm /usr/lib/liblzma.a | grep physmem > > > > # nm /usr/lib/liblzma.a | grep physmem > > nm: '/usr/lib/liblzma.a': No such file > > # > > > > Did you mean /usr/local/lib/liblzma.a ? > > > > # nm /usr/local/lib/liblzma.a|grep physmem > > # > > > > > > On my other 2 ia64 boxes, where I don't have > > this problem, the output of the last command > > is the same. > > > > > > many thanks > > anton > > > > -- > > Anton Shterenlikht > > Room 2.6, Queen's Building > > Mech Eng Dept > > Bristol University > > University Walk, Bristol BS8 1TR, UK > > Tel: +44 (0)117 331 5944 > > Fax: +44 (0)117 929 4423 > -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 15:53:12 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54C021065672; Thu, 24 Jun 2010 15:53:12 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC018FC15; Thu, 24 Jun 2010 15:53:11 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 89AE61FFC35; Thu, 24 Jun 2010 15:53:10 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id B19F0845D6; Thu, 24 Jun 2010 17:50:59 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> <8639wcafhn.fsf@ds4.des.no> <20100624110511.GD10082@mech-cluster241.men.bris.ac.uk> <86tyos8u57.fsf@ds4.des.no> <20100624151121.GA29609@mech-cluster241.men.bris.ac.uk> Date: Thu, 24 Jun 2010 17:50:59 +0200 In-Reply-To: <20100624151121.GA29609@mech-cluster241.men.bris.ac.uk> (Anton Shterenlikht's message of "Thu, 24 Jun 2010 16:11:21 +0100") Message-ID: <86lja48m58.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@FreeBSD.org, freebsd-ia64@FreeBSD.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 15:53:12 -0000 Anton Shterenlikht writes: > Dag-Erling Sm=C3=B8rgrav writes: > > I expect this to produce the same error as before; if not, there is > > something seriously wrong. > the error is different... > > echo fsck_ffs: /usr/lib/libc.a /usr/lib/libufs.a >> .depend > cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESC= UE -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uniniti= alized -Wno-pointer-sign -c dir.c This is wrong. It shouldn't compile anything. Did you do anything at all to your tree (src or obj) after the failed buildworld? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 15:56:07 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5860C1065674; Thu, 24 Jun 2010 15:56:07 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id CCEB78FC15; Thu, 24 Jun 2010 15:56:06 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id C23AF1FFC35; Thu, 24 Jun 2010 15:56:05 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id ED7AE845D6; Thu, 24 Jun 2010 17:53:54 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Marcel Moolenaar References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <1A1C9482-2E4B-4AD7-975C-7D1A30A2D9E7@mac.com> Date: Thu, 24 Jun 2010 17:53:54 +0200 In-Reply-To: <1A1C9482-2E4B-4AD7-975C-7D1A30A2D9E7@mac.com> (Marcel Moolenaar's message of "Thu, 24 Jun 2010 08:16:52 -0700") Message-ID: <86hbks8m0d.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-current@freebsd.org" , Anton Shterenlikht , "freebsd-ia64@freebsd.org" Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 15:56:07 -0000 Marcel Moolenaar writes: > Can check if you have /usr/local/lib/liblzma on your other machines. I > have this nagging feeling that you're picking up a library outside of > your object tree. That's what I'm working my way towards, Marcel. Can you wait until Anton has answered my questions. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 16:10:13 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFA2A1065678 for ; Thu, 24 Jun 2010 16:10:12 +0000 (UTC) (envelope-from roam@ringlet.net) Received: from erengrad.hoster.bg (erengrad.hoster.bg [77.77.142.9]) by mx1.freebsd.org (Postfix) with ESMTP id 50A568FC1A for ; Thu, 24 Jun 2010 16:10:12 +0000 (UTC) Received: from middenheim.hoster.bg (middenheim.hoster.bg [77.77.142.11]) by erengrad.hoster.bg (Postfix) with ESMTP id 52F90DCAF5 for ; Thu, 24 Jun 2010 18:46:20 +0300 (EEST) Received: from straylight.ringlet.net (office.hoster.bg [78.90.131.77]) (Authenticated sender: roam@hoster.bg) by mail.hoster.bg (Postfix) with ESMTP id 352F55C53E for ; Thu, 24 Jun 2010 18:46:17 +0300 (EEST) Received: from roam (uid 1000) (envelope-from roam@ringlet.net) id 41600c by straylight.ringlet.net (DragonFly Mail Agent) Thu, 24 Jun 2010 18:46:10 +0300 Date: Thu, 24 Jun 2010 18:46:10 +0300 From: Peter Pentchev To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Message-ID: <20100624154610.GC18189@straylight.ringlet.net> Mail-Followup-To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= , Ed Schouten , freebsd-hackers@freebsd.org, Mike Meyer , Andrew Reilly , freebsd-current@freebsd.org References: <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624092148.GA6948@duncan.reilly.home> <20100624132154.GT2179@hoeg.nl> <20100624094408.68d13c41@bhuda.mired.org> <20100624134550.GU2179@hoeg.nl> <86pqzg8rfb.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XMCwj5IQnwKtuyBG" Content-Disposition: inline In-Reply-To: <86pqzg8rfb.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) X-MailScanner-ID: 352F55C53E.E7CBE X-hoster-MailScanner: Found to be clean X-hoster-MailScanner-SpamCheck: not spam, SpamAssassin (cached, score=0.001, required 10, autolearn=disabled, UNPARSEABLE_RELAY 0.00) X-hoster-MailScanner-From: roam@ringlet.net X-hoster-MailScanner-To: freebsd-current@freebsd.org X-Spam-Status: No Cc: Ed Schouten , Mike Meyer , freebsd-current@freebsd.org, Andrew Reilly , freebsd-hackers@freebsd.org Subject: Re: using cupsd instead of base lpr X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 16:10:13 -0000 --XMCwj5IQnwKtuyBG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 24, 2010 at 03:56:56PM +0200, Dag-Erling Sm=C3=B8rgrav wrote: > Ed Schouten writes: > > In my opinion, we should just rename mailwrapper to whateverwrapper > > and list the lpr programs in there as well. >=20 > Take a look at /etc/alternatives in any Debian-based Linux distro... Yeah, that's actually something I've long wondered about implementing; shouldn't be too hard, really. Never found the tuits, though :) For those who don't know what the idea is: /usr/bin/ftp is a symlink to /etc/alternatives/ftp, which in its turn is a symlink to /usr/bin/tnftp. The /etc/alternatives/ links are maintained by the update-alternatives utility which knows about priorities, defaults, slave symlinks (e.g. if the ftp(1) utility's symlink changes, it would be best to also change the ftp.1.gz manpage symlink, wouldn't it?), and a whole lot more. =46rom a user's standpoint, all you have to do is install a package that declares a higher-priority alternative, and update-alternatives switches the symlink behind the scenes (unless you have explicitly specified one of the choices). If you don't like that, run update-alternatives by hand, and your choice is honored even if later a package with an even higher priority is installed. G'luck, Peter --=20 Peter Pentchev roam@space.bg roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 Hey, out there - is it *you* reading me, or is it someone else? --XMCwj5IQnwKtuyBG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBCgAGBQJMI33CAAoJEGUe77AlJ98TFusP/iN2zNk/bj5DJGwaQKgYfEqq oaLi6cUd/5P5bJPNm+8freXHgU9Hg5VangGOYGyvyXhGDZ9nthCEU+rga1SA5IYR y97XooViSQGS+x8BqqXKuBG/zv4TZ7y4zZOWb6Kaz3QwiwdyG1GO1/OLqG93Sru/ 1i0eWK+oOZUhuQavWu+e83DiDUW0DT3etzTB+GumkXt35z8jAC++xDXZR1IB2bBl 29pLunPrLWz2/u9Pax9EPVUNnEuosgDYAP7qHLjohk+zgClCDQSb23QfFJ50sGE6 SXeEcSQpLIp8BSnffdkGnqBJRpc8g6EcP/KjKf2imHMZFzgaJkM4dLL3cQSx2U2b XR6qemE7kEfeu6zRc7dSOF93+/EZ/siFieLK8nbWGfjVks9kwa9gvIRXS5KTPfHr 8PsB4WKNbpoIUEBTILog7bCZjNKO2klwXT3VbJo0F5UNO8LUab3ZK7tqkeLwEp3j RUeUVkPWdmSi/qhh22E2fECLE6iJgFsu75HeHq6O/F+DvF3ey7TYi5W9EO6m2YYO Tz20U0/tQhXqNi540Du6GoOHKP4XGl5CuD5Kn6/W3MnEZW6DAiSq5OuWDAve5vnh wIJHz40tVCxQEFCyykxsCv3zi7kTnDiEWD33N2HzGuo6Z7fdrZktAW8fa4Q/eKaN S7zFn/85EgtzJotFIxjS =o9DP -----END PGP SIGNATURE----- --XMCwj5IQnwKtuyBG-- From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 16:18:34 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBA4F106564A; Thu, 24 Jun 2010 16:18:34 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98]) by mx1.freebsd.org (Postfix) with ESMTP id A942A8FC1E; Thu, 24 Jun 2010 16:18:34 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=utf-8 Received: from [10.119.26.228] (166-205-137-133.mobile.mymmode.com [166.205.137.133]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L4J000931AE3K90@asmtp023.mac.com>; Thu, 24 Jun 2010 09:18:34 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006240093 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-24_02:2010-02-06, 2010-06-24, 2010-06-24 signatures=0 References: <20100617101541.GA90363@mech-cluster241.men.bris.ac.uk> <4C1A117A.9060608@dataix.net> <20100618085018.GA94427@mech-cluster241.men.bris.ac.uk> <4C1B63A1.3010604@dataix.net> <8639wgfnrk.fsf@ds4.des.no> <20100621150445.GA50194@mech-cluster241.men.bris.ac.uk> <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <1A1C9482-2E4B-4AD7-975C-7D1A30A2D9E7@mac.com> <86hbks8m0d.fsf@ds4.des.no> In-reply-to: <86hbks8m0d.fsf@ds4.des.no> Message-id: <7750D47E-6987-4DC2-B0E0-F0EFF2C19D05@mac.com> X-Mailer: iPhone Mail (8A293) From: Marcel Moolenaar Date: Thu, 24 Jun 2010 09:13:36 -0700 To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Cc: "freebsd-current@freebsd.org" , Anton Shterenlikht , "freebsd-ia64@freebsd.org" Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 16:18:34 -0000 On Jun 24, 2010, at 8:53 AM, Dag-Erling Smørgrav wrote: > Marcel Moolenaar writes: >> Can check if you have /usr/local/lib/liblzma on your other machines. I >> have this nagging feeling that you're picking up a library outside of >> your object tree. > > That's what I'm working my way towards, Marcel. Can you wait until > Anton has answered my questions. > Will do. Thanks for looking into it. -- Marcel (mobile) From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 16:54:46 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 813C31065672; Thu, 24 Jun 2010 16:54:46 +0000 (UTC) (envelope-from faber@zod.isi.edu) Received: from zod.isi.edu (zod.isi.edu [128.9.168.221]) by mx1.freebsd.org (Postfix) with ESMTP id 445E58FC0C; Thu, 24 Jun 2010 16:54:46 +0000 (UTC) Received: from zod.isi.edu (localhost [127.0.0.1]) by zod.isi.edu (8.14.4/8.14.4) with ESMTP id o5OGsjhO047921; Thu, 24 Jun 2010 09:54:45 -0700 (PDT) (envelope-from faber@zod.isi.edu) Received: (from faber@localhost) by zod.isi.edu (8.14.4/8.14.4/Submit) id o5OGsj0V047920; Thu, 24 Jun 2010 09:54:45 -0700 (PDT) (envelope-from faber) Date: Thu, 24 Jun 2010 09:54:45 -0700 From: Ted Faber To: Tom Evans Message-ID: <20100624165445.GF46600@zod.isi.edu> References: <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624152957.GA46600@zod.isi.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IvGM3kKqwtniy32b" Content-Disposition: inline In-Reply-To: <20100624152957.GA46600@zod.isi.edu> User-Agent: Mutt/1.4.2.3i X-url: http://www.isi.edu/~faber Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 16:54:46 -0000 --IvGM3kKqwtniy32b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 24, 2010 at 08:29:57AM -0700, Ted Faber wrote: > On Thu, Jun 24, 2010 at 09:40:00AM +0100, Tom Evans wrote: > > I also have this in make.conf: > > CUPS_OVERWRITE_BASE=3Dyes > > WITHOUT_LPR=3Dyes > >=20 > > which print/cups-base uses to do make any lpr related binaries in > > /usr/bin non-executable, so they are skipped over and the cups > > specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just > > stops LPR being built by buildworld. >=20 > The clear winner, and one I was unaware of. >=20 > Thanks, Tom. CUPS_OVERWRITE_BASE seems to do an odd thing. It doesn't install the cups binaries in /usr/bin, but it does do a chmod 0000 on everything it replaces in /usr/bin . For example praxis:~$ ls -l /usr/bin/lpr -r-sr-sr-x 1 root daemon 29876 Jun 24 09:16 /usr/bin/lpr # portupgrade -f cups-base-1.4.3 praxis:~$ ls -l /usr/bin/lpr ---------- 1 root daemon 29876 Jun 24 09:16 /usr/bin/lpr I'll still use it, but interesting behavior. --=20 Ted Faber http://www.isi.edu/~faber PGP: http://www.isi.edu/~faber/pubkeys.= asc Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#= SIG --IvGM3kKqwtniy32b Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwjjdUACgkQaUz3f+Zf+Xvc8ACg1aGz3iIceO379NTqQzlvwXCO QvAAoIrqfiDzNbX2wSfG8eNfzCSJlyt4 =IMWC -----END PGP SIGNATURE----- --IvGM3kKqwtniy32b-- From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 18:13:39 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDE311065673; Thu, 24 Jun 2010 18:13:39 +0000 (UTC) (envelope-from aoyama@peach.ne.jp) Received: from moon.peach.ne.jp (unknown [IPv6:2001:380:e06:127::53]) by mx1.freebsd.org (Postfix) with ESMTP id 8672A8FC19; Thu, 24 Jun 2010 18:13:39 +0000 (UTC) Received: from moon.peach.ne.jp (localhost [127.0.0.1]) by moon.peach.ne.jp (Postfix) with ESMTP id A502578C6A; Fri, 25 Jun 2010 03:13:38 +0900 (JST) Received: from artemis (unknown [192.168.2.20]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by moon.peach.ne.jp (Postfix) with ESMTP id 939A778C67; Fri, 25 Jun 2010 03:13:38 +0900 (JST) Message-ID: From: "Daisuke Aoyama" To: , , Date: Fri, 25 Jun 2010 03:12:38 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-2022-jp"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 X-Virus-Scanned: ClamAV using ClamSMTP Cc: Subject: iSCSI boot driver version 0.1.1 for iBFT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 18:13:39 -0000 Hello, I made small device driver for the first time. It is published on my blog. Because it is written in Japanese, I try to write here. This module provides initial connection of the iSCSI target with setting via iBFT (iSCSI Boot Firmware Table). Currently, it is intended to use Intel NIC and istgt (iSCSI target). Any other cards, targets may not work. Also, I'm developing under FreeBSD 7.3. (build check under 8.1) Please refer to Microsoft website about iBFT: http://www.microsoft.com/whdc/system/platform/firmware/ibft.mspx I did't use iscsi_initiator.ko within kernel module. So, I'm creating a small version of initiator based on iscsi-2.2.4 and istgt-20100606. Now it have only one cmd holding space in the iSCSI session and use polling. It should be added the queuing/asynchronous operation :) After loading it via /boot/loader.conf, you can install to/boot from the iSCSI target as same as a local SCSI harddisk. Complex settings such as TFTP, NFS, DHCP and PXE are no longer needed. Just use /dev/da0 and so on. How to compile: isboot is a stand alone iSCSI initiator, but source code is depend on the header file of iscsi-2.2.4. You need to extract iscsi-2.2.4 before compiling isboot. # cd /usr/src # tar xvf /path/to/iscsi-2.2.4.tar.gz # tar xvf /path/to/isboot-0.1.1.tar.gz # make buildkernel # make installkernel or # cd /usr/src/sys/modules/iscsi/isboot # make obj # make depend # make all # make install After above install, you have /boot/kernel/isboot.ko. Using as module: Add isboot_load="YES" to /boot/loader.conf. Setup iSCSI target. (recommend istgt-20100407 or later) Configure NIC BIOS to connect the target. Try to boot the server. If the NIC find the target, iBFT can be found by isboot. Then, isboot create own bus for CAM device with iBFT parameters. All LUNs in the target are appeared in the bus. Once FreeBSD + isboot is booted, you can handle it by camcontrol and other normal way as same as SCSI HDD. If you want full install and boot demo, please download FreeNAS 0.7.2 5226 p4 from my blog and try it without local harddisk. FYI: FreeNAS 0.7.1 5127 (stable) includes istgt-20100407. FYI: FreeNAS 0.7.2 5226 p3 includes istgt-20100606. FYI: FreeNAS 0.7.2 5226 p4 includes istgt-20100606 + isboot-0.1.1. sysctl MIBs (read only): net.isboot.version net.isboot.nic net.isboot.device hw.ibft.nic_gateway hw.ibft.nic_prefix hw.ibft.target_lun hw.ibft.target_port hw.ibft.target_address hw.ibft.target_name hw.ibft.initiator_address hw.ibft.initiator_name Performance (read from the target): All using Intel PRO/1000 PT Server Adapter. istgt 20100606 + isboot 0.1 with header/data digest(CRC32C): # dd if=/dev/da6 of=/dev/null bs=1m count=1k 1024+0 records in 1024+0 records out 1073741824 bytes transferred in 20.452429 secs (52499477 bytes/sec) istgt 20100606 + isboot 0.1 with header digest: # dd if=/dev/da6 of=/dev/null bs=1m count=1k 1024+0 records in 1024+0 records out 1073741824 bytes transferred in 17.684945 secs (60715022 bytes/sec) istgt 20100606 + isboot 0.1 without digest: # dd if=/dev/da6 of=/dev/null bs=1m count=1k 1024+0 records in 1024+0 records out 1073741824 bytes transferred in 17.508400 secs (61327239 bytes/sec) Notes/Known Issues/Limitations: bootup/reconnect time might be a little long. ifconfig(8),route(8),etc should not change booted NIC and critical path. Unload the module will cause to panic. IPv6 is not tested. DNS is not configured. Queuing is not supported at this time. CHAP is not supported at this time. Can't configure iSCSI parameter without modifing soure code. Can't reject running XPT command when the socket is lost. Can't exchange the session to iscsi_initiator.ko. The source code depend on iscsi initiator's structure. (first I tried to use it, but finally gave up) The controller such as iscontrol(8) is not provided. Documentation is not written. I'm new to the kernel land. If you have any suggestion, please tell me. Download here (the page is Japanese only): isboot-0.1.1 http://shell.peach.ne.jp/aoyama/archives/1179 FreeNAS 0.7.2 5226 p4 http://shell.peach.ne.jp/aoyama/archives/1181 FYI: danny's iscsi initiator: ftp://ftp.cs.huji.ac.il/users/danny/freebsd/iscsi-2.2.4.tar.gz Regards, Daisuke Aoyama From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 20:04:48 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 074181065674 for ; Thu, 24 Jun 2010 20:04:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (core.vx.sk [188.40.32.143]) by mx1.freebsd.org (Postfix) with ESMTP id 4BFD38FC1F for ; Thu, 24 Jun 2010 20:04:47 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id 6A9DBD8205 for ; Thu, 24 Jun 2010 22:04:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id LgSmXnlUhNt0 for ; Thu, 24 Jun 2010 22:04:43 +0200 (CEST) Received: from [127.0.0.1] (89-201-148-228.dsl.optinet.hr [89.201.148.228]) by mail.vx.sk (Postfix) with ESMTPSA id A0C9FD81FF for ; Thu, 24 Jun 2010 22:04:43 +0200 (CEST) Message-ID: <4C23BA5B.2020709@FreeBSD.org> Date: Thu, 24 Jun 2010 22:04:43 +0200 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: freebsd-current@FreeBSD.org X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=windows-1250 Content-Transfer-Encoding: 7bit Cc: Subject: [CFT] ZFS v16 with stat() speedup X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 20:04:48 -0000 As I have imported some more improvements to the ZFS v15 patch that also target speed, I am now calling for testing of v16 with mainly the following important (post-v16) enhancement (and some related bugfixes): OpenSolaris Bug ID: 6775100 stat() performance on files on zfs should be improved This significantly improves stat() performance of ZFS and has a very positive effect on e.g webservers using PHP (I benchmarked a ~20% speed increase of PHP webserving) The patch is available here: http://people.freebsd.org/~mm/patches/zfs/v16/head-v16-extended.patch List of all changes (compared to current head and v15-patch): http://people.freebsd.org/~mm/patches/zfs/v16/head-v16.txt And again some ISOs (patched 8.1rc1) for testing: http://mfsbsd.vx.sk/iso/8.1rc1-zfsv16.iso (without symbols, 98.7MB) http://mfsbsd.vx.sk/iso/8.1rc1-zfsv16-debug.iso (with kernel symbols, 187.6MB) Login/password: root/mfsroot You can test these ISO's in Virtualbox, other emulation software or real-world systems. They contain a full installable distribution, here is a zfsinstall command example on an ad4 disk, with ZFS version 16, 4GB extra swap partition, lzjb compression and fletcher4 checksum: 1. Login as root (root:mfsroot) 2. mount_cd9660 /dev/acd0 /cdrom 3. zfsinstall -V 16 -t /cdrom/8.1-RC1-amd64.tar.xz -s 4G -c -4 -d ad4 When mfsbsd (not the installed system) is booted, there is a python and py-zfs package in /packages. You can copy and install these to your installed system for full pyzfs functionality (zfs userspace, zfs groupspace, zfs allow, zfs unallow). Thanks for testing, mm From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 08:44:31 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83DBD106564A; Fri, 25 Jun 2010 08:44:31 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirj.bris.ac.uk (dirj.bris.ac.uk [137.222.10.78]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0878FC08; Fri, 25 Jun 2010 08:44:30 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirj.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1OS4WT-0006ew-UX; Fri, 25 Jun 2010 09:44:30 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1OS4WT-0006xh-Pc; Fri, 25 Jun 2010 09:44:29 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id o5P8iT4P042144; Fri, 25 Jun 2010 09:44:29 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id o5P8iTJa042143; Fri, 25 Jun 2010 09:44:29 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Fri, 25 Jun 2010 09:44:29 +0100 From: Anton Shterenlikht To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100625084429.GA42107@mech-cluster241.men.bris.ac.uk> References: <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> <8639wcafhn.fsf@ds4.des.no> <20100624110511.GD10082@mech-cluster241.men.bris.ac.uk> <86tyos8u57.fsf@ds4.des.no> <20100624151121.GA29609@mech-cluster241.men.bris.ac.uk> <86lja48m58.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86lja48m58.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 08:44:31 -0000 On Thu, Jun 24, 2010 at 05:50:59PM +0200, Dag-Erling Smørgrav wrote: > Anton Shterenlikht writes: > > Dag-Erling Smørgrav writes: > > > I expect this to produce the same error as before; if not, there is > > > something seriously wrong. > > the error is different... > > > > echo fsck_ffs: /usr/lib/libc.a /usr/lib/libufs.a >> .depend > > cc -O1 -I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -DRESCUE -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c dir.c > > This is wrong. It shouldn't compile anything. Did you do anything at > all to your tree (src or obj) after the failed buildworld? sorry, I probably misunderstood you again. I did "rm -rf /usr/obj/*" before trying your suggested commands. I guess now this is not what you wanted. So, just for me to be clear, I need to proceed with the buildworld, until I get the error, and then, without cleaning anything, do % cd /usr/src % make buildenv % cd rescue/rescue % make Is that correct? sorry for the bother and many thanks for your help -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423 From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 09:03:44 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD31A1065670; Fri, 25 Jun 2010 09:03:44 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id 077128FC1D; Fri, 25 Jun 2010 09:03:43 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 25so24733eya.9 for ; Fri, 25 Jun 2010 02:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=ElNIEfTefmijEC+63lM1FK7XvUTM/ay0STMGI+/t3PU=; b=mHUksa4OImj2Z52hfH8IVnbXzqtjSG3i+M7nFuaXYzmVQFdlIBAsh+1ZzM2yXEMjCL S9anukIedCrti+1qCr6IrKGduLvbBFFdXj6SEuSYUtVaDPOpRLhBi+1l1VcRMHHiMDvQ XFf4Y8hNPPc9UYf/GmkxpeqByHQSLH1rPh+go= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=p7GfP4eyL2Tq0VbsdcRA/8tzkG61t0NfFgjKDCC2It9RgOM08NSOIhBQgX26BQBb0e muThGKLovCwmzMuAKp+wpPHFp3bQ8CReUTcj3k4XBwZq1rSy4KdQmuNZwB5vh6na+/ON Dj67Ipkb8ylLfB6cfM0HfrEEEnVOyWhcwGXqE= Received: by 10.102.13.11 with SMTP id 11mr85852mum.74.1277456622671; Fri, 25 Jun 2010 02:03:42 -0700 (PDT) Received: from ernst.jennejohn.org (p578E2768.dip.t-dialin.net [87.142.39.104]) by mx.google.com with ESMTPS id j10sm13264298muh.58.2010.06.25.02.03.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 25 Jun 2010 02:03:41 -0700 (PDT) Date: Fri, 25 Jun 2010 11:03:39 +0200 From: Gary Jennejohn To: Ted Faber Message-ID: <20100625110339.398a5006@ernst.jennejohn.org> In-Reply-To: <20100624165445.GF46600@zod.isi.edu> References: <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624152957.GA46600@zod.isi.edu> <20100624165445.GF46600@zod.isi.edu> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Tom Evans , freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 09:03:44 -0000 On Thu, 24 Jun 2010 09:54:45 -0700 Ted Faber wrote: > On Thu, Jun 24, 2010 at 08:29:57AM -0700, Ted Faber wrote: > > On Thu, Jun 24, 2010 at 09:40:00AM +0100, Tom Evans wrote: > > > I also have this in make.conf: > > > CUPS_OVERWRITE_BASE=yes > > > WITHOUT_LPR=yes > > > > > > which print/cups-base uses to do make any lpr related binaries in > > > /usr/bin non-executable, so they are skipped over and the cups > > > specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just > > > stops LPR being built by buildworld. > > > > The clear winner, and one I was unaware of. > > > > Thanks, Tom. > > CUPS_OVERWRITE_BASE seems to do an odd thing. It doesn't install the > cups binaries in /usr/bin, but it does do a chmod 0000 on everything it > replaces in /usr/bin . For example > > praxis:~$ ls -l /usr/bin/lpr > -r-sr-sr-x 1 root daemon 29876 Jun 24 09:16 /usr/bin/lpr > # portupgrade -f cups-base-1.4.3 > praxis:~$ ls -l /usr/bin/lpr > ---------- 1 root daemon 29876 Jun 24 09:16 /usr/bin/lpr > > I'll still use it, but interesting behavior. > IMO if you're going to make the binaries in base non-executable you might just as well delete them. But CUPS_OVERWRITE_BASE does have the advantage that it works without (active) user intervention. -- Gary Jennejohn From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 09:50:11 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5246106564A; Fri, 25 Jun 2010 09:50:11 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 7E46B8FC16; Fri, 25 Jun 2010 09:50:11 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 549921FFC35; Fri, 25 Jun 2010 09:50:10 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 74E1184427; Fri, 25 Jun 2010 11:47:59 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Anton Shterenlikht References: <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> <8639wcafhn.fsf@ds4.des.no> <20100624110511.GD10082@mech-cluster241.men.bris.ac.uk> <86tyos8u57.fsf@ds4.des.no> <20100624151121.GA29609@mech-cluster241.men.bris.ac.uk> <86lja48m58.fsf@ds4.des.no> <20100625084429.GA42107@mech-cluster241.men.bris.ac.uk> Date: Fri, 25 Jun 2010 11:47:59 +0200 In-Reply-To: <20100625084429.GA42107@mech-cluster241.men.bris.ac.uk> (Anton Shterenlikht's message of "Fri, 25 Jun 2010 09:44:29 +0100") Message-ID: <86vd97e94g.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 09:50:11 -0000 Anton Shterenlikht writes: > So, just for me to be clear, I need to proceed with the buildworld, > until I get the error, and then, without cleaning anything, do > > % cd /usr/src > % make buildenv > % cd rescue/rescue > % make > > Is that correct? Yes. Then you take the cc comand line that failed and run it again with the -v option and show us the output. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 09:50:53 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F05501065670 for ; Fri, 25 Jun 2010 09:50:53 +0000 (UTC) (envelope-from freebsd-current@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 7DEFE8FC18 for ; Fri, 25 Jun 2010 09:50:53 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OS5Yf-0004YC-PF for freebsd-current@freebsd.org; Fri, 25 Jun 2010 11:50:49 +0200 Received: from gw2.masterhost.ru ([87.242.97.5]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Jun 2010 11:50:49 +0200 Received: from citrin by gw2.masterhost.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Jun 2010 11:50:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-current@freebsd.org From: Anton Yuzhaninov Date: Fri, 25 Jun 2010 09:50:40 +0000 (UTC) Organization: Vega Lines: 44 Sender: Message-ID: X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: gw2.masterhost.ru User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/2.6.32-gentoo-r7 (i686)) Subject: panic in deadlkres X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 09:50:54 -0000 I've got panic on 9-current from Jun 25 2010 May be this is bug in deadlock resolver panic: blockable sleep lock (sleep mutex) process lock @ /usr/src/sys/kern/kern_clock.c:203 db> show alllocks Process 0 (kernel) thread 0xc4dcd270 (100047) shared sx allproc (allproc) r = 0 (0xc0885ebc) locked @ /usr/src/sys/kern/kern_clock.c:193 db> show lock 0xc4dcd270 class: spin mutex name: D flags: {SPIN, RECURSE} state: {OWNED} (kgdb) bt #0 doadump () at pcpu.h:248 #1 0xc05ae59f in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:416 #2 0xc05ae825 in panic (fmt=Variable "fmt" is not available. ) at /usr/src/sys/kern/kern_shutdown.c:590 #3 0xc048ff45 in db_panic (addr=Could not find the frame base for "db_panic". ) at /usr/src/sys/ddb/db_command.c:478 #4 0xc0490533 in db_command (last_cmdp=0xc086ef1c, cmd_table=0x0, dopager=1) at /usr/src/sys/ddb/db_command.c:445 #5 0xc0490662 in db_command_loop () at /usr/src/sys/ddb/db_command.c:498 #6 0xc04923ef in db_trap (type=3, code=0) at /usr/src/sys/ddb/db_main.c:229 #7 0xc05dade6 in kdb_trap (type=3, code=0, tf=0xc4b31bd0) at /usr/src/sys/kern/subr_kdb.c:535 #8 0xc078696b in trap (frame=0xc4b31bd0) at /usr/src/sys/i386/i386/trap.c:692 #9 0xc076ca0b in calltrap () at /usr/src/sys/i386/i386/exception.s:165 #10 0xc05daf30 in kdb_enter (why=0xc07ea02d "panic", msg=0xc07ea02d "panic") at cpufunc.h:71 #11 0xc05ae806 in panic (fmt=0xc07efd94 "blockable sleep lock (%s) %s @ %s:%d") at /usr/src/sys/kern/kern_shutdown.c:573 #12 0xc05ee30b in witness_checkorder (lock=0xc5148088, flags=9, file=0xc07e3b20 "/usr/src/sys/kern/kern_clock.c", line=203, interlock=0x0) at /usr/src/sys/kern/subr_witness.c:1067 #13 0xc05a093c in _mtx_lock_flags (m=0xc5148088, opts=0, file=0xc07e3b20 "/usr/src/sys/kern/kern_clock.c", line=203) at /usr/src/sys/kern/kern_mutex.c:200 #14 0xc05706a9 in deadlkres () at /usr/src/sys/kern/kern_clock.c:203 #15 0xc0588721 in fork_exit (callout=0xc05705ea , arg=0x0, frame=0xc4b31d38) at /usr/src/sys/kern/kern_fork.c:843 #16 0xc076ca80 in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:270 -- WBR, Anton Yuzhaninov From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 10:04:44 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00DEB1065670 for ; Fri, 25 Jun 2010 10:04:44 +0000 (UTC) (envelope-from freebsd-current@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id B00218FC08 for ; Fri, 25 Jun 2010 10:04:43 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OS5m3-0001Pw-4q for freebsd-current@freebsd.org; Fri, 25 Jun 2010 12:04:39 +0200 Received: from gw2.masterhost.ru ([87.242.97.5]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Jun 2010 12:04:39 +0200 Received: from citrin by gw2.masterhost.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Jun 2010 12:04:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-current@freebsd.org From: Anton Yuzhaninov Date: Fri, 25 Jun 2010 10:04:26 +0000 (UTC) Organization: Vega Lines: 26 Sender: Message-ID: References: X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: gw2.masterhost.ru X-Comment-To: Anton Yuzhaninov User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/2.6.32-gentoo-r7 (i686)) Subject: Re: panic in deadlkres X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 10:04:44 -0000 On Fri, 25 Jun 2010 09:50:40 +0000 (UTC), Anton Yuzhaninov wrote: AY> I've got panic on 9-current from Jun 25 2010 It's wrong date. The system is: FreeBSD 9.0-CURRENT #0: Fri May 28 23:47:37 MSD 2010 AY> AY> May be this is bug in deadlock resolver AY> AY> panic: blockable sleep lock (sleep mutex) process lock @ AY> /usr/src/sys/kern/kern_clock.c:203 AY> db>> show alllocks AY> Process 0 (kernel) thread 0xc4dcd270 (100047) AY> shared sx allproc (allproc) r = 0 (0xc0885ebc) locked @ AY> /usr/src/sys/kern/kern_clock.c:193 AY> db>> show lock 0xc4dcd270 AY> class: spin mutex AY> name: D AY> flags: {SPIN, RECURSE} AY> state: {OWNED} -- WBR, Anton Yuzhaninov From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 11:40:13 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03DFC1065672 for ; Fri, 25 Jun 2010 11:40:13 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (adsl-63-193-123-122.dsl.snfc21.pacbell.net [63.193.123.122]) by mx1.freebsd.org (Postfix) with ESMTP id AD70B8FC16 for ; Fri, 25 Jun 2010 11:40:12 +0000 (UTC) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.4/8.14.4) with ESMTP id o5PBeBvJ035286 for ; Fri, 25 Jun 2010 04:40:11 -0700 (PDT) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.4/8.14.4/Submit) id o5PBeBQu035285 for current@freebsd.org; Fri, 25 Jun 2010 04:40:11 -0700 (PDT) (envelope-from david) Date: Fri, 25 Jun 2010 04:40:11 -0700 From: David Wolfskill To: current@freebsd.org Message-ID: <20100625114011.GO90096@albert.catwhisker.org> Mail-Followup-To: David Wolfskill , current@freebsd.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FTsVDVnBYKo0tCDH" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: Use of boot0cfg to set boot slice broke between r209459 and r209502 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 11:40:13 -0000 --FTsVDVnBYKo0tCDH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Well, one one of my machines -- I realize that there are some machines for which it's been problematic for a while. And all of the machines I'm using run FreeBSD/i386. But it had been working on my build machine since I acquired it (a few months ago) in daily use. Of course, I didn't notice the effect, as after I finished building & smoke-checking head on the build machine, I power it off, via: sudo boot0cfg -s 2 aacd0 && sudo shutdown -p now || sudo shutdown -r now (as leaving it on generates too much noise and heat). And when I powered it up last night (in preparation for the nightly update of my local mirrors and the start of the morning's builds), I failed to note that it was running head, vs. stable/7 (as I had intended). A similar use of boot0cfg on my laptop remains working. Here are the respective "uname -a" outputs from the build machine: FreeBSD freebeast.catwhisker.org 9.0-CURRENT FreeBSD 9.0-CURRENT #198 r2094= 59: Wed Jun 23 06:05:16 PDT 2010 root@freebeast.catwhisker.org:/usr/obj= /usr/src/sys/GENERIC i386 FreeBSD freebeast.catwhisker.org 9.0-CURRENT FreeBSD 9.0-CURRENT #199 r2095= 02: Thu Jun 24 05:41:59 PDT 2010 root@freebeast.catwhisker.org:/usr/obj= /usr/src/sys/GENERIC i386 (As you can see, I run a GENERIC kernel on the build machine.) I've placed a copy of a recent stable/7 dmesg.boot in ; when I next boot CURRENT, I'll grab dmesg.boot & stuff it in . (That should be within a few hours.) Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --FTsVDVnBYKo0tCDH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwklZoACgkQmprOCmdXAD0WIQCfVUneHes83yxuXIv76pE0q7V3 MF8AmwUlNgjr+rYs4EGDwf+EnDw3PIoL =hyAb -----END PGP SIGNATURE----- --FTsVDVnBYKo0tCDH-- From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 13:29:40 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34F9A1065672; Fri, 25 Jun 2010 13:29:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 06D818FC14; Fri, 25 Jun 2010 13:29:40 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 7A9C946B06; Fri, 25 Jun 2010 09:29:39 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D80B78A03C; Fri, 25 Jun 2010 09:29:38 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Fri, 25 Jun 2010 08:37:36 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <20100625114011.GO90096@albert.catwhisker.org> In-Reply-To: <20100625114011.GO90096@albert.catwhisker.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201006250837.36220.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 25 Jun 2010 09:29:38 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: brucec@freebsd.org Subject: Re: Use of boot0cfg to set boot slice broke between r209459 and r209502 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 13:29:40 -0000 On Friday 25 June 2010 7:40:11 am David Wolfskill wrote: > Well, one one of my machines -- I realize that there are some > machines for which it's been problematic for a while. And all of > the machines I'm using run FreeBSD/i386. 209469 perhaps? -- John Baldwin From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 15:38:40 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE5CD106564A for ; Fri, 25 Jun 2010 15:38:40 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 9665A8FC0C for ; Fri, 25 Jun 2010 15:38:40 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id 415CE1CF185 for ; Fri, 25 Jun 2010 10:38:39 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id JHRG02L52SP1 for ; Fri, 25 Jun 2010 10:38:36 -0500 From: Rui Paulo Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Fri, 25 Jun 2010 16:38:33 +0100 Message-Id: <25C030A1-040E-4C7C-99BA-420576026A2B@FreeBSD.org> To: current@freebsd.org Mime-Version: 1.0 (Apple Message framework v1081) X-Mailer: Apple Mail (2.1081) Cc: Subject: HEADS UP: removal of acpi_aiboost(4) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 15:38:41 -0000 Hi, In about a month, acpi_aiboost(4) will be removed. You should start = using acpi_aibs(4) starting today. Regards, -- Rui Paulo From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 16:33:03 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B62F21065673; Fri, 25 Jun 2010 16:33:03 +0000 (UTC) (envelope-from aoyama@peach.ne.jp) Received: from moon.peach.ne.jp (unknown [IPv6:2001:380:e06:127::53]) by mx1.freebsd.org (Postfix) with ESMTP id 7CC6A8FC1B; Fri, 25 Jun 2010 16:33:03 +0000 (UTC) Received: from moon.peach.ne.jp (localhost [127.0.0.1]) by moon.peach.ne.jp (Postfix) with ESMTP id 5F82378C3B; Sat, 26 Jun 2010 01:33:02 +0900 (JST) Received: from artemis (unknown [192.168.2.20]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by moon.peach.ne.jp (Postfix) with ESMTP id 4D56178C34; Sat, 26 Jun 2010 01:33:02 +0900 (JST) Message-ID: <1931AE1113EC4A8983B8A52A2A1966C2@ad.peach.ne.jp> From: "Daisuke Aoyama" To: References: In-Reply-To: Date: Sat, 26 Jun 2010 01:32:05 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-2022-jp"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-current@freebsd.org, freebsd-stable@freebsd.org Subject: Re: iSCSI boot driver version 0.1.1 for iBFT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 16:33:03 -0000 Sorry, isboot-0.1.1 was broken under i386 kernel + loader. The version 0.1.2 is uploaded in my blog. Also I uploaded isboot integrated FreeBSD 7.3 disc1, 8.1-RC1 dics1 and making script. Use at your own risk. You need only iBFT supported NIC and iSCSI target. Please see Intel's site about iBFT supported NIC. http://www.intel.com/support/network/adapter/pro100/sb/CS-028681.htm If you can connect to iSCSI target by NIC BIOS, isboot.ko shows the following log. In this case, em0 is configured automatically with NIC0 parameter in iBFT, and you can install FreeBSD to da1 directly and you can boot from da1. If you want to try to copy existing FreeBSD, then configure NIC and loading isboot.ko via loader.conf or "kldload isboot.ko" from shell. Then, use normal way such as dump/restore. Note: do not set IP to em0 when installation. it might be a problem. --------------------------------------------------------------- iSCSI boot driver version 0.1.2 IS: Initiator name: iqn.2007-09.jp.ne.peach:pluto NIC0: IP address: 192.168.3.48 NIC0: Prefix: 24 NIC0: Gateway: 0.0.0.0 NIC0: MAC address: 00:15:17:97:85:ab TGT0: Target IP address: 192.168.3.36 TGT0: Target Port: 3260 TGT0: Target LUN: 2 TGT0: Target name: iqn.2007-09.jp.ne.peach:isboot1 Boot NIC: em0 Configure IPv4 by NIC0 Attempting to login to iSCSI target and scan all LUNs. ... cut ... da0 at isboot0 bus 0 scbus0 target 0 lun 0 da0: Fixed Direct Access SCSI-5 device da0: 40960MB (83886080 512 byte sectors: 255H 63S/T 5221C) da1 at isboot0 bus 0 scbus0 target 0 lun 2 da1: Fixed Direct Access SCSI-5 device da1: 10240MB (20971520 512 byte sectors: 255H 63S/T 1305C) da2 at isboot0 bus 0 scbus0 target 0 lun 3 da2: Fixed Direct Access SCSI-5 device da2: 1024MB (2097152 512 byte sectors: 64H 32S/T 1024C) ... cut ... Boot device: da1 --------------------------------------------------------------- Download links: http://www.peach.ne.jp/archives/isboot/demo/FreeBSD-7.3-RELEASE-amd64-isboot-0.1.2.iso http://www.peach.ne.jp/archives/isboot/demo/FreeBSD-7.3-RELEASE-i386-isboot-0.1.2.iso http://www.peach.ne.jp/archives/isboot/demo/FreeBSD-8.1-RC1-amd64-isboot-0.1.2.iso http://www.peach.ne.jp/archives/isboot/demo/FreeBSD-8.1-RC1-i386-isboot-0.1.2.iso http://www.peach.ne.jp/archives/isboot/demo/unionfs-mkisboot.sh Try it you self :) Daisuke Aoyama From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 18:01:31 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79F7E106566B; Fri, 25 Jun 2010 18:01:31 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (adsl-63-193-123-122.dsl.snfc21.pacbell.net [63.193.123.122]) by mx1.freebsd.org (Postfix) with ESMTP id 3FA1D8FC1D; Fri, 25 Jun 2010 18:01:30 +0000 (UTC) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.4/8.14.4) with ESMTP id o5PI1UVZ039244; Fri, 25 Jun 2010 11:01:30 -0700 (PDT) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.4/8.14.4/Submit) id o5PI1Umj039243; Fri, 25 Jun 2010 11:01:30 -0700 (PDT) (envelope-from david) Date: Fri, 25 Jun 2010 11:01:30 -0700 From: David Wolfskill To: John Baldwin Message-ID: <20100625180130.GV90096@albert.catwhisker.org> References: <20100625114011.GO90096@albert.catwhisker.org> <201006250837.36220.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jr/gb2Ce1GM9KKZD" Content-Disposition: inline In-Reply-To: <201006250837.36220.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org, brucec@freebsd.org Subject: Re: Use of boot0cfg to set boot slice broke between r209459 and r209502 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 18:01:31 -0000 --jr/gb2Ce1GM9KKZD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 25, 2010 at 08:37:36AM -0400, John Baldwin wrote: > On Friday 25 June 2010 7:40:11 am David Wolfskill wrote: > > Well, one one of my machines -- I realize that there are some > > machines for which it's been problematic for a while. And all of > > the machines I'm using run FreeBSD/i386. >=20 > 209469 perhaps? Apparently so. Here's what I did to test the above assertion: * Booted the build machine from slice 4 (usual "head" slice); cloned that slice to slice 1; booted from slice 1. * In a "head" src working directory, I issued svn diff -c209469 and saw that r209469 merely added 2 lines to usr.sbin/boot0cfg/boot0cfg.c. * On the build machine's src working directory, I edited usr.sbin/boot0cfg/boot0cfg.c to remove the lines in question. * Then (as root), I made /usr/src/usr.sbin/boot0cfg/ my current working directory and issued: make && make install * I then issued boot0cfg -s 4 aacd0 && shutdown -r now then watched the serial console. * I noticed that the default boot slice -- which had been 1 -- was now 4. * For grins, I then booted slice 4 (head) in single-user mode, mounted the file systems, then invoked the boot0cfg executable from slice 1 to switch the default to slice 2, then issued "halt -p". I waited a bit, then powered the machine back up (WoL can be handy!) noted it was booting from slice 2, brought it up in single-user mode, then issued "halt -p" to reduce its power consumption and heat & nouse generation. All that said, it looks as if r209469 merely noticed an existing error condition and tried to do something arguably sensible with it, rather than merely ignore it. So it would seem that there's a more fundamental issue at stake, here.... Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --jr/gb2Ce1GM9KKZD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwk7vkACgkQmprOCmdXAD18OACcCvf7TfrtK9WtxGaNmvPuKuX8 PbIAn1NvfOGp+GfsnHIVYz3g9T8ekggO =pcn7 -----END PGP SIGNATURE----- --jr/gb2Ce1GM9KKZD-- From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 20:52:24 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04BFB1065679 for ; Fri, 25 Jun 2010 20:52:24 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 80B428FC17 for ; Fri, 25 Jun 2010 20:52:23 +0000 (UTC) Received: by wyf22 with SMTP id 22so1712740wyf.13 for ; Fri, 25 Jun 2010 13:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=GOado0N2IXZ7L3yvvL2feojgYhgz0p8HlMP3+r+0bOc=; b=JYLBGvBqvP5nU+9XV9SJw1mmRDYMMiGQuRHDCaRnusoC9xuMC1p7YL+Ko6ZWtIfDuo iw9AdWsO73GH7NjK7IMYScKDxn+dDV3n+wIbUZG7y2SdSdHD3NlcSWyAM/ixfmWNY8Sc /kokWbaNXDK0n8AGAzeKsJgda79LPZpan7Srw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=EFA+Aor8zVej826GeJ5MxsmIXiMX6RY1ee+3gFWIIhoIIJZHzZQ4mzxNv3HeCnmen+ KL2MGibF/N/h3M5b9Ds4Q6g0ANvF9yEySQzudEC1tvdD3DzB0A9AlOcj1QG3nw9pgXQ8 tUuFLUO30yv1wvpSnXmH6Cq2q9X261RTKTn1o= MIME-Version: 1.0 Received: by 10.216.88.211 with SMTP id a61mr983796wef.65.1277499142497; Fri, 25 Jun 2010 13:52:22 -0700 (PDT) Received: by 10.216.37.68 with HTTP; Fri, 25 Jun 2010 13:52:22 -0700 (PDT) In-Reply-To: References: Date: Sat, 26 Jun 2010 00:52:22 +0400 Message-ID: From: pluknet To: Anton Yuzhaninov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: panic in deadlkres X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 20:52:24 -0000 On 25 June 2010 13:50, Anton Yuzhaninov wrote: > I've got panic on 9-current from Jun 25 2010 > > May be this is bug in deadlock resolver > > panic: blockable sleep lock (sleep mutex) process lock @ > /usr/src/sys/kern/kern_clock.c:203 > > db> show alllocks > Process 0 (kernel) thread 0xc4dcd270 (100047) > shared sx allproc (allproc) r =3D 0 (0xc0885ebc) locked @ > /usr/src/sys/kern/kern_clock.c:193 > > db> show lock 0xc4dcd270 > =A0class: spin mutex > =A0name: D > =A0flags: {SPIN, RECURSE} > =A0state: {OWNED} > > (kgdb) bt > #0 =A0doadump () at pcpu.h:248 > #1 =A00xc05ae59f in boot (howto=3D260) at /usr/src/sys/kern/kern_shutdown= .c:416 > #2 =A00xc05ae825 in panic (fmt=3DVariable "fmt" is not available. > ) at /usr/src/sys/kern/kern_shutdown.c:590 > #3 =A00xc048ff45 in db_panic (addr=3DCould not find the frame base for "d= b_panic". > ) at /usr/src/sys/ddb/db_command.c:478 > #4 =A00xc0490533 in db_command (last_cmdp=3D0xc086ef1c, cmd_table=3D0x0, = dopager=3D1) at /usr/src/sys/ddb/db_command.c:445 > #5 =A00xc0490662 in db_command_loop () at /usr/src/sys/ddb/db_command.c:4= 98 > #6 =A00xc04923ef in db_trap (type=3D3, code=3D0) at /usr/src/sys/ddb/db_m= ain.c:229 > #7 =A00xc05dade6 in kdb_trap (type=3D3, code=3D0, tf=3D0xc4b31bd0) at /us= r/src/sys/kern/subr_kdb.c:535 > #8 =A00xc078696b in trap (frame=3D0xc4b31bd0) at /usr/src/sys/i386/i386/t= rap.c:692 > #9 =A00xc076ca0b in calltrap () at /usr/src/sys/i386/i386/exception.s:165 > #10 0xc05daf30 in kdb_enter (why=3D0xc07ea02d "panic", msg=3D0xc07ea02d "= panic") at cpufunc.h:71 > #11 0xc05ae806 in panic (fmt=3D0xc07efd94 "blockable sleep lock (%s) %s @= %s:%d") at /usr/src/sys/kern/kern_shutdown.c:573 > #12 0xc05ee30b in witness_checkorder (lock=3D0xc5148088, flags=3D9, file= =3D0xc07e3b20 "/usr/src/sys/kern/kern_clock.c", line=3D203, interlock=3D0x0= ) > =A0 =A0at /usr/src/sys/kern/subr_witness.c:1067 > #13 0xc05a093c in _mtx_lock_flags (m=3D0xc5148088, opts=3D0, file=3D0xc07= e3b20 "/usr/src/sys/kern/kern_clock.c", line=3D203) > =A0 =A0at /usr/src/sys/kern/kern_mutex.c:200 > #14 0xc05706a9 in deadlkres () at /usr/src/sys/kern/kern_clock.c:203 > #15 0xc0588721 in fork_exit (callout=3D0xc05705ea , arg=3D0x0,= frame=3D0xc4b31d38) at /usr/src/sys/kern/kern_fork.c:843 > #16 0xc076ca80 in fork_trampoline () at /usr/src/sys/i386/i386/exception.= s:270 Hi! [throw in ideas (just ignore them if they're dumb, thinking badly atm).] AFAIK, that indicates that some thread already has a spin mutex and then it tries to acquire a sleep mutex. Looks like kern/kern_clock.c v1.213 (SVN rev 206482) has a regression in handling ticks wrap-up w.r.t. it doesn't release a thread mutex, does it? >From subr_witness.c: 1062: * Since spin locks include a critical section, this c= heck 1063: * implicitly enforces a lock order of all sleep locks before 1064: * all spin locks. 1065: */ 1066: if (td->td_critnest !=3D 0 && !kdb_active) 1067: panic("blockable sleep lock (%s) %s @ %s:%d", 1068: class->lc_name, lock->lo_name, file, line)= ; >From kern_clock.c, v1.213 (in several places, while holding a thread lock): + /* Handle ticks wrap-up. */ + if (ticks < td->td_blktick) + continue; Should not it be like the next: + /* Handle ticks wrap-up. */ + if (ticks < td->td_blktick) { + thread_unlock(td); + continue; + } The precondition idea to reproduce it is to lock a subject thread in some deadlkres callout, handle re-wrap condition, then try to lock a process to witch the thread belongs in (n+m)'th deadlkres callout, or in different context. --=20 wbr, pluknet From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 22:47:29 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F56E1065670; Fri, 25 Jun 2010 22:47:29 +0000 (UTC) (envelope-from vince@unsane.co.uk) Received: from unsane.co.uk (unsane-pt.tunnel.tserv5.lon1.ipv6.he.net [IPv6:2001:470:1f08:110::2]) by mx1.freebsd.org (Postfix) with ESMTP id B8B068FC18; Fri, 25 Jun 2010 22:47:28 +0000 (UTC) Received: from vhoffman-macbook.local ([10.0.0.173]) (authenticated bits=0) by unsane.co.uk (8.14.4/8.14.4) with ESMTP id o5PMlPfL061584 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 25 Jun 2010 23:47:26 +0100 (BST) (envelope-from vince@unsane.co.uk) Message-ID: <4C2531FD.8050605@unsane.co.uk> Date: Fri, 25 Jun 2010 23:47:25 +0100 From: Vincent Hoffman User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Daisuke Aoyama References: <1931AE1113EC4A8983B8A52A2A1966C2@ad.peach.ne.jp> In-Reply-To: <1931AE1113EC4A8983B8A52A2A1966C2@ad.peach.ne.jp> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Cc: freebsd-scsi@freebsd.org, freebsd-current@freebsd.org, freebsd-stable@freebsd.org Subject: Re: iSCSI boot driver version 0.1.1 for iBFT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 22:47:29 -0000 On 25/06/2010 17:32, Daisuke Aoyama wrote: > Sorry, isboot-0.1.1 was broken under i386 kernel + loader. > The version 0.1.2 is uploaded in my blog. > Also I uploaded isboot integrated FreeBSD 7.3 disc1, 8.1-RC1 dics1 and > making script. Use at your own risk. > > You need only iBFT supported NIC and iSCSI target. Since I dont have a supported nic, would the iscsi support in gpxe (http://etherboot.org/wiki/iscsiboot) be enough? (might give it a try if i get time after the weekend.) Vince > > Please see Intel's site about iBFT supported NIC. > http://www.intel.com/support/network/adapter/pro100/sb/CS-028681.htm > > If you can connect to iSCSI target by NIC BIOS, isboot.ko shows the > following log. > > In this case, em0 is configured automatically with NIC0 parameter in > iBFT, > and you can install FreeBSD to da1 directly and you can boot from da1. > > If you want to try to copy existing FreeBSD, then configure NIC and > loading isboot.ko via loader.conf or "kldload isboot.ko" from shell. > Then, use normal way such as dump/restore. > > Note: do not set IP to em0 when installation. it might be a problem. > --------------------------------------------------------------- > iSCSI boot driver version 0.1.2 > IS: Initiator name: iqn.2007-09.jp.ne.peach:pluto > NIC0: IP address: 192.168.3.48 > NIC0: Prefix: 24 > NIC0: Gateway: 0.0.0.0 > NIC0: MAC address: 00:15:17:97:85:ab > TGT0: Target IP address: 192.168.3.36 > TGT0: Target Port: 3260 > TGT0: Target LUN: 2 > TGT0: Target name: iqn.2007-09.jp.ne.peach:isboot1 > Boot NIC: em0 > Configure IPv4 by NIC0 > Attempting to login to iSCSI target and scan all LUNs. > ... cut ... > da0 at isboot0 bus 0 scbus0 target 0 lun 0 > da0: Fixed Direct Access SCSI-5 device > da0: 40960MB (83886080 512 byte sectors: 255H 63S/T 5221C) > da1 at isboot0 bus 0 scbus0 target 0 lun 2 > da1: Fixed Direct Access SCSI-5 device > da1: 10240MB (20971520 512 byte sectors: 255H 63S/T 1305C) > da2 at isboot0 bus 0 scbus0 target 0 lun 3 > da2: Fixed Direct Access SCSI-5 device > da2: 1024MB (2097152 512 byte sectors: 64H 32S/T 1024C) > ... cut ... > Boot device: da1 > --------------------------------------------------------------- > > Download links: > http://www.peach.ne.jp/archives/isboot/demo/FreeBSD-7.3-RELEASE-amd64-isboot-0.1.2.iso > > http://www.peach.ne.jp/archives/isboot/demo/FreeBSD-7.3-RELEASE-i386-isboot-0.1.2.iso > > http://www.peach.ne.jp/archives/isboot/demo/FreeBSD-8.1-RC1-amd64-isboot-0.1.2.iso > > http://www.peach.ne.jp/archives/isboot/demo/FreeBSD-8.1-RC1-i386-isboot-0.1.2.iso > > http://www.peach.ne.jp/archives/isboot/demo/unionfs-mkisboot.sh > > Try it you self :) > Daisuke Aoyama > > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" From owner-freebsd-current@FreeBSD.ORG Fri Jun 25 22:48:02 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6740210656CC for ; Fri, 25 Jun 2010 22:48:02 +0000 (UTC) (envelope-from eng.mufic@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id E91A08FC18 for ; Fri, 25 Jun 2010 22:48:01 +0000 (UTC) Received: by wyf22 with SMTP id 22so1779219wyf.13 for ; Fri, 25 Jun 2010 15:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=yWhe9V+jO6ClQUSpNYe1iSKZiy25vwvxZ+BuNN0zKRw=; b=B9sRPpd4W71YrAuQ8jY9JkYyHXfupGzxjVoD8TNvgV9dIgEhFkRhAlPYWpaq9ACLMH GebeJ0jSz4pQ3IlPu8gQ/EL8jJAmtxWMIqwH39yMaS+LvoduloSka4mJzvmcK9abV3/A uDnOpUgmmrUaBNXYYstoI0ygiT4tOwL0OpcSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Gj7gCznXw+akPMNU4eQjFLzaXR9M3fCL1hI7xaxUnLXRjEtZK7IG57KomoeLAYGIke Z6xBFvq2Haq7/VMpDZymK6PWsloLP2A1Woayqkd8+Uk13B0bPA7M5Roln3XpXaCo1uXf yliOV3UGkW9Zdt4YgVR3fRSsZV/WBlHDpAaMo= MIME-Version: 1.0 Received: by 10.216.165.82 with SMTP id d60mr5611476wel.40.1277506080979; Fri, 25 Jun 2010 15:48:00 -0700 (PDT) Sender: eng.mufic@gmail.com Received: by 10.216.5.66 with HTTP; Fri, 25 Jun 2010 15:48:00 -0700 (PDT) In-Reply-To: <20100612100006.000073fa@unknown> References: <20100612100006.000073fa@unknown> Date: Sat, 26 Jun 2010 01:48:00 +0300 X-Google-Sender-Auth: D84md6Pq8h07mRW5KhlewHoEkRk Message-ID: From: Mohammed Farrag To: Bruce Cran Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Chargen , freebsd-hackers@freebsd.org, Matt Thyer , freebsd-current@freebsd.org Subject: Re: I need reply in Embedded FreeBSD Kernel Theme X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 22:48:02 -0000 hi sorry for being late in reply but I had some problems in the last week. I hope u still remeber what I was talking about :) @chargen Thanx for ur reply. Embedded computer systems permeate all aspects of our daily lives. Alarm clocks, coffee makers, digital watches, cell phones, and automobiles are just a few of the devices that make use of embedded systems. The design and development of such systems is unique, because the design constraints are different for each system. I supposed a new design for reducing the size of the kernel to be able to work in such an environment which has some constraints make it does not have the ability to get large memory, large storage devices or others. ///////////////////////////// as far as your document goes: "We will unload all the drivers that indicated with zeros in the module metadata file. That would make the OS to be a few of Megabytes." unload? what is the logic here? I'm sorry but what is the real gain here, ////////////////////// The configuration file is dependent on the kernel (which is included as a compiled kernel). If I unload these unneeded drivers, I decrease the size of the compiled kernel So it will have the ability to work in more constrained environment and that is suitable to work for Operating Systems for small chips for embedded systems. As the Internet grew, the requirements of embedded systems also began to grow in complexity. In addition to solving classic embedded systems problems, system designers were required to add connectivity for sending and receiving data or providing an automated method for software upgrades. Rather than increase the development effort, system designers have moved toward using third-party hardware and evaluating open source software. Thanx Chargen @ andrew Thanx for your reply. I appreciate your effort to download the document. Regarding the uploading of the document to that site, I am sorry for that but I tried to attach it with the email but it was refused because its size was too large. I did not send it in the text part because the text format and tables will be lost. I am sorry for that. ////////////////////////////// /////////////////////////// After a couple of quick readings, I'm not sure I correctly understand what you plan to achieve. It sounds like you are trying to achive something like hardware specific dynamic module loading (like in Solaris, for example), but then it also sounds like you are trying to build a kernel based on a generated config which somehow involves building a tiny binary hardware profile built from POST data. Are you compiling a kernel at some point rather than just generating a loader.conf for modules in order to minimise the running size? //////////////////////////////////////////////////////// This approach will combine the two both. It will build a kernel based on a generated config which somehow involves building a tiny binary hardware profile built from POST data. It also will use hardware specific dynamic module loading because I don't have to load all the drivers for devices connected to the machine. I will use this dynamic module loading at the start-up only not at the run time because some considerations of the embedded systems for chips not being to load modules and change how to work at run time. that would make power problems. //////////////////////////////////////////////////////// I was most confused by We will unload all the drivers that indicated with zeros in the > module metadata file. That would make the OS to be a > few of Megabytes. > Whether you are compiling a kernel for the (chosen) hardware based on a generated kernel or loader config, I don't see a sensible case in which you would ever need to "unload" any driver. /////////////////////////////////////////////////////////////// yeah I know it is not sensible but I wrote it as a result of what I supposed before so it has no meaning. just a result to clarify what I reduced here. Thanx for ur sympathy and I will be glad to send you my next file to get ur comments about. //////////////////////////////////////////////////////////////// As much fun as it is spending hours manually tweaking and testing a kernel config for each system and deciding what modules to use, I like the idea of a one time guided process based on accurately identified hardware to build an optimal kernel, so I hope that's what you're proposing. ////////////////////////////////////////////////////////////////// Actually, I am deciding many time guided process based on accurately identified hardware to build an optimal kernel because I think this is more dynamic for considerations of changing the purpose of the embedded system. I mean sometimes u may need to perform deterministic operation in this boot so u do not have to load all drivers which there will be a lot of unneeded drivers of them at this boot process. I will determine the dependencies to provide optimal kernel. Thanx Andrew @ Matt Thanx for ur reply Matt. ///////////////////////////////////////////////////// FreeBSD is already a very modular system and the traditional way (a traditional way) to build for embedded systems is to follow the NanoBSD build method (tools included in the source tree) with a stripped down kernel in which you only load the modules your hardware requires using the FreeBSD loader (or after the initial boot). //////////////////////////////////////////////////// yeah I read about that. My mentor suggested that before and my idea is very close to NanoBSD but I don't know if the freebsd loader will load the moduls based on the hardware requirements or user requirements. I will be glad to reply me. //////////////////////////////////////////////// However my Soekris net4801 board still takes about 2.5 minutes to boot and I think time could be saved by parallel probing of hardware where possible. //////////////////////////////////////////////////// I think parallel probing is not providing in many boards. It's supported for the new borders only (correct me if I am wrong). I have to develop something which can be used in most of embedded systems. /////////////////////////////////////////////////// I'd vote for more work on FreeBSD's existing boot method rather than an entirely new implementation. What problem are you trying to solve Mohammed ? ////////////////////////////// I am not going to change in the main boot process. I am only changing the how of including the kernel in the configuration file. that is it and everything will be done as it is in the current freebsd. no more. That would save space and that is what I need to reduce the size of kernel in memory. @ bruce Thanx for ur reply. From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 02:52:14 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84F7F1065670 for ; Sat, 26 Jun 2010 02:52:14 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4ACDE8FC1C for ; Sat, 26 Jun 2010 02:52:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5Q2nO6V038127 for ; Fri, 25 Jun 2010 20:49:24 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 25 Jun 2010 20:49:37 -0600 (MDT) Message-Id: <20100625.204937.1137842809181322773.imp@bsdimp.com> To: current@freebsd.org From: "M. Warner Losh" X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: HEADS-UP: object directory name change X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 02:52:14 -0000 I recently committed a change that changes the name of the object tree where things are built to if you are cross compiling. Rather than /usr/obj/$TARGET_ARCH, it is now /usr/obj/$TARGET.$TARGET_ARCH. The reason for the change is so that embedded platforms with multiple endians can compile into the same tree. This means that if you are cross building on a regular basis, you'll need to update your cross tools. If you are building kernels, then you'll need a make kernel-toolchain for things to work again. You'll also be able to reclaim the disk space used by the old tree. If you want, a simple mv will do the trick. In a few days mips and arm will change how endian is represented and you'll need two trees for each if you want to compile both endians (one for mips.mipsel and one for mips.mipseb). I'm still working out some snags with how make universe will cope with the kernels, so I've not pulled the trigger on that change yet. thank you for your patience... Warner From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 03:00:03 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA1C0106564A; Sat, 26 Jun 2010 03:00:03 +0000 (UTC) (envelope-from matt.thyer@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF4A8FC1C; Sat, 26 Jun 2010 03:00:02 +0000 (UTC) Received: by vws13 with SMTP id 13so5059066vws.13 for ; Fri, 25 Jun 2010 20:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=nyYcgDJRx44CWX9GK44olfB1JgWJGoLM9bSIb9AG1PU=; b=FmKmHG5secRW11VyBFDaj1hV9MKae7nACLhPOeNwZlihj/mxSTBEZnwGa4C3N6frIv MQ4LJ4w09fxaAo0xCPzP/Z0h9pjq2e0uH0kp2yzmKQyPU9W9luwP8kdGmZ/ycBYvPJEd VYc0+9p0XcxsFqMfNOW7/53gP2NnbM83IITZA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=EctMIZ8HY8dsicAcm9ViywwvBi6mtZV3PxVgLicRRLOGtNEQWAzu0VY4w7UyNCUN+v DXM17KX8XftUIuLZiX8qL5yI7pCxJzsGWrpjzdOB3fsuV7CRUI49ZustSJZ5YaZh2BsG 6Lde6I5eVJbZieqTQM9CEgs8zXSZa7+UjWNMY= MIME-Version: 1.0 Received: by 10.220.161.201 with SMTP id s9mr957184vcx.137.1277521202196; Fri, 25 Jun 2010 20:00:02 -0700 (PDT) Received: by 10.220.180.204 with HTTP; Fri, 25 Jun 2010 20:00:02 -0700 (PDT) In-Reply-To: References: <20100612100006.000073fa@unknown> Date: Sat, 26 Jun 2010 12:30:02 +0930 Message-ID: From: Matt Thyer To: Mohammed Farrag Content-Type: text/plain; charset=ISO-8859-1 Cc: Bruce Cran , Chargen , freebsd-current@freebsd.org, Mohammed@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: I need reply in Embedded FreeBSD Kernel Theme X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 03:00:04 -0000 On 24 June 2010 11:06, Mohammed Farrag wrote: > @ Matt > Thanx for ur reply Matt. > ///////////////////////////////////////////////////// > FreeBSD is already a very modular system and the traditional way (a > traditional way) to build for embedded systems is to follow the > NanoBSD build method (tools included in the source tree) with a > stripped down kernel in which you only load the modules your hardware > requires using the FreeBSD loader (or after the initial boot). > //////////////////////////////////////////////////// > yeah I read about that. My mentor suggested that before and my idea is very > close to NanoBSD but I don't know if the freebsd loader will load the moduls > based on the hardware requirements or user requirements. I will be glad to > reply me. Modules are loaded by the user adding entries to /boot/loader.conf. e.g. if_sis_load="YES". That example will load the "sis" driver for the Silicon Image network interfaces on my Soekris net4801 board as I have removed almost everything in my kernel and just load the modules I require. Some modules will automatically load when another driver requires them. FreeBSD does not try to discover and reconfigure your hardware at boot time like the "kudzu" utility in Linux. Instead it will attach to the hardware for which you have drivers in your kernel or for which you have told the loader to load modules for. From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 09:11:00 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F8F51065672 for ; Sat, 26 Jun 2010 09:11:00 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.16.84]) by mx1.freebsd.org (Postfix) with ESMTP id 5104C8FC15 for ; Sat, 26 Jun 2010 09:10:59 +0000 (UTC) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by kabab.cs.huji.ac.il with esmtp id 1OSRPd-000Kma-ER; Sat, 26 Jun 2010 12:10:57 +0300 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: David Wolfskill In-reply-to: <20100625180130.GV90096@albert.catwhisker.org> References: <20100625114011.GO90096@albert.catwhisker.org> <201006250837.36220.jhb@freebsd.org> <20100625180130.GV90096@albert.catwhisker.org> Comments: In-reply-to David Wolfskill message dated "Fri, 25 Jun 2010 11:01:30 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 26 Jun 2010 12:10:57 +0300 From: Daniel Braniss Message-ID: Cc: "Andrey V. Elsukov" , freebsd-current@freebsd.org, brucec@freebsd.org Subject: Re: Use of boot0cfg to set boot slice broke between r209459 and r209502 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 09:11:00 -0000 > > --jr/gb2Ce1GM9KKZD > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Fri, Jun 25, 2010 at 08:37:36AM -0400, John Baldwin wrote: > > On Friday 25 June 2010 7:40:11 am David Wolfskill wrote: > > > Well, one one of my machines -- I realize that there are some > > > machines for which it's been problematic for a while. And all of > > > the machines I'm using run FreeBSD/i386. > >=20 > > 209469 perhaps? > > Apparently so. > > Here's what I did to test the above assertion: > > * Booted the build machine from slice 4 (usual "head" slice); cloned > that slice to slice 1; booted from slice 1. > > * In a "head" src working directory, I issued > > svn diff -c209469 > > and saw that r209469 merely added 2 lines to usr.sbin/boot0cfg/boot0cfg.c. > > * On the build machine's src working directory, I edited > usr.sbin/boot0cfg/boot0cfg.c to remove the lines in question. > > * Then (as root), I made /usr/src/usr.sbin/boot0cfg/ my current working > directory and issued: > > make && make install > > * I then issued > > boot0cfg -s 4 aacd0 && shutdown -r now > > then watched the serial console. > > * I noticed that the default boot slice -- which had been 1 -- was now > 4. > > * For grins, I then booted slice 4 (head) in single-user mode, mounted > the file systems, then invoked the boot0cfg executable from slice 1 to > switch the default to slice 2, then issued "halt -p". I waited a bit, > then powered the machine back up (WoL can be handy!) noted it was > booting from slice 2, brought it up in single-user mode, then issued > "halt -p" to reduce its power consumption and heat & nouse generation. > > All that said, it looks as if r209469 merely noticed an existing error > condition and tried to do something arguably sensible with it, rather > than merely ignore it. So it would seem that there's a more fundamental > issue at stake, here.... what do you see when you type boot0cfg -v ...? gpart show? then try gpart set -a active -i n aacd0 n will probably be 5. bottom line, the MBR is NOT being updated by boot0cfg danny From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 07:41:00 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18F61106566C; Sat, 26 Jun 2010 07:41:00 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id E401E8FC13; Sat, 26 Jun 2010 07:40:59 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id o5Q7exBx052523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 26 Jun 2010 00:40:59 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id o5Q7exP3052522; Sat, 26 Jun 2010 00:40:59 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA01374; Sat, 26 Jun 10 00:34:55 PDT Date: Sat, 26 Jun 2010 00:31:12 -0700 From: perryh@pluto.rain.com To: faber@isi.edu, gljennjohn@googlemail.com Message-Id: <4c25acc0.Iv6wSe8/bzgSDqFQ%perryh@pluto.rain.com> References: <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> <20100623154531.GB31578@zod.isi.edu> <20100624011509.GI31578@zod.isi.edu> <20100624092337.6bed1f45@ernst.jennejohn.org> <20100624152957.GA46600@zod.isi.edu> <20100624165445.GF46600@zod.isi.edu> <20100625110339.398a5006@ernst.jennejohn.org> In-Reply-To: <20100625110339.398a5006@ernst.jennejohn.org> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 26 Jun 2010 11:28:14 +0000 Cc: tevans.uk@googlemail.com, freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 07:41:00 -0000 Gary Jennejohn wrote: > IMO if you're going to make the binaries in base non-executable > you might just as well delete them. The chmod is reversible without having to recover the base binaries from somewhere. From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 11:42:53 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60C8C106566C; Sat, 26 Jun 2010 11:42:53 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (adsl-63-193-123-122.dsl.snfc21.pacbell.net [63.193.123.122]) by mx1.freebsd.org (Postfix) with ESMTP id 1550E8FC0C; Sat, 26 Jun 2010 11:42:52 +0000 (UTC) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.4/8.14.4) with ESMTP id o5QBfWce044880; Sat, 26 Jun 2010 04:41:32 -0700 (PDT) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.4/8.14.4/Submit) id o5QBfWKA044879; Sat, 26 Jun 2010 04:41:32 -0700 (PDT) (envelope-from david) Date: Sat, 26 Jun 2010 04:41:32 -0700 From: David Wolfskill To: Daniel Braniss Message-ID: <20100626114132.GG90096@albert.catwhisker.org> References: <20100625114011.GO90096@albert.catwhisker.org> <201006250837.36220.jhb@freebsd.org> <20100625180130.GV90096@albert.catwhisker.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qZLFzaLf2KECwqmh" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: "Andrey V. Elsukov" , freebsd-current@freebsd.org, brucec@freebsd.org Subject: Re: Use of boot0cfg to set boot slice broke between r209459 and r209502 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 11:42:53 -0000 --qZLFzaLf2KECwqmh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 26, 2010 at 12:10:57PM +0300, Daniel Braniss wrote: > ... > what do you see when you type boot0cfg -v ...? > gpart show? > then try=20 > gpart set -a active -i n aacd0 > n will probably be 5. >=20 > bottom line, the MBR is NOT being updated by boot0cfg OK; here's what I see -- note that the /S1/usr/sbin/boot0cfg executable is the one I built yesterday without the 2 lines from r209469: freebeast(9.0-C)[2] uname -a FreeBSD freebeast.catwhisker.org 9.0-CURRENT FreeBSD 9.0-CURRENT #200 r2095= 22: Fri Jun 25 06:11:00 PDT 2010 root@freebeast.catwhisker.org:/usr/obj= /usr/src/sys/GENERIC i386 freebeast(9.0-C)[3] sudo boot0cfg -v aacd0; echo $? Password: # flag start chs type end chs offset size 1 0x00 0: 1: 1 0xa5 651:254:63 63 10474317 2 0x00 652: 0: 1 0xa5 1023:254:63 10474380 10474380 3 0x00 1023:255:63 0xa5 1023:254:63 20948760 10474380 4 0x80 1023:255:63 0xa5 1023:254:63 31423140 40194630 version=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) options=3Dpacket,update,nosetdrv default_selection=3DF4 (Slice 4) 0 freebeast(9.0-C)[4] sudo boot0cfg -v -s 2 aacd0 ; echo $? boot0cfg: write_mbr: /dev/aacd0: Operation not permitted 1 freebeast(9.0-C)[5] sudo boot0cfg -v aacd0 ; echo $? # flag start chs type end chs offset size 1 0x00 0: 1: 1 0xa5 651:254:63 63 10474317 2 0x00 652: 0: 1 0xa5 1023:254:63 10474380 10474380 3 0x00 1023:255:63 0xa5 1023:254:63 20948760 10474380 4 0x80 1023:255:63 0xa5 1023:254:63 31423140 40194630 version=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) options=3Dpacket,update,nosetdrv default_selection=3DF4 (Slice 4) 0 freebeast(9.0-C)[6] sudo /S1/usr/sbin/boot0cfg -v -s 2 aacd0 ; echo $? # flag start chs type end chs offset size 1 0x00 0: 1: 1 0xa5 651:254:63 63 10474317 2 0x00 652: 0: 1 0xa5 1023:254:63 10474380 10474380 3 0x00 1023:255:63 0xa5 1023:254:63 20948760 10474380 4 0x80 1023:255:63 0xa5 1023:254:63 31423140 40194630 version=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) options=3Dpacket,update,nosetdrv default_selection=3DF2 (Slice 2) 0 freebeast(9.0-C)[7] sudo boot0cfg -v aacd0 ; echo $? # flag start chs type end chs offset size 1 0x00 0: 1: 1 0xa5 651:254:63 63 10474317 2 0x00 652: 0: 1 0xa5 1023:254:63 10474380 10474380 3 0x00 1023:255:63 0xa5 1023:254:63 20948760 10474380 4 0x80 1023:255:63 0xa5 1023:254:63 31423140 40194630 version=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) options=3Dpacket,update,nosetdrv default_selection=3DF2 (Slice 2) 0 freebeast(9.0-C)[8] sudo gpart show =3D> 63 71619471 aacd0 MBR (34G) 63 10474317 1 freebsd (5.0G) 10474380 10474380 2 freebsd (5.0G) 20948760 10474380 3 freebsd (5.0G) 31423140 40194630 4 freebsd [active] (19G) 71617770 1764 - free - (882K) =3D> 63 143306919 aacd1 MBR (68G) 63 143299737 1 freebsd [active] (68G) 143299800 7182 - free - (3.5M) =3D> 0 10474317 aacd0s1 BSD (5.0G) 0 3072000 1 freebsd-ufs (1.5G) 3072000 7402317 4 freebsd-ufs (3.5G) =3D> 0 10474380 aacd0s2 BSD (5.0G) 0 3072000 1 freebsd-ufs (1.5G) 3072000 7402380 4 freebsd-ufs (3.5G) =3D> 0 10474380 aacd0s3 BSD (5.0G) 0 3072000 1 freebsd-ufs (1.5G) 3072000 7402380 4 freebsd-ufs (3.5G) =3D> 0 40194630 aacd0s4 BSD (19G) 0 3072000 1 freebsd-ufs (1.5G) 3072000 20971520 2 freebsd-swap (10G) 24043520 7401472 4 freebsd-ufs (3.5G) 31444992 8749638 6 freebsd-ufs (4.2G) =3D> 0 143299737 aacd1s1 BSD (68G) 0 20971520 2 freebsd-swap (10G) 20971520 67108864 4 freebsd-ufs (32G) 88080384 55219353 5 freebsd-ufs (26G) freebeast(9.0-C)[9]=20 Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --qZLFzaLf2KECwqmh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwl52sACgkQmprOCmdXAD1l/wCfdH87+segBmAK7TkF+o/IILiR No0An3Gp54WuBe3CwQHFH7Uvdv1f6klQ =5i0j -----END PGP SIGNATURE----- --qZLFzaLf2KECwqmh-- From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 11:54:50 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7629C106564A for ; Sat, 26 Jun 2010 11:54:50 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.31.41]) by mx1.freebsd.org (Postfix) with ESMTP id 332978FC13 for ; Sat, 26 Jun 2010 11:54:49 +0000 (UTC) Received: from [78.34.142.64] (helo=r500.local) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1OSTyC-0006XV-JL; Sat, 26 Jun 2010 13:54:48 +0200 Date: Sat, 26 Jun 2010 13:54:56 +0200 From: Fabian Keil To: Martin Matuska Message-ID: <20100626135456.616e0bc5@r500.local> In-Reply-To: <4C23BA5B.2020709@FreeBSD.org> References: <4C23BA5B.2020709@FreeBSD.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/QBz6W/hkgEBNWN/4Fe=WaiO"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: freebsd-current@FreeBSD.org Subject: Re: [CFT] ZFS v16 with stat() speedup X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 11:54:50 -0000 --Sig_/QBz6W/hkgEBNWN/4Fe=WaiO Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Martin Matuska wrote: > As I have imported some more improvements to the ZFS v15 patch that also > target speed, > I am now calling for testing of v16 with mainly the following important > (post-v16) enhancement (and some related bugfixes): Thanks a lot. I've been only using it for a few hours so far, but I'll let you know if I run into any issues. I'm still booting from UFS, though, and I haven't looked at the python parts yet.=20 Fabian --Sig_/QBz6W/hkgEBNWN/4Fe=WaiO Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAkwl6p4ACgkQBYqIVf93VJ2I9gCgmZINMmiTSOtr1OEUjY2t2Gvt sKgAoK0Kxo3eVZxAshLZ8biXewnD5YIj =pqBS -----END PGP SIGNATURE----- --Sig_/QBz6W/hkgEBNWN/4Fe=WaiO-- From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 12:24:13 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32A90106566B; Sat, 26 Jun 2010 12:24:13 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.16.84]) by mx1.freebsd.org (Postfix) with ESMTP id D857C8FC0C; Sat, 26 Jun 2010 12:24:12 +0000 (UTC) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by kabab.cs.huji.ac.il with esmtp id 1OSUQc-000MHP-IL; Sat, 26 Jun 2010 15:24:10 +0300 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: David Wolfskill In-reply-to: <20100626114132.GG90096@albert.catwhisker.org> References: <20100625114011.GO90096@albert.catwhisker.org> <201006250837.36220.jhb@freebsd.org> <20100625180130.GV90096@albert.catwhisker.org> <20100626114132.GG90096@albert.catwhisker.org> Comments: In-reply-to David Wolfskill message dated "Sat, 26 Jun 2010 04:41:32 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 26 Jun 2010 15:24:10 +0300 From: Daniel Braniss Message-ID: Cc: "Andrey V. Elsukov" , freebsd-current@freebsd.org, brucec@freebsd.org Subject: Re: Use of boot0cfg to set boot slice broke between r209459 and r209502 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 12:24:13 -0000 > > --qZLFzaLf2KECwqmh > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Sat, Jun 26, 2010 at 12:10:57PM +0300, Daniel Braniss wrote: > > ... > > what do you see when you type boot0cfg -v ...? > > gpart show? > > then try=20 > > gpart set -a active -i n aacd0 > > n will probably be 5. > >=20 > > bottom line, the MBR is NOT being updated by boot0cfg > > OK; here's what I see -- note that the /S1/usr/sbin/boot0cfg executable > is the one I built yesterday without the 2 lines from r209469: > > freebeast(9.0-C)[2] uname -a > FreeBSD freebeast.catwhisker.org 9.0-CURRENT FreeBSD 9.0-CURRENT #200 r2095= > 22: Fri Jun 25 06:11:00 PDT 2010 root@freebeast.catwhisker.org:/usr/obj= > /usr/src/sys/GENERIC i386 > freebeast(9.0-C)[3] sudo boot0cfg -v aacd0; echo $? > Password: > # flag start chs type end chs offset size > 1 0x00 0: 1: 1 0xa5 651:254:63 63 10474317 > 2 0x00 652: 0: 1 0xa5 1023:254:63 10474380 10474380 > 3 0x00 1023:255:63 0xa5 1023:254:63 20948760 10474380 > 4 0x80 1023:255:63 0xa5 1023:254:63 31423140 40194630 > > version=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) > options=3Dpacket,update,nosetdrv > default_selection=3DF4 (Slice 4) > 0 > freebeast(9.0-C)[4] sudo boot0cfg -v -s 2 aacd0 ; echo $? > boot0cfg: write_mbr: /dev/aacd0: Operation not permitted > 1 > freebeast(9.0-C)[5] sudo boot0cfg -v aacd0 ; echo $? > # flag start chs type end chs offset size > 1 0x00 0: 1: 1 0xa5 651:254:63 63 10474317 > 2 0x00 652: 0: 1 0xa5 1023:254:63 10474380 10474380 > 3 0x00 1023:255:63 0xa5 1023:254:63 20948760 10474380 > 4 0x80 1023:255:63 0xa5 1023:254:63 31423140 40194630 > > version=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) > options=3Dpacket,update,nosetdrv > default_selection=3DF4 (Slice 4) > 0 > freebeast(9.0-C)[6] sudo /S1/usr/sbin/boot0cfg -v -s 2 aacd0 ; echo $? > # flag start chs type end chs offset size > 1 0x00 0: 1: 1 0xa5 651:254:63 63 10474317 > 2 0x00 652: 0: 1 0xa5 1023:254:63 10474380 10474380 > 3 0x00 1023:255:63 0xa5 1023:254:63 20948760 10474380 > 4 0x80 1023:255:63 0xa5 1023:254:63 31423140 40194630 > > version=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) > options=3Dpacket,update,nosetdrv > default_selection=3DF2 (Slice 2) > 0 > freebeast(9.0-C)[7] sudo boot0cfg -v aacd0 ; echo $? > # flag start chs type end chs offset size > 1 0x00 0: 1: 1 0xa5 651:254:63 63 10474317 > 2 0x00 652: 0: 1 0xa5 1023:254:63 10474380 10474380 > 3 0x00 1023:255:63 0xa5 1023:254:63 20948760 10474380 > 4 0x80 1023:255:63 0xa5 1023:254:63 31423140 40194630 > > version=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) > options=3Dpacket,update,nosetdrv > default_selection=3DF2 (Slice 2) > 0 > freebeast(9.0-C)[8] sudo gpart show > =3D> 63 71619471 aacd0 MBR (34G) > 63 10474317 1 freebsd (5.0G) > 10474380 10474380 2 freebsd (5.0G) > 20948760 10474380 3 freebsd (5.0G) > 31423140 40194630 4 freebsd [active] (19G) > 71617770 1764 - free - (882K) > > =3D> 63 143306919 aacd1 MBR (68G) > 63 143299737 1 freebsd [active] (68G) > 143299800 7182 - free - (3.5M) > > =3D> 0 10474317 aacd0s1 BSD (5.0G) > 0 3072000 1 freebsd-ufs (1.5G) > 3072000 7402317 4 freebsd-ufs (3.5G) > > =3D> 0 10474380 aacd0s2 BSD (5.0G) > 0 3072000 1 freebsd-ufs (1.5G) > 3072000 7402380 4 freebsd-ufs (3.5G) > > =3D> 0 10474380 aacd0s3 BSD (5.0G) > 0 3072000 1 freebsd-ufs (1.5G) > 3072000 7402380 4 freebsd-ufs (3.5G) > > =3D> 0 40194630 aacd0s4 BSD (19G) > 0 3072000 1 freebsd-ufs (1.5G) > 3072000 20971520 2 freebsd-swap (10G) > 24043520 7401472 4 freebsd-ufs (3.5G) > 31444992 8749638 6 freebsd-ufs (4.2G) > > =3D> 0 143299737 aacd1s1 BSD (68G) > 0 20971520 2 freebsd-swap (10G) > 20971520 67108864 4 freebsd-ufs (32G) > 88080384 55219353 5 freebsd-ufs (26G) > > freebeast(9.0-C)[9]=20 if you look closely, changing the slice via boot0cfg does NOT change the active flag (0x80), so this is what I do - till the bug gets fixed: boot0cfg -s 3 ad0 gpart set -a active -i 3 ad0 btw, if you type on the console the selection at boot's prompt, the MBR gets updated. danny From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 20:32:05 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26B7D1065676 for ; Sat, 26 Jun 2010 20:32:05 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe11.tele2.se [212.247.155.65]) by mx1.freebsd.org (Postfix) with ESMTP id AF12F8FC1B for ; Sat, 26 Jun 2010 20:32:04 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=uZktmZJsF8oA:10 a=ADBQPqJMlbwA:10 a=kj9zAlcOel0A:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=jRTv9uWDl7gY5cy5RjAA:9 a=i0pcQiD9muHz9VEDeepmtaiZTYEA:4 a=CjuIK1q_8ugA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe11.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1237856846 for freebsd-current@freebsd.org; Sat, 26 Jun 2010 22:32:02 +0200 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Sat, 26 Jun 2010 22:29:09 +0200 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201006262229.09747.hselasky@c2i.net> Subject: Patch for rc.d/devd on FreeBSD 9-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 20:32:05 -0000 Hi, Sometimes utilities that are started by devd require libraries outside /usr/lib. One example is the webcamd utility which is started by devd upon USB device insertion. What do you think about the following patch: --- devd (revision 209463) +++ devd (local) @@ -4,7 +4,7 @@ # # PROVIDE: devd -# REQUIRE: netif +# REQUIRE: netif ldconfig # BEFORE: NETWORKING mountcritremote # KEYWORD: nojail shutdown --HPS From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 20:45:48 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEE2F106566B for ; Sat, 26 Jun 2010 20:45:48 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7897D8FC18 for ; Sat, 26 Jun 2010 20:45:48 +0000 (UTC) Received: by qwg5 with SMTP id 5so1287060qwg.13 for ; Sat, 26 Jun 2010 13:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ubL4OZVn9y8//4IjHghMLAny1xSq5jmtGiFOeCVWPoA=; b=fBPAktfT3g2fuPKb6nv0t2b2vBrEAZ3vJoHgQFcRWk2ogQSR35bYZTe05JCk5U8PIX WqMW7r2OBFJq8n12Sk+WpFQSSp5Lu0F/gDNkStk5VShDIopcaORib49FtE0NDwZEtkSm MwXY3TYwVTuOIu8+wvQgffq+F4TpXRN0thoZo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=VF5vxHC4ze4Q9HfEiWB0jYkwjnCNYioMD9JhwRszk85YRS/GM4Y9AEAYaGiW8NGH/z 0gL8bmuHhvFO7OmYoG7mJLhKw4Y37ZmzP5QfzXtajsuXgiV+w9+zIniYpC/E6pK7Nw+u 9yiUQL5gR8rOYywe2oIfMnHveFycC2c/rlmgU= MIME-Version: 1.0 Received: by 10.224.35.216 with SMTP id q24mr1867275qad.79.1277585147807; Sat, 26 Jun 2010 13:45:47 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Sat, 26 Jun 2010 13:45:47 -0700 (PDT) In-Reply-To: <201006262229.09747.hselasky@c2i.net> References: <201006262229.09747.hselasky@c2i.net> Date: Sat, 26 Jun 2010 13:45:47 -0700 Message-ID: From: Garrett Cooper To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: Patch for rc.d/devd on FreeBSD 9-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 20:45:48 -0000 On Sat, Jun 26, 2010 at 1:29 PM, Hans Petter Selasky wro= te: > Hi, > > Sometimes utilities that are started by devd require libraries outside > /usr/lib. One example is the webcamd utility which is started by devd upo= n USB > device insertion. What do you think about the following patch: > > --- devd =A0 =A0 =A0 =A0(revision 209463) > +++ devd =A0 =A0 =A0 =A0(local) > @@ -4,7 +4,7 @@ > =A0# > > =A0# PROVIDE: devd > -# REQUIRE: netif > +# REQUIRE: netif ldconfig > =A0# BEFORE: NETWORKING mountcritremote > =A0# KEYWORD: nojail shutdown Funny since I was just monkeying around with this. This doesn't appear to be the only issue with devd: # devd devd: devd already running, pid: 430 # pgrep 430; echo $? 1 # Looks like /etc/rc.d/devd restart is broken :(... Thanks, -Garrett From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 21:00:07 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 332B11065679 for ; Sat, 26 Jun 2010 21:00:07 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 88AF28FC1D for ; Sat, 26 Jun 2010 21:00:05 +0000 (UTC) Received: by qyk12 with SMTP id 12so72559qyk.13 for ; Sat, 26 Jun 2010 14:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Dgg0cesZX98SNxj+wMc/cgCn7rSjfCKctYBYjU+ox1o=; b=O1FAt7jpYupNrLS2p0xCI5tIEahHVrYcx7Rjx9RG3A+wEF5VaLKaAtYRREC2rzWGVh muenmYrzFag8Ze3YexclNfpyd+K3D4iMUC5a6No1x48+ej1a6yRjAFP1gpj4EmJO6qRV 7u7AW4w7TKKc/uHxERzt7CFAxC4Zv4oQjODvg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=A7CY5B6LoJP0/7pk079dfgdDckPxAaN8t+9tI1vgAfPbeIxQUYcZpJmaA+O+sQWuOD eIKUAbFkgPpoHsFKOZTjtLndZtU98XcvPqTYtuAHitby1jTwk+dCOg1JiE67p1qmjDAP HeVDp6rBDXyAvxhr30jTN3N8JC72+Qho/NzlY= MIME-Version: 1.0 Received: by 10.229.182.16 with SMTP id ca16mr1496955qcb.88.1277586005385; Sat, 26 Jun 2010 14:00:05 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Sat, 26 Jun 2010 14:00:05 -0700 (PDT) In-Reply-To: References: <201006262229.09747.hselasky@c2i.net> Date: Sat, 26 Jun 2010 14:00:05 -0700 Message-ID: From: Garrett Cooper To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: Patch for rc.d/devd on FreeBSD 9-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 21:00:07 -0000 On Sat, Jun 26, 2010 at 1:45 PM, Garrett Cooper wrote: > On Sat, Jun 26, 2010 at 1:29 PM, Hans Petter Selasky w= rote: >> Hi, >> >> Sometimes utilities that are started by devd require libraries outside >> /usr/lib. One example is the webcamd utility which is started by devd up= on USB >> device insertion. What do you think about the following patch: >> >> --- devd =A0 =A0 =A0 =A0(revision 209463) >> +++ devd =A0 =A0 =A0 =A0(local) >> @@ -4,7 +4,7 @@ >> =A0# >> >> =A0# PROVIDE: devd >> -# REQUIRE: netif >> +# REQUIRE: netif ldconfig >> =A0# BEFORE: NETWORKING mountcritremote >> =A0# KEYWORD: nojail shutdown > > Funny since I was just monkeying around with this. This doesn't appear > to be the only issue with devd: > > # devd > devd: devd already running, pid: 430 > # pgrep 430; echo $? > 1 > # > > Looks like /etc/rc.d/devd restart is broken :(... This seems to fix that. Thanks, -Garrett Index: devd.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- devd.cc (revision 209530) +++ devd.cc (working copy) @@ -739,6 +739,7 @@ static void event_loop(void) { + bool warn_user_about_cleanup; int rv; int fd; char buffer[DEVCTL_MAXBUF]; @@ -804,6 +805,17 @@ new_client(server_fd); } close(fd); + close(server_fd); + + if (unlink(PIPE) =3D=3D 0) { + cfg.remove_pidfile(); + warn_user_about_cleanup =3D false; + } else + warn_user_about_cleanup =3D true; + + if (warn_user_about_cleanup =3D=3D true) + warn("cleanup failed"); + } =0C /* From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 21:37:47 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B7FE1065673; Sat, 26 Jun 2010 21:37:47 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 074CE8FC15; Sat, 26 Jun 2010 21:37:46 +0000 (UTC) Received: by qwg5 with SMTP id 5so1303775qwg.13 for ; Sat, 26 Jun 2010 14:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=xjXArvLWqfWcKwfB5h+uwx2/7COXiYoxBe87x81TaJE=; b=dgpE4+br90MMqzfN3CS+xs04CyYe2/kwvT5V0gL9YmzU/LXg+KdZHSsmHTnNykqi42 EUmUrV7SxcZkVs+ynxa8HKPkQrgCU8jyTZ3nGNpIqw303fDDDcD2g4KZ1Q2IkOG5aZof 6P+0ZFpENEcShE5o0c8/zeuTMm3dnntjzTpuI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=sxPc8lmGPE7/OQqhjxDKdrbmilj15trRL1LyXBISg7mRuCJGJ0kybN7HWNwEkP3wRe hb00O21JCfm7kiK7RKetC4+Km4sdzvozGo27IPB1FTQ0au9gZrqChifayfnorzar/FYt DXmUULsMMQMvq7EactLKJSRM6MDUe5wQxG2WI= MIME-Version: 1.0 Received: by 10.224.52.8 with SMTP id f8mr1878259qag.122.1277588266249; Sat, 26 Jun 2010 14:37:46 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Sat, 26 Jun 2010 14:37:46 -0700 (PDT) In-Reply-To: <20100625084429.GA42107@mech-cluster241.men.bris.ac.uk> References: <754D875E-48AB-423D-B309-9415EA2867E4@mac.com> <20100623130534.GA69821@mech-cluster241.men.bris.ac.uk> <86d3vhomot.fsf@ds4.des.no> <20100624083635.GB9272@mech-cluster241.men.bris.ac.uk> <86vd98aj7p.fsf@ds4.des.no> <8639wcafhn.fsf@ds4.des.no> <20100624110511.GD10082@mech-cluster241.men.bris.ac.uk> <86tyos8u57.fsf@ds4.des.no> <20100624151121.GA29609@mech-cluster241.men.bris.ac.uk> <86lja48m58.fsf@ds4.des.no> <20100625084429.GA42107@mech-cluster241.men.bris.ac.uk> Date: Sat, 26 Jun 2010 14:37:46 -0700 Message-ID: From: Garrett Cooper To: Anton Shterenlikht Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= , freebsd-current@freebsd.org, freebsd-ia64@freebsd.org Subject: Re: r209240 ia64 -> buildworld -> undefined reference to `lzma_physmem' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 21:37:47 -0000 2010/6/25 Anton Shterenlikht : > On Thu, Jun 24, 2010 at 05:50:59PM +0200, Dag-Erling Sm=F8rgrav wrote: >> Anton Shterenlikht writes: >> > Dag-Erling Sm=F8rgrav writes: >> > > I expect this to produce the same error as before; if not, there is >> > > something seriously wrong. >> > the error is different... >> > >> > echo fsck_ffs: /usr/lib/libc.a /usr/lib/libufs.a >> .depend >> > cc -O1 =A0-I/usr/src/sbin/fsck_ffs -I/usr/src/sbin/fsck_ffs/../mount -= DRESCUE -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-un= initialized -Wno-pointer-sign -c dir.c >> >> This is wrong. =A0It shouldn't compile anything. =A0Did you do anything = at >> all to your tree (src or obj) after the failed buildworld? > > sorry, I probably misunderstood you again. > I did "rm -rf /usr/obj/*" before trying your > suggested commands. > > I guess now this is not what you wanted. > > So, just for me to be clear, I need to > proceed with the buildworld, until I get the > error, and then, without cleaning anything, do > > % cd /usr/src > % make buildenv > % cd rescue/rescue > % make > > Is that correct? > > sorry for the bother > and many thanks for your help Hi Anton, Sorry to jump in, but could you please copy your source tree on the failing machine elsewhere, run make clean cleandir, and try applying the patch attached to the post below [1] and see whether or not the issue is resolved? Thanks! -Garrett [1] http://lists.freebsd.org/pipermail/freebsd-hackers/2010-June/032202.htm= l