* Re: [Linux-ia64] IA32 process segfaults on exit
2001-04-20 16:46 [Linux-ia64] IA32 process segfaults on exit Michael Madore
@ 2001-04-20 19:24 ` Don Dugger
2001-04-20 19:37 ` Don Dugger
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Don Dugger @ 2001-04-20 19:24 UTC (permalink / raw)
To: linux-ia64
Mike-
How very serendipitous :-)
This is not supposed to happen but I think I'm working on the solution.
Some code to initialize EDX on process startup (EDX points to a potential
atexit routine) got deleted. I put the code back but it's not working
properly so there's something else wrong. Stay tuned.
On Fri, Apr 20, 2001 at 09:46:06AM -0700, Michael Madore wrote:
> Hi,
>
> The attached 32 bit code will run without error on IA32, but the same binary
> will generate the following errors when it returns on IA64.
>
> sizeof(elf_gregset_t) (1024) != sizeof(struct pt_regs) (400)
> Segmentation fault (core dumped)
>
> Is this expected behavior?
>
> --
> Mike Madore
> Software Engineer
> TurboLinux, Inc.
>
> _______________________________________________
> Linux-IA64 mailing list
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linux-ia64
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
n0ano@valinux.com
Ph: 303/938-9838
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Linux-ia64] IA32 process segfaults on exit
2001-04-20 16:46 [Linux-ia64] IA32 process segfaults on exit Michael Madore
2001-04-20 19:24 ` Don Dugger
@ 2001-04-20 19:37 ` Don Dugger
2001-05-07 16:09 ` Don Dugger
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Don Dugger @ 2001-04-20 19:37 UTC (permalink / raw)
To: linux-ia64
Mike-
Curious. I used `gdb' to clear out the registers and you program
is still getting a segv. I'll look into it.
On Fri, Apr 20, 2001 at 01:24:12PM -0600, Don Dugger wrote:
> Mike-
>
> How very serendipitous :-)
>
> This is not supposed to happen but I think I'm working on the solution.
> Some code to initialize EDX on process startup (EDX points to a potential
> atexit routine) got deleted. I put the code back but it's not working
> properly so there's something else wrong. Stay tuned.
>
> On Fri, Apr 20, 2001 at 09:46:06AM -0700, Michael Madore wrote:
> > Hi,
> >
> > The attached 32 bit code will run without error on IA32, but the same binary
> > will generate the following errors when it returns on IA64.
> >
> > sizeof(elf_gregset_t) (1024) != sizeof(struct pt_regs) (400)
> > Segmentation fault (core dumped)
> >
> > Is this expected behavior?
> >
> > --
> > Mike Madore
> > Software Engineer
> > TurboLinux, Inc.
> >
> > _______________________________________________
> > Linux-IA64 mailing list
> > Linux-IA64@linuxia64.org
> > http://lists.linuxia64.org/lists/listinfo/linux-ia64
>
> --
> Don Dugger
> "Censeo Toto nos in Kansa esse decisse." - D. Gale
> n0ano@valinux.com
> Ph: 303/938-9838
>
> _______________________________________________
> Linux-IA64 mailing list
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linux-ia64
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
n0ano@valinux.com
Ph: 303/938-9838
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Linux-ia64] IA32 process segfaults on exit
2001-04-20 16:46 [Linux-ia64] IA32 process segfaults on exit Michael Madore
2001-04-20 19:24 ` Don Dugger
2001-04-20 19:37 ` Don Dugger
@ 2001-05-07 16:09 ` Don Dugger
2001-05-07 16:47 ` Michael Madore
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Don Dugger @ 2001-05-07 16:09 UTC (permalink / raw)
To: linux-ia64
Mike-
Well, I'll very confused. I thought your problem was some registers
that we stopped initializing that the LIBC startup code expected to
point to an exit handler. I spent over a week debugging my initialization
code (the register was always non-zero in user mode) only to disciver
today that when I link the process static everything works fine, including
your test program. When I try and run a dynamic program the initial
registers are bogus. (Did I ever mention that I HATE dynamic linking.)
Bottom line is I still don't know what the problem is but I think I'm
making progress.
On Fri, Apr 20, 2001 at 09:46:06AM -0700, Michael Madore wrote:
> Hi,
>
> The attached 32 bit code will run without error on IA32, but the same binary
> will generate the following errors when it returns on IA64.
>
> sizeof(elf_gregset_t) (1024) != sizeof(struct pt_regs) (400)
> Segmentation fault (core dumped)
>
> Is this expected behavior?
>
> --
> Mike Madore
> Software Engineer
> TurboLinux, Inc.
>
> _______________________________________________
> Linux-IA64 mailing list
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linux-ia64
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
n0ano@valinux.com
Ph: 303/938-9838
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Linux-ia64] IA32 process segfaults on exit
2001-04-20 16:46 [Linux-ia64] IA32 process segfaults on exit Michael Madore
` (2 preceding siblings ...)
2001-05-07 16:09 ` Don Dugger
@ 2001-05-07 16:47 ` Michael Madore
2001-05-07 20:00 ` Don Dugger
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Michael Madore @ 2001-05-07 16:47 UTC (permalink / raw)
To: linux-ia64
Hi Don,
Thanks for looking into it. It's not a critical problem for us at the
moment. Our IA32 installer was invoking some BIOS code to get geometry
information for the hard disk. We replaced that with basically the same
code that fdisk uses.
So you can just work on this for fun now. ;-)
On Mon, May 07, 2001 at 10:09:07AM -0600, Don Dugger wrote:
> Mike-
>
> Well, I'll very confused. I thought your problem was some registers
> that we stopped initializing that the LIBC startup code expected to
> point to an exit handler. I spent over a week debugging my initialization
> code (the register was always non-zero in user mode) only to disciver
> today that when I link the process static everything works fine, including
> your test program. When I try and run a dynamic program the initial
> registers are bogus. (Did I ever mention that I HATE dynamic linking.)
>
> Bottom line is I still don't know what the problem is but I think I'm
> making progress.
>
> On Fri, Apr 20, 2001 at 09:46:06AM -0700, Michael Madore wrote:
> > Hi,
> >
> > The attached 32 bit code will run without error on IA32, but the same binary
> > will generate the following errors when it returns on IA64.
> >
> > sizeof(elf_gregset_t) (1024) != sizeof(struct pt_regs) (400)
> > Segmentation fault (core dumped)
> >
> > Is this expected behavior?
> >
> > --
> > Mike Madore
> > Software Engineer
> > TurboLinux, Inc.
> >
> > _______________________________________________
> > Linux-IA64 mailing list
> > Linux-IA64@linuxia64.org
> > http://lists.linuxia64.org/lists/listinfo/linux-ia64
>
> --
> Don Dugger
> "Censeo Toto nos in Kansa esse decisse." - D. Gale
> n0ano@valinux.com
> Ph: 303/938-9838
--
Mike Madore
Senior Software Engineer
TurboLinux, Inc.
(650)228-5203
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Linux-ia64] IA32 process segfaults on exit
2001-04-20 16:46 [Linux-ia64] IA32 process segfaults on exit Michael Madore
` (3 preceding siblings ...)
2001-05-07 16:47 ` Michael Madore
@ 2001-05-07 20:00 ` Don Dugger
2001-05-07 20:26 ` Michael Madore
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Don Dugger @ 2001-05-07 20:00 UTC (permalink / raw)
To: linux-ia64
Michael-
Um, I think I found your problem and I'm pretty sure it's program
error. The test case you sent effectively does:
fd_zero = open("/dev/zero", O_RDONLY);
m = mmap(0x10000, 0x10000, ..., fd_zero, 0);
This mapps zeros to loation 0x10000. What makes you think that
the address 0x10000 is free? On an IA32 machine the Run Time LoaDer
is loaded at 0x2aaab000 so this location, strictly by chance, is free.
On Trillian the RTLD is loaded at 0x4000 (actually, it's the first
page boundary) so you've mapped zero's on top of RTLD.
I'm really curious, why do you think 0x10000 is free?
On Fri, Apr 20, 2001 at 09:46:06AM -0700, Michael Madore wrote:
> Hi,
>
> The attached 32 bit code will run without error on IA32, but the same binary
> will generate the following errors when it returns on IA64.
>
> sizeof(elf_gregset_t) (1024) != sizeof(struct pt_regs) (400)
> Segmentation fault (core dumped)
>
> Is this expected behavior?
>
> --
> Mike Madore
> Software Engineer
> TurboLinux, Inc.
>
> _______________________________________________
> Linux-IA64 mailing list
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linux-ia64
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
n0ano@valinux.com
Ph: 303/938-9838
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Linux-ia64] IA32 process segfaults on exit
2001-04-20 16:46 [Linux-ia64] IA32 process segfaults on exit Michael Madore
` (4 preceding siblings ...)
2001-05-07 20:00 ` Don Dugger
@ 2001-05-07 20:26 ` Michael Madore
2001-05-07 20:35 ` Don Dugger
2001-05-07 20:39 ` Michael Madore
7 siblings, 0 replies; 9+ messages in thread
From: Michael Madore @ 2001-05-07 20:26 UTC (permalink / raw)
To: linux-ia64
Hi Don,
I'm not intimately familiar with what the author (not me, really!) was
trying to accomplish. I believe that the code belongs to part of the IA32
installer that is making BIOS calls to get drive geometry. I guess since it
didn't outright break on IA32, nobody questioned whether it was actually
correct or not.
If you only saw the RPM handling code that we just ported... ugh! Integer
-> pointer -> integer conversions all over the place.
Anyway, as I said, we removed this code and replaced it with something that
doesn't suck as much. ;-)
On Mon, May 07, 2001 at 02:00:46PM -0600, Don Dugger wrote:
> Michael-
>
> Um, I think I found your problem and I'm pretty sure it's program
> error. The test case you sent effectively does:
>
> fd_zero = open("/dev/zero", O_RDONLY);
> m = mmap(0x10000, 0x10000, ..., fd_zero, 0);
>
> This mapps zeros to loation 0x10000. What makes you think that
> the address 0x10000 is free? On an IA32 machine the Run Time LoaDer
> is loaded at 0x2aaab000 so this location, strictly by chance, is free.
> On Trillian the RTLD is loaded at 0x4000 (actually, it's the first
> page boundary) so you've mapped zero's on top of RTLD.
>
> I'm really curious, why do you think 0x10000 is free?
>
> On Fri, Apr 20, 2001 at 09:46:06AM -0700, Michael Madore wrote:
> > Hi,
> >
> > The attached 32 bit code will run without error on IA32, but the same binary
> > will generate the following errors when it returns on IA64.
> >
> > sizeof(elf_gregset_t) (1024) != sizeof(struct pt_regs) (400)
> > Segmentation fault (core dumped)
> >
> > Is this expected behavior?
> >
> > --
> > Mike Madore
> > Software Engineer
> > TurboLinux, Inc.
> >
> > _______________________________________________
> > Linux-IA64 mailing list
> > Linux-IA64@linuxia64.org
> > http://lists.linuxia64.org/lists/listinfo/linux-ia64
>
> --
> Don Dugger
> "Censeo Toto nos in Kansa esse decisse." - D. Gale
> n0ano@valinux.com
> Ph: 303/938-9838
--
Mike Madore
Senior Software Engineer
TurboLinux, Inc.
(650)228-5203
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Linux-ia64] IA32 process segfaults on exit
2001-04-20 16:46 [Linux-ia64] IA32 process segfaults on exit Michael Madore
` (5 preceding siblings ...)
2001-05-07 20:26 ` Michael Madore
@ 2001-05-07 20:35 ` Don Dugger
2001-05-07 20:39 ` Michael Madore
7 siblings, 0 replies; 9+ messages in thread
From: Don Dugger @ 2001-05-07 20:35 UTC (permalink / raw)
To: linux-ia64
Michael-
Well, unless anyone else can prove different, I'm just going to chalk
this one up as application error and declare the kernel innocent.
PS: Yes, I feel your RPM pain. It's one of those programs that, when
it works, it's great but, when it doesn't work ...
On Mon, May 07, 2001 at 01:26:17PM -0700, Michael Madore wrote:
> Hi Don,
>
> I'm not intimately familiar with what the author (not me, really!) was
> trying to accomplish. I believe that the code belongs to part of the IA32
> installer that is making BIOS calls to get drive geometry. I guess since it
> didn't outright break on IA32, nobody questioned whether it was actually
> correct or not.
>
> If you only saw the RPM handling code that we just ported... ugh! Integer
> -> pointer -> integer conversions all over the place.
>
> Anyway, as I said, we removed this code and replaced it with something that
> doesn't suck as much. ;-)
>
> On Mon, May 07, 2001 at 02:00:46PM -0600, Don Dugger wrote:
> > Michael-
> >
> > Um, I think I found your problem and I'm pretty sure it's program
> > error. The test case you sent effectively does:
> >
> > fd_zero = open("/dev/zero", O_RDONLY);
> > m = mmap(0x10000, 0x10000, ..., fd_zero, 0);
> >
> > This mapps zeros to loation 0x10000. What makes you think that
> > the address 0x10000 is free? On an IA32 machine the Run Time LoaDer
> > is loaded at 0x2aaab000 so this location, strictly by chance, is free.
> > On Trillian the RTLD is loaded at 0x4000 (actually, it's the first
> > page boundary) so you've mapped zero's on top of RTLD.
> >
> > I'm really curious, why do you think 0x10000 is free?
> >
> > On Fri, Apr 20, 2001 at 09:46:06AM -0700, Michael Madore wrote:
> > > Hi,
> > >
> > > The attached 32 bit code will run without error on IA32, but the same binary
> > > will generate the following errors when it returns on IA64.
> > >
> > > sizeof(elf_gregset_t) (1024) != sizeof(struct pt_regs) (400)
> > > Segmentation fault (core dumped)
> > >
> > > Is this expected behavior?
> > >
> > > --
> > > Mike Madore
> > > Software Engineer
> > > TurboLinux, Inc.
> > >
> > > _______________________________________________
> > > Linux-IA64 mailing list
> > > Linux-IA64@linuxia64.org
> > > http://lists.linuxia64.org/lists/listinfo/linux-ia64
> >
> > --
> > Don Dugger
> > "Censeo Toto nos in Kansa esse decisse." - D. Gale
> > n0ano@valinux.com
> > Ph: 303/938-9838
>
> --
> Mike Madore
> Senior Software Engineer
> TurboLinux, Inc.
> (650)228-5203
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
n0ano@valinux.com
Ph: 303/938-9838
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Linux-ia64] IA32 process segfaults on exit
2001-04-20 16:46 [Linux-ia64] IA32 process segfaults on exit Michael Madore
` (6 preceding siblings ...)
2001-05-07 20:35 ` Don Dugger
@ 2001-05-07 20:39 ` Michael Madore
7 siblings, 0 replies; 9+ messages in thread
From: Michael Madore @ 2001-05-07 20:39 UTC (permalink / raw)
To: linux-ia64
On Mon, May 07, 2001 at 02:35:15PM -0600, Don Dugger wrote:
> Michael-
>
> Well, unless anyone else can prove different, I'm just going to chalk
> this one up as application error and declare the kernel innocent.
Sounds good. Now about real player... ;-)
--
Mike Madore
Senior Software Engineer
TurboLinux, Inc.
(650)228-5203
^ permalink raw reply [flat|nested] 9+ messages in thread