Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #10412 > unrolled thread

Testing if a pointer is valid

Started byjacob navia <jacob@spamsink.net>
First post2011-09-18 00:29 +0200
Last post2011-09-20 00:22 -0700
Articles 20 on this page of 284 — 42 participants

Back to article view | Back to comp.lang.c


Contents

  Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-18 00:29 +0200
    Re: Testing if a pointer is valid Harald van Dijk <truedfx@gmail.com> - 2011-09-17 15:38 -0700
      Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-18 00:57 +0200
        Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-18 16:30 +0000
          Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-18 19:25 +0200
            Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-19 07:53 +1200
            Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-18 20:00 +0000
              Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-19 08:23 +1200
                Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-18 20:32 +0000
                  Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-18 23:28 +0000
                    Re: Testing if a pointer is valid blp@cs.stanford.edu (Ben Pfaff) - 2011-09-18 16:38 -0700
                      Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-19 04:27 +0000
                        Re: Testing if a pointer is valid blp@cs.stanford.edu (Ben Pfaff) - 2011-09-18 21:48 -0700
                          Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-19 05:38 +0000
                            Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-19 09:14 +0200
                              Re: Testing if a pointer is valid "BartC" <bc@freeuk.com> - 2011-09-19 10:10 +0100
                              Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-19 05:07 -0700
                              Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-19 14:24 +0100
                                Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-19 16:10 +0200
                              Re: Testing if a pointer is valid "BartC" <bc@freeuk.com> - 2011-09-19 16:50 +0100
                            Re: Testing if a pointer is valid Ben Pfaff <blp@cs.stanford.edu> - 2011-09-19 08:11 -0700
                              Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-19 17:21 +0200
                              Re: Testing if a pointer is valid "BartC" <bc@freeuk.com> - 2011-09-19 16:27 +0100
                                Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-19 10:14 -0700
                                  Re: Testing if a pointer is valid "BartC" <bc@freeuk.com> - 2011-09-19 19:56 +0100
                                    Re: Testing if a pointer is valid blp@cs.stanford.edu (Ben Pfaff) - 2011-09-19 13:20 -0700
                                    Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-20 18:31 +0300
                                      Re: Testing if a pointer is valid "BartC" <bc@freeuk.com> - 2011-09-20 17:44 +0100
                                        Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-20 17:06 -0700
                                          Re: Testing if a pointer is valid "BartC" <bc@freeuk.com> - 2011-09-21 01:37 +0100
                                        Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-22 22:03 +0300
                                    Re: Testing if a pointer is valid Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-28 02:33 -0700
                                  Re: Testing if a pointer is valid ImpalerCore <jadill33@gmail.com> - 2011-09-19 13:01 -0700
                                    Re: Testing if a pointer is valid ImpalerCore <jadill33@gmail.com> - 2011-09-19 14:42 -0700
                                      Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-20 10:08 +1200
                                        Re: Testing if a pointer is valid ImpalerCore <jadill33@gmail.com> - 2011-09-20 07:55 -0700
                              Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-19 16:39 +0000
                                Re: Testing if a pointer is valid blp@cs.stanford.edu (Ben Pfaff) - 2011-09-19 09:48 -0700
                              Re: Testing if a pointer is valid ImpalerCore <jadill33@gmail.com> - 2011-09-19 12:49 -0700
                                Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-19 22:45 +0200
                                  Re: Testing if a pointer is valid ImpalerCore <jadill33@gmail.com> - 2011-09-19 14:02 -0700
                        Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-19 07:14 +0000
                          Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-19 16:13 +0000
                            Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-19 17:36 +0000
                              Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-19 20:09 +0000
                          Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-19 20:36 +0200
                            Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-20 08:05 +1200
                            Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-19 20:18 +0000
                              Re: Testing if a pointer is valid Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-19 23:37 +0000
                              Re: Testing if a pointer is valid Kenneth Brody <kenbrody@spamcop.net> - 2011-09-21 12:23 -0400
                            Re: Testing if a pointer is valid Kenneth Brody <kenbrody@spamcop.net> - 2011-09-21 12:09 -0400
                      Re: Testing if a pointer is valid websnarf <websnarf@gmail.com> - 2011-09-26 22:01 -0700
                    Re: Testing if a pointer is valid Kenneth Brody <kenbrody@spamcop.net> - 2011-09-19 13:51 -0400
                      Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-19 20:11 +0000
                    Re: Testing if a pointer is valid Nobody <nobody@nowhere.com> - 2011-09-19 22:21 +0100
                      Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-20 00:05 +0000
            Re: Testing if a pointer is valid Nobody <nobody@nowhere.com> - 2011-09-18 23:34 +0100
            Re: Testing if a pointer is valid pacman@kosh.dhis.org (Alan Curry) - 2011-09-18 22:47 +0000
            Re: Testing if a pointer is valid tom st denis <tom@iahu.ca> - 2011-09-19 04:50 -0700
            Re: Testing if a pointer is valid Kenneth Brody <kenbrody@spamcop.net> - 2011-09-19 13:42 -0400
              Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-19 20:30 +0200
                Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-20 08:09 +1200
                  Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-19 22:38 +0200
                    Re: Testing if a pointer is valid Ike Naar <ike@iceland.freeshell.org> - 2011-09-19 20:50 +0000
                      Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-19 22:53 +0200
                        Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-19 22:30 +0100
                          Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-20 00:05 +0200
                            Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-20 00:31 +0100
                        Re: Testing if a pointer is valid Ike Naar <ike@iceland.freeshell.org> - 2011-09-19 22:43 +0000
                          Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-20 00:59 +0200
                            Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-20 11:50 +1200
                              Re: Testing if a pointer is valid blp@cs.stanford.edu (Ben Pfaff) - 2011-09-19 19:03 -0700
                                Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-20 14:11 +1200
                              Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-19 21:49 -0700
                              Re: Testing if a pointer is valid Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-28 06:17 -0700
                                Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-28 07:02 -0700
                            Re: Testing if a pointer is valid Ike Naar <ike@sverige.freeshell.org> - 2011-09-20 07:26 +0000
                            Re: Testing if a pointer is valid Kenneth Brody <kenbrody@spamcop.net> - 2011-09-21 12:31 -0400
                      Re: Testing if a pointer is valid Kenneth Brody <kenbrody@spamcop.net> - 2011-09-21 12:26 -0400
                        Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-21 21:20 +0200
                          Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-21 19:40 +0000
                          Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-22 07:46 +1200
                        Re: Testing if a pointer is valid "Rosario Pulvirenti" <NoInUseno1Spam@non.usare.invalid> - 2011-09-22 07:38 +0200
                    Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-20 09:05 +1200
                Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-20 07:16 +0000
                  Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-20 09:50 +0200
                    Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-20 10:38 +0000
                      Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-20 04:29 -0700
                        Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-20 12:04 +0000
                          Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-20 05:25 -0700
                            Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-20 16:49 +0000
                              Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-22 22:35 +0300
                                Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-23 07:59 +0000
                                  Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-23 12:33 +0300
                                    Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-23 12:23 +0000
                                      Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-23 17:34 +0300
                                        Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-23 17:08 +0000
                                  Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-23 06:49 -0400
                                    Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-23 12:20 +0000
                                      Re: Testing if a pointer is valid Seebs <usenet-nospam@seebs.net> - 2011-09-26 22:59 +0000
                            Re: Testing if a pointer is valid Michael Press <rubrum@pacbell.net> - 2011-09-30 01:27 -0700
                              Re: Testing if a pointer is valid Willem <willem@toad.stack.nl> - 2011-09-30 08:38 +0000
                                Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-10-04 12:40 +0000
                Re: Testing if a pointer is valid Kenneth Brody <kenbrody@spamcop.net> - 2011-09-21 12:00 -0400
                  Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-21 21:17 +0200
          Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-18 23:21 +0000
            Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-18 17:32 -0700
              Re: Testing if a pointer is valid Joe Wright <joewwright@comcast.net> - 2011-09-18 23:10 -0400
                Re: Testing if a pointer is valid gazelle@shell.xmission.com (Kenny McCormack) - 2011-09-19 03:34 +0000
                  Re: Testing if a pointer is valid Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-09-18 22:32 -0600
                    Re: Testing if a pointer is valid gazelle@shell.xmission.com (Kenny McCormack) - 2011-09-20 14:18 +0000
                      Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-20 18:15 +0200
                        Re: Testing if a pointer is valid "BartC" <bc@freeuk.com> - 2011-09-20 17:49 +0100
                          Re: Testing if a pointer is valid Willem <willem@toad.stack.nl> - 2011-09-20 17:02 +0000
                            Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-20 20:35 +0200
                              Re: Testing if a pointer is valid Ike Naar <ike@iceland.freeshell.org> - 2011-09-20 20:30 +0000
                                Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-20 22:35 +0200
                                Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-22 22:07 +0300
                                  Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-22 16:11 -0400
                                    Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-23 12:28 +0300
                                      Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-23 06:44 -0400
                                        Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-23 17:33 +0300
                                          Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-23 11:31 -0400
                                            Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-23 20:09 +0200
                                          Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-23 20:02 +0200
                                            Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-23 13:49 -0700
                                              Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-24 09:01 +1200
                                                Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-23 23:08 +0200
                                                  Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-24 09:43 +1200
                                                Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-23 22:13 +0100
                                                  Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-23 23:45 +0200
                                                    Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-24 00:01 +0100
                                                  Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-24 09:47 +1200
                                                Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-23 17:22 -0400
                                                  Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-23 23:47 +0200
                                                  Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-24 09:50 +1200
                                                    Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-23 18:06 -0400
                                                      Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-24 10:25 +1200
                                                        Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-24 08:02 -0400
                                                          Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-24 14:13 +0200
                                                            Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-24 14:07 +0100
                                                          Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-24 13:15 +0000
                                                            Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-24 15:20 +0100
                                                            Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-24 11:28 -0400
                                                              Re: Testing if a pointer is valid Willem <willem@toad.stack.nl> - 2011-09-24 15:45 +0000
                                                                Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-24 20:07 +0300
                                                                  Re: Testing if a pointer is valid Richard Damon <news.x.richarddamon@xoxy.net> - 2011-09-24 14:31 -0400
                                                                    Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-24 21:49 +0100
                                                                      Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-24 14:40 -0700
                                                                        Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-25 01:14 +0100
                                                                          Re: Testing if a pointer is valid Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-24 13:44 -0800
                                                                      Re: Testing if a pointer is valid Richard Damon <news.x.richarddamon@xoxy.net> - 2011-09-24 20:23 -0400
                                                                  Re: Testing if a pointer is valid Willem <willem@toad.stack.nl> - 2011-09-24 18:44 +0000
                                                                Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-25 07:04 -0400
                                                              Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-24 17:30 +0000
                                                              Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-24 12:34 -0700
                                                                Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-25 01:00 -0700
                                                                  Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-25 21:30 +1300
                                                                    Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-25 05:08 -0700
                                                                      Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-26 08:39 +1300
                                                      Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-24 20:04 +0300
                                              Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-23 17:09 -0400
                                                Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-23 23:43 +0200
                                      Re: Testing if a pointer is valid Michael Press <rubrum@pacbell.net> - 2011-09-27 20:48 -0700
                                        Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-10-03 19:59 +0300
                                          Re: Testing if a pointer is valid Michael Press <rubrum@pacbell.net> - 2011-10-03 17:32 -0700
                                  Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-24 13:53 +0100
                            Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-20 21:18 +0100
                              Re: Testing if a pointer is valid Willem <willem@toad.stack.nl> - 2011-09-20 20:35 +0000
                                Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-20 22:45 +0200
                                  Re: Testing if a pointer is valid Willem <willem@toad.stack.nl> - 2011-09-21 08:09 +0000
                                    Re: Testing if a pointer is valid Noob <root@127.0.0.1> - 2011-09-22 13:04 +0200
                                      Re: Testing if a pointer is valid Robert Wessel <robertwessel2@yahoo.com> - 2011-09-22 11:38 -0500
                                        Re: Testing if a pointer is valid Noob <root@127.0.0.1> - 2011-09-23 10:41 +0200
                                    Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-22 22:20 +0300
                                      Re: Testing if a pointer is valid Willem <willem@toad.stack.nl> - 2011-09-22 22:15 +0000
                                        Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-23 12:30 +0300
                                      Re: Testing if a pointer is valid Seebs <usenet-nospam@seebs.net> - 2011-09-26 22:59 +0000
                                        Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-27 02:06 +0100
                                          Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-27 03:39 +0000
                                            Re: Testing if a pointer is valid "Rosario Pulvirenti" <NoInUseno1Spam@non.usare.invalid> - 2011-10-03 19:51 +0200
                                              Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-10-03 19:11 +0100
                                                Re: Testing if a pointer is valid "Rosario Pulvirenti" <NoInUseno1Spam@non.usare.invalid> - 2011-10-04 16:20 +0200
                                            Re: Testing if a pointer is valid China Blue Corn Chips <chine.bleu@yahoo.com> - 2011-10-04 08:11 -0700
                                              Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-10-04 12:19 -0400
                                          Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-27 13:56 +0300
                                            Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-27 13:13 +0100
                                        Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-27 12:08 +0300
                                    Re: Testing if a pointer is valid Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-29 01:00 -0700
                                Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-20 21:59 +0100
                                Re: Testing if a pointer is valid Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-09-22 22:08 +0300
                        Re: Testing if a pointer is valid Willem <willem@toad.stack.nl> - 2011-09-20 17:00 +0000
                          Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-20 20:32 +0200
                            Re: Testing if a pointer is valid gazelle@shell.xmission.com (Kenny McCormack) - 2011-09-20 18:53 +0000
                              Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-20 22:55 +0200
                              Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-20 21:50 +0100
                                Re: Testing if a pointer is valid gazelle@shell.xmission.com (Kenny McCormack) - 2011-09-21 15:48 +0000
                                  Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-21 16:12 +0000
                                    Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-21 09:42 -0700
                                      Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-21 18:01 +0000
                                  Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-21 21:00 +0100
                                Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-21 21:32 +0200
                                  Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-22 12:40 +0100
                                    Re: Testing if a pointer is valid gazelle@shell.xmission.com (Kenny McCormack) - 2011-09-22 13:00 +0000
                                      Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-22 14:54 +0100
                                        Re: Testing if a pointer is valid gazelle@shell.xmission.com (Kenny McCormack) - 2011-09-22 14:03 +0000
                                        Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-22 11:39 -0700
                                          Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-24 13:44 +0100
                                            Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-24 12:23 -0700
                                      Re: Testing if a pointer is valid Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-29 04:52 -0700
                                    Re: Testing if a pointer is valid Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-29 04:51 -0700
                            Re: Testing if a pointer is valid Willem <willem@toad.stack.nl> - 2011-09-20 19:32 +0000
                              Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-20 22:48 +0200
                                Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-20 17:29 -0400
                                  Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-20 23:45 +0200
                                    Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-21 10:35 -0400
                                      Re: Testing if a pointer is valid Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-29 05:04 -0700
                                Re: Testing if a pointer is valid Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-29 04:54 -0700
                            Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-20 17:19 -0700
                              Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-21 23:26 +0200
                                Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-21 14:35 -0700
                                  Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-22 00:09 +0200
                                    Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-21 19:08 -0400
                            Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-21 05:25 +0000
                        Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-20 21:11 +0100
                          Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-20 23:01 +0200
                            Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-21 03:11 -0700
                              Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-21 12:16 +0200
                                Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-21 03:23 -0700
                            Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-21 20:44 +0100
                              Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-21 22:53 +0200
                                Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-21 23:08 -0400
                                  Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-21 21:14 -0700
                                    Re: Testing if a pointer is valid James Kuyper <jameskuyper@verizon.net> - 2011-09-22 07:17 -0400
                                  Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-22 16:37 +0100
                                Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-22 16:25 +0100
                                  Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-22 11:36 -0700
                                    Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-24 13:37 +0100
                                      Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-24 13:50 +0000
                                        Re: Testing if a pointer is valid gazelle@shell.xmission.com (Kenny McCormack) - 2011-09-24 14:47 +0000
                                          Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-24 20:43 +0100
                                        Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-24 20:26 +0100
                                        Re: Testing if a pointer is valid Richard Damon <news.x.richarddamon@xoxy.net> - 2011-09-24 20:53 -0400
                                          Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-25 02:30 +0100
                                            Re: Testing if a pointer is valid Richard Damon <news.x.richarddamon@xoxy.net> - 2011-09-24 22:24 -0400
                                              Re: Testing if a pointer is valid Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-25 12:36 +0100
                              Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-21 13:56 -0700
                                Re: Testing if a pointer is valid "Rosario Pulvirenti" <NoInUseno1Spam@non.usare.invalid> - 2011-09-22 07:38 +0200
                                  Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-22 02:06 -0700
                                Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-22 15:24 +0100
                                  Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-22 11:35 -0700
                                    Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-24 13:25 +0100
                                Re: Testing if a pointer is valid Seebs <usenet-nospam@seebs.net> - 2011-09-26 22:59 +0000
                                  Re: Testing if a pointer is valid Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-24 13:30 -0800
                              Re: Testing if a pointer is valid Nobody <nobody@nowhere.com> - 2011-09-22 18:23 +0100
                          Re: Testing if a pointer is valid gazelle@shell.xmission.com (Kenny McCormack) - 2011-09-21 15:40 +0000
                            Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-21 20:20 +0100
                Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-19 06:39 +0000
                  Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-19 10:06 -0700
                    Re: Testing if a pointer is valid Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-20 07:03 +0000
                Re: Testing if a pointer is valid pete <pfiland@mindspring.com> - 2011-09-19 19:17 -0400
                Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-20 20:57 +0100
              Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-19 05:14 +0000
                Re: Testing if a pointer is valid Ian Collins <ian-news@hotmail.com> - 2011-09-19 18:02 +1200
                  Re: Testing if a pointer is valid cri@tiac.net (Richard Harter) - 2011-09-19 06:18 +0000
              Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-19 17:50 +0200
                Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-19 20:45 +0200
              Re: Testing if a pointer is valid Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-28 08:05 -0700
                Re: Testing if a pointer is valid Keith Thompson <kst-u@mib.org> - 2011-09-28 09:14 -0700
            Re: Testing if a pointer is valid Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-18 23:52 -0700
            Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-20 20:45 +0100
              Re: Testing if a pointer is valid August Karlstrom <fusionfile@gmail.com> - 2011-09-20 23:35 +0200
                Re: Testing if a pointer is valid Rui Maciel <rui.maciel@gmail.com> - 2011-09-21 19:53 +0100
    Re: Testing if a pointer is valid "BartC" <bc@freeuk.com> - 2011-09-17 23:54 +0100
      Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-18 00:59 +0200
    Re: Testing if a pointer is valid Heikki Kallasjoki <fis+usenet@zem.fi> - 2011-09-17 23:35 +0000
      Re: Testing if a pointer is valid jacob navia <jacob@spamsink.net> - 2011-09-18 01:47 +0200
    Re: Testing if a pointer is valid Geoff <geoff@invalid.invalid> - 2011-09-17 17:15 -0700
    Re: Testing if a pointer is valid Максим Фомин <maxim@maxim-fomin.ru> - 2011-09-18 00:43 -0700
    Re: Testing if a pointer is valid "Rosario Pulvirenti" <NoInUseno1Spam@non.usare.invalid> - 2011-09-18 10:34 +0200
      Re: Testing if a pointer is valid "Rosario Pulvirenti" <NoInUseno1Spam@non.usare.invalid> - 2011-09-20 09:28 +0200
    Re: Testing if a pointer is valid Ike Naar <ike@iceland.freeshell.org> - 2011-09-18 12:55 +0000
    Re: Testing if a pointer is valid "Joel C. Salomon" <joelcsalomon@gmail.com> - 2011-09-19 10:29 -0400
    Re: Testing if a pointer is valid China Blue Corn Chips <chine.bleu@yahoo.com> - 2011-09-20 00:22 -0700

