found 523086 mksh/39.3.20100721-1
found 523086 dietlibc-dev/0.32-5
thanks

https://buildd.debian.org/fetch.cgi?pkg=mksh&arch=hppa&ver=39.3.20100721-1&stamp=1279802508&file=log&as=raw

In addition to that, I tried debugging (build a dietlibc with “debug”
in DEB_BUILD_OPTIONS, manually build mksh with appropriate options after
export DIETHOME=/home/tg/dietlibc-0.32/debian/dietlibc-dev/usr/lib/diet)
but can’t even get it to start up:

   POE Paste with lovely alien head...

                                       No paste!

                                          from "mirabilos" at 192.168.1.3
                                          Debian/hppa gdb weirdness (mksh 
linked against dietlibc)

                                       [1]format options below

(sid)t...@paer:~/mksh-39.3.20100721/b$ gdb ./mksh
GNU gdb (GDB) 7.1-debian
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "hppa-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/tg/mksh-39.3.20100721/b/mksh...done.
(gdb) b main
Breakpoint 1 at 0x4833c: file ../main.c, line 473.
(gdb) r
Starting program: /home/tg/mksh-39.3.20100721/b/mksh
/build/buildd-gdb_7.1-1+b1-hppa-ha7PVO/gdb-7.1/gdb/gdbarch.c:3504: 
internal-error: gdbarch_get_syscall_number: Assertion 
`gdbarch->get_syscall_number != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

/build/buildd-gdb_7.1-1+b1-hppa-ha7PVO/gdb-7.1/gdb/gdbarch.c:3504: 
internal-error: gdbarch_get_syscall_number: Assertion 
`gdbarch->get_syscall_number != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
(gdb) s
Cannot execute this command while the selected thread is running.
(gdb) q
A debugging session is active.

        Inferior 1 [process 22903] will be killed.
Quit anyway? (y or n) y



Here it waits, I need to do
t...@paer:~$ kill -9 22903
on another shell to the same machine to kill it:

22903 pts/1    T      0:00 /home/tg/mksh-39.3.20100721/b/mksh

Then gdb exits with
[process 22903 exited]
cleanly.

   [2][_] plain text (suitable for cut and paste, overrides all)

   [3][_] word wrap (disables pre-formatted text wrapper)
   [4][_] line numbers

   perl stuff: (might be helpful for others but not perfect)
   [5][_] tidy up a bit
   [6][_] syntax highlight

   [7][_] store these preferences in a semi-permanent cookie [8]Format it!

                                                                          
[9]Valid HTML 4.01!

                                                          [10]Pastebot is 
powered by [11]POE.

References

   1. http://nopaste.snit.ch/22268#format
   2. form field = checkbox
   3. form field = checkbox
   4. form field = checkbox
   5. form field = checkbox
   6. form field = checkbox
   7. form field = checkbox
   8. form field = submit button
   9. http://validator.w3.org/check/referer
  10. http://sf.net/projects/pastebot/
  11. http://poe.perl.org/



Simiarily, weird things happen here:

(sid)t...@paer:~/mksh-39.3.20100721/b$ ./mksh -c 'echo yes'
yes
(sid)t...@paer:~/mksh-39.3.20100721/b$ gdb --args ./mksh -c 'echo yes'
GNU gdb (GDB) 7.1-debian
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "hppa-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/tg/mksh-39.3.20100721/b/mksh...done.
(gdb) r
Starting program: /home/tg/mksh-39.3.20100721/b/mksh -c echo\ yes
/build/buildd-gdb_7.1-1+b1-hppa-ha7PVO/gdb-7.1/gdb/gdbarch.c:3504: 
internal-error: gdbarch_get_syscall_number: Assertion 
dbarch->get_syscall_number != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

/build/buildd-gdb_7.1-1+b1-hppa-ha7PVO/gdb-7.1/gdb/gdbarch.c:3504: 
internal-error: gdbarch_get_syscall_number: Assertion 
dbarch->get_syscall_number != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
(sid)t...@paer:~/mksh-39.3.20100721/b$ yes
_
↑ position of cursor


This basically means that mksh (at least one linked against dietlibc)
cannot be debugged at all on hppa.

The most probable code section to look at is in mksh’s histrap.c in
the function hist_replace(), line 328ff (comments inline):

  341                 int any_subst = 0;
should be a bool… will fix that in mksh ☺
  342
  343                 Xinit(xs, xp, 128, ATEMP);
initialises a dynamic string at xs with xp pointing to its content
  344                 for (s = *hp; (s1 = strstr(s, pat)) && (!any_subst || 
globr);
  345                     s = s1 + pat_len) {
  346                         any_subst = 1;
  347                         len = s1 - s;
  348                         XcheckN(xs, xp, len + rep_len);
ensures xs has at least len + rep_len bytes left
  349                         memcpy(xp, s, len);             /* first part */
  350                         xp += len;
  351                         memcpy(xp, rep, rep_len);       /* replacement */
  352                         xp += rep_len;
  353                 }
  354                 if (!any_subst) {
  355                         bi_errorf("substitution failed");
this one is triggered on hppa+dietlibc *ONLY*
  356                         return (1);
  357                 }

There may be strstr damaged? Hrm, no, even adding strstr.c instead
of libc.a’s strstr.S doesn’t help:

(sid)t...@paer:~/mksh-39.3.20100721/b$ sh B ./mksh
Xabc def asjj sadjhasdjh asdjhasd
X./mksh: <stdin>[2]: fc: substitution failed
Xres: 1
 = wanted: =
