From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 19 May 2004 20:42:10 +0400 From: "Dmitry V. Levin" To: ALT Devel discussion list Subject: Re: [devel] glibc 2.3 - argp_parse broken?? Message-ID: <20040519164210.GA26387@nomad.office.altlinux.org> Mail-Followup-To: ALT Devel discussion list References: <20040519153105.GA17274@mailhub.gu.net> <20040519153752.GB24646@basalt.office.altlinux.org> <20040519160331.GB17274@mailhub.gu.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vGgW1X5XWziG23Ko" Content-Disposition: inline In-Reply-To: <20040519160331.GB17274@mailhub.gu.net> X-fingerprint: 9658 398D 181B 1200 8FC5 26B8 F6F8 846B C1E2 3429 X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.1.4 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 16:42:51 -0000 Archived-At: List-Archive: List-Post: --vGgW1X5XWziG23Ko Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 19, 2004 at 07:03:31PM +0300, Victor Forsyuk wrote: > On Wed, May 19, 2004 at 07:37:52PM +0400, Dmitry V. Levin wrote: > > On Wed, May 19, 2004 at 06:31:05PM +0300, Victor Forsyuk wrote: > > > =E9=CC=C9 subj, =C9=CC=C9 =D1 =DE=C5=C7=CF-=D4=CF =CE=C5 =D0=CF=CE=C9= =CD=C1=C0. =FA=C1=CD=C5=DE=C5=CE=C1 =D0=CF=CC=CF=CD=CB=C1 =CF=D0=C3=C9=C9 "= -o" =D7 ccze > > > (ccze-0.2.1-alt2). =E2=C5=DA =D5=CB=C1=DA=C1=CE=C9=D1 =DC=D4=CF=CA = =CF=D0=C3=C9=C9 =D0=D2=CF=C7=D2=C1=CD=CD=C1 =D2=C1=C2=CF=D4=C1=C5=D4. =EE= =C1=D0=D2=C9=CD=C5=D2: > > >=20 > > > > tail -f /var/log/exim/main.log|ccze -A -p exim > > >=20 > > > =EB=C1=CB =D4=CF=CC=D8=CB=CF =D5=CB=C1=DA=D9=D7=C1=C5=CD =DE=D4=CF-= =CC=C9=C2=CF =D7 =DC=D4=CF=CA =CF=D0=C3=C9=C9, =C9=CD=C5=C5=CD =D3=C5=C7=C6= =CF=CC=D4: > > >=20 > > > > tail -f /var/log/exim/main.log|ccze -A -p exim -o nolookups > > > Segmentation fault > >=20 > > ccze -A -p exim -o nolookups =20 > =E4=C1, =D1 =C9 =D4=C1=CB =D0=D2=CF=D7=C5=D2=D1=CC. =E4=CF =CF=C2=D2=C1= =C2=CF=D4=CB=C9 =C4=C1=CE=CE=D9=C8 =C4=C5=CC=CF =D7=CF=CF=C2=DD=C5 =CE=C5 = =C4=CF=C8=CF=C4=C9=D4, > =D3=C5=C7=C6=CF=CC=D4 =D7=CE=D5=D4=D2=C9 argp_parse. =EE=C5=D4, Program received signal SIGSEGV, Segmentation fault. 0x0804a0dd in parse_opt (key=3D111, arg=3D0xbffffa07 "nolookups", state=3D0= xbffff7b4) at ccze.c:277 > > > Bug, =C9=DA=CD=C5=CE=C5=CE=C9=D1 =D7 =C6=D5=CE=CB=C3=C9=C9 =D3 =CF=C2= =D2=C1=D4=CE=CF=CA =CE=C5=D3=CF=D7=CD=C5=D3=D4=C9=CD=CF=D3=D4=D8=C0, =D0=D2= =CF=D1=D7=C9=D7=DB=C1=D1=D3=D1 > > > =CF=DB=C9=C2=CB=C1 =D7 =D0=D2=CF=C7=D2=C1=CD=CD=C5? =F0=CF=C4=D3=CB= =C1=D6=C9=D4=C5, =CB=D4=CF =D3 argp_parse =DA=CE=C1=CB=CF=CD =C2=CC=C9=D6=C5 > > > (=D1 =CE=C9=CB=CF=C7=C4=C1 =C5=C5 =CE=C5 =C9=D3=D0=CF=CC=D8=DA=CF=D7= =C1=CC), =D5 =CD=C5=CE=D1 =D2=C1=DA=C2=C9=D2=C1=D4=D8=D3=D1, =CB =D3=CF=D6= =C1=CC=C5=CE=C9=C0, > > > =D0=D2=C1=CB=D4=C9=DE=C5=D3=CB=C9 =CE=C5=D4 =D7=D2=C5=CD=C5=CE=C9. > >=20 > > =F1 =D0=CF=D3=CD=CF=D4=D2=C0. >=20 > =F0=CF=D7=C5=D3=C9=D4=D8 =C2=C1=C7 (=D7=D2=CF=C4=C5 =CB=C1=CB bugzilla = =D0=CF=C4=CE=D1=CC=C1=D3=D8 =D5=D6=C5) =C9=CC=C9 =CE=C5 =CE=D5=D6=CE=CF? =FC=D4=CF =C6=C1=D4=C1=CC=D8=CE=C1=D1 =CF=D0=C5=DE=C1=D4=CB=C1 =D7 =D0=D2= =CF=C7=D2=C1=CD=CD=C5, =D0=CC=C0=D3 =CE=C5=CF=C2=D2=C1=D4=C9=CD=CF=C5 =C9= =DA=CD=C5=CE=C5=CE=C9=C5 =D7 glibc =CF=D4 8 =CD=C1=D2=D4=C1 =DC=D4=CF=C7=CF =C7=CF=C4=C1, =D3=CF=C2=D3=D4=D7= =C5=CE=CE=CF =C9 =C4=C5=CC=C1=C0=DD=C5=C5 =DC=D4=D5 =CF=D0=C5=DE=C1=D4=CB= =D5 =C6=C1=D4=C1=CC=D8=CE=CF=CA. =F0=C1=D4=DE =CE=C1 ccze =C9 =D4=C5=CB=D3=D4 =C9=DA=CD=C5=CE=C5=CE=C9=D1 = =D0=D2=C9=CC=C1=C7=C1=C0=D4=D3=D1. --=20 ldv --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ccze-0.2.1-alt-argp.patch" diff -uprk.orig ccze-0.2.1.orig/src/ccze.c ccze-0.2.1/src/ccze.c --- ccze-0.2.1.orig/src/ccze.c 2003-05-13 22:09:30 +0400 +++ ccze-0.2.1/src/ccze.c 2004-05-19 20:21:02 +0400 @@ -209,7 +209,7 @@ parse_opt (int key, char *arg, struct ar } break; case 'a': - plugin = strtok (optarg, "="); + plugin = strtok (arg, "="); value = strtok (NULL, "\n"); ccze_plugin_argv_set (plugin, value); break; @@ -249,7 +249,7 @@ parse_opt (int key, char *arg, struct ar ccze_config.remfac = 1; break; case 'm': - subopts = optarg; + subopts = arg; while (*subopts != '\0') { switch (getsubopt (&subopts, m_subopts, &value)) @@ -273,7 +273,7 @@ parse_opt (int key, char *arg, struct ar } break; case 'o': - subopts = optarg; + subopts = arg; while (*subopts != '\0') { switch (getsubopt (&subopts, o_subopts, &value)) --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=optarg_change 2004-03-08 Marcus Brinkmann * posix/getopt.h (_getopt_internal): Move to ... * posix/getopt_int.h: ... here. New file. * include/getopt_int.h: New file. * include/getopt.h: Remove libc_hidden_proto for getopt_long and getopt_long_only. * posix/getopt1.c: Include "getopt_int.h". Remove libc_hidden_def for getopt_long and getopt_long_only. (_getopt_long_r, _getopt_long_only_r): New functions. * posix/getopt.c: Include "getopt_int.h". (__getopt_initialized): Variable removed. (nextchar, ordering, posixly_correct, first_nonopt, last_nonopt): Static variables removed. (nonoption_flags_max_len, nonoption_flags_len) [_LIBC && USE_NONOPTION_FLAGS]: Static variables removed. (getopt_data): New static variable. (SWAP_FLAGS): Use d->__nonoption_flags_len instead nonoption_flags_len. (exchange): Add new argument D of type struct getopt_data *. Replace optind with d->optind, optarg with d->optarg, opterr with d->opterr, optopt with d->optopt, nextchar with d->__nextchar, first_nonopt with d->__first_nonopt, last_nonopt with d->__last_nonopt, d->ordering with d->__ordering, d->posixly_correct with d->__posixly_correct (which is now an int instead a string, so fix users), nonoption_flags_len with d->__nonoption_flags_len, nonoption_flags_max_len with d->__nonoption_flags_max_len. (_getopt_initialize): Likewise. (_getopt_internal): Rename to ... (_getopt_internal_r): ... this. Also add new argument D of type struct getopt_data * and use of members of D rather than global or static variables as described for exchange() above. Add new argument to invocations of _getopt_initialize and exchange. (_getopt_internal): Reimplement in terms of _getopt_internal_r. * argp/argp-parse.c: Include . [_LIBC]: Do not include . [!_LIBC && HAVE_CTHREADS_H]: Do not include . [!_LIBC] (_argp_hang): Make static. (getopt_lock, LOCK_GETOPT, UNLOCK_GETOPT): Remove. (_argp_unlock_xxx): Remove. (parser_init): Do not use LOCK_GETOPT. (parser_finalize): Do not use UNLOCK_GETOPT. (struct parser): New member OPT_DATA. (parser_init): Initialize parser->opt_data. Use parser->opt_data.opterr instead of opterr. (parser_parse_opt): Use parser->opt_data.optarg instead optarg. (parser_parse_next): Likewise. Use parser->opt_data.optind instead optind. Use parser->opt_data.optopt instead of optopt. Call _getopt_long_only_r and _getopt_long_r instead of getopt_long_only and getopt_long, and pass the extra argument. --5mCyUwZo2JvN/JJP-- --vGgW1X5XWziG23Ko Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAq45i9viEa8HiNCkRAv3AAJ9nXb9d5uzmzioJoq4wESshOoZ2VgCeNIRL 2hbg2L6ePPkfSz4s2peeSj4= =ydiq -----END PGP SIGNATURE----- --vGgW1X5XWziG23Ko--