Page 3 of 15 — ← Prev page 1 2 [3] 4 5 … 15  Next page →


#10530

FromImpalerCore <jadill33@gmail.com>
Date2011-09-19 14:02 -0700
Message-ID<579f814f-c46b-4159-9f45-ab7fb4af37cb@o9g2000vbo.googlegroups.com>
In reply to#10527
On Sep 19, 4:45 pm, jacob navia <ja...@spamsink.net> wrote:
> Thanks for your very informative message John
>
> Excellent.

No problem.  I've been chewing on this bone for quite a while.  I'm
glad it sounds somewhat reasonable to at least one person :-)

John D.

[toc] | [prev] | [next] | [standalone]


#10482

FromKleuskes & Moos <kleuske@somewhere.else.net>
Date2011-09-19 07:14 +0000
Message-ID<j56q4u$gct$2@dont-email.me>
In reply to#10470
On Mon, 19 Sep 2011 04:27:43 +0000, Richard Harter wrote:

> On Sun, 18 Sep 2011 16:38:57 -0700, blp@cs.stanford.edu (Ben Pfaff)
> wrote:
> 
>>cri@tiac.net (Richard Harter) writes:
>>
>>> On Sun, 18 Sep 2011 20:32:12 +0000 (UTC), Kleuskes & Moos
>>> <kleuske@somewhere.else.net> wrote:
>>>
>>>>On Mon, 19 Sep 2011 08:23:50 +1200, Ian Collins wrote:
>>>>
>>>>> On 09/19/11 08:00 AM, Kleuskes & Moos wrote:
>>>>>> On Sun, 18 Sep 2011 19:25:49 +0200, jacob navia wrote:
>>>>>>
>>>>>>> You should have a way to avoid crashes because of malicious code
>>>>>>> that feeds you a bad pointer isn't it?
>>>>>>
>>>>>> You should not be uncertain wether or not a pointer is valid or
>>>>>> not. If you are, your design stinks. If you try to compensate by
>>>>>> adding checks, your methodology stinks, too.
>>>>> 
>>>>> That's untrue.  How can a library designer know what a user will
>>>>> pass to one of their functions?
>>>>
>>>>That's the users responsibility, not one the author of the library
>>>>should concern himself with. If the user passes crap to the library, a
>>>>crash (or at least a SIGSEGV) is what's called for.
>>>>
>>>>The alternative is requiring complete checking of any pointer passed
>>>>to any library, thus penalizing those programs that pass valid
>>>>pointers for the benefit of programmers who can't be bothered to
>>>>ensure their pointers are valid.
>>>>
>>>>That's not the proper way to do it.
>>>
>>> If you don't mind I would prefer not to use libraries you write.
>>
>>Richard, you seem to believe that a library should validate all the
>>pointers passed into it.  Can you explain how you believe that a library
>>should actually do this?  I don't believe that it is practical.
>>
>>An example would be helpful.  For example, how would you implement
>>memcpy()?
> 
> Mon ami, you miscomprehend.  I did not claim nor do I suppose that I can
> determine whether every pointer is valid.  That is not the issue. It is
> the viewpoint.  Let me quote:
> 
>     That's the users responsibility, not one the author of the library
>     should concern himself with. If the user passes crap to the library,
>     a crash (or at least a SIGSEGV) is what's called for.
> 
> The issue is:  As a library author do you validate your input as best
> you can and provide a graceful response to input error - again as best
> as you can?  Or do you, perhaps, take the view that if "the user passes
> crap" it is their lookout.
>
> If the library author takes the view that the onus is on the crap
> passing user and therefore doesn't have to care whether about validating
> input or about designing the library software to be robust. Given my
> druthers, I'd rather not use software written by such an author.

