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


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

double free

Started byG G <gdotone@gmail.com>
First post2016-07-05 02:38 -0700
Last post2016-11-27 10:05 -0800
Articles 20 on this page of 354 — 37 participants

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


Contents

  double free G G <gdotone@gmail.com> - 2016-07-05 02:38 -0700
    Re: double free Ian Collins <ian-news@hotmail.com> - 2016-07-05 21:45 +1200
      Re: double free Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-07-05 07:08 -0400
      Re: double free G G <gdotone@gmail.com> - 2016-07-05 16:41 -0700
    Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-05 10:50 +0100
    Re: double free BartC <bc@freeuk.com> - 2016-07-05 11:06 +0100
      Re: double free BartC <bc@freeuk.com> - 2016-07-05 19:07 +0100
    Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-05 12:16 +0000
      Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-05 13:57 +0100
        Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-05 08:43 -0700
      Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-05 14:57 +0100
        Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-10 18:49 +0000
      Re: double free G G <gdotone@gmail.com> - 2016-07-05 17:03 -0700
        Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-05 17:25 -0700
      Re: double free Jorgen Grahn <grahn+nntp@snipabacken.se> - 2016-07-06 19:09 +0000
        Re: double free "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-06 15:22 -0400
          Re: double free Nobody <nobody@nowhere.invalid> - 2016-07-09 06:13 +0100
            Re: double free "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-09 10:16 -0400
              Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-09 08:58 -0700
                Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-09 13:28 -0700
                Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-11 10:41 +0000
              Re: double free David Brown <david.brown@hesbynett.no> - 2016-07-09 20:27 +0200
                Re: double free "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-07-09 11:31 -0700
                Re: double free Gareth Owen <gwowen@gmail.com> - 2016-07-09 20:14 +0100
                Re: double free Jerry Stuckle <jstucklex@attglobal.net> - 2016-07-09 15:34 -0400
                  Re: double free jameskuyper@verizon.net - 2016-07-09 14:02 -0700
                    Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-09 14:10 -0700
                      Re: double free "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-09 17:14 -0400
                        Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-09 14:24 -0700
                    Re: double free "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-09 17:31 -0400
                    Re: double free Jerry Stuckle <jstucklex@attglobal.net> - 2016-07-09 20:50 -0400
                Re: double free "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-09 15:50 -0400
                  Re: double free David Brown <david.brown@hesbynett.no> - 2016-07-10 11:32 +0200
                    Re: double free James Kuyper <jameskuyper@verizon.net> - 2016-07-10 16:01 -0400
                      Re: double free David Brown <david.brown@hesbynett.no> - 2016-07-11 10:07 +0200
                        Re: double free James Kuyper <jameskuyper@verizon.net> - 2016-07-11 08:15 -0400
                          Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-11 06:53 -0700
                            Re: double free Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-07-11 10:35 -0600
                              Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-11 09:48 -0700
                                Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-11 11:02 -0700
                              Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-11 11:01 -0700
                                Re: double free Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-07-11 13:03 -0600
                            Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-11 10:57 -0700
                      Re: double free albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-11-27 13:29 +0100
                        Re: double free Melzzzzz <mel@zzzzz.com> - 2016-11-27 14:07 +0100
                  Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-10 13:05 +0100
                    Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-10 05:31 -0700
                      Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-10 13:42 +0100
                      Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-11 01:07 +0100
                Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-09 13:39 -0700
                  Re: double free David Brown <david.brown@hesbynett.no> - 2016-07-10 11:53 +0200
                    Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-10 04:11 -0700
                      Re: double free Jerry Stuckle <jstucklex@attglobal.net> - 2016-07-10 08:47 -0400
                    Re: double free James Kuyper <jameskuyper@verizon.net> - 2016-07-10 16:05 -0400
                Re: double free Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-07-09 17:43 -0600
                  Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-09 17:32 -0700
                    Re: double free Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-07-09 20:34 -0600
                Re: double free Jorgen Grahn <grahn+nntp@snipabacken.se> - 2016-07-10 06:25 +0000
                  Re: double free supercat@casperkitty.com - 2016-07-11 08:02 -0700
                Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-11 11:01 +0000
                  Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-11 04:07 -0700
                    Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-11 12:17 +0100
                      Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-11 04:59 -0700
                        Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-11 13:07 +0100
                          Re: double free BartC <bc@freeuk.com> - 2016-07-11 13:38 +0100
                            Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-11 14:11 +0100
                              Re: double free BartC <bc@freeuk.com> - 2016-07-11 18:54 +0100
                                Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-11 11:09 -0700
                                Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-11 19:47 +0100
                                Re: double free Ike Naar <ike@iceland.freeshell.org> - 2016-07-11 19:08 +0000
                                Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-11 21:19 +0100
                                  Re: double free BartC <bc@freeuk.com> - 2016-07-11 21:34 +0100
                                    Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-11 13:48 -0700
                                    Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-11 22:49 +0100
                                      Re: double free BartC <bc@freeuk.com> - 2016-07-11 23:20 +0100
                                        Re: double free Udyant Wig <udyant.wig@gmail.com> - 2016-07-12 10:26 +0530
                                          Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-11 22:34 -0700
                                            Re: double free Ike Naar <ike@iceland.freeshell.org> - 2016-07-12 06:39 +0000
                                              Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-12 00:41 -0700
                                                Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-12 08:57 +0100
                                                  Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-12 01:16 -0700
                                                    Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-12 09:27 +0100
                                                  Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-12 11:48 +0100
                                            Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-12 08:46 +0100
                                              Re: double free David Brown <david.brown@hesbynett.no> - 2016-07-12 10:42 +0200
                                                Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-12 09:59 +0100
                                                  Re: double free David Brown <david.brown@hesbynett.no> - 2016-07-12 12:46 +0200
                                                    Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-12 09:08 -0700
                                                      Re: double free David Brown <david.brown@hesbynett.no> - 2016-07-12 18:51 +0200
                                                        Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-12 11:28 -0700
                                                        Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-12 19:53 +0100
                                                      Re: double free supercat@casperkitty.com - 2016-07-12 12:19 -0700
                                                        Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-12 14:26 -0700
                                              Re: double free Ken Brody <kenbrody@spamcop.net> - 2016-07-12 11:00 -0400
                                                Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-12 16:18 +0100
                                            Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-12 08:44 -0700
                                              Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-12 09:24 -0700
                                                Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-12 17:34 +0100
                                                  Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-12 09:52 -0700
                                                Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-12 09:40 -0700
                                                  Re: double free BartC <bc@freeuk.com> - 2016-07-12 18:22 +0100
                                                  Re: double free Gareth Owen <gwowen@gmail.com> - 2016-07-13 18:33 +0100
                                                    Re: double free "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-13 14:00 -0400
                                                    Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-13 19:16 +0100
                                                    Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-18 09:15 -0700
                                              Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-18 09:04 -0700
                                                Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-18 11:10 -0700
                                                  Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-20 08:52 -0700
                                                    Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-20 09:36 -0700
                                                      Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-21 18:23 -0700
                                          Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-12 08:42 +0100
                                          Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-12 11:24 +0100
                                            Re: double free BartC <bc@freeuk.com> - 2016-07-12 11:52 +0100
                                              Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-12 13:18 +0100
                                                Re: double free BartC <bc@freeuk.com> - 2016-07-12 16:42 +0100
                                                  Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-12 17:21 +0100
                                                  Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-12 09:35 -0700
                                                    Re: double free BartC <bc@freeuk.com> - 2016-07-12 18:08 +0100
                                                      Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-12 18:14 +0100
                                                      Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-18 10:01 -0700
                                                        Re: double free BartC <bc@freeuk.com> - 2016-07-18 18:20 +0100
                                                          Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-21 09:26 -0700
                                                            Re: double free BartC <bc@freeuk.com> - 2016-07-21 18:57 +0100
                                                              Re: double free Udyant Wig <udyant.wig@gmail.com> - 2016-07-22 23:41 +0530
                                                                Re: double free BartC <bc@freeuk.com> - 2016-07-22 19:47 +0100
                                                                  Re: double free supercat@casperkitty.com - 2016-07-22 11:58 -0700
                                                                  Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-22 12:03 -0700
                                                                    Re: double free BartC <bc@freeuk.com> - 2016-07-22 20:26 +0100
                                                                      Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-22 13:12 -0700
                                                                    Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-23 08:57 +0000
                                                                      Re: double free BartC <bc@freeuk.com> - 2016-07-23 10:21 +0100
                                                                        Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-23 11:08 +0100
                                                                          Re: double free BartC <bc@freeuk.com> - 2016-07-23 12:36 +0100
                                                                            Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-23 07:14 -0700
                                                                              Re: double free BartC <bc@freeuk.com> - 2016-07-23 16:41 +0100
                                                                            Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-23 19:17 +0000
                                                                            Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-23 20:42 +0100
                                                                            Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-23 12:51 -0700
                                                                              Re: double free BartC <bc@freeuk.com> - 2016-07-23 21:50 +0100
                                                                                Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-23 14:17 -0700
                                                                                  Re: double free luser droog <luser.droog@gmail.com> - 2016-07-23 15:53 -0700
                                                                                    Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-23 20:55 -0700
                                                                                      Re: double free luser droog <luser.droog@gmail.com> - 2016-07-23 22:21 -0700
                                                                                      Re: double free BartC <bc@freeuk.com> - 2016-07-24 10:35 +0100
                                                                                        Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-24 02:55 -0700
                                                                                          Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-24 04:05 -0700
                                                                                            Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-24 14:03 +0100
                                                                                              Re: double free BartC <bc@freeuk.com> - 2016-07-24 14:24 +0100
                                                                                                Re: double free BartC <bc@freeuk.com> - 2016-07-24 15:15 +0100
                                                                                              Re: double free BartC <bc@freeuk.com> - 2016-07-24 16:01 +0100
                                                                                                Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-24 11:36 -0700
                                                                                                  Re: double free BartC <bc@freeuk.com> - 2016-07-24 19:52 +0100
                                                                                                    Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-24 12:14 -0700
                                                                                              Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-24 11:13 -0700
                                                                                                Re: double free Martin Shobe <mashobe9@gmail.com> - 2016-07-24 14:52 -0500
                                                                                                  Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-25 09:59 -0700
                                                                                                    Re: double free Martin Shobe <mashobe9@gmail.com> - 2016-07-25 19:32 -0500
                                                                                                Re: double free supercat@casperkitty.com - 2016-07-25 07:39 -0700
                                                                                  Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-24 10:55 -0700
                                                                            Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-24 08:30 -0700
                                                                        Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-23 11:11 +0100
                                                                      Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-23 12:39 -0700
                                                                        Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-23 20:25 +0000
                                                                  Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-22 12:51 -0700
                                                                    Re: double free supercat@casperkitty.com - 2016-07-22 13:18 -0700
                                                              Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-24 08:23 -0700
                                                                Re: double free BartC <bc@freeuk.com> - 2016-07-24 19:36 +0100
                                                Re: double free albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-12-02 10:21 +0100
                                                  Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-12-02 10:57 +0000
                                                  Re: double free BartC <bc@freeuk.com> - 2016-12-02 12:33 +0000
                                                    Re: double free David Brown <david.brown@hesbynett.no> - 2016-12-02 14:07 +0100
                                                  Re: double free "James R. Kuyper" <jameskuyper@verizon.net> - 2016-12-02 10:19 -0500
                                                    Re: double free Keith Thompson <kst-u@mib.org> - 2016-12-02 08:56 -0800
                                                      Re: double free "James R. Kuyper" <jameskuyper@verizon.net> - 2016-12-02 12:31 -0500
                                                        Re: double free Keith Thompson <kst-u@mib.org> - 2016-12-02 11:42 -0800
                                              Re: double free supercat@casperkitty.com - 2016-07-12 08:46 -0700
                                              Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-12 09:16 -0700
                                                Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-12 09:27 -0700
                                          Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-12 08:20 -0700
                                          Re: double free James Kuyper <jameskuyper@verizon.net> - 2016-07-12 12:47 -0400
                                    Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-12 22:21 +0000
                                      Re: double free BartC <bc@freeuk.com> - 2016-07-12 23:27 +0100
                                        Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-12 16:28 -0700
                                          Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-13 00:23 -0700
                                            Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-13 08:43 +0100
                                              Re: double free BartC <bc@freeuk.com> - 2016-07-13 11:21 +0100
                                                Re: double free Jean-Marc Bourguet <jm@bourguet.org> - 2016-07-13 12:56 +0200
                                                Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-13 12:35 +0100
                                                  Re: double free Jerry Stuckle <jstucklex@attglobal.net> - 2016-07-13 10:34 -0400
                                              Re: double free Cal Dershowitz <cal@example.invalid> - 2016-07-15 05:57 -0700
                                            Re: double free BartC <bc@freeuk.com> - 2016-07-13 11:17 +0100
                                              Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-13 04:30 -0700
                                              Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-13 12:33 +0100
                                                Re: double free BartC <bc@freeuk.com> - 2016-07-13 13:41 +0100
                                                  Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-13 13:57 +0100
                                                    Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-13 06:10 -0700
                                                      Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-13 20:08 +0100
                                                    Re: double free BartC <bc@freeuk.com> - 2016-07-13 15:11 +0100
                                                      Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-13 18:14 +0100
                                                        Re: double free Jean-Marc Bourguet <jm@bourguet.org> - 2016-07-13 19:20 +0200
                                                        Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-13 18:24 +0100
                                                          Re: double free Robert Wessel <robertwessel2@yahoo.com> - 2016-07-15 00:51 -0500
                                                            Re: double free luser droog <luser.droog@gmail.com> - 2016-07-15 02:18 -0700
                                                          Re: double free "Osmium" <r124c4u102@comcast.net> - 2016-07-15 07:12 -0500
                                                            Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-15 13:14 +0100
                                                          Re: double free Rosario19 <Ros@invalid.invalid> - 2016-07-18 09:28 +0200
                                                        Re: double free BartC <bc@freeuk.com> - 2016-07-13 18:43 +0100
                                                          Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-13 20:15 +0100
                                                            Re: double free BartC <bc@freeuk.com> - 2016-07-13 21:14 +0100
                                                              Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-13 13:24 -0700
                                                                Re: double free BartC <bc@freeuk.com> - 2016-07-13 21:50 +0100
                                                                Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-23 19:21 +0000
                                                        Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-13 13:02 -0700
                                                          Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-13 21:34 +0100
                                                            Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-13 13:51 -0700
                                                              Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-13 22:22 +0100
                                                                Re: double free Robert Wessel <robertwessel2@yahoo.com> - 2016-07-15 01:08 -0500
                                                                  Re: double free Reinhardt Behm <rbehm@hushmail.com> - 2016-07-15 17:33 +0800
                                                                    Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-15 05:02 -0700
                                                                      Re: double free Reinhardt Behm <rbehm@hushmail.com> - 2016-07-15 21:15 +0800
                                                                      Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-15 14:48 +0100
                                                                        Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-15 08:02 -0700
                                                                          Re: double free Cal Dershowitz <cal@example.invalid> - 2016-07-18 01:42 -0700
                                                                            Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-18 03:07 -0700
                                                            Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-13 22:01 +0100
                                                              Re: double free BartC <bc@freeuk.com> - 2016-07-13 22:14 +0100
                                                              Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-13 14:31 -0700
                                                                Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-13 23:03 +0100
                                                                  Re: double free "Osmium" <r124c4u102@comcast.net> - 2016-07-13 17:53 -0500
                                                                    Re: double free supercat@casperkitty.com - 2016-07-13 16:18 -0700
                                                                    Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-13 16:19 -0700
                                                                  Re: double free Jerry Stuckle <jstucklex@attglobal.net> - 2016-07-13 22:44 -0400
                                                                  Re: double free Jean-Marc Bourguet <jm@bourguet.org> - 2016-07-14 09:44 +0200
                                                              Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-13 17:07 -0700
                                                                Re: double free supercat@casperkitty.com - 2016-07-14 07:13 -0700
                                                              Re: double free Robert Wessel <robertwessel2@yahoo.com> - 2016-07-15 01:18 -0500
                                                    Re: double free Jerry Stuckle <jstucklex@attglobal.net> - 2016-07-13 10:46 -0400
                                                  Re: double free Robert Wessel <robertwessel2@yahoo.com> - 2016-07-15 00:59 -0500
                                                    Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-14 23:47 -0700
                                                    Re: double free BartC <bc@freeuk.com> - 2016-07-15 11:22 +0100
                                                      Re: double free BartC <bc@freeuk.com> - 2016-07-15 11:35 +0100
                                                      Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-15 14:33 +0100
                                                        Re: double free BartC <bc@freeuk.com> - 2016-07-15 15:16 +0100
                                                          Re: double free BartC <bc@freeuk.com> - 2016-07-15 16:19 +0100
                                                          Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-15 08:39 -0700
                                                            Re: double free BartC <bc@freeuk.com> - 2016-07-15 16:54 +0100
                                                              Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-15 21:20 +0100
                                                          Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-15 16:45 +0100
                                                            Re: double free BartC <bc@freeuk.com> - 2016-07-15 17:15 +0100
                                                              Re: double free BartC <bc@freeuk.com> - 2016-07-15 17:42 +0100
                                                                Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-15 21:18 +0100
                                                              Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-15 21:06 +0100
                                                                Re: double free BartC <bc@freeuk.com> - 2016-07-15 21:46 +0100
                                                                  Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-15 23:08 +0100
                                                                    Re: double free BartC <bc@freeuk.com> - 2016-07-16 01:26 +0100
                                                                      Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-15 18:22 -0700
                                                                        Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-15 18:48 -0700
                                                                      Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-15 18:40 -0700
                                                            Re: double free supercat@casperkitty.com - 2016-07-15 10:09 -0700
                                                              Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-15 11:07 -0700
                                                                Re: double free supercat@casperkitty.com - 2016-07-15 12:11 -0700
                                                                  Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-15 12:30 -0700
                                                                    Re: double free supercat@casperkitty.com - 2016-07-15 12:41 -0700
                                                                      Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-15 13:04 -0700
                                                                        Re: double free supercat@casperkitty.com - 2016-07-15 14:26 -0700
                                                                      Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-19 10:00 -0700
                                              Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-13 12:46 +0100
                                                Re: double free BartC <bc@freeuk.com> - 2016-07-13 13:19 +0100
                                                  Re: double free BartC <bc@freeuk.com> - 2016-07-13 13:30 +0100
                                                  Re: double free Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-13 20:53 +0100
                                                    Re: double free BartC <bc@freeuk.com> - 2016-07-13 21:37 +0100
                                                Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-13 05:22 -0700
                                              Re: double free supercat@casperkitty.com - 2016-07-13 07:07 -0700
                                                Re: double free BartC <bc@freeuk.com> - 2016-07-14 19:31 +0100
                                                  Re: double free supercat@casperkitty.com - 2016-07-14 12:10 -0700
                                                    Re: double free BartC <bc@freeuk.com> - 2016-07-14 23:16 +0100
                                                      Re: double free supercat@casperkitty.com - 2016-07-14 16:00 -0700
                                                  Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-14 12:34 -0700
                                                    Re: double free BartC <bc@freeuk.com> - 2016-07-14 20:57 +0100
                                                      Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-14 13:15 -0700
                                                        Re: double free BartC <bc@freeuk.com> - 2016-07-14 21:27 +0100
                                                        Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-14 21:31 +0100
                                          Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-18 09:46 -0700
                                            Re: double free BartC <bc@freeuk.com> - 2016-07-19 13:32 +0100
                                              Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-19 13:46 +0100
                                                Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-19 06:00 -0700
                                                  Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-19 09:23 -0700
                                                    Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-19 09:38 -0700
                                                      Re: double free BartC <bc@freeuk.com> - 2016-07-19 17:51 +0100
                                                        Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-19 18:22 +0100
                                                        Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-23 09:02 +0000
                                                      Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-19 11:42 -0700
                                                        Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-19 12:27 -0700
                                                      Re: double free Philip Lantz <prl@canterey.us> - 2016-07-21 10:02 -0700
                                                        Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-21 10:25 -0700
                                                        Re: double free BartC <bc@freeuk.com> - 2016-07-21 18:27 +0100
                                                      Re: double free Cal Dershowitz <cal@example.invalid> - 2016-07-29 00:42 -0700
                                                    Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-23 08:59 +0000
                                                Re: double free BartC <bc@freeuk.com> - 2016-07-19 15:22 +0100
                                                  Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-19 15:59 +0100
                                                    Re: double free BartC <bc@freeuk.com> - 2016-07-19 16:39 +0100
                                                      Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-19 16:55 +0100
                                                        Re: double free BartC <bc@freeuk.com> - 2016-07-19 17:49 +0100
                                                          Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-19 18:20 +0100
                                                            Re: double free BartC <bc@freeuk.com> - 2016-07-19 19:03 +0100
                                                              Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-19 19:22 +0100
                                                                sizeof (was Re: double free) Ken Brody <kenbrody@spamcop.net> - 2016-07-19 14:44 -0400
                                                                  Re: sizeof (was Re: double free) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-19 12:31 -0700
                                                                Re: double free BartC <bc@freeuk.com> - 2016-07-19 22:46 +0100
                                                                  Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-19 15:19 -0700
                                                                  Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-20 00:21 +0100
                                                                    Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-23 19:21 +0000
                                                              Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-19 12:08 -0700
                                                      Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-19 09:41 -0700
                                              Re: double free Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-21 18:10 -0700
                                                Re: double free BartC <bc@freeuk.com> - 2016-07-22 11:23 +0100
                                                  Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-22 03:40 -0700
                                                    Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-22 10:33 -0700
                                                      Re: double free Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-07-22 12:47 -0700
                                Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-12 22:18 +0000
                            Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-11 10:53 -0700
                              Re: double free BartC <bc@freeuk.com> - 2016-07-11 21:20 +0100
                                Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-11 13:56 -0700
                                  Re: double free BartC <bc@freeuk.com> - 2016-07-11 22:39 +0100
                                    Re: double free David Brown <david.brown@hesbynett.no> - 2016-07-12 10:57 +0200
                                Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-11 21:58 +0100
                    Re: double free BartC <bc@freeuk.com> - 2016-07-11 13:23 +0100
                    Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-11 13:00 +0000
                    Re: double free Keith Thompson <kst-u@mib.org> - 2016-07-11 10:44 -0700
                      Re: double free Gareth Owen <gwowen@gmail.com> - 2016-07-11 19:10 +0100
                        Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-11 20:22 +0100
                          Re: double free BartC <bc@freeuk.com> - 2016-07-11 21:11 +0100
                          Re: double free Gareth Owen <gwowen@gmail.com> - 2016-07-11 21:49 +0100
                            Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-11 22:01 +0100
                  Re: double free James Kuyper <jameskuyper@verizon.net> - 2016-07-11 09:09 -0400
                    Re: double free Richard Heathfield <rjh@cpax.org.uk> - 2016-07-11 14:16 +0100
                    Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-15 13:51 +0000
                      Re: double free James Kuyper <jameskuyper@verizon.net> - 2016-07-15 12:04 -0400
                  Re: double free Jean-Marc Bourguet <jm@bourguet.org> - 2016-07-11 17:51 +0200
              Re: double free raltbos@xs4all.nl (Richard Bos) - 2016-07-11 10:19 +0000
    Re: double free Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-07-05 08:57 -0600
    Re: double free James Kuyper <jameskuyper@verizon.net> - 2016-07-05 11:13 -0400
      Re: double free supercat@casperkitty.com - 2016-07-05 09:05 -0700
        Re: double free G G <gdotone@gmail.com> - 2016-07-05 16:38 -0700
      Re: double free G G <gdotone@gmail.com> - 2016-07-05 16:34 -0700
    Re: double free Nobody <nobody@nowhere.invalid> - 2016-07-06 04:10 +0100
      Re: double free Siri Cruise <chine.bleu@yahoo.com> - 2016-07-05 21:27 -0700
        Re: double free supercat@casperkitty.com - 2016-07-06 02:53 -0700
          Re: double free Siri Cruise <chine.bleu@yahoo.com> - 2016-07-06 06:09 -0700
            Re: double free supercat@casperkitty.com - 2016-07-06 07:53 -0700
      Re: double free "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-07-06 01:25 -0700
      Re: double free BartC <bc@freeuk.com> - 2016-07-06 11:12 +0100
    Re: double free Thiago Adams <thiago.adams@gmail.com> - 2016-11-27 09:52 -0800
      Re: double free supercat@casperkitty.com - 2016-11-27 10:05 -0800

