| Anonymous | Login | Signup for a new account | 11-10-2008 11:28 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0001859 | [uClibc] Shared Library Support | minor | always | 01-04-08 02:57 | 01-04-08 21:58 | ||||
| Reporter | michael_d | View Status | public | ||||||
| Assigned To | uClibc | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | |||||||
| Summary | 0001859: 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. |
||||||||
| Additional Information | |||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
Notes |
|
|
(0003379) vapier 01-04-08 21:58 |
thanks for the patch, but this has already been fixed in svn dupe of 1310 |
| Copyright © 2000 - 2006 Mantis Group |