If your standards are such that you would insist on having impractical, nay,
impossible checks, your choice of software to use may be rather limited. If
I'm correctly informed not even (g)libc does that kind of checking.

Validating input is something different that what we're discussing
here, which specifically talked about bogus pointers. If there's input from
some unreliable source, it should be checked thoroughly, but if the user of
a library is considered unreliable, your well into the paranoid mode of
defensive programming.

> To be fair I believe that K&M is an able programmer who checks inputs
> carefully and who writes robust software.  Much of what K&M posts is of
> high quality.  However I was dismayed at the attitude expressed in the
> post to which I responded.

Why, thank you. May i add that my usual neck of the woods is real-time
embedded software, which may help you understand the origins of my attitude.
I rather _do_ expect a fellow programmer to know what he's doing.

If you're writing software (and that's the only way i can think of to pass
bogus pointers to a library), you should be able to tell whether or not a
pointer is valid or not at a given point. If you're not, *something* is
seriously wrong.

Note: I'm using "you are" in the sense of "one is", I'm not implying anything
about you personally.

-------------------------------------------------------------------------------
 _________________________________________
/ Was my SOY LOAF left out in th'RAIN? It \
\ tastes REAL GOOD!!                      /
 -----------------------------------------
  \
   \
       ___  
     {~._.~}
      ( Y )
     ()~*~()   
     (_)-(_)   
