Bug#869135: Please consider switching to giza
Ole Streicher
olebole at debian.org
Fri Jul 21 13:14:10 UTC 2017
Hi again,
I think I got the problem: The segfault with debug symbols enabled is
when giza_print_id() calls strcat():
#0 __strcat_sse2_unaligned () at
../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:807
#1 0x00007fc420eb6f45 in giza_print_id () at giza-print-id.c:86
#2 0x00007fc42130eee5 in cpgiden () at giza-cpgplot.c:408
#3 0x00007fc42151de04 in XS_PGPLOT_pgiden (my_perl=<optimized out>,
cv=0x55b16a4e4820)
at PGPLOT.xs:493
#4 0x000055b169c171b0 in Perl_pp_entersub ()
#5 0x000055b169c0f6f6 in Perl_runops_standard ()
#6 0x000055b169b95789 in perl_run ()
#7 0x000055b169b6e93d in main ()
And when looking into the giza source, it is clear what happens:
void giza_print_id (void) {
// ...
/* get user id */
char *userid = getlogin();
if (userid == NULL) userid = "";
/* get current date and time */
struct tm *current;
time_t now;
time(&now);
current = localtime(&now);
/* format the date and time into a string */
char date[20];
strftime(date,sizeof(date)," %e-%h-%Y %H:%M",current);
char *string = strcat(userid,date);
// ...
the strcat tries to append something to either the string returned by
getlogin(), or to the string constant "".
Both is wrong.
--> this is clearly a bug in giza; I will contact upstream with the
problem. However, this is probably easy to fix and should not be a
show-stopper. If you like, you can create a bug for giza to track the
progress.
Best regards
Ole
More information about the pkg-perl-maintainers
mailing list