Page 1 of 18  [1] 2 3 … 18  Next page →


#90018 — double free

FromG G <gdotone@gmail.com>
Date2016-07-05 02:38 -0700
Subjectdouble free
Message-ID<d5964270-015f-4955-9f7a-6a06bcfb5944@googlegroups.com>
the code fragments come from Understanding and Using C 
Pointers. pp. 48 - 49

int *pi = (int*) malloc(sizeof(int)); 
*pi = 5;

free(pi);
...
free(pi);

the author explains this creates a runtime error

------------------

p1 = (int*) malloc(sizeof(int));
int *p2 = p1;

free(p1);
...
free(p2);

also this creates a runtime error.

so there is no check to see if another variable is
pointing to that location in memory before it is freed?

reference counting, i've only read a little bit about in
objective-c, was a way to handle this occurrence? 

[toc] | [next] | [standalone]


#90019

FromIan Collins <ian-news@hotmail.com>
Date2016-07-05 21:45 +1200
Message-ID<du1dt6Fdvb8U1@mid.individual.net>
In reply to#90018
On 07/ 5/16 09:38 PM, G G wrote:
> the code fragments come from Understanding and Using C
> Pointers. pp. 48 - 49
>
> int *pi = (int*) malloc(sizeof(int));
> *pi = 5;
>
> free(pi);
> ....
> free(pi);
>
> the author explains this creates a runtime error

