Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Mike Meyer
On Tue, 22 Apr 2008 22:40:21 -0700 Garrett Cooper [EMAIL PROTECTED] wrote: Hi all, I made an oops in a program, which uncovered feature in strdup(2) that I wasn't aware of before. So I was wondering, is strdup(pointer = NULL) supposed to segfault should this just return NULL and set

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Dimitry Andric
On 2008-04-23 07:40, Garrett Cooper wrote: I made an oops in a program, which uncovered feature in strdup(2) that I wasn't aware of before. So I was wondering, is strdup(pointer = NULL) supposed to segfault should this just return NULL and set errno? It could, in fact, tear up the fabric

Re: devctl (alike?) for devfs

2008-04-23 Thread Andriy Gapon
on 23/04/2008 00:06 Jille said the following: Andriy Gapon wrote: Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes in devfs - appearance and disappearance of devices (in devfs sense of the word)? devctl currently

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Constantine A. Murenin
On 23/04/2008, Garrett Cooper [EMAIL PROTECTED] wrote: Hi all, I made an oops in a program, which uncovered feature in strdup(2) that I wasn't aware of before. So I was wondering, is strdup(pointer = NULL) supposed to segfault should this just return NULL and set errno? Good news

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Bernard van Gastel
Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: On Tue, 22 Apr 2008 22:40:21 -0700 Garrett Cooper [EMAIL PROTECTED] wrote: Hi all, I made an oops in a program, which uncovered feature in strdup(2) that I wasn't aware of before. So I was wondering, is strdup(pointer

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Garrett Cooper
On Tue, Apr 22, 2008 at 11:50 PM, Mike Meyer [EMAIL PROTECTED] wrote: On Tue, 22 Apr 2008 22:40:21 -0700 Garrett Cooper [EMAIL PROTECTED] wrote: Hi all, I made an oops in a program, which uncovered feature in strdup(2) that I wasn't aware of before. So I was wondering, is

Fwd: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Garrett Cooper
On Wed, Apr 23, 2008 at 1:30 AM, Bernard van Gastel [EMAIL PROTECTED] wrote: Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: On Tue, 22 Apr 2008 22:40:21 -0700 Garrett Cooper [EMAIL PROTECTED] wrote: Hi all, I made an oops in a program, which uncovered feature

Re: Multipath routing - failover version

2008-04-23 Thread Mihai Serb
On 4/16/08, Li, Qing [EMAIL PROTECTED] wrote: Hi, I recently incorporated multipath support into -CURRENT, for the upcoming 8.0. This patch originated from the KAME project and builds on the existing routing data structures and infrastructure. As a

Re: Fwd: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Robert Watson
On Wed, 23 Apr 2008, Garrett Cooper wrote: But strdup uses malloc, which is a system call (from the strdup manual: If insufficient memory is available, NULL is returned and errno is set to ENOMEM.) FYI, malloc(3) is actually a library call, and while it obviously does invoke system calls

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Giorgos Keramidas
On Wed, 23 Apr 2008 10:30:39 +0200, Bernard van Gastel [EMAIL PROTECTED] wrote: Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: On Tue, 22 Apr 2008 22:40:21 -0700 Garrett Cooper [EMAIL PROTECTED] wrote: Hi all, I made an oops in a program, which uncovered feature in

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Simun Mikecin
Yes, it's supposed to segfault. Check out what, say, strcpy does if you ask it to copy a NULL pointer. And this is an improvement from the bad old days, when they would happily walk through memory starting at 0. Besides, errno is used to signal errors from system calls. strdup isn't a system

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Heiko Wundram
Am Mittwoch, 23. April 2008 11:38:54 schrieb Simun Mikecin: Yes, it's supposed to segfault. Check out what, say, strcpy does if you ask it to copy a NULL pointer. And this is an improvement from the bad old days, when they would happily walk through memory starting at 0. Besides, errno is

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Kostik Belousov
On Wed, Apr 23, 2008 at 02:38:54AM -0700, Simun Mikecin wrote: Yes, it's supposed to segfault. Check out what, say, strcpy does if you ask it to copy a NULL pointer. And this is an improvement from the bad old days, when they would happily walk through memory starting at 0. Besides, errno

Re: Fwd: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Kostik Belousov
On Wed, Apr 23, 2008 at 02:19:53AM -0700, Garrett Cooper wrote: On Wed, Apr 23, 2008 at 1:30 AM, Bernard van Gastel [EMAIL PROTECTED] wrote: Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: On Tue, 22 Apr 2008 22:40:21 -0700 Garrett Cooper [EMAIL PROTECTED] wrote:

Re: devctl (alike?) for devfs

2008-04-23 Thread John Baldwin
On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote: Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes in devfs - appearance and disappearance of devices (in devfs sense of the word)? devctl currently notifies about

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Mike Meyer
On Wed, 23 Apr 2008 10:30:39 +0200 Bernard van Gastel [EMAIL PROTECTED] wrote: Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: On Tue, 22 Apr 2008 22:40:21 -0700 Garrett Cooper [EMAIL PROTECTED] wrote: Hi all, I made an oops in a program, which uncovered feature

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Simun Mikecin
If you're going to quote documents to support your ideas, it's probably better to read them first. My apologies. My fingers were faster than my mind. But this made me read it the way I should have done in the first place. And I see that it says: A null pointer is returned if the new string

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Roman Divacky
I think someone gave the reason I'm about to: trying to copy a NULL pointer means I have a bug somewhere earlier in my code that will eventually produce visibly wrong results - a segfault being such. The sooner that happens after the bug, the less code I have to search to find it, the better

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Mike Meyer
On Wed, 23 Apr 2008 09:06:44 -0700 (PDT) Simun Mikecin [EMAIL PROTECTED] wrote: If you're going to quote documents to support your ideas, it's probably better to read them first. My apologies. My fingers were faster than my mind. But this made me read it the way I should have done in the

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Mike Meyer
On Wed, 23 Apr 2008 18:26:35 +0200 Roman Divacky [EMAIL PROTECTED] wrote: I think someone gave the reason I'm about to: trying to copy a NULL pointer means I have a bug somewhere earlier in my code that will eventually produce visibly wrong results - a segfault being such. The sooner that

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Heiko Wundram
Am Mittwoch, 23. April 2008 18:06:44 schrieb Simun Mikecin: If you're going to quote documents to support your ideas, it's probably better to read them first. My apologies. My fingers were faster than my mind. But this made me read it the way I should have done in the first place. And I see

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Hans Petter Selasky
Hi, I recently had to tell someone that strncpy does not always zero terminate the destination string. Surprised by what I was telling they immediately wanted to change the way the function worked. When a function is defined by an ISO standard you are not supposed to change the definition.

Re: Fwd: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Bakul Shah
On Wed, 23 Apr 2008 11:03:10 BST Robert Watson [EMAIL PROTECTED] wrote: On Wed, 23 Apr 2008, Garrett Cooper wrote: Of course I did some more research after you guys gave me some replies and realized I'm not the first person to bumble across this fact, but I haven't found FreeBSD or Linux

Re: devctl (alike?) for devfs

2008-04-23 Thread Andriy Gapon
on 23/04/2008 16:55 John Baldwin said the following: On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote: Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes in devfs - appearance and disappearance of devices (in devfs

Re: devctl (alike?) for devfs

2008-04-23 Thread John Baldwin
On Wednesday 23 April 2008 03:25:23 pm Andriy Gapon wrote: on 23/04/2008 16:55 John Baldwin said the following: On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote: Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Giorgos Keramidas
On Wed, 23 Apr 2008 09:06:44 -0700 (PDT), Simun Mikecin [EMAIL PROTECTED] wrote: If you're going to quote documents to support your ideas, it's probably better to read them first. My apologies. My fingers were faster than my mind. But this made me read it the way I should have done in the

Re: strdup(NULL) supposed to create SIGSEGV?

2008-04-23 Thread Giorgos Keramidas
On Wed, 23 Apr 2008 19:57:47 +0200, Hans Petter Selasky [EMAIL PROTECTED] wrote: Hi, I recently had to tell someone that strncpy does not always zero terminate the destination string. Surprised by what I was telling they immediately wanted to change the way the function worked. When a

Re: devctl (alike?) for devfs

2008-04-23 Thread Andriy Gapon
on 23/04/2008 22:49 John Baldwin said the following: Events have a subsystem associated with them, so devfs events would use their own subsystem type to avoid that sort of confusion. Thank you for straightening me - for some reason I was thinking about +/- (attach/detach) events, but I see

Re: Please welcome our Summer of Code Students

2008-04-23 Thread Konrad Jankowski
Greetings to all in the FreeBSD community! My long-time dream of joining has come! As for the introduction: I am a 3'rd year Informatics student at Gdansk University of Technology. My interests are low level (kernel, library) coding. (surprise!) I have some bigger projects on my account: 1. DOORS