[uClibc 0001859]: program_invocation_name and others not set with shared libc
bugs at busybox.net
bugs at busybox.net
Sat Jan 5 05:58:26 UTC 2008
The following issue has been CLOSED
======================================================================
http://busybox.net/bugs/view.php?id=1859
======================================================================
Reported By: michael_d
Assigned To: uClibc
======================================================================
Project: uClibc
Issue ID: 1859
Category: Shared Library Support
Reproducibility: always
Severity: minor
Priority: normal
Status: closed
Resolution: fixed
Fixed in Version:
======================================================================
Date Submitted: 01-04-2008 02:57 PST
Last Modified: 01-04-2008 21:58 PST
======================================================================
Summary: program_invocation_name and others not set with
shared libc
Description:
Consider the following program:
#define _GNU_SOURCE
#include <errno.h>
#include <stdio.h>
#include <assert.h>
extern char *__progname;
int
main (int argc, char **argv)
{
printf ("PISN = %s\nPIN = %s\n_PN = %s\n",
program_invocation_short_name, program_invocation_name, __progname);
/* assertion reveals the value of __uclibc_progname */
assert (0);
}
The output of the program should be as follows:
$ progname
PISN = progname
PIN = ./progname
_PN = progname
progname: progname.c: 14: main: Assertion `0' failed.
Aborted
Yet the actual result on an unfixed, shared uClibc is:
$ ./progname
PISN = (null)
PIN = (null)
_PN = progname
(null): progname.c: 14: main: Assertion `0' failed.
Aborted
uClibc tries to arrange for __progname to occupy the same memory address
as program_invocation_short_name and the hidden variable
__uclibc_progname. It also arranges for program_invocation_name to
similarly overlap the hidden variable __progname_full.
In __uClibc_main(), only one variable from each group is actually set.
This would be fine if the magic to overlap the variables actually worked.
But it does not when uClibc is a shared library.
I've attached a patch which adds extra assignments so that all 5 variables
are initialized.
======================================================================
----------------------------------------------------------------------
vapier - 01-04-08 21:58
----------------------------------------------------------------------
thanks for the patch, but this has already been fixed in svn
dupe of 1310
Issue History
Date Modified Username Field Change
======================================================================
01-04-08 02:57 michael_d New Issue
01-04-08 02:57 michael_d Status new => assigned
01-04-08 02:57 michael_d Assigned To => uClibc
01-04-08 02:57 michael_d File Added: uClibc-0.9.29-progname.diff
01-04-08 21:58 vapier Note Added: 0003379
01-04-08 21:58 vapier Status assigned => closed
01-04-08 21:58 vapier Resolution open => fixed
======================================================================
More information about the uClibc-cvs
mailing list