It might, if the run-time (or allocator library) spots the double free. 
  Many won't and the error may well go unnoticed.

> ------------------
>
> p1 = (int*) malloc(sizeof(int));
> int *p2 = p1;
>
> free(p1);
> ....
> free(p2);
>
> also this creates a runtime error.
>
> so there is no check to see if another variable is
> pointing to that location in memory before it is freed?

That can get complicated.  It is effectively what a garbage collector 
does.  If you aren't using GC, you have to keep track your self.

> reference counting, i've only read a little bit about in
> objective-c, was a way to handle this occurrence?

Reference counting is one way, yes.  Unfortunately C, unlike C++, lacks 
the means to manage reference counting automatically.

-- 
Ian

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


#90024

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2016-07-05 07:08 -0400
Message-ID<nlg4eu$ln$1@dont-email.me>
In reply to#90019
On 7/5/2016 5:45 AM, Ian Collins wrote:
> On 07/ 5/16 09:38 PM, G G wrote:
>> the code fragments come from Understanding and Using C
>> Pointers. pp. 48 - 49
>>
>> int *pi = (int*) malloc(sizeof(int));
>> *pi = 5;
>>
>> free(pi);
>> ....
>> free(pi);
>>
>> the author explains this creates a runtime error
>
> It might, if the run-time (or allocator library) spots the double free.
>  Many won't and the error may well go unnoticed.

     It *is* a run-time error, period.  The consequences of the error
