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 4 of 15 — ← Prev page 1 2 3 [4] 5 6 … 15  Next page →


#10513

Fromjacob navia <jacob@spamsink.net>
Date2011-09-19 20:30 +0200
Message-ID<j581of$219$1@speranza.aioe.org>
In reply to#10510
Le 19/09/11 19:42, Kenneth Brody a écrit :
>
> Personally, I prefer debugging a program that crashes at the actual
> point of failure.
>

Well, it depends where the point of failure is.

Suppose your library is expecting a pointer to "a" and is passed a 
pointer to "b", a similar syructure but with slightly different layout.

1) The program crashes deep inside the library when processing the 
pointer data. You have a stack trace that tells you:

0x488776AAD()
0x446655FF4()
MyFunction()  myfunction.c 476
main()        main.c 876

Now what?


2) When you pass a bad pointer the library opens a dialog box:
    "Invalid argument to function Library_input(), argument two"

You see?

A crash isn't always a good thing.

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


#10520

FromIan Collins <ian-news@hotmail.com>
Date2011-09-20 08:09 +1200
Message-ID<9dpls4Fr5dU19@mid.individual.net>
In reply to#10513
On 09/20/11 06:30 AM, jacob navia wrote:
> Le 19/09/11 19:42, Kenneth Brody a écrit :
>>
>> Personally, I prefer debugging a program that crashes at the actual
>> point of failure.
>>
>
> Well, it depends where the point of failure is.
>
> Suppose your library is expecting a pointer to "a" and is passed a
> pointer to "b", a similar syructure but with slightly different layout.

How do your checking function help in this case?  They can't.

> 1) The program crashes deep inside the library when processing the
> pointer data. You have a stack trace that tells you:
>
> 0x488776AAD()
> 0x446655FF4()
> MyFunction()  myfunction.c 476
> main()        main.c 876
>
> Now what?
>
>
> 2) When you pass a bad pointer the library opens a dialog box:
>      "Invalid argument to function Library_input(), argument two"
>
> You see?

Again, your example uses an incorrect, but otherwise good, pointer.

-- 
Ian Collins

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


#10526

Fromjacob navia <jacob@spamsink.net>
Date2011-09-19 22:38 +0200
Message-ID<j5897u$m7t$1@speranza.aioe.org>
In reply to#10520
Le 19/09/11 22:09, Ian Collins a écrit :
>
> Again, your example uses an incorrect, but otherwise good, pointer.
>

Ian, the context is the proposed solution with
a 64 bit magic number. You read 8 bytes and test for your
magic number. If you crash or the magic number is not there
then it is a bad pointer you see?

I proposed that a few messages above, maybe you missed it.

jacob

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


#10528

FromIke Naar <ike@iceland.freeshell.org>
Date2011-09-19 20:50 +0000
Message-ID<slrn3vfsj7fao8.ctm.ike@iceland.freeshell.org>
In reply to#10526
On 2011-09-19, jacob navia <jacob@spamsink.net> wrote:
> Ian, the context is the proposed solution with
> a 64 bit magic number. You read 8 bytes and test for your
> magic number. If you crash or the magic number is not there
> then it is a bad pointer you see?

But if it does not crash and the magic number is there, you
still cannot be sure that the pointer was good.

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


#10529

Fromjacob navia <jacob@spamsink.net>
Date2011-09-19 22:53 +0200
Message-ID<j58a3q$ong$1@speranza.aioe.org>
In reply to#10528
Le 19/09/11 22:50, Ike Naar a écrit :
> On 2011-09-19, jacob navia<jacob@spamsink.net>  wrote:
>> Ian, the context is the proposed solution with
>> a 64 bit magic number. You read 8 bytes and test for your
>> magic number. If you crash or the magic number is not there
>> then it is a bad pointer you see?
>
> But if it does not crash and the magic number is there, you
> still cannot be sure that the pointer was good.


Well, the chances of hitting a 64 bit number by chance for a well chosen 
magic number ar 1 in 2^64...

Quite low really

:-)

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


#10533

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2011-09-19 22:30 +0100
Message-ID<0.d769bff7c8a940f9872d.20110919223015BST.87ty88te3c.fsf@bsb.me.uk>
In reply to#10529
jacob navia <jacob@spamsink.net> writes:

