Re: threads and malloc/free on freebsd 8.0

2010-05-25 Thread Anoop Kumar Narayanan
On Sat, May 22, 2010 at 1:56 AM, Dan Nelson  wrote:
> In the last episode (May 22), Anoop Kumar Narayanan said:
>> I think glibc uses asynchronous free, as in it doesn't free the memory
>> immediately.  So even though the memory is free'd its still part of the
>> process's address space but present in the free pool and so it doesn't
>> crash.
>
> FreeBSD doesn't use glibc, so that doesn't apply here :)
:) Oh yeah, BSD has its own libc
>
> --
>        Dan Nelson
>        dnel...@allantgroup.com
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: threads and malloc/free on freebsd 8.0

2010-05-21 Thread Anoop Kumar Narayanan
I think glibc uses asynchronous free, as in it doesn't free the memory
immediately. So even though the memory is free'd its still part of the
process's address space but present in the free pool and so it doesn't
crash.

-Anoop

On Sat, May 22, 2010 at 12:48 AM, Dan Nelson  wrote:
> In the last episode (May 21), Vikash Badal said:
>> Excuse me if this is a stupid questions.
>>
>> I have a thread socket application that seems to be behaving strangely
>>
>> In a worker thread, I have the following.
>>
>> ---
>>    LogMessage(DEBUG_0, "allocated %ld", malloc_usable_size(inst));
>>
>>    free(inst);
>>
>>    LogMessage(DEBUG_0, "after free allocated %ld", malloc_usable_size(inst));
>>
>>     return 0;
>> ---
>>
>> output> allocated 2304
>> output> after free allocated 2304
>>
>> from playing around, this should have segfaulted but it didn't
>
> You're invoking undefined behaviour here by calling malloc_usable_size on a
> free'd pointer.  The function is free to crash, return useful data, or
> return useless data, at its discretion :)
>
> As long as you only call it on pointers that are still valid you will be
> okay.
>
> --
>        Dan Nelson
>        dnel...@allantgroup.com
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: random FreeBSD panics

2010-04-08 Thread Anoop Kumar Narayanan
On Sat, Apr 3, 2010 at 6:21 PM, Masoom Shaikh  wrote:
> On Sun, Mar 28, 2010 at 5:38 PM, Ivan Voras  wrote:
>> On 28 March 2010 16:42, Masoom Shaikh  wrote:
>>
>>> lets assume if this is h/w problem, then how can other OSes overcome
>>> this ? is there a way to make FreeBSD ignore this as well, let it
>>> result in reasonable performance penalty.
>>
>> Very probably, if only we could detect where the problem is.
>> Try adding "options     PRINTF_BUFR_SIZE=128" to the kernel
>> configuration file if you can, to see if you can get a less mangled
>> log outout.
>>
>
> ok, after few days of silence I am back with more questions
> this time system feels little better, it is able to sustain for more
> time that what 7.3-RELEASE could
>
> FreeBSD raptor 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Thu Apr  1
> 01:20:45 UTC 2010     root@:/usr/obj/usr/src/sys/INSPIRON  amd64
>
> I am using KDE4, and when OS freezes, well it freezes, means I cannot
> change to tty0 and see the panic text, if any it might possibly have
> spit. the stuck frozen GUI keeps staring there. So the question is how
> to I capture that panic text ? unfortunately I am not getting core
> files too, so there is nothing I can pick up hints
>
> is there some option (KDB, DDB), so that on panic system drop to debugger ?
>
> Masoom Shaikh

I am having the very same problem, with my AMD64 running i386 (both
7.3-REL and 8.0-REL) keeps crashing, The best part is, if I disable
ACPI it crashes before it even boots up so is the case with safe-mode
and single-user-mode. With ACPI it boots up but crashes after a while.
I have the vmcore files on the system. Who do I contact on this regard
?

> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: random FreeBSD panics