are not easily predicted.  Sometimes you'll get away with it (or seem
to), sometimes you'll get caught right away, sometimes you'll poison
the well and cause Mysterious Things to happen to perfectly innocent
code elsewhere in the program.

     It's a bit like texting while driving blindfolded.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

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


#90060

FromG G <gdotone@gmail.com>
Date2016-07-05 16:41 -0700
Message-ID<dbf9d718-8507-4c29-a281-10f73dc6cf9f@googlegroups.com>
In reply to#90019
On Tuesday, July 5, 2016 at 5:45:22 AM UTC-4, Ian Collins wrote:
> On 07/ 5/16 09:38 PM, G G wrote:
> > the code fragments come from Understanding and Using C
> > Pointers. pp. 48 - 49
> >
> > int *pi = (int*) malloc(sizeof(int));
> > *pi = 5;
> >
> > free(pi);
> > ....
> > free(pi);
> >
> > the author explains this creates a runtime error
> 
> It might, if the run-time (or allocator library) spots the double free. 
>   Many won't and the error may well go unnoticed.
> 
> > ------------------
> >
> > p1 = (int*) malloc(sizeof(int));
> > int *p2 = p1;
> >
> > free(p1);
> > ....
> > free(p2);
> >
> > also this creates a runtime error.
> >
> > so there is no check to see if another variable is
> > pointing to that location in memory before it is freed?
> 
> That can get complicated.  It is effectively what a garbage collector 
> does.  If you aren't using GC, you have to keep track your self.
> 
> > reference counting, i've only read a little bit about in
> > objective-c, was a way to handle this occurrence?
> 
> Reference counting is one way, yes.  Unfortunately C, unlike C++, lacks 
> the means to manage reference counting automatically.
> 
> -- 
> Ian

