Quantcast

problems with cvsup on FreeBSD 9 snapshot 201101

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problems with cvsup on FreeBSD 9 snapshot 201101

Holger Kipp-3
Dear all,

I had installed FreeBSD 9 amd64 from snapshot (ISO-image) located here:
ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201101/FreeBSD-9.0-CURRENT-201101-amd64-dvd1.iso

Today I wanted to cvsup to a later date to upgrade to ZFS v28
and compiled port /usr/ports/net/cvsup-without-gui without problems.

Starting freshly compiled cvsup then gives me

"Illegal Instruction"

This error seems to be identical to http://lists.freebsd.org/pipermail/freebsd-current/2010-September/020083.html

As this was created on a vanilla 9 snapshot using the default make.conf with only cvsup settings adapted I thought this might be of interest.

Have now used csup instead of cvsup (which seems to have worked fine), and started cvsup once again (seems cvsup only gives "Illegal Instruction" when a file needs to be changed...).

Any ideas?

Best regards,
Holger



--
Holger Kipp
Diplom-Mathematiker
Senior Consultant

Tel. : +49 30 436 58 114
Fax. : +49 30 436 58 214
Mobil: +49 178 36 58 114
Email: [hidden email]

alogis AG
Alt-Moabit 90b
D-10559 Berlin

web : http://www.alogis.com

----------------------------------------------------------

alogis AG
Sitz/Registergericht: Berlin/AG Charlottenburg, HRB 71484
Vorstand: Arne Friedrichs, Joern Samuelson
Aufsichtsratsvorsitzender: Reinhard Mielke
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with cvsup on FreeBSD 9 snapshot 201101

Bartosz Stec-2
W dniu 2011-06-15 14:23, Holger Kipp pisze:

> Dear all,
>
> I had installed FreeBSD 9 amd64 from snapshot (ISO-image) located here:
> ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201101/FreeBSD-9.0-CURRENT-201101-amd64-dvd1.iso
>
> Today I wanted to cvsup to a later date to upgrade to ZFS v28
> and compiled port /usr/ports/net/cvsup-without-gui without problems.
>
> Starting freshly compiled cvsup then gives me
>
> "Illegal Instruction"
>
> This error seems to be identical to http://lists.freebsd.org/pipermail/freebsd-current/2010-September/020083.html
>
> As this was created on a vanilla 9 snapshot using the default make.conf with only cvsup settings adapted I thought this might be of interest.
>
> Have now used csup instead of cvsup (which seems to have worked fine), and started cvsup once again (seems cvsup only gives "Illegal Instruction" when a file needs to be changed...).
>
> Any ideas?
>
> Best regards,
> Holger
>
Although it's not a "fix" to your problem, doesn't cvsup became
obsolete, from the moment when csup was integrated into the world (a
couple of years ago I believe)?
If you just want to update the ports tree, use csup.

--
Bartosz Stec


_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with cvsup on FreeBSD 9 snapshot 201101

Bartosz Stec-2
In reply to this post by Holger Kipp-3
W dniu 2011-06-15 14:23, Holger Kipp pisze:
> Have now used csup instead of cvsup (which seems to have worked fine), and started cvsup once again (seems cvsup only gives "Illegal Instruction" when a file needs to be changed...).
>
> Any ideas?
Whoops, I read your message too fast, apologize. Please ignore my
previous email :)

--
Bartosz Stec


_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with cvsup on FreeBSD 9 snapshot 201101

Eric McCorkle
In reply to this post by Holger Kipp-3
On 6/15/11 8:23 AM, Holger Kipp wrote:

> Dear all,
>
> I had installed FreeBSD 9 amd64 from snapshot (ISO-image) located here:
> ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201101/FreeBSD-9.0-CURRENT-201101-amd64-dvd1.iso
>
>
> Today I wanted to cvsup to a later date to upgrade to ZFS v28
> and compiled port /usr/ports/net/cvsup-without-gui without problems.
>
> Starting freshly compiled cvsup then gives me
>
> "Illegal Instruction"
>
> This error seems to be identical to
> http://lists.freebsd.org/pipermail/freebsd-current/2010-September/020083.html 
>