-------------------------------------------------------------------------------

[toc] | [prev] | [next] | [standalone]


#10500

Fromcri@tiac.net (Richard Harter)
Date2011-09-19 16:13 +0000
Message-ID<4e7751af.337071921@text.giganews.com>
In reply to#10482
On Mon, 19 Sep 2011 07:14:38 +0000 (UTC), Kleuskes & Moos
<kleuske@somewhere.else.net> wrote:

>On Mon, 19 Sep 2011 04:27:43 +0000, Richard Harter wrote:
>
>> On Sun, 18 Sep 2011 16:38:57 -0700, blp@cs.stanford.edu (Ben Pfaff)
>> wrote:
>> 
>>>cri@tiac.net (Richard Harter) writes:
>>>
>>>> On Sun, 18 Sep 2011 20:32:12 +0000 (UTC), Kleuskes & Moos
>>>> <kleuske@somewhere.else.net> wrote:
>>>>
>>>>>On Mon, 19 Sep 2011 08:23:50 +1200, Ian Collins wrote:
>>>>>
>>>>>> On 09/19/11 08:00 AM, Kleuskes & Moos wrote:
>>>>>>> On Sun, 18 Sep 2011 19:25:49 +0200, jacob navia wrote:
>>>>>>>
>>>>>>>> You should have a way to avoid crashes because of malicious code
>>>>>>>> that feeds you a bad pointer isn't it?
>>>>>>>
>>>>>>> You should not be uncertain wether or not a pointer is valid or
>>>>>>> not. If you are, your design stinks. If you try to compensate by
>>>>>>> adding checks, your methodology stinks, too.
>>>>>> 
>>>>>> That's untrue.  How can a library designer know what a user will
>>>>>> pass to one of their functions?
>>>>>
>>>>>That's the users responsibility, not one the author of the library
>>>>>should concern himself with. If the user passes crap to the library, a
>>>>>crash (or at least a SIGSEGV) is what's called for.
>>>>>
>>>>>The alternative is requiring complete checking of any pointer passed
>>>>>to any library, thus penalizing those programs that pass valid
>>>>>pointers for the benefit of programmers who can't be bothered to
>>>>>ensure their pointers are valid.
>>>>>
>>>>>That's not the proper way to do it.
>>>>
>>>> If you don't mind I would prefer not to use libraries you write.
>>>
>>>Richard, you seem to believe that a library should validate all the
>>>pointers passed into it.  Can you explain how you believe that a library
>>>should actually do this?  I don't believe that it is practical.
>>>
>>>An example would be helpful.  For example, how would you implement
>>>memcpy()?
>> 
>> Mon ami, you miscomprehend.  I did not claim nor do I suppose that I can
>> determine whether every pointer is valid.  That is not the issue. It is
>> the viewpoint.  Let me quote:
>> 
>>     That's the users responsibility, not one the author of the library
>>     should concern himself with. If the user passes crap to the library,
>>     a crash (or at least a SIGSEGV) is what's called for.
>> 
>> The issue is:  As a library author do you validate your input as best
>> you can and provide a graceful response to input error - again as best
>> as you can?  Or do you, perhaps, take the view that if "the user passes
>> crap" it is their lookout.
>>
>> If the library author takes the view that the onus is on the crap
>> passing user and therefore doesn't have to care whether about validating
>> input or about designing the library software to be robust. Given my
>> druthers, I'd rather not use software written by such an author.

>If your standards are such that you would insist on having impractical, nay,
>impossible checks, your choice of software to use may be rather limited.

Nice strawman.  I make no such insistance, just as I don't insist that
all software I use be written by somebody named Fred. 

>If I'm correctly informed not even (g)libc does that kind of checking.

So? I would be highly surprised if they did.

 

>Validating input is something different that what we're discussing
>here, which specifically talked about bogus pointers. If there's input from
>some unreliable source, it should be checked thoroughly, but if the user of
>a library is considered unreliable, your well into the paranoid mode of
>defensive programming.

In general, users of libraries are unreliable.  Maybe your users write
error free code and never have dangling pointers.  If so, I am happy
for you.

The issue is, what can you do about being passed bad pointers, if
anything.  The trouble I have with your post is that you present a
false dichotomy - either you accept no responsibility for handling bad
input pointers (crap passing users are fair game) or else you go into
paranoid mode. ("You" being a library author, not you personally.)

What you do or even can do depends upon the specific situation.  We
all (I hope) understand that C pointers are inherently unsafe and
there is no general way to check for pointer validity.  That said,
sometimes there are things that can be done.  One can at least ask the
question, "is there anything meaningful I can do".

And sometimes "paranoid defensive programming" is right and proper.
As it happens I am working with some software in which the possibility
of stale *pointers* is part of the spec.  The answer is not to use raw
C pointers but rather to use "safe references" that can be and are
checked for validity.   
  
>
>> To be fair I believe that K&M is an able programmer who checks inputs
>> carefully and who writes robust software.  Much of what K&M posts is of
>> high quality.  However I was dismayed at the attitude expressed in the
>> post to which I responded.
>
>Why, thank you. May i add that my usual neck of the woods is real-time
>embedded software, which may help you understand the origins of my attitude.
>I rather _do_ expect a fellow programmer to know what he's doing.

Having done a bit of real-time programming myself, I quite understand.
>
>If you're writing software (and that's the only way i can think of to pass
>bogus pointers to a library), you should be able to tell whether or not a
>pointer is valid or not at a given point. If you're not, *something* is
>seriously wrong.

Eventually, of course, you *should* be able to tell.  I notice,
though, that I know of no large software product that is know to be
error free.  Finding the dangling pointer after the rocket has crashed
is not the happiest of outcomes.
>
>Note: I'm using "you are" in the sense of "one is", I'm not implying anything
>about you personally.

Likewise.

[toc] | [prev] | [next] | [standalone]


#10509

FromKleuskes & Moos <kleuske@somewhere.else.net>
Date2011-09-19 17:36 +0000
Message-ID<j57ujo$k3q$1@dont-email.me>
In reply to#10500
On Mon, 19 Sep 2011 16:13:55 +0000, Richard Harter wrote:

> On Mon, 19 Sep 2011 07:14:38 +0000 (UTC), Kleuskes & Moos
> <kleuske@somewhere.else.net> wrote:
> 
>>On Mon, 19 Sep 2011 04:27:43 +0000, Richard Harter wrote:
>>
>>> On Sun, 18 Sep 2011 16:38:57 -0700, blp@cs.stanford.edu (Ben Pfaff)
>>> wrote:
>>> 
>>>>cri@tiac.net (Richard Harter) writes:
>>>>
>>>>> On Sun, 18 Sep 2011 20:32:12 +0000 (UTC), Kleuskes & Moos
>>>>> <kleuske@somewhere.else.net> wrote:
>>>>>
>>>>>>On Mon, 19 Sep 2011 08:23:50 +1200, Ian Collins wrote:
>>>>>>
>>>>>>> On 09/19/11 08:00 AM, Kleuskes & Moos wrote:
>>>>>>>> On Sun, 18 Sep 2011 19:25:49 +0200, jacob navia wrote:
>>>>>>>>
>>>>>>>>> You should have a way to avoid crashes because of malicious code
>>>>>>>>> that feeds you a bad pointer isn't it?
>>>>>>>>
>>>>>>>> You should not be uncertain wether or not a pointer is valid or
>>>>>>>> not. If you are, your design stinks. If you try to compensate by
>>>>>>>> adding checks, your methodology stinks, too.
>>>>>>> 
>>>>>>> That's untrue.  How can a library designer know what a user will
>>>>>>> pass to one of their functions?
>>>>>>
>>>>>>That's the users responsibility, not one the author of the library
>>>>>>should concern himself with. If the user passes crap to the library,
>>>>>>a crash (or at least a SIGSEGV) is what's called for.
>>>>>>
>>>>>>The alternative is requiring complete checking of any pointer passed
>>>>>>to any library, thus penalizing those programs that pass valid
>>>>>>pointers for the benefit of programmers who can't be bothered to
>>>>>>ensure their pointers are valid.
>>>>>>
>>>>>>That's not the proper way to do it.
>>>>>
>>>>> If you don't mind I would prefer not to use libraries you write.
>>>>
>>>>Richard, you seem to believe that a library should validate all the
>>>>pointers passed into it.  Can you explain how you believe that a
>>>>library should actually do this?  I don't believe that it is
>>>>practical.
>>>>
>>>>An example would be helpful.  For example, how would you implement
>>>>memcpy()?
>>> 
>>> Mon ami, you miscomprehend.  I did not claim nor do I suppose that I
>>> can determine whether every pointer is valid.  That is not the issue.
>>> It is the viewpoint.  Let me quote:
>>> 
>>>     That's the users responsibility, not one the author of the library
>>>     should concern himself with. If the user passes crap to the
>>>     library, a crash (or at least a SIGSEGV) is what's called for.
>>> 
>>> The issue is:  As a library author do you validate your input as best
>>> you can and provide a graceful response to input error - again as best
>>> as you can?  Or do you, perhaps, take the view that if "the user
>>> passes crap" it is their lookout.
>>>
>>> If the library author takes the view that the onus is on the crap
>>> passing user and therefore doesn't have to care whether about
>>> validating input or about designing the library software to be robust.
>>> Given my druthers, I'd rather not use software written by such an
>>> author.
> 
>>If your standards are such that you would insist on having impractical,
>>nay, impossible checks, your choice of software to use may be rather
>>limited.
> 
> Nice strawman.  I make no such insistance, just as I don't insist that
> all software I use be written by somebody named Fred.
> 
>>If I'm correctly informed not even (g)libc does that kind of checking.
> 
> So? I would be highly surprised if they did.
> 
> 
>  
>>Validating input is something different that what we're discussing here,
>>which specifically talked about bogus pointers. If there's input from
>>some unreliable source, it should be checked thoroughly, but if the user
>>of a library is considered unreliable, your well into the paranoid mode
>>of defensive programming.
> 
> In general, users of libraries are unreliable.  Maybe your users write
> error free code and never have dangling pointers.  If so, I am happy for
> you.

No they aren't and neither am i. I think, however, i can assume both know
how to use a debugger. Besides, i don't usually write libraries.

> The issue is, what can you do about being passed bad pointers, if
> anything.  The trouble I have with your post is that you present a false
> dichotomy - either you accept no responsibility for handling bad input
> pointers (crap passing users are fair game) or else you go into paranoid
> mode. ("You" being a library author, not you personally.)

I don't see much in the middle, except replacing pointers with something
more robust, like your solution below. The only trick i sometimes employ
is crude range-checking, but that depends on know where in memory a
pointer should (or rather, should not) point and/or checking alignment if
required, but these do not end up in production code.

> What you do or even can do depends upon the specific situation.  We all
> (I hope) understand that C pointers are inherently unsafe and there is
> no general way to check for pointer validity.  That said, sometimes
> there are things that can be done.  One can at least ask the question,
> "is there anything meaningful I can do".

Not much, I'm afraid.

> And sometimes "paranoid defensive programming" is right and proper.

Aye. But that's usually restricted to having proper asserts in place
and various other sanity checks. Don't get me wrong, I'm all for that,
if it's possible to use them.

> As
> it happens I am working with some software in which the possibility of
> stale *pointers* is part of the spec.  The answer is not to use raw C
> pointers but rather to use "safe references" that can be and are checked
> for validity.

Thus avoiding the problem. Clever. But it doesn't really address being
passed bad pointers.

>>> To be fair I believe that K&M is an able programmer who checks inputs
>>> carefully and who writes robust software.  Much of what K&M posts is
>>> of high quality.  However I was dismayed at the attitude expressed in
>>> the post to which I responded.
>>
>>Why, thank you. May i add that my usual neck of the woods is real-time
>>embedded software, which may help you understand the origins of my
>>attitude. I rather _do_ expect a fellow programmer to know what he's
>>doing.
> 
> Having done a bit of real-time programming myself, I quite understand.

:-)

>>If you're writing software (and that's the only way i can think of to
>>pass bogus pointers to a library), you should be able to tell whether or
>>not a pointer is valid or not at a given point. If you're not,
>>*something* is seriously wrong.
> 
> Eventually, of course, you *should* be able to tell.  I notice, though,
> that I know of no large software product that is know to be error free.

There's a bet on TeX, IIRC. Problem is, by the time the software has matured,
the product is obsolete.

> Finding the dangling pointer after the rocket has crashed is not the
> happiest of outcomes.

Nope. And unless you're talking manned missions, there are worse possible
outcomes, but the solutions suggested in this thread do not strike me as
being "the way to go".

>>Note: I'm using "you are" in the sense of "one is", I'm not implying
>>anything about you personally.
> 
> Likewise.

-------------------------------------------------------------------------------
 _________________________________
< YOU PICKED KARL MALDEN'S NOSE!! >
 ---------------------------------
  \
   \
       ___  
     {~._.~}
      ( Y )
     ()~*~()   
     (_)-(_)   
-------------------------------------------------------------------------------

[toc] | [prev] | [next] | [standalone]


#10519

Fromcri@tiac.net (Richard Harter)
Date2011-09-19 20:09 +0000
Message-ID<4e779d1f.356385220@text.giganews.com>
In reply to#10509
On Mon, 19 Sep 2011 17:36:57 +0000 (UTC), Kleuskes & Moos
<kleuske@somewhere.else.net> wrote:

>On Mon, 19 Sep 2011 16:13:55 +0000, Richard Harter wrote:
[snip]

>> In general, users of libraries are unreliable.  Maybe your users write
>> error free code and never have dangling pointers.  If so, I am happy for
>> you.
>
>No they aren't and neither am i. I think, however, i can assume both know
>how to use a debugger. Besides, i don't usually write libraries.

