Opened 17 years ago

Closed 17 years ago

#1538 closed bug (fixed)

Page fault during installing perl from sources

Reported by: kaliber Owned by: axeld
Priority: normal Milestone: R1
Component: System Version: R1/pre-alpha1
Keywords: Cc: andreasf
Blocked By: Blocking:
Platform: All

Description

I've successfully compiled (gcc 2.9.x) perl-5.8.8 under Haiku using:

export LDLOADLIBS="-lnet"
./Configure -ds -e -Dosname=beos -Dcc=gcc -Duseshrplib

but during install (e.g. make install DESTDIR=/boot/home/perl) perl crashes:

vm_soft_fault: va 0x0 not covered by area in address space
vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x0, ip 0x6a6689, write 0, user 1, thread 0x27e5
vm_page_fault: sending team "./perl" 0x27e5 SIGSEGV, ip 0x6a6689 ("Cwd.so_seg0ro" +0x1689)
stack trace:
  0x002762a2 (libperl.so_seg0ro + 0x722a2)
  0x0026f603 (libperl.so_seg0ro + 0x6b603)
  0x00220d49 (libperl.so_seg0ro + 0x1cd49)
  0x00220abe (libperl.so_seg0ro + 0x1cabe)
  0x002242dc (libperl.so_seg0ro + 0x202dc)
  0x00223fbc (libperl.so_seg0ro + 0x1ffbc)
  0x0024b609 (libperl.so_seg0ro + 0x47609)
  0x002488cc (libperl.so_seg0ro + 0x448cc)
  0x002419bf (libperl.so_seg0ro + 0x3d9bf)
  0x0021fe77 (libperl.so_seg0ro + 0x1be77)
  0x0021efe0 (libperl.so_seg0ro + 0x1afe0)
  0x002017b7 (perl_seg0ro + 0x17b7)
  0x002013ef (perl_seg0ro + 0x13ef)
  0x001007be (runtime_loader_seg0ro + 0x7be)
  0x7ffe6fec (./perl_main_stack + 0xffffec)
vm_soft_fault: va 0x0 not covered by area in address space
vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x0, ip 0x8009b1ec, write 0, user 0, thread 0x27e5
debug_server: Thread 10213 entered the debugger: Segment violation
stack trace, current PC 0x6a6689  boot_Cwd + 0x25:
  (0x7ffe6b2c)  0x2762a2  Perl_pp_entersub + 0x4f2
  (0x7ffe6b8c)  0x26f603  Perl_runops_standard + 0x33
  (0x7ffe6bac)  0x220d49  Perl_call_sv + 0x6b9 (closest symbol)
  (0x7ffe6bcc)  0x220abe  Perl_call_sv + 0x42e
  (0x7ffe6c7c)  0x2242dc  Perl_call_list + 0x454 (closest symbol)
  (0x7ffe6cac)  0x223fbc  Perl_call_list + 0x134
  (0x7ffe6d0c)  0x24b609  Perl_newATTRSUB + 0xc0d
  (0x7ffe6dac)  0x2488cc  Perl_utilize + 0x358
  (0x7ffe6e1c)  0x2419bf  Perl_yyparse + 0xf4f
  (0x7ffe6e8c)  0x21fe77  perl_parse + 0x118b (closest symbol)
  (0x7ffe6edc)  0x21efe0  perl_parse + 0x2f4
  (0x7ffe6f3c)  0x2017b7  main + 0xa7
  (0x7ffe6f7c)  0x2013ef  _start + 0x5b
  (0x7ffe6fac)  0x1007be  (runtime_loader_seg0ro + 0x7be)

and GDB says:

GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-pc-haiku"...(no debugging symbols found)

[tcsetpgrp failed in terminal_inferior: Invalid Argument]
Thread 10213 caused an exception: Segment violation
Reading symbols from /boot/home/perl-5.8.8/libperl.so...(no debugging symbols found)...done.
Loaded symbols for /boot/home/perl-5.8.8/libperl.so
Reading symbols from /boot/beos/system/lib/libnetwork.so...(no debugging symbols found)...done.
Loaded symbols for /boot/beos/system/lib/libnetwork.so
Reading symbols from /boot/beos/system/lib/libroot.so...done.
Loaded symbols for /boot/beos/system/lib/libroot.so
Reading symbols from /boot/beos/system/lib/libbe.so...done.
Loaded symbols for /boot/beos/system/lib/libbe.so
Reading symbols from /boot/beos/system/lib/libstdc++.r4.so...done.
Loaded symbols for /boot/beos/system/lib/libstdc++.r4.so
Reading symbols from /boot/home/perl-5.8.8/lib/auto/Cwd/Cwd.so...done.
Loaded symbols for /boot/home/perl-5.8.8/lib/auto/Cwd/Cwd.so
Reading symbols from /boot/home/perl-5.8.8//libperl.so...done.
Loaded symbols for /boot/home/perl-5.8.8//libperl.so
[tcsetpgrp failed in terminal_inferior: Invalid Argument]

[Switching to team ./perl installperl --destdir=/boot/home/perl (10213) thread perl (10213)]
0x006a6689 in boot_Cwd () from /boot/home/perl-5.8.8/lib/auto/Cwd/Cwd.so
(gdb) thread apply all bt