> Le 19/09/11 22:50, Ike Naar a écrit :
>> On 2011-09-19, jacob navia<jacob@spamsink.net>  wrote:
>>> Ian, the context is the proposed solution with
>>> a 64 bit magic number. You read 8 bytes and test for your
>>> magic number. If you crash or the magic number is not there
>>> then it is a bad pointer you see?
>>
>> But if it does not crash and the magic number is there, you
>> still cannot be sure that the pointer was good.
>
>
> Well, the chances of hitting a 64 bit number by chance for a well
> chosen magic number ar 1 in 2^64...

I doubt that very much.  Computers are predictable beasts, and you will
have these numbers dotted around in memory.  They could get copied by
buggy code or they may simply be left lying around in deceptive places:

  mytype *f(void)
  {
     mytype t;
     /* ... */
    return &t;
  }

A function that uses the return from f may well find the magic number
still in place.

I am not saying the technique has no merit (I happen to have been
looking at some code that does exactly this a couple of days ago) but
the probability of false positives is very unlikely to be as low as you
hope.

-- 
Ben.

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


#10536

Fromjacob navia <jacob@spamsink.net>
Date2011-09-20 00:05 +0200
Message-ID<j58eb0$344$1@speranza.aioe.org>
In reply to#10533
Le 19/09/11 23:30, Ben Bacarisse a écrit :
> jacob navia<jacob@spamsink.net>  writes:
>
>> Le 19/09/11 22:50, Ike Naar a écrit :
>>> On 2011-09-19, jacob navia<jacob@spamsink.net>   wrote:
>>>> Ian, the context is the proposed solution with
>>>> a 64 bit magic number. You read 8 bytes and test for your
>>>> magic number. If you crash or the magic number is not there
>>>> then it is a bad pointer you see?
>>>
>>> But if it does not crash and the magic number is there, you
>>> still cannot be sure that the pointer was good.
>>
>>
>> Well, the chances of hitting a 64 bit number by chance for a well
>> chosen magic number ar 1 in 2^64...
>
> I doubt that very much.  Computers are predictable beasts, and you will
> have these numbers dotted around in memory.  They could get copied by
> buggy code or they may simply be left lying around in deceptive places:
>
>    mytype *f(void)
>    {
>       mytype t;
>       /* ... */
>      return&t;
>    }
>
> A function that uses the return from f may well find the magic number
> still in place.
>


Sure, but most compilers nowadays emit a warning when they see such a
code.

Look I do NOT have a solution for finding ALL bugs. If I would
I would be multimillionaifre already and wouldn't be here...


> I am not saying the technique has no merit

Thanks. That is all I am saying actually. It is NOT *THE*
silver bullet

(I happen to have been
> looking at some code that does exactly this a couple of days ago) but
> the probability of false positives is very unlikely to be as low as you
> hope.
>

It is very low, for well chosen magic numbers WITH versions of free()
that clean up the released memory.

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


#10544

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2011-09-20 00:31 +0100
Message-ID<0.d7b65b02586be1f7f256.20110920003126BST.877h54t8hd.fsf@bsb.me.uk>
In reply to#10536
jacob navia <jacob@spamsink.net> writes:

> Le 19/09/11 23:30, Ben Bacarisse a écrit :
>> jacob navia<jacob@spamsink.net>  writes:
>>
>>> Le 19/09/11 22:50, Ike Naar a écrit :
>>>> On 2011-09-19, jacob navia<jacob@spamsink.net>   wrote:
>>>>> Ian, the context is the proposed solution with
>>>>> a 64 bit magic number. You read 8 bytes and test for your
>>>>> magic number. If you crash or the magic number is not there
>>>>> then it is a bad pointer you see?
>>>>
>>>> But if it does not crash and the magic number is there, you
>>>> still cannot be sure that the pointer was good.
>>>
>>>
>>> Well, the chances of hitting a 64 bit number by chance for a well
>>> chosen magic number ar 1 in 2^64...
>>
>> I doubt that very much.  Computers are predictable beasts, and you will
>> have these numbers dotted around in memory.  They could get copied by
>> buggy code or they may simply be left lying around in deceptive places:
>>
>>    mytype *f(void)
>>    {
>>       mytype t;
>>       /* ... */
>>      return&t;
>>    }
>>
>> A function that uses the return from f may well find the magic number
>> still in place.
>
> Sure, but most compilers nowadays emit a warning when they see such a
> code.

No compiler can emit a warning in all such cases.  Obviously I did not
want to suggest that this simple function was a problem -- it's just
illustrative of the fact that the chance of seeing a valid magic number
is not anything like as low as 1 in 2**64.