Xabc def asjj sadjhasdjh asdjhasd
Xecho FooBARbc def FooBARsjj sFooBARdjhFooBARsdjh FooBARsdjhFooBARsd
FooBARbc def FooBARsjj sFooBARdjhFooBARsdjh FooBARsdjhFooBARsd
Xres: 0

This is the reproducer script, btw:
(sid)t...@paer:~/mksh-39.3.20100721/b$ cat B
env ENV=./Env HISTFILE=hist.file $1 -i <<'EOF'
echo abc def asjj sadjhasdjh asdjhasd
fc -e - -g a=FooBAR
EOF
echo res: $?
echo ' = wanted: =
Xabc def asjj sadjhasdjh asdjhasd
Xecho FooBARbc def FooBARsjj sFooBARdjhFooBARsdjh FooBARsdjhFooBARsd
FooBARbc def FooBARsjj sFooBARdjhFooBARsdjh FooBARsdjhFooBARsd
Xres: 0'


There’s one more thing I don’t seem to understand:

/home/tg/dietlibc-0.32/bin-parisc/memcpy.o: ELF 32-bit MSB relocatable, PA-RISC 
(LP64) version 1 (GNU/Linux), not stripped

I just saw that because, when I tried to compile with
/home/tg/dietlibc-0.32/lib/{strstr,strlen,memcmp}.c
added to the list of files in mksh¹, I get:
/home/tg/dietlibc-0.32/lib/strlen.c: In function 'strlen':
/home/tg/dietlibc-0.32/lib/strlen.c:70: warning: left shift count >= width of 
type
/home/tg/dietlibc-0.32/lib/strlen.c:73: warning: left shift count >= width of 
type

./mksh: ELF 32-bit MSB executable, PA-RISC (LP64) version 1 (GNU/Linux), 
statically linked, not stripped

Is it now LP64 or a 32-bit architecture?


① The actual compile command was taken from Build.sh’s output and modified:
  ‣ cc -nostdlib -static 
-L/home/tg/dietlibc-0.32/debian/dietlibc-dev/usr/lib/diet/lib-parisc 
/home/tg/dietlibc-0.32/debian/dietlibc-dev/usr/lib/diet/lib-parisc/start.o 
-Wall -g3 -std=gnu99 -I. -I.. -DMKSH_SMALL -DMKSH_BINSHREDUCED -DDEBUG 
-D_GNU_SOURCE -DHAVE_ATTRIBUTE_BOUNDED=0 -DHAVE_ATTRIBUTE_FORMAT=1 
-DHAVE_ATTRIBUTE_NONNULL=1 -DHAVE_ATTRIBUTE_NORETURN=1 
-DHAVE_ATTRIBUTE_UNUSED=1 -DHAVE_ATTRIBUTE_USED=1 -DHAVE_SYS_PARAM_H=1 
-DHAVE_SYS_MKDEV_H=0 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_SYSMACROS_H=1 
-DHAVE_LIBGEN_H=1 -DHAVE_LIBUTIL_H=1 -DHAVE_PATHS_H=1 -DHAVE_STDBOOL_H=1 
-DHAVE_STRINGS_H=1 -DHAVE_GRP_H=1 -DHAVE_ULIMIT_H=1 -DHAVE_VALUES_H=1 
-DHAVE_STDINT_H=1 -D_FILE_OFFSET_BITS=64 -DHAVE_RLIM_T=1 -Dsig_t=sighandler_t 
-DHAVE_SIG_T=1 -DHAVE_SYS_SIGNAME=0 -DHAVE_SYS_SIGLIST=1 -DHAVE_STRSIGNAL=0 
-DHAVE_GETRUSAGE=1 -DHAVE_KILLPG=1 -DHAVE_MKNOD=0 -DHAVE_MKSTEMP=1 
-DHAVE_NICE=0 -DHAVE_REVOKE=0 -DHAVE_SETLOCALE_CTYPE=0 
-DHAVE_LANGINFO_CODESET=0 -DHAVE_SETMODE=1 -DHAVE_SETRESUGID=1 
-DHAVE_SETGROUPS=1 -DHAVE_STRCASESTR=0 -DHAVE_STRLCPY=1 -DHAVE_FLOCK_DECL=0 
-DHAVE_REVOKE_DECL=1 -DHAVE_SYS_SIGLIST_DECL=1 -DHAVE_PERSISTENT_HISTORY=0 
-DMKSH_PRINTF_BUILTIN --combine -o mksh ../lalloc.c ../edit.c ../eval.c 
../exec.c ../expr.c ../funcs.c ../histrap.c ../jobs.c ../lex.c ../main.c 
../misc.c ../shf.c ../syn.c ../tree.c ../var.c printf.c 
/home/tg/dietlibc-0.32/lib/{strstr,strlen,memcmp}.c -isystem 
/home/tg/dietlibc-0.32/debian/dietlibc-dev/usr/lib/diet/include -D__dietlibc__ 
/home/tg/dietlibc-0.32/debian/dietlibc-dev/usr/lib/diet/lib-parisc/libc.a -lgcc 
-I/home/tg/dietlibc-0.32
  And yes, even with taking all three files from the .c versions instead
  of the .S versions it didn’t work.


Maybe someone else can make more sense out of this?

Thanks in advance,
//mirabilos
-- 
Yay for having to rewrite other people's Bash scripts because bash
suddenly stopped supporting the bash extensions they make use of
        -- Tonnerre Lombard in #nosec



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to