Much of my work has been in contexts where relying on a debugger often
isn't an option.    
>
>> The issue is, what can you do about being passed bad pointers, if
>> anything.  The trouble I have with your post is that you present a false
>> dichotomy - either you accept no responsibility for handling bad input
>> pointers (crap passing users are fair game) or else you go into paranoid
>> mode. ("You" being a library author, not you personally.)
>
>I don't see much in the middle, except replacing pointers with something
>more robust, like your solution below. The only trick i sometimes employ
>is crude range-checking, but that depends on know where in memory a
>pointer should (or rather, should not) point and/or checking alignment if
>required, but these do not end up in production code.

You've probably never thought about the issue.  Then again, neither
have I.  :-)  Let's see.  One can use Jacob's self-identifying data
scheme.  It's not a universal solution, but it has its place.  One can
an error handler that traps on what would otherwise be a crash and
writes an error file.  If you are into instrumented code that can be
quite informative.  Again, not a universal solution, but it has its
place.  And so on.  It's all about deciding in advance what your error
handling strategy is going to be rather than tacking it on as an after
thought.

>
>> What you do or even can do depends upon the specific situation.  We all
[snip]
>
>> As
>> it happens I am working with some software in which the possibility of
>> stale *pointers* is part of the spec.  The answer is not to use raw C
>> pointers but rather to use "safe references" that can be and are checked
>> for validity.
>
>Thus avoiding the problem. Clever. But it doesn't really address being
>passed bad pointers.

Granted.
[snip]
>> Finding the dangling pointer after the rocket has crashed is not the
>> happiest of outcomes.
>
>Nope. And unless you're talking manned missions, there are worse possible
>outcomes, but the solutions suggested in this thread do not strike me as
>being "the way to go".

True enough.  There is a difference between "getting it right" and
"lowering the probability of error".

[toc] | [prev] | [next] | [standalone]


#10514

Fromjacob navia <jacob@spamsink.net>
Date2011-09-19 20:36 +0200
Message-ID<j58233$2ua$1@speranza.aioe.org>
In reply to#10482
Le 19/09/11 09:14, Kleuskes & Moos a écrit :
>
> If you're writing software (and that's the only way i can think of to pass
> bogus pointers to a library), you should be able to tell whether or not a
> pointer is valid or not at a given point. If you're not, *something* is
> seriously wrong.
>


But you can write in your code

LibraryFunction(handle1,pdata);

instead of the correct

LibraryFunction(pdata,handle1);

you see, because you are (like many other beings)
a HUMAN, not a machine.


And now you do not get any warning because both are
pointers to opaque types, i.e. eventually void *.

Or, you have two similarly named variables and instead of
writing h1 you wrote h2...

etc, the possibilities (as you very well know) are endless.

Shit happens...

In a debug setting, a clear error message from the library would be
very welcome. You are spared starting the debugger, driving the program
to the crash point and debugging!!!

[toc] | [prev] | [next] | [standalone]


#10518

FromIan Collins <ian-news@hotmail.com>
Date2011-09-20 08:05 +1200
Message-ID<9dpll2Fr5dU18@mid.individual.net>
In reply to#10514
On 09/20/11 06:36 AM, jacob navia wrote:
> Le 19/09/11 09:14, Kleuskes&  Moos a écrit :
>>
>> If you're writing software (and that's the only way i can think of to pass
>> bogus pointers to a library), you should be able to tell whether or not a
>> pointer is valid or not at a given point. If you're not, *something* is
>> seriously wrong.
>
> But you can write in your code
>
> LibraryFunction(handle1,pdata);
>
> instead of the correct
>
> LibraryFunction(pdata,handle1);
>
> you see, because you are (like many other beings)
> a HUMAN, not a machine.
>
>
> And now you do not get any warning because both are
> pointers to opaque types, i.e. eventually void *.
>
> Or, you have two similarly named variables and instead of
> writing h1 you wrote h2...
>
> etc, the possibilities (as you very well know) are endless.
>
> Shit happens...
>
> In a debug setting, a clear error message from the library would be
> very welcome. You are spared starting the debugger, driving the program
> to the crash point and debugging!!!

But the examples you used are precisely the common case where run time 
pointer validity checking achieves nothing: both pointers are valid.

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#10524

Fromcri@tiac.net (Richard Harter)
Date2011-09-19 20:18 +0000
Message-ID<4e77a26b.357741149@text.giganews.com>
In reply to#10514
On Mon, 19 Sep 2011 20:36:22 +0200, jacob navia <jacob@spamsink.net>
wrote:

>Le 19/09/11 09:14, Kleuskes & Moos a écrit :
>>
>> If you're writing software (and that's the only way i can think of to pass
>> bogus pointers to a library), you should be able to tell whether or not a
>> pointer is valid or not at a given point. If you're not, *something* is
>> seriously wrong.
>>
>
>
>But you can write in your code
>
>LibraryFunction(handle1,pdata);
>
>instead of the correct
>
>LibraryFunction(pdata,handle1);
>
>you see, because you are (like many other beings)
>a HUMAN, not a machine.
>
>
>And now you do not get any warning because both are
>pointers to opaque types, i.e. eventually void *.

Just as a note, I have found that using a void * pointer as a handle
is not all that great an idea.  Better is to use a small struct that
is type specific.  Then you can type check and, with a small bit of
thought, do type specific sanity checks.  YMMV.

[toc] | [prev] | [next] | [standalone]


#10545

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2011-09-19 23:37 +0000
Message-ID<slrnj7fki8.1bk.grahn+nntp@frailea.sa.invalid>
In reply to#10524
On Mon, 2011-09-19, Richard Harter wrote:
> On Mon, 19 Sep 2011 20:36:22 +0200, jacob navia <jacob@spamsink.net>
> wrote:
>
>>Le 19/09/11 09:14, Kleuskes & Moos a écrit :
>>>
>>> If you're writing software (and that's the only way i can think of to pass
>>> bogus pointers to a library), you should be able to tell whether or not a
>>> pointer is valid or not at a given point. If you're not, *something* is
>>> seriously wrong.
>>>
>>
>>
>>But you can write in your code
>>
>>LibraryFunction(handle1,pdata);
>>
>>instead of the correct
>>
>>LibraryFunction(pdata,handle1);
>>
>>you see, because you are (like many other beings)
>>a HUMAN, not a machine.
>>
>>
>>And now you do not get any warning because both are
>>pointers to opaque types, i.e. eventually void *.
>
> Just as a note, I have found that using a void * pointer as a handle
> is not all that great an idea.  Better is to use a small struct that
> is type specific.  Then you can type check and, with a small bit of
> thought, do type specific sanity checks.  YMMV.

(Or "incomplete types", or whatever they are called, when you deal with
pointers to 'struct Foo' without having seen the definition of struct
Foo.)

Yes -- I'd be much more annoyed by a library which has a weak
interface with respect to types and constness, than by a library
which doesn't check that my pointers go somewhere meaningful.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#10649

FromKenneth Brody <kenbrody@spamcop.net>
Date2011-09-21 12:23 -0400
Message-ID<ypydnZQ7VucBkufTnZ2dnUVZ_uWdnZ2d@bestweb.net>
In reply to#10524
On 9/19/2011 4:18 PM, Richard Harter wrote:
> On Mon, 19 Sep 2011 20:36:22 +0200, jacob navia<jacob@spamsink.net>
> wrote:
[...]
>> And now you do not get any warning because both are
>> pointers to opaque types, i.e. eventually void *.
>
> Just as a note, I have found that using a void * pointer as a handle
> is not all that great an idea.  Better is to use a small struct that
> is type specific.  Then you can type check and, with a small bit of
> thought, do type specific sanity checks.  YMMV.

The Windows API, if STRICT is #defined, does just this.  Without STRICT, all 
handles are of the same type -- HANDLE.  With STRICT, the following macro 
typedefs type-specific handles (line-break added by me, for the sake of 
Usenet wrapping):