> Look I do NOT have a solution for finding ALL bugs. If I would
> I would be multimillionaifre already and wouldn't be here...

Quite.  I was commenting on your suggestion about the probabilities, and
making no comment about it not finding all bugs.

<snip>
-- 
Ben.

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


#10540

FromIke Naar <ike@iceland.freeshell.org>
Date2011-09-19 22:43 +0000
Message-ID<slrn3vfsj7fhcs.d05.ike@iceland.freeshell.org>
In reply to#10529
On 2011-09-19, jacob navia <jacob@spamsink.net> wrote:
> Le 19/09/11 22:50, Ike Naar a ?crit :
>> On 2011-09-19, jacob navia<jacob@spamsink.net>  wrote:
>>> Ian, the context is the proposed solution with
>>> a 64 bit magic number. You read 8 bytes and test for your
>>> magic number. If you crash or the magic number is not there
>>> then it is a bad pointer you see?
>>
>> But if it does not crash and the magic number is there, you
>> still cannot be sure that the pointer was good.
>
> Well, the chances of hitting a 64 bit number by chance for a well chosen 
> magic number ar 1 in 2^64...
>
> Quite low really

Can you give some details about how your magic numbers are chosen?
Can they cope with, for instance, the following situation:

  SomeType *a = malloc(10000 * sizeof *a);
  if (a != NULL)
  {
    SomeType *p = a + 5000; /* p now a good pointer */
    *p = SomeGoodValue(); /* good data and good magic number
                             at location p */
    free(a);
    *p; /* should fail, because p is now a bad pointer; will it fail?
        has free() modified the data or magic number at location p? */
    /* ... */
    *p; /* what if the data at location p has become garbled, but the
           magic number is has not? will you accept the bad data? */
  }

or perhaps this situation:

  SomeType a[1], b[2]; /* suppose a+2 and b+1 are
                          the same memory location */
  b[1] = SomeGoodValue(); /* good value and magic number at b[1] */
  a[2]; /* dereferencing bad pointer, but will that be detected?
           after all, there's good data and a good checksum there */

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


#10542

Fromjacob navia <jacob@spamsink.net>
Date2011-09-20 00:59 +0200
Message-ID<j58hh9$9bg$1@speranza.aioe.org>
In reply to#10540
Le 20/09/11 00:43, Ike Naar a écrit :
> On 2011-09-19, jacob navia<jacob@spamsink.net>  wrote:
>> Le 19/09/11 22:50, Ike Naar a ?crit :
>>> On 2011-09-19, jacob navia<jacob@spamsink.net>   wrote:
>>>> Ian, the context is the proposed solution with
>>>> a 64 bit magic number. You read 8 bytes and test for your
>>>> magic number. If you crash or the magic number is not there
>>>> then it is a bad pointer you see?
>>>
>>> But if it does not crash and the magic number is there, you
>>> still cannot be sure that the pointer was good.
>>
>> Well, the chances of hitting a 64 bit number by chance for a well chosen
>> magic number ar 1 in 2^64...
>>
>> Quite low really
>
> Can you give some details about how your magic numbers are chosen?
> Can they cope with, for instance, the following situation:
>
>    SomeType *a = malloc(10000 * sizeof *a);
>    if (a != NULL)
>    {
>      SomeType *p = a + 5000; /* p now a good pointer */
>      *p = SomeGoodValue(); /* good data and good magic number
>                               at location p */
>      free(a);
>      *p; /* should fail, because p is now a bad pointer; will it fail?
>          has free() modified the data or magic number at location p? */
>      /* ... */
>      *p; /* what if the data at location p has become garbled, but the
>             magic number is has not? will you accept the bad data? */
>    }

Most versions of free() destroy the memory contents. If they don't they
should be replaced ASAP at least in a debug setting.
>
> or perhaps this situation:
>
>    SomeType a[1], b[2]; /* suppose a+2 and b+1 are
>                            the same memory location */
>    b[1] = SomeGoodValue(); /* good value and magic number at b[1] */
>    a[2]; /* dereferencing bad pointer, but will that be detected?
>             after all, there's good data and a good checksum there */

Sorry but I do not have a solution for fixing all possible bugs. If I
would I would be richer than the owners of Google.


What do you expect? Case two is not really a library problem: you
pass it a correct pointer to a correct type, it can't possible
fix that bug!

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


#10546