2010-03-30 Thread Anoop Kumar Narayanan
On Wed, Mar 31, 2010 at 2:33 AM, Paul B Mahol  wrote:
> On 3/30/10, Anoop Kumar Narayanan  wrote:
>> On Sun, Mar 28, 2010 at 5:33 PM, Gary Jennejohn
>>  wrote:
>>> On Sun, 28 Mar 2010 11:18:59 +
>>> Masoom Shaikh  wrote:
>>>
>>>> On Sun, Mar 28, 2010 at 10:32 AM, Ivan Voras  wrote:
>>>> > Masoom Shaikh wrote:
>>>> >>
>>>> >> Hello List,
>>>> >>
>>>> >> I was a happy FreeBSD user, just before I installed FreeBSD8.0-RC1.
>>>> >> Since
>>>> >> then, system randomly just freezes, and there is no option other than
>>>> >> hard
>>>> >> boot. I guessed this will get solved in 8.0-RELEASE, but it was not :(
>>>> >
>>>> > I wild shot - did you try disabling superpages?
>>>> >
>>>> > ___
>>>> > freebsd-questions@freebsd.org mailing list
>>>> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>>>> > To unsubscribe, send any mail to
>>>> > "freebsd-questions-unsubscr...@freebsd.org"
>>>> >
>>>>
>>>> umm, how do I do that ?
>>>>
>>>
>>> Add this to /boot/loader.conf
>>> vm.pmap.pg_ps_enabled="0"
>>
>> I keep getting RW errors while writing into an USB drive, wondering if
>> its the same problem is related to your reply ?
>> USB mass storage driver seems to be broken.
>
> Works for me.
>
>>
>> da0 at umass-sim0 bus 0 target 0 lun 0
>> da0:  Removable Direct Access SCSI-2 device
>> da0: 40.000MB/s transfers
>> da0: 1940MB (3973120 512 byte sectors: 255H 63S/T 247C)
>> info: [drm] Num pipes: 2
>> info: [drm] Loading R300 Microcode
>> info: [drm] Num pipes: 2
>> g_vfs_done():da0s1[WRITE(offset=648923648, length=32768)]error = 5
>> g_vfs_done():da0s1[WRITE(offset=648956416, length=32768)]error = 5
>> g_vfs_done():da0s1[WRITE(offset=648989184, length=32768)]error = 5
>> g_vfs_done():da0s1[WRITE(offset=649021952, length=65536)]error = 5
>> g_vfs_done():da0s1[WRITE(offset=649087488, length=32768)]error = 5
>
> Are you sure that your device is not dead (weared out)?
>
That seem to have been the case. :P Ran a scan disk on windows and
fixed it. :) But this doesn't solve the FreeBSD 8.0 frequent crashes.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: random FreeBSD panics

2010-03-29 Thread Anoop Kumar Narayanan
On Sun, Mar 28, 2010 at 5:33 PM, Gary Jennejohn
 wrote:
> On Sun, 28 Mar 2010 11:18:59 +
> Masoom Shaikh  wrote:
>
>> On Sun, Mar 28, 2010 at 10:32 AM, Ivan Voras  wrote:
>> > Masoom Shaikh wrote:
>> >>
>> >> Hello List,
>> >>
>> >> I was a happy FreeBSD user, just before I installed FreeBSD8.0-RC1. Since
>> >> then, system randomly just freezes, and there is no option other than hard
>> >> boot. I guessed this will get solved in 8.0-RELEASE, but it was not :(
>> >
>> > I wild shot - did you try disabling superpages?
>> >
>> > ___
>> > freebsd-questions@freebsd.org mailing list
>> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> > To unsubscribe, send any mail to 
>> > "freebsd-questions-unsubscr...@freebsd.org"
>> >
>>
>> umm, how do I do that ?
>>
>
> Add this to /boot/loader.conf
> vm.pmap.pg_ps_enabled="0"

I keep getting RW errors while writing into an USB drive, wondering if
its the same problem is related to your reply ?
USB mass storage driver seems to be broken.

da0 at umass-sim0 bus 0 target 0 lun 0
da0:  Removable Direct Access SCSI-2 device
da0: 40.000MB/s transfers
da0: 1940MB (3973120 512 byte sectors: 255H 63S/T 247C)
info: [drm] Num pipes: 2
info: [drm] Loading R300 Microcode
info: [drm] Num pipes: 2
g_vfs_done():da0s1[WRITE(offset=648923648, length=32768)]error = 5
g_vfs_done():da0s1[WRITE(offset=648956416, length=32768)]error = 5
g_vfs_done():da0s1[WRITE(offset=648989184, length=32768)]error = 5
g_vfs_done():da0s1[WRITE(offset=649021952, length=65536)]error = 5
g_vfs_done():da0s1[WRITE(offset=649087488, length=32768)]error = 5

bye,
-Anoop

>
> --
> Gary Jennejohn
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: FreeBSD 8.0 Booting Problem on ZV5320US Laptop

2010-03-20 Thread Anoop Kumar Narayanan
 wrote:
> Are you able to get to the FreeBSD splash screen (where you get a countdown
> to startup with a menu of 6 selections)?

Yes, It doesn't go beyond that selection most of the time.
>
> One of the choices there is boot w/o ACPI; you could try that if you get
> that far.

That is exactly where I am, at that screen when I make the selection
(any selection) it just pauses for about 30 Secs before the computer
shuts down. Tried all options including 'set hint.acpi.0.disabled="1"'
followed by 'boot' at the loader prompt. Its more or less 1 successful
boot in 7 attempts, totally random, not dependent on w/o ACPI is
picked or not, sometimes it just works with verbose logging or normal
boot.

It is definitely something to do with the RESET BIOS timer (If at all
there is anything like that) expiring before FreeBSD kernel can fully
load or something... Thank you HP !

-Anoop
>
> Good luck--
>
> Richard
>
> On Fri, Mar 19, 2010 at 11:55 AM, Anoop Kumar Narayanan 
> wrote:
>>
>> On Fri, Mar 19, 2010 at 7:49 PM, Richard DeLaurell
>>  wrote:
>> >>On Fri, Mar 19, 2010 at 8:20 AM, Anoop Kumar Narayanan
>> >> wrote:
>> >>I have recently installed FreeBSD8.0 on my 5 year old HP laptop with
>> >>absolute 0 battery backup (behaviour same when batter removed).
>> >>Installation works fine but when I try to boot into FreeBSD I get to
>> >>the BTX loader screen, after having made any selection and it pauses
>> >>for about 15 secs and the computer suddenly powers down. I was able to
>> >>boot into the system occasionally lets say about 1 in 5 boots. I am
>> >>able to install and boot into Linux without any problem.
>> >
>> >
>> > So then you are attempting to startup using a power adaptor (i.e. your
>> > computer is plugged in to a wall socket)?
>> Yes. I don't know if its a specific Athlon XP related problem as I did
>> observe a similar post some years ago. And, Apparently its the same
>> thing.
>> http://osdir.com/ml/os.freebsd.devel.hardware/2004-10/msg00044.html
>> In this case its the installation. In my case its after the installation.
>> >
>> > I had the reverse problem a while ago with Slackware shutting down in
>> > the
>> > middle of installation onto a Toshiba laptop while FreeBSD has always
>> > been
>> > no problem.
>> >
>> > My guess is that these issues reflect power management settings, perhaps
>> > even something in the bios.
>> Maybe its something in the BIOS, but the thing is that Linux boots
>> fine on the machine. Maybe some driver is crashing and is causing a
>> reboot of the machine. Are there any critical drivers in the system
>> that can result in such a problem.
>> >
>> > Does this occur when you use the installation or boot-only disks?
>> I can install it just fine, but can't seem to to boot into the
>> installed version (Once its been installed).
>> I did create the FreeBSD swap partition before the root file-system
>> (and it still seems to label the root file-system as 'a'), Would this
>> affect the system boot up in anyway ?
>> >
>> > Sorry this is not more help to you.
>> >
>> > Richard
>> > ___
>> > freebsd-questions@freebsd.org mailing list
>> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> > To unsubscribe, send any mail to
>> > "freebsd-questions-unsubscr...@freebsd.org"
>> >
>> ___
>> freebsd-questions@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> To unsubscribe, send any mail to
>> "freebsd-questions-unsubscr...@freebsd.org"
>
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: FreeBSD 8.0 Booting Problem on ZV5320US Laptop

2010-03-19 Thread Anoop Kumar Narayanan
On Fri, Mar 19, 2010 at 7:49 PM, Richard DeLaurell
 wrote:
>>On Fri, Mar 19, 2010 at 8:20 AM, Anoop Kumar Narayanan 
>>wrote:
>>I have recently installed FreeBSD8.0 on my 5 year old HP laptop with
>>absolute 0 battery backup (behaviour same when batter removed).
>>Installation works fine but when I try to boot into FreeBSD I get to
>>the BTX loader screen, after having made any selection and it pauses
>>for about 15 secs and the computer suddenly powers down. I was able to
>>boot into the system occasionally lets say about 1 in 5 boots. I am
>>able to install and boot into Linux without any problem.
>
>
> So then you are attempting to startup using a power adaptor (i.e. your
> computer is plugged in to a wall socket)?
Yes. I don't know if its a specific Athlon XP related problem as I did
observe a similar post some years ago. And, Apparently its the same
thing.
http://osdir.com/ml/os.freebsd.devel.hardware/2004-10/msg00044.html
In this case its the installation. In my case its after the installation.
>
> I had the reverse problem a while ago with Slackware shutting down in the
> middle of installation onto a Toshiba laptop while FreeBSD has always been
> no problem.
>
> My guess is that these issues reflect power management settings, perhaps
> even something in the bios.
Maybe its something in the BIOS, but the thing is that Linux boots
fine on the machine. Maybe some driver is crashing and is causing a
reboot of the machine. Are there any critical drivers in the system
that can result in such a problem.
>
> Does this occur when you use the installation or boot-only disks?
I can install it just fine, but can't seem to to boot into the
installed version (Once its been installed).
I did create the FreeBSD swap partition before the root file-system
(and it still seems to label the root file-system as 'a'), Would this
affect the system boot up in anyway ?
>
> Sorry this is not more help to you.
>
> Richard
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


FreeBSD 8.0 Booting Problem on ZV5320US Laptop

2010-03-19 Thread Anoop Kumar Narayanan
I have recently installed FreeBSD8.0 on my 5 year old HP laptop with
absolute 0 battery backup (behaviour same when batter removed).
Installation works fine but when I try to boot into FreeBSD I get to
the BTX loader screen, after having made any selection and it pauses
for about 15 secs and the computer suddenly powers down. I was able to
boot into the system occasionally lets say about 1 in 5 boots. I am
able to install and boot into Linux without any problem.

On successful boot, I did see a message "battery0: battery
initialization failed"

1. Is there any way to increase the amount of debug messages printed
on the screen to figure out what's happening ?
2. Has it got to do with some module crashing as, I am able to install
and run LINUX without any problem ?
3. Why is there a pause of 15 secs after making the selection ?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


FreeBSD 8.0 Booting Problem on ZV5320US Laptop

2010-03-12 Thread Anoop Kumar Narayanan
I have recently installed FreeBSD8.0 on my 5 year old HP laptop with
absolute 0 battery backup (behaviour same when batter removed).
Installation works fine but when I try to boot into FreeBSD I get to
the BTX loader screen, after having made any selection and it pauses
for about 15 secs and the computer suddenly powers down. I was able to
boot into the system occasionally lets say about 1 in 5 boots. I am
able to install and boot into Linux without any problem.

On successful boot, I did see a message "battery0: battery
initialization failed"

1. Is there any way to increase the amount of debug messages printed
on the screen to figure out what's happening ?
2. Has it got to do with some module crashing as, I am able to install
and run LINUX without any problem ?
3. Why is there a pause of 15 secs after making the selection ?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"