Thanks Ian,

g.

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


#90020

FromRichard Heathfield <rjh@cpax.org.uk>
Date2016-07-05 10:50 +0100
Message-ID<nlfvsj$hme$1@dont-email.me>
In reply to#90018
On 05/07/16 10:38, G G wrote:
> the code fragments come from Understanding and Using C
> Pointers. pp. 48 - 49

Ian has answered your question already, so I'll just add a couple of 
points of detail (three, actually):

>
> int *pi = (int*) malloc(sizeof(int));
> *pi = 5;

1) the cast is unnecessary, and can hide a bug (depending on which 
Standard your compiler supports);
2) the canonical form is: T *p = malloc(sizeof *p);

so in your case it would be:

int *pi = malloc(sizeof *pi);

3) Don't even /think/ about assigning to *pi before you've checked that 
malloc succeeded:

if(pi != NULL)
{
   /* all is well, carry on */
}
else
{
   /* handle the error */
}

<snip>

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

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


#90021

FromBartC <bc@freeuk.com>
Date2016-07-05 11:06 +0100
Message-ID<nlg0qu$ki8$1@dont-email.me>
In reply to#90018
On 05/07/2016 10:38, G G wrote:
> the code fragments come from Understanding and Using C
> Pointers. pp. 48 - 49
>
> int *pi = (int*) malloc(sizeof(int));
> *pi = 5;
>
> free(pi);
> ...
> free(pi);
>
> the author explains this creates a runtime error
>
> ------------------
>
> p1 = (int*) malloc(sizeof(int));
> int *p2 = p1;
>
> free(p1);
> ...
> free(p2);
>
> also this creates a runtime error.
>
> so there is no check to see if another variable is
> pointing to that location in memory before it is freed?