I've gotten the same problem, and managed to diagnose it.  The problem
actually isn't an illegal instruction, but a stack misalignment.  If you
load it in gdb, it will die with SIGSEGV somewhere in libc.so.7, on a
callq instruction.  This is because callq needs the stack to be 16-byte
aligned, and it's not for some reason.

As for why it's not aligned, I don't know.

--
Eric McCorkle
Computer Science Ph.D Student,
University of Massachusetts
Research Intern, IBM Research
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with cvsup on FreeBSD 9 snapshot 201101

Konstantin Belousov
On Wed, Jun 15, 2011 at 10:24:46AM -0400, Eric McCorkle wrote:

> On 6/15/11 8:23 AM, Holger Kipp wrote:
> >Dear all,
> >
> >I had installed FreeBSD 9 amd64 from snapshot (ISO-image) located here:
> >ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201101/FreeBSD-9.0-CURRENT-201101-amd64-dvd1.iso
> >
> >
> >Today I wanted to cvsup to a later date to upgrade to ZFS v28
> >and compiled port /usr/ports/net/cvsup-without-gui without problems.
> >
> >Starting freshly compiled cvsup then gives me
> >
> >"Illegal Instruction"
> >
> >This error seems to be identical to
> >http://lists.freebsd.org/pipermail/freebsd-current/2010-September/020083.html 
> >
>
> I've gotten the same problem, and managed to diagnose it.  The problem
> actually isn't an illegal instruction, but a stack misalignment.  If you
> load it in gdb, it will die with SIGSEGV somewhere in libc.so.7, on a
> callq instruction.  This is because callq needs the stack to be 16-byte
> aligned, and it's not for some reason.
Stack alignment requirement is an ABI convention, and it is not enforced
by CPU, except several special cases. In particular, either EFLAGS.AC
bit should be set, that usually is not, or SSE instruction explicitely
disallowing non-aligned access executed. Anyway, you will not get
Illegal instruction fault for unaligned access.

>
> As for why it's not aligned, I don't know.
>
> --
> Eric McCorkle
> Computer Science Ph.D Student,
> University of Massachusetts
> Research Intern, IBM Research
> _______________________________________________
> [hidden email] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "[hidden email]"

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: problems with cvsup on FreeBSD 9 snapshot 201101

Holger Kipp-3
In reply to this post by Eric McCorkle
Ah, ok.

Do we have a compiler switch to force stack alignment to 16-Byte-boundaries? Otherwise I am really concerned that we might have similar wrong pieces of code lurking unnoticed in other binaries as well :-/

My cvsup binary is:

# file /usr/local/bin/cvsup
/usr/local/bin/cvsup: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.0 (900029), stripped

Best regards,
Holger

________________________________________
From: [hidden email] [[hidden email]] on behalf of Eric McCorkle [[hidden email]]
Sent: 15 June 2011 16:24
To: [hidden email]
Subject: Re: problems with cvsup on FreeBSD 9 snapshot 201101

On 6/15/11 8:23 AM, Holger Kipp wrote:

> Dear all,
>
> I had installed FreeBSD 9 amd64 from snapshot (ISO-image) located here:
> ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201101/FreeBSD-9.0-CURRENT-201101-amd64-dvd1.iso
>
>
> Today I wanted to cvsup to a later date to upgrade to ZFS v28
> and compiled port /usr/ports/net/cvsup-without-gui without problems.
>
> Starting freshly compiled cvsup then gives me
>
> "Illegal Instruction"
>
> This error seems to be identical to
> http://lists.freebsd.org/pipermail/freebsd-current/2010-September/020083.html
>

I've gotten the same problem, and managed to diagnose it.  The problem
actually isn't an illegal instruction, but a stack misalignment.  If you
load it in gdb, it will die with SIGSEGV somewhere in libc.so.7, on a
callq instruction.  This is because callq needs the stack to be 16-byte
aligned, and it's not for some reason.