Thread 1 (team ./perl installperl --destdir=/boot/home/perl (10213) thread perl(10213)):
#0  0x006a6689 in boot_Cwd () from /boot/home/perl-5.8.8/lib/auto/Cwd/Cwd.so
#1  0x002762a2 in Perl_pp_entersub () from /boot/home/perl-5.8.8/libperl.so
#2  0x0026f603 in Perl_runops_standard () from /boot/home/perl-5.8.8/libperl.so
#3  0x00220d49 in S_call_body () from /boot/home/perl-5.8.8/libperl.so
#4  0x00220abe in Perl_call_sv () from /boot/home/perl-5.8.8/libperl.so
#5  0x002242dc in S_call_list_body () from /boot/home/perl-5.8.8/libperl.so
#6  0x00223fbc in Perl_call_list () from /boot/home/perl-5.8.8/libperl.so
#7  0x0024b609 in Perl_newATTRSUB () from /boot/home/perl-5.8.8/libperl.so
#8  0x002488cc in Perl_utilize () from /boot/home/perl-5.8.8/libperl.so
#9  0x002419bf in Perl_yyparse () from /boot/home/perl-5.8.8/libperl.so
#10 0x0021fe77 in S_parse_body () from /boot/home/perl-5.8.8/libperl.so
#11 0x0021efe0 in perl_parse () from /boot/home/perl-5.8.8/libperl.so
#12 0x002017b7 in main ()
(gdb)

I don't know what's wrong. Maybe loading dynamic modules is broken? Dynamic modules were built with "gcc -nostart", in a linux it's compiled with "gcc -shared".

BTW. Why "tcsetpgrp failed in terminal_inferior: Invalid Argument"?

Attachments (1)

Cwd.c (11.6 KB ) - added by kaliber 17 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 by axeld, 17 years ago

Milestone: R1R1/alpha

comment:2 by axeld, 17 years ago

Milestone: R1/alphaR1

Can you please attach the code perl used to build the boot_Cwd() function?

comment:3 by kaliber, 17 years ago

Sorry, I don't understand how to help. Perl sources you can download from http://www.cpan.org/src/perl-5.8.8.tar.gz. Unfortunately I don't have a simple test case to reproduce this bug.

comment:4 by axeld, 17 years ago

I have downloaded the perl sources - it's just that the problem happens in a file that is automatically produced by the build process. Since I don't have access to a BeOS box, it would take a bit more effort to reproduce this problem. You could do a "grep -R boot_Cwd ." in your perl folder, and it should find something somewhere, eventually in lib/auto/ (C source). And that would be very helpful for solving this problem.

by kaliber, 17 years ago

Attachment: Cwd.c added

comment:5 by kaliber, 17 years ago

I have added Cwd.c

comment:6 by andreasf, 17 years ago

Cc: andreasf added

comment:7 by andreasf, 17 years ago

On BeOS Max v4b1, Perl 5.8.8 builds and installs okay but says "Symbol not found" when executed; Perl 5.6.2 complains about no rule to make beos.o. Both configured via ./configure.gnu.

comment:8 by andreasf, 17 years ago

Okay, so 5.8.8 does run on BeOS once I fixed the libperl.so symlink.

On Haiku my Cwd.c's boot_Cwd looks identical as above; will check on BeOS.

comment:9 by andreasf, 17 years ago

A diff between the attached Cwd.c and the Cwd.c generated on BeOS indicates they're identical.

comment:10 by andreasf, 17 years ago

Using Perl 5.8.8 copied over from R5 (which worked fine there), I get a similar crash when building autoconf - in boot_Data__Dumper () (Data/Dumper.so).

Seems like this is not specific to Cwd.so.

in reply to:  10 ; comment:11 by kaliber, 17 years ago

Replying to andreasf:

Using Perl 5.8.8 copied over from R5 (which worked fine there), I get a similar crash when building autoconf - in boot_Data__Dumper () (Data/Dumper.so).

Seems like this is not specific to Cwd.so.

Yes, I know. I think it is related to dynamic module loading.

in reply to:  11 ; comment:12 by andreasf, 17 years ago

Replying to kaliber:

Yes, I know. I think it is related to dynamic module loading.

You said maybe. Now we have evidence. :)

If you have any further insights on this (or workarounds), please let me know.

My guess is we should be starting work on a Perl hints script specifically for Haiku, now that we even have flock natively. Maybe it's possible to have the modules built into libperl for now?

in reply to:  12 ; comment:13 by bonefish, 17 years ago

Replying to andreasf:

My guess is we should be starting work on a Perl hints script specifically for Haiku, now that we even have flock natively. Maybe it's possible to have the modules built into libperl for now?

Just to let you know, I've already started porting Perl to Haiku.

in reply to:  13 ; comment:14 by andreasf, 17 years ago

Replying to bonefish:

Just to let you know, I've already started porting Perl to Haiku.

Good to hear! Which Perl are you working on (5.8/5.10/6) and how are you doing this? Doesn't seem to be in Haiku SVN.

in reply to:  14 comment:15 by bonefish, 17 years ago

Replying to andreasf:

Good to hear! Which Perl are you working on (5.8/5.10/6)

5.10.0

and how are you doing this? Doesn't seem to be in Haiku SVN.

No, and it won't appear there, since we don't really want to put all the third-party stuff into our repository. I think I'll add the patches though.

comment:16 by kaliber, 17 years ago

Since rev 23930 perl is working for me, so I think we should close this ticket.

comment:17 by bonefish, 17 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.