FromIan Collins <ian-news@hotmail.com>
Date2011-09-20 11:50 +1200
Message-ID<9dq2peF76kU3@mid.individual.net>
In reply to#10542
On 09/20/11 10:59 AM, jacob navia wrote:
>
> Most versions of free() destroy the memory contents. If they don't they
> should be replaced ASAP at least in a debug setting.

Really?  I've yet to see one that does, the overhead would be dramatic 
for large blocks.  Not to mention knowing how to link a different free 
from the standard library for debugging.

I did write an allocator that invalidated the memory segment on free, 
which was an extremely effective (and efficient) debug aid.  It was 
limited by the 386 LDT to 4096 concurrent allocations, but that was 
plenty in the application in question.

-- 
Ian Collins

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


#10550

Fromblp@cs.stanford.edu (Ben Pfaff)
Date2011-09-19 19:03 -0700
Message-ID<87vcsovukr.fsf@blp.benpfaff.org>
In reply to#10546
Ian Collins <ian-news@hotmail.com> writes:

> On 09/20/11 10:59 AM, jacob navia wrote:
>>
>> Most versions of free() destroy the memory contents. If they don't they
>> should be replaced ASAP at least in a debug setting.
>
> Really?  I've yet to see one that does, the overhead would be dramatic
> for large blocks.  Not to mention knowing how to link a different free
> from the standard library for debugging.

With glibc, just set the MALLOC_PERTURB_ environment variable to
a byte value.  No re-linking necessary.  See
http://udrepper.livejournal.com/11429.html
-- 
"What is appropriate for the master is not appropriate for the novice.
 You must understand the Tao before transcending structure."
--The Tao of Programming

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


#10551

FromIan Collins <ian-news@hotmail.com>
Date2011-09-20 14:11 +1200
Message-ID<9dqb1kF76kU5@mid.individual.net>
In reply to#10550
On 09/20/11 02:03 PM, Ben Pfaff wrote:
> Ian Collins<ian-news@hotmail.com>  writes:
>
>> On 09/20/11 10:59 AM, jacob navia wrote:
>>>
>>> Most versions of free() destroy the memory contents. If they don't they
>>> should be replaced ASAP at least in a debug setting.
>>
>> Really?  I've yet to see one that does, the overhead would be dramatic
>> for large blocks.  Not to mention knowing how to link a different free
>> from the standard library for debugging.
>
> With glibc, just set the MALLOC_PERTURB_ environment variable to
> a byte value.  No re-linking necessary.  See
> http://udrepper.livejournal.com/11429.html

Interesting, thanks for the link Ben.

-- 
Ian Collins

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


#10552

FromKeith Thompson <kst-u@mib.org>
Date2011-09-19 21:49 -0700
Message-ID<lnehzb6cod.fsf@nuthaus.mib.org>
In reply to#10546
Ian Collins <ian-news@hotmail.com> writes:
> On 09/20/11 10:59 AM, jacob navia wrote:
>> Most versions of free() destroy the memory contents. If they don't they
>> should be replaced ASAP at least in a debug setting.
>
> Really?  I've yet to see one that does, the overhead would be dramatic 
> for large blocks.  Not to mention knowing how to link a different free 
> from the standard library for debugging.
[...]

Experiment shows that the glibc implementation of free() doesn't
modify the contents of the released memory.  (Of course the behavior
of my experimental program is undefined.)

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

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


#11043

FromNick Keighley <nick_keighley_nospam@hotmail.com>
Date2011-09-28 06:17 -0700
Message-ID<99f9f9a9-bed3-4a7f-8255-aed4952c25e5@de2g2000vbb.googlegroups.com>
In reply to#10546
On Sep 20, 12:50 am, Ian Collins <ian-n...@hotmail.com> wrote:
> On 09/20/11 10:59 AM, jacob navia wrote:
>
>
>
> > Most versions of free() destroy the memory contents. If they don't they
> > should be replaced ASAP at least in a debug setting.
>
> Really?  I've yet to see one that does, the overhead would be dramatic
> for large blocks.  Not to mention knowing how to link a different free
> from the standard library for debugging.

I'm pretty sure Visual C++ in debug mode writes over at least some of
the block when its freed. Finding feeefeee in your data indicates
you've accessed a freed block

> I did write an allocator that invalidated the memory segment on free,
> which was an extremely effective (and efficient) debug aid.  It was
> limited by the 386 LDT to 4096 concurrent allocations, but that was
> plenty in the application in question.
>
> --
> Ian Collins

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