As for why it's not aligned, I don't know.

--
Eric McCorkle
Computer Science Ph.D Student,
University of Massachusetts
Research Intern, IBM Research
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"


--
Holger Kipp
Diplom-Mathematiker
Senior Consultant

Tel. : +49 30 436 58 114
Fax. : +49 30 436 58 214
Mobil: +49 178 36 58 114
Email: [hidden email]

alogis AG
Alt-Moabit 90b
D-10559 Berlin

web : http://www.alogis.com

----------------------------------------------------------

alogis AG
Sitz/Registergericht: Berlin/AG Charlottenburg, HRB 71484
Vorstand: Arne Friedrichs, Joern Samuelson
Aufsichtsratsvorsitzender: Reinhard Mielke
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with cvsup on FreeBSD 9 snapshot 201101

Eric McCorkle
In reply to this post by Holger Kipp-3
On 6/15/11 10:46 AM, Holger Kipp wrote:

> Ah, ok.
>
> Do we have a compiler switch to force stack alignment to 16-Byte-boundaries? Otherwise I am really concerned that we might have similar wrong pieces of code lurking unnoticed in other binaries as well :-/
>
> My cvsup binary is:
>
> # file /usr/local/bin/cvsup
> /usr/local/bin/cvsup: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.0 (900029), stripped
>
> Best regards,
> Holger
(Accidentally replied directly to you, cc'ing list)

It's certainly possible, though GCC aligns the stack correctly, or else
nothing would work.  CVSup is written in Modula 3.  I checked the stack
alignment option for FBSD_AMD64, and it is sure enough set to 16.  My
guess is somewhere in the native call interface, something's not being
done right.

I ran into a similar problem when porting the mlton compiler to Mac OS a
couple of years back.

--
Eric McCorkle
Computer Science Ph.D student,
University of Massachusetts
Research Intern, IBM Research
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with cvsup on FreeBSD 9 snapshot 201101

Eric McCorkle
In reply to this post by Konstantin Belousov
On 6/15/11 10:58 AM, Kostik Belousov wrote:

> On Wed, Jun 15, 2011 at 10:24:46AM -0400, Eric McCorkle wrote:
>> On 6/15/11 8:23 AM, Holger Kipp wrote:
>>> Dear all,
>>>
>>> I had installed FreeBSD 9 amd64 from snapshot (ISO-image) located here:
>>> ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201101/FreeBSD-9.0-CURRENT-201101-amd64-dvd1.iso
>>>
>>>
>>> Today I wanted to cvsup to a later date to upgrade to ZFS v28
>>> and compiled port /usr/ports/net/cvsup-without-gui without problems.
>>>
>>> Starting freshly compiled cvsup then gives me
>>>
>>> "Illegal Instruction"
>>>
>>> This error seems to be identical to
>>> http://lists.freebsd.org/pipermail/freebsd-current/2010-September/020083.html
>>>
>>
>> I've gotten the same problem, and managed to diagnose it.  The problem
>> actually isn't an illegal instruction, but a stack misalignment.  If you
>> load it in gdb, it will die with SIGSEGV somewhere in libc.so.7, on a
>> callq instruction.  This is because callq needs the stack to be 16-byte
>> aligned, and it's not for some reason.
> Stack alignment requirement is an ABI convention, and it is not enforced
> by CPU, except several special cases. In particular, either EFLAGS.AC
> bit should be set, that usually is not, or SSE instruction explicitely
> disallowing non-aligned access executed. Anyway, you will not get
> Illegal instruction fault for unaligned access.

I took a closer look this afternoon, and you're right.  callq with an
unaligned stack pointer does *not* cause a fault.  If anyone does a
movaps, however, you will get a fault (SIGBUS, I believe), and if the
ABI says stacks are 16-byte aligned, then libraries may assume it's safe
to load from the stack with movaps, and you'll get a fault.  This is
what happened to mlton on Mac OS, so I thought it might be something
similar going on here.

Anyways, I'll look into it more.
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Loading...