#define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef \
     struct name##__ *name

So, an HBRUSH is not compatible with an HPEN, for example.

BTW, I understand that the "everything is a HANDLE" (HANDLE being a typedef 
of "void*") default is left over from "ye goode ol' days" when that's what 
the API used.

On the other hand, I would like to think that the Windows kernel would do a 
quick check that the pointer is, in fact, a pointer to the proper object, 
perhaps with the "magic number" check mentioned previously in this thread. 
However, in this case, the overhead of this check, compared to the risk 
involved with an "invalid" pointer, is minimal, and I would put this under 
the "appropriate use" category.  Now, what should happen next if a bad 
pointer was used, is up for debate.  (ie: return error code, or crash the 
user's program.)

-- 
Kenneth Brody

[toc] | [prev] | [next] | [standalone]


#10647

FromKenneth Brody <kenbrody@spamcop.net>
Date2011-09-21 12:09 -0400
Message-ID<6YKdneDqlpPakefTnZ2dnUVZ_vadnZ2d@bestweb.net>
In reply to#10514
On 9/19/2011 2:36 PM, jacob navia wrote:
> Le 19/09/11 09:14, Kleuskes & Moos a écrit :
>>
>> If you're writing software (and that's the only way i can think of to pass
>> bogus pointers to a library), you should be able to tell whether or not a
>> pointer is valid or not at a given point. If you're not, *something* is
>> seriously wrong.
>>
>
>
> But you can write in your code
>
> LibraryFunction(handle1,pdata);
>
> instead of the correct
>
> LibraryFunction(pdata,handle1);
>
> you see, because you are (like many other beings)
> a HUMAN, not a machine.
>
>
> And now you do not get any warning because both are
> pointers to opaque types, i.e. eventually void *.