#11045

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2011-09-28 07:02 -0700
Message-ID<72ea2888-8bad-4cde-8da4-36b32b7e4e60@db5g2000vbb.googlegroups.com>
In reply to#11043
On Sep 28, 3:17 pm, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
> On Sep 20, 12:50 am, Ian Collins <ian-n...@hotmail.com> wrote:
>
> > Really?  I've yet to see one that does, the overhead would be dramatic
> > for large blocks.  Not to mention knowing how to link a different free
> > from the standard library for debugging.
>
> I'm pretty sure Visual C++ in debug mode writes over at least some of
> the block when its freed. Finding feeefeee in your data indicates
> you've accessed a freed block
>
Most systems crunch your garbage in debug mode, also set new blocks
allocated with malloc to some bit pattern that results in an invalid
pointer if interpreted as an address and a large negative number if
interpreted as an integer.

The overhead is large in terms of malloc(), free, but not in terms of
the program. If a program doesn't write to practically all of the
memory it allocates, then what is it doing with it?

--
Poetry time, on my website
http://www.malcolmmclean.site11.com/www

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


#10558

FromIke Naar <ike@sverige.freeshell.org>
Date2011-09-20 07:26 +0000
Message-ID<slrn3vfsj7gg1j.3a3.ike@sverige.freeshell.org>
In reply to#10542
On 2011-09-19, jacob navia <jacob@spamsink.net> wrote:
> Sorry but I do not have a solution for fixing all possible bugs. If I
> would I would be richer than the owners of Google.

That sounds a lot more realistic than believing 64-bit
magic numbers reduce the chances of false positives to 2^-64.

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


#10651

FromKenneth Brody <kenbrody@spamcop.net>
Date2011-09-21 12:31 -0400
Message-ID<_86dnbUJDOvnjOfTnZ2dnUVZ_hadnZ2d@bestweb.net>
In reply to#10542
On 9/19/2011 6:59 PM, jacob navia wrote:
[...]
> Most versions of free() destroy the memory contents. If they don't they
> should be replaced ASAP at least in a debug setting.
[...]

I don't think I would want a non-debug version of free() wasting its time 
destroying the memory contents, any more than a non-debug malloc() should do so.

-- 
Kenneth Brody

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


#10650

FromKenneth Brody <kenbrody@spamcop.net>
Date2011-09-21 12:26 -0400
Message-ID<ypydnZc7VuevjefTnZ2dnUVZ_uWdnZ2d@bestweb.net>
In reply to#10528
On 9/19/2011 4:50 PM, Ike Naar wrote:
> On 2011-09-19, jacob navia<jacob@spamsink.net>  wrote:
>> Ian, the context is the proposed solution with
>> a 64 bit magic number. You read 8 bytes and test for your
>> magic number. If you crash or the magic number is not there
>> then it is a bad pointer you see?
>
> But if it does not crash and the magic number is there, you
> still cannot be sure that the pointer was good.

The problem with trying to make idiot-proof software is that the universe 
keeps creating better idiots.

Nothing you can do (that I can think of) can be 100% failsafe in checking 
that the pointer is "valid".

-- 
Kenneth Brody

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


#10671

Fromjacob navia <jacob@spamsink.net>
Date2011-09-21 21:20 +0200
Message-ID<j5dddi$377$1@speranza.aioe.org>
In reply to#10650
Le 21/09/11 18:26, Kenneth Brody a critic :
> On 9/19/2011 4:50 PM, Ike Naar wrote:
>> On 2011-09-19, jacob navia<jacob@spamsink.net> wrote:
>>> Ian, the context is the proposed solution with
>>> a 64 bit magic number. You read 8 bytes and test for your
>>> magic number. If you crash or the magic number is not there
>>> then it is a bad pointer you see?
>>
>> But if it does not crash and the magic number is there, you
>> still cannot be sure that the pointer was good.
>
> The problem with trying to make idiot-proof software is that the
> universe keeps creating better idiots.
>
> Nothing you can do (that I can think of) can be 100% failsafe in
> checking that the pointer is "valid".
>

Nobody wants to do that. I told you already that this is not
a magical solution to all problems. It s just a BETTER solution
under certain circumstances that can give more meaningful
error messages than

bus error
core dumped.

And, (embedded programmers should know) not all CPUs have
a MMU that will crash... Many will just overwrite some
other process memory or whatever

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


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

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


csiph-web