No. C is a low level language. These checks aren't automatic, and would 
slow it down too much; C is also supposed to be very efficient.

> reference counting, i've only read a little bit about in
> objective-c, was a way to handle this occurrence?

You wouldn't use reference counting for individual allocations like 
this, and it's also a considerable overhead which in C would also 
clutter up the code.

If you're really worried that your code will call free multiple times on 
the same pointer, perhaps try using code like this:

#include <stdio.h>
#include <stdlib.h>

void myfree(void ** p){
if (*p==NULL) {
    puts("Freeing null or freed pointer");
    exit(1);
}
free(*p);
*p = NULL;
}


int main(void) {
int* p=malloc(sizeof(int));
int i;

printf("P1=%p\n",p);
myfree(&p);
printf("P2=%p\n",p);
myfree(&p);
printf("P3=%p\n",p);
}

Call myfree(&p) instead of free(p). myfree() sets the pointer to zero 
after it's first freed.

But this won't protect against any inadvertent dereferences of p after 
it's been freed once, or of calling myfree() on a pointer that has not 
been initialised, or any of a hundred different things.

-- 
Bartc

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


#90044

FromBartC <bc@freeuk.com>
Date2016-07-05 19:07 +0100
Message-ID<nlgt0k$rvn$1@dont-email.me>
In reply to#90021
On 05/07/2016 11:06, BartC wrote:
> On 05/07/2016 10:38, G G wrote:

>> p1 = (int*) malloc(sizeof(int));
>> int *p2 = p1;
>>
>> free(p1);
>> ...
>> free(p2);

> Call myfree(&p) instead of free(p). myfree() sets the pointer to zero
> after it's first freed.
>
> But this won't protect against any inadvertent dereferences of p after
> it's been freed once,

It also won't help with multiple copies of the same pointer as in your 
second example (which I've just noticed...).

Here, you may need to use two levels of indirection, although it rapidly 
gets confusing (see my earlier example for myfree()):

int main(void) {

int* pactual=malloc(sizeof(int));
int** p1=&pactual;
int** p2;

p2=p1;

printf("P1a,P2a=%p %p\n",*p1, *p2);
myfree(p1);
printf("P1b,P2b=%p %p\n",*p1, *p2);
myfree(p2);
printf("P1c,P2c=%p %p\n",*p1, *p2);

}

But although this guards against freeing p1 followed by p2, the idea 
behind reference counting is that it won't actually free the memory 
until no other pointers exist. Things get more complicated.

So if p1, p2 and p3 point to the same allocation, the reference count is 
3, and:

  Free(p1);    // reduces the count to 2
  Free(p2);    // reduces the count to 1
  Free(p3);    // reduces the count to 0 and frees the memory

You also can't just write p3=p2, but need to use a special copy function 
that will step the reference count.

There are reasons why it's not used much directly in C.

-- 
Bartc

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


#90025

Fromraltbos@xs4all.nl (Richard Bos)
Date2016-07-05 12:16 +0000
Message-ID<577ba42f.13700328@news.xs4all.nl>
In reply to#90018
G G <gdotone@gmail.com> wrote:

> the code fragments come from Understanding and Using C 
> Pointers. pp. 48 - 49
> 
> int *pi = (int*) malloc(sizeof(int)); 

Ditch this book.

> *pi = 5;
> 
> free(pi);
> ...
> free(pi);
> 
> the author explains this creates a runtime error

Ditch this book.

Casting malloc() is a bad idea, and if an author does so in a book
specifically about C pointers (C++ is, lamentably, a different matter),
he doesn't understand his own subject.

Calling free() on a pointer that has already been free()d has undefined
behaviour, which means that it _may but need not_ cause a runtime error.
Another thing it could very well do is corrupt your allocation arena. If
an author who writes about _any_ kind of pointer claims that this _will_
cause a runtime error, he dangerously and fundamentally misunderstands
his own subject.

Ditch this book. It is misleading you, and the author is incompetent.

Richard

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


#90026

FromRichard Heathfield <rjh@cpax.org.uk>
Date2016-07-05 13:57 +0100
Message-ID<nlgaru$jbu$2@dont-email.me>
In reply to#90025
On 05/07/16 13:16, Richard Bos wrote:

<snip>

> Ditch this book. It is misleading you, and the author is incompetent.

Possible. Also possible: the author has been misquoted and/or 
misinterpreted. (I have no evidence either way. I just know how very, 
very possible it is.)

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

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


#90038

FromKeith Thompson <kst-u@mib.org>
Date2016-07-05 08:43 -0700
Message-ID<ln37nonl9p.fsf@kst-u.example.com>
In reply to#90026
Richard Heathfield <rjh@cpax.org.uk> writes:
> On 05/07/16 13:16, Richard Bos wrote:
> <snip>
>
>> Ditch this book. It is misleading you, and the author is incompetent.
>
> Possible. Also possible: the author has been misquoted and/or 
> misinterpreted. (I have no evidence either way. I just know how very, 
> very possible it is.)

The book in question is "Understanding and Using C Pointers" by Richard
Reese, published by O'Reilly.  I have a copy.

http://shop.oreilly.com/product/0636920028000.do

The quoted excerpts are accurate, with one small wording change.
G G referred to a "runtime error".  The actual wording in the book's
discussion of a "double free" is:

    The term *double free* refers to an attempt to free a block of
    memory twice. A simple example follows:

        int *pi = (int*) malloc(sizeof(int));
        *pi = 5;
        free(pi);
        ...
        free(pi);

    The execution of the second free function will result in a runtime
    exception.

The phrase "runtime error", as Eric Sosman points out, could be
consistent with undefined behavior, which might have no visible
effects.  The phrase "runtime exception", I think, clearly implies
some visible result.  (I don't assume it refers to C++ exceptions.)

FWIW, when I run the above code on my own system, there is an
explicit runtime error:

    *** Error in `./c': double free or corruption (fasttop): 0x0000000008829010 ***
    Aborted

On another system (Solaris 9), there is no visible indication of
an error.  Both are of course consistent with the undefined behavior
of this construct.

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

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


#90030

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2016-07-05 14:57 +0100
Message-ID<87furo6vcq.fsf@bsb.me.uk>
In reply to#90025
raltbos@xs4all.nl (Richard Bos) writes:

> G G <gdotone@gmail.com> wrote:
>
>> the code fragments come from Understanding and Using C 
>> Pointers. pp. 48 - 49
>> 
>> int *pi = (int*) malloc(sizeof(int)); 
>
> Ditch this book.

What, though, is the alternative?  The book addresses and area that a
lot of people have trouble with and I don't know of any substitute.  At
the least, please suggest the closest alternative.  Telling people to
ditch what might seem to them to be the only option is rather
mean-spirited.

>> *pi = 5;
>> 
>> free(pi);
>> ...
>> free(pi);
>> 
>> the author explains this creates a runtime error
>
> Ditch this book.

The first chapter is available as a sample from O'Reilly.  It shows an
all too familiar pattern of errors, minor misunderstandings and clumsy
half-explanations.  And the examples are rather thin in that they just
illustrate a feature rather trying to find a use for the feature.
Sadly, I don't think it's particularly bad.  This seems to be par for
the course these days.  And let's not forget that the majority of the
statements (at least in Chapter 1) are actually correct.

I don't have a book to recommend.  Other than K&R, I've not read any C
books so I don't know what's good and what isn't.  Maybe others could
come in with sound alternatives that have a significant amount of
material about pointers.

<snip>
-- 
Ben.

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


#90180

Fromraltbos@xs4all.nl (Richard Bos)
Date2016-07-10 18:49 +0000
Message-ID<57829860.1327718@news.xs4all.nl>
In reply to#90030
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

> raltbos@xs4all.nl (Richard Bos) writes:
> > G G <gdotone@gmail.com> wrote:
> >
> >> the code fragments come from Understanding and Using C 
> >> Pointers. pp. 48 - 49
> >> 
> >> int *pi = (int*) malloc(sizeof(int)); 
> >
> > Ditch this book.
> 
> What, though, is the alternative?  The book addresses and area that a
> lot of people have trouble with and I don't know of any substitute.  At
> the least, please suggest the closest alternative.  Telling people to
> ditch what might seem to them to be the only option is rather
> mean-spirited.

Not if that option is actively damaging. And this book is.

An alternative? I dunno, what about K&R?

Richard

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


#90061

FromG G <gdotone@gmail.com>
Date2016-07-05 17:03 -0700
Message-ID<ded174f1-962b-411b-a60c-eab35a9f1a5b@googlegroups.com>
In reply to#90025
On Tuesday, July 5, 2016 at 8:16:26 AM UTC-4, Richard Bos wrote:
> G G <gdotone@gmail.com> wrote:
> 
> > the code fragments come from Understanding and Using C 
> > Pointers. pp. 48 - 49
> > 
> > int *pi = (int*) malloc(sizeof(int)); 
> 
> Ditch this book.
> 
> > *pi = 5;
> > 
> > free(pi);
> > ...
> > free(pi);
> > 
> > the author explains this creates a runtime error
> 
> Ditch this book.
> 
> Casting malloc() is a bad idea, and if an author does so in a book
> specifically about C pointers (C++ is, lamentably, a different matter),
> he doesn't understand his own subject.
> 
> Calling free() on a pointer that has already been free()d has undefined
> behaviour, which means that it _may but need not_ cause a runtime error.
> Another thing it could very well do is corrupt your allocation arena. If
> an author who writes about _any_ kind of pointer claims that this _will_
> cause a runtime error, he dangerously and fundamentally misunderstands
> his own subject.
> 
> Ditch this book. It is misleading you, and the author is incompetent.
> 
> Richard


"Ditch the book"

Richard the books I'm reading are dated I'm sure, but what's nice
is being able to ask you guys questions and find out the latest and 
correct methods that should be used. 

Keith is correct, and I should apologize to the group. The author did say 
"runtime exception". I ran the code and it produce a runtime error on my
machine.  I should not have said he said "runtime error".

I do apologize everyone. I don't want to give the authors a bad rep due
to my mistakes in representing there teachings, or thoughts.

Thanks everyone and really thanks for the discussions you guys have,
and thanks for the patience. 

g.

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


#90062

FromKeith Thompson <kst-u@mib.org>
Date2016-07-05 17:25 -0700
Message-ID<lny45fmx36.fsf@kst-u.example.com>
In reply to#90061
G G <gdotone@gmail.com> writes:
[...]
> Keith is correct, and I should apologize to the group. The author did say 
> "runtime exception". I ran the code and it produce a runtime error on my
> machine.  I should not have said he said "runtime error".

The lack of quotation marks made it clear enough that you weren't
claiming to quote the book exactly, but rather summarizing it, and your
summary was reasonably good.  For most purposes, "runtime error" is
nearly the same thing as "runtime exception".

> I do apologize everyone. I don't want to give the authors a bad rep due
> to my mistakes in representing there teachings, or thoughts.

Actually you made the author look slightly better (but it's really not a
big deal).  "Runtime error" might reasonably describe undefined behavior
(which is what the standard actually says); "runtime exception" implies
some observable error (which is not guaranteed).

[...]

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

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


#90092

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2016-07-06 19:09 +0000
Message-ID<slrnnnqlqn.5q5.grahn+nntp@frailea.sa.invalid>
In reply to#90025
On Tue, 2016-07-05, Richard Bos wrote:
> G G <gdotone@gmail.com> wrote:
>
>> the code fragments come from Understanding and Using C 
>> Pointers. pp. 48 - 49
>> 
>> int *pi = (int*) malloc(sizeof(int)); 
...
>> the author explains this creates a runtime error
>
> Ditch this book.
>
> Casting malloc() is a bad idea, and if an author does so in a book
> specifically about C pointers (C++ is, lamentably, a different matter),

Casting is /less/ common in C++ than in C -- there's nothing to
lament!  Unless you compile C code with a C++ compiler, which is
generally a bad idea.

> he doesn't understand his own subject.

Given the strange title of the book, that seems likely.

> Ditch this book. It is misleading you, and the author is incompetent.

/Jorgen

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

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


#90093

From"James R. Kuyper" <jameskuyper@verizon.net>
Date2016-07-06 15:22 -0400
Message-ID<48c43c3f-8e7e-0509-5b9d-04133e7bb537@verizon.net>
In reply to#90092
On 07/06/2016 03:09 PM, Jorgen Grahn wrote:
> On Tue, 2016-07-05, Richard Bos wrote:
>> G G <gdotone@gmail.com> wrote:
>>
>>> the code fragments come from Understanding and Using C 
>>> Pointers. pp. 48 - 49
>>>
>>> int *pi = (int*) malloc(sizeof(int)); 
> ...
>>> the author explains this creates a runtime error
>>
>> Ditch this book.
>>
>> Casting malloc() is a bad idea, and if an author does so in a book
>> specifically about C pointers (C++ is, lamentably, a different matter),
> 
> Casting is /less/ common in C++ than in C -- there's nothing to
> lament!  Unless you compile C code with a C++ compiler, which is
> generally a bad idea.

Casting (preferably by using static_cast<>) is required by C++ to
convert a void* to a pointer to object type (C++ 2011 C.1.3,
cross-referencing 4.10). Such conversions do not occur implicitly the
way they do in C.

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


#90139

FromNobody <nobody@nowhere.invalid>
Date2016-07-09 06:13 +0100
Message-ID<pan.2016.07.09.05.13.42.40000@nowhere.invalid>
In reply to#90093
On Wed, 06 Jul 2016 15:22:51 -0400, James R. Kuyper wrote:

>> Casting is /less/ common in C++ than in C -- there's nothing to lament! 
>> Unless you compile C code with a C++ compiler, which is generally a bad
>> idea.
> 
> Casting (preferably by using static_cast<>) is required by C++ to convert
> a void* to a pointer to object type (C++ 2011 C.1.3, cross-referencing
> 4.10). Such conversions do not occur implicitly the way they do in C.

OTOH, C++ code typically has fewer reasons to use void* in the first place.

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


#90144

From"James R. Kuyper" <jameskuyper@verizon.net>
Date2016-07-09 10:16 -0400
Message-ID<d3c0b115-927f-af9a-2c65-7893df4cbba9@verizon.net>
In reply to#90139
On 07/09/2016 01:13 AM, Nobody wrote:
> On Wed, 06 Jul 2016 15:22:51 -0400, James R. Kuyper wrote:
> 
>>> Casting is /less/ common in C++ than in C -- there's nothing to lament! 
>>> Unless you compile C code with a C++ compiler, which is generally a bad
>>> idea.
>>
>> Casting (preferably by using static_cast<>) is required by C++ to convert
>> a void* to a pointer to object type (C++ 2011 C.1.3, cross-referencing
>> 4.10). Such conversions do not occur implicitly the way they do in C.
> 
> OTOH, C++ code typically has fewer reasons to use void* in the first place.
> 

True - but the case under discussion is one of those reasons. In pure
C++ code, calls to malloc() should almost always be replaced by more
type-safe approaches such as direct or indirect use of the 'new'
operator. But in code meant to be usable in both C and C++, it's
annoying that casting the value returned by malloc() is mandatory in
C++, and a bad idea in C.

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


#90147

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2016-07-09 08:58 -0700
Message-ID<16f5cce4-d88e-48e8-a141-9f5b604adcaf@googlegroups.com>
In reply to#90144
On Saturday, July 9, 2016 at 3:16:09 PM UTC+1, James R. Kuyper wrote:
> 
> True - but the case under discussion is one of those reasons. In pure
> C++ code, calls to malloc() should almost always be replaced by more
> type-safe approaches such as direct or indirect use of the 'new'
> operator. But in code meant to be usable in both C and C++, it's
> annoying that casting the value returned by malloc() is mandatory in
> C++, and a bad idea in C.
>
It's not really "a bad idea" in C.
comp.lang.c is hardly the authority on good C style. 

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


#90156

FromKeith Thompson <kst-u@mib.org>
Date2016-07-09 13:28 -0700
Message-ID<lnd1mmmu7v.fsf@kst-u.example.com>
In reply to#90147
Malcolm McLean <malcolm.mclean5@btinternet.com> writes:
> On Saturday, July 9, 2016 at 3:16:09 PM UTC+1, James R. Kuyper wrote:
>> True - but the case under discussion is one of those reasons. In pure
>> C++ code, calls to malloc() should almost always be replaced by more
>> type-safe approaches such as direct or indirect use of the 'new'
>> operator. But in code meant to be usable in both C and C++, it's
>> annoying that casting the value returned by malloc() is mandatory in
>> C++, and a bad idea in C.
>>
> It's not really "a bad idea" in C.

Yes, it really is.

> comp.lang.c is hardly the authority on good C style. 

Nobody claimed it was.  The reasons that casting the result of
malloc() in C is a bad idea are valid on their own, without regard
to whether they've been discussed in this newsgroup or not.

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

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


Page 1 of 18  [1] 2 3 … 18  Next page →

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


csiph-web