Note that there is no need for opaque pointers to be "void*".  Heck, even 
the Windows API has used for quite some time, opaque pointers for all 
"handle" types passed (if you #define STRICT).  A function which takes a 
"brush handle" won't accept a "cursor handle".

> Or, you have two similarly named variables and instead of
> writing h1 you wrote h2...
>
> etc, the possibilities (as you very well know) are endless.
>
> Shit happens...
>
> In a debug setting, a clear error message from the library would be
> very welcome. You are spared starting the debugger, driving the program
> to the crash point and debugging!!!

Well, you still need the debugger to figure out why the "sanity check" failed.

I'm not saying such checks are bad, when used appropriately.  The definition 
of "appropriately", of course, varies based on context.

-- 
Kenneth Brody

[toc] | [prev] | [next] | [standalone]


#10995

Fromwebsnarf <websnarf@gmail.com>
Date2011-09-26 22:01 -0700
Message-ID<9bcf5ef8-87b2-4a63-9b93-d06dfa447e8f@12g2000vbu.googlegroups.com>
In reply to#10457
On Sep 18, 4:38 pm, b...@cs.stanford.edu (Ben Pfaff) wrote:
> c...@tiac.net (Richard Harter) writes:
> > On Sun, 18 Sep 2011 20:32:12 +0000 (UTC), Kleuskes & Moos
> > <kleu...@somewhere.else.net> wrote:
>
> >>On Mon, 19 Sep 2011 08:23:50 +1200, Ian Collins wrote:
>
> >>> On 09/19/11 08:00 AM, Kleuskes & Moos wrote:
> >>>> On Sun, 18 Sep 2011 19:25:49 +0200, jacob navia wrote:
>
> >>>>> You should have a way to avoid crashes because of malicious code that
> >>>>> feeds you a bad pointer isn't it?
>
> >>>> You should not be uncertain wether or not a pointer is valid or not. If
> >>>> you are, your design stinks. If you try to compensate by adding checks,
> >>>> your methodology stinks, too.
>
> >>> That's untrue.  How can a library designer know what a user will pass to
> >>> one of their functions?
>
> >>That's the users responsibility, not one the author of the library should
> >>concern himself with. If the user passes crap to the library, a crash (or
> >>at least a SIGSEGV) is what's called for.
>
> >>The alternative is requiring complete checking of any pointer passed to any
> >>library, thus penalizing those programs that pass valid pointers for the
> >>benefit of programmers who can't be bothered to ensure their pointers are
> >>valid.
>
> >>That's not the proper way to do it.
>
> > If you don't mind I would prefer not to use libraries you write.
>
> Richard, you seem to believe that a library should validate all
> the pointers passed into it.  Can you explain how you believe
> that a library should actually do this?  I don't believe that it
> is practical.

Well, if you are in control of the compiler and its libraries, then
you can typically get very close.  Close enough for the typical
purpose anyway (which is to debug something).  In Windows programs,
you have a finite number of "segments" that you program loads, plus a
some dynamic memory that can be allocated from the system, that you
can obviously track in a linked list (or balanced tree if you want
more speed) of regions.  The "rough range" for all such regions can be
estimated by the behavior of Windows, its libraries and so on.

I have actually implemented similar utilities in the old DOS days to
debug some nasty code.  In practice it works just fine.  Even
estimates, like testing for double frees, allocation canaries, and
{min, max} memory regions is usually good enough.

--
Paul

[toc] | [prev] | [next] | [standalone]


#10512

FromKenneth Brody <kenbrody@spamcop.net>
Date2011-09-19 13:51 -0400
Message-ID<Yp6dnc9DEKPRHOrTnZ2dnUVZ_rqdnZ2d@bestweb.net>
In reply to#10455
On 9/18/2011 7:28 PM, Richard Harter wrote:
> On Sun, 18 Sep 2011 20:32:12 +0000 (UTC), Kleuskes&  Moos
> <kleuske@somewhere.else.net>  wrote:
>
>> On Mon, 19 Sep 2011 08:23:50 +1200, Ian Collins wrote:
>>
>>> On 09/19/11 08:00 AM, Kleuskes&  Moos wrote:
>>>> On Sun, 18 Sep 2011 19:25:49 +0200, jacob navia wrote:
>>>>
>>>>> You should have a way to avoid crashes because of malicious code that
>>>>> feeds you a bad pointer isn't it?
>>>>
>>>> You should not be uncertain wether or not a pointer is valid or not. If
>>>> you are, your design stinks. If you try to compensate by adding checks,
>>>> your methodology stinks, too.
>>>
>>> That's untrue.  How can a library designer know what a user will pass to
>>> one of their functions?
>>
>> That's the users responsibility, not one the author of the library should
>> concern himself with. If the user passes crap to the library, a crash (or
>> at least a SIGSEGV) is what's called for.
>>
>> The alternative is requiring complete checking of any pointer passed to any
>> library, thus penalizing those programs that pass valid pointers for the
>> benefit of programmers who can't be bothered to ensure their pointers are
>> valid.
>>
>> That's not the proper way to do it.
>
> If you don't mind I would prefer not to use libraries you write.

Some might respond that they would prefer that you not use their libraries, 
either.  (After all, if you can't be bothered to check that you aren't using 
garbage pointers, go somewhere else.)

I'm not saying on which side I sit.

-- 
Kenneth Brody

[toc] | [prev] | [next] | [standalone]


#10522

Fromcri@tiac.net (Richard Harter)
Date2011-09-19 20:11 +0000
Message-ID<4e77a18b.357516898@text.giganews.com>
In reply to#10512
On Mon, 19 Sep 2011 13:51:57 -0400, Kenneth Brody
<kenbrody@spamcop.net> wrote:

>On 9/18/2011 7:28 PM, Richard Harter wrote:
>> On Sun, 18 Sep 2011 20:32:12 +0000 (UTC), Kleuskes&  Moos
>> <kleuske@somewhere.else.net>  wrote:
>>
>>> On Mon, 19 Sep 2011 08:23:50 +1200, Ian Collins wrote:
>>>
>>>> On 09/19/11 08:00 AM, Kleuskes&  Moos wrote:
>>>>> On Sun, 18 Sep 2011 19:25:49 +0200, jacob navia wrote:
>>>>>
>>>>>> You should have a way to avoid crashes because of malicious code that
>>>>>> feeds you a bad pointer isn't it?
>>>>>
>>>>> You should not be uncertain wether or not a pointer is valid or not. If
>>>>> you are, your design stinks. If you try to compensate by adding checks,
>>>>> your methodology stinks, too.
>>>>
>>>> That's untrue.  How can a library designer know what a user will pass to
>>>> one of their functions?
>>>
>>> That's the users responsibility, not one the author of the library should
>>> concern himself with. If the user passes crap to the library, a crash (or
>>> at least a SIGSEGV) is what's called for.
>>>
>>> The alternative is requiring complete checking of any pointer passed to any
>>> library, thus penalizing those programs that pass valid pointers for the
>>> benefit of programmers who can't be bothered to ensure their pointers are
>>> valid.
>>>
>>> That's not the proper way to do it.
>>
>> If you don't mind I would prefer not to use libraries you write.
>
>Some might respond that they would prefer that you not use their libraries, 
>either.  (After all, if you can't be bothered to check that you aren't using 
>garbage pointers, go somewhere else.)
>
>I'm not saying on which side I sit.

Snicker.  I'm happy to go along with your hypothetical library author.
If their thinking is that muddled, why should I trust their software?

[toc] | [prev] | [next] | [standalone]


#10532

FromNobody <nobody@nowhere.com>
Date2011-09-19 22:21 +0100
Message-ID<pan.2011.09.19.21.21.21.827000@nowhere.com>
In reply to#10455
On Sun, 18 Sep 2011 23:28:19 +0000, Richard Harter wrote:

> If you don't mind I would prefer not to use libraries you write.

I guess you don't use anyone's libraries then. Because, other than
checking for NULL pointers, I've never encountered a library which
attempts to validate the pointers which it is passed.

[toc] | [prev] | [next] | [standalone]


#10547

Fromcri@tiac.net (Richard Harter)
Date2011-09-20 00:05 +0000
Message-ID<4e77d86d.371567986@text.giganews.com>
In reply to#10532
On Mon, 19 Sep 2011 22:21:22 +0100, Nobody <nobody@nowhere.com> wrote:

>On Sun, 18 Sep 2011 23:28:19 +0000, Richard Harter wrote:
>
>> If you don't mind I would prefer not to use libraries you write.
>
>I guess you don't use anyone's libraries then. Because, other than
>checking for NULL pointers, I've never encountered a library which
>attempts to validate the pointers which it is passed.

I guess you never bothered to look at the context for the remark.
Good show.  You get to make a snarky comment and I get to chuckle.

[toc] | [prev] | [next] | [standalone]


#10449

FromNobody <nobody@nowhere.com>
Date2011-09-18 23:34 +0100
Message-ID<pan.2011.09.18.22.34.39.671000@nowhere.com>
In reply to#10441
On Sun, 18 Sep 2011 19:25:49 +0200, jacob navia wrote:

>> If you need code to check whether or not a pointer is valid, _your code_
>> is fundamentally flawed.
> 
> Suppose a library that receives a bad pointer. Isn't it reasonable to
> check its validity before using it?

Only if such a check exists. Usually it doesn't.

It isn't the pointers which point at unmapped address space that are the
problem; those produce a nice clean segfault. The real problem is with
pointers which point at something they're not supposed to be pointing at,
which end up silently trashing data. And there's no way to detect that.

If you want that level of hand-holding, you need to use a high-level
language which simply doesn't admit the possibility of an invalid pointer.

[toc] | [prev] | [next] | [standalone]


#10453

Frompacman@kosh.dhis.org (Alan Curry)
Date2011-09-18 22:47 +0000
Message-ID<j55sd7$ci8$1@speranza.aioe.org>
In reply to#10441
In article <j559ir$np9$1@speranza.aioe.org>,
jacob navia  <jacob@jspamsink.org> wrote:
>Le 18/09/11 18:30, Kleuskes & Moos a écrit :
>>
>> If you need code to check whether or not a pointer is valid, _your code_
>> is fundamentally flawed.
>>
>
>Suppose a library that receives a bad pointer. Isn't it reasonable to
>check its validity before using it?
>
>You should have a way to avoid crashes because of malicious code that
>feeds you a bad pointer isn't it?

Not if you're implementing a library interface. There is no security
boundary between a library function and its caller. Within a single
process, if any part of it is malicious, the whole thing is malicious.

If you want to be able to classify one piece of code as an attacker and
another as its potential victim, they need to be in separate processes.
With different user IDs.

-- 
Alan Curry

[toc] | [prev] | [next] | [standalone]


#10486

Fromtom st denis <tom@iahu.ca>
Date2011-09-19 04:50 -0700
Message-ID<50d490b4-f70b-47ea-a69d-5775148a311e@15g2000vbb.googlegroups.com>
In reply to#10441
On Sep 18, 1:25 pm, jacob navia <ja...@spamsink.net> wrote:
> Le 18/09/11 18:30, Kleuskes & Moos a écrit :
>
>
>
> > If you need code to check whether or not a pointer is valid, _your code_
> > is fundamentally flawed.
>
> Suppose a library that receives a bad pointer. Isn't it reasonable to
> check its validity before using it?

Not really.  Besides checking for NULL [*] pointers it's up to the
caller to pass valid pointers since they're not really easily testable
[hence this thread] in a portable fashion.

> You should have a way to avoid crashes because of malicious code that
> feeds you a bad pointer isn't it?
>
> Besides, my motivation here is that in principle I thought that this
> would be impossible, but later on and reflecting a bit, I found out
> that it is not that difficult. I am not advocating the usage of this
> function everywhere.

Raising a signal is not the best of ideas because you could be in a
debugger in which signals are masked to the user process and throw
debugging problems.

[*] I check for NULL pointers since I tend to use memset/calloc and it
lets me find any uninitialized pointers easily.

Tom

[toc] | [prev] | [next] | [standalone]


#10510

FromKenneth Brody <kenbrody@spamcop.net>
Date2011-09-19 13:42 -0400
Message-ID<ROKdnRubqfRr4-rTnZ2dnUVZ_oWdnZ2d@bestweb.net>
In reply to#10441
On 9/18/2011 1:25 PM, jacob navia wrote:
> Le 18/09/11 18:30, Kleuskes & Moos a écrit :
>>
>> If you need code to check whether or not a pointer is valid, _your code_
>> is fundamentally flawed.
>>
>
> Suppose a library that receives a bad pointer. Isn't it reasonable to
> check its validity before using it?

Well, it depends on your definition of "valid".  The IsBadReadPtr() and 
IsBadWritePtr() just check that, at the moment the function is called, there 
exists readable/writable memory at the address specified.  It doesn't (and 
can't) determine whether that memory is the correct place to read/write.

> You should have a way to avoid crashes because of malicious code that
> feeds you a bad pointer isn't it?

Doesn't crashing a program avoid executing malicious code?

> Besides, my motivation here is that in principle I thought that this
> would be impossible, but later on and reflecting a bit, I found out
> that it is not that difficult. I am not advocating the usage of this
> function everywhere.

Okay.

> Consider too the development environment where it is much more likely
> that in the first versions of your software bugs still creep in or
> bugs exist that are undetected.
>
> Rather than simply crashing you could print some useful information,
> jump to a recovery point and go on.

Personally, I prefer debugging a program that crashes at the actual point of 
failure.

-- 
Kenneth Brody

[toc] | [prev] | [next] | [standalone]


Page 3 of 15 — ← Prev page 1 2 [3] 4 5 … 15  Next page →

Back to top | Article view | comp.lang.c


csiph-web