New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #24605 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

P5-cgi-speedycgi +apple_apache :: latest version :: Runtime error -

Reported by: phiwie@… Owned by: markd@…
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc:
Port: p5-cgi-speedycgi

Description (last modified by jmr@…) (diff)

I had SpeedyCGI installing and running successfully on Mac OS X 10.4 and 10.5 (after some hacking). However, now I experience problems after recently clean-installing 10.6.3 with Apple Apache 2.2.14 and Perl 5.10.0 and setting-up a completely fresh Mac Ports system (BerkeleyDB 4.7 installed by myself).

First problem (solved): p5-cgi-speedycgi +apple_apache aborts installation complaining about the missing perl5 port, even if Apple Perl is there.

Second problem (solved): p5-cgi-speedycgi +apple_apache still ships with the bug that keeps it from installing. In src/speedy_backend_main.h:

-#define speedy_new(s,n,t) New(123,s,n,t)
+#define speedy_new(s,n,t) Newx(s,n,t)

Third problem (not solved): after successful compiling via port install p5-cgi-speedycgi +apple_apache, and after copying /opt/local/share/doc/speedycgi/mod_speedycgi.so to /usr/libexec/apache2/, I get a server error when initiating SpeedyCGI. Apple Apache running in 64bit mode on a Mac Pro Intel Dual 2.8GHz Harpertown. Here is an excerpt of the crash report:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000007
Crashed Thread:  0  Dispatch queue: com.apple.main-thread
Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0xffffffff  ebx: 0x00064e1a  ecx: 0x00000000  edx: 0xffffffff
  edi: 0x00009edb  esi: 0x00800000  ebp: 0xbfffe468  esp: 0xbfffe3d0
   ss: 0x0000001f  efl: 0x00010286  eip: 0x00064e29   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037
  cr2: 0x00000007

I would be greatful in learning soon what the cause could be, thanks!

Change History

comment:1 Changed 5 years ago by jmr@…

  • Priority changed from High to Normal
  • Keywords speedycgi, CGI, speedy, +apple_apache, perl, perl5 removed
  • Description modified (diff)
  • Owner changed from macports-tickets@… to markd@…

Please remember to preview and use WikiFormatting, and cc the maintainer. As per the ticket guidelines, the High priority is reserved for the use of MacPorts team members.

comment:2 follow-up: ↓ 3 Changed 5 years ago by markd@…

I applied the backend patch in revision 5 to the port. That was actually a gentoo patch I see. If 10.6 uses a 64-bit version of apache then I think that is the problem since speedycgi doesn't seem to support that. You could always install macports apache2 to get around the problem.

http://stackoverflow.com/questions/25846/installing-apache-web-server-on-64-bit-mac http://www.mail-archive.com/qpsmtpd@perl.org/msg04125.htm

comment:3 in reply to: ↑ 2 Changed 4 years ago by phiwie@…

Thanks for your input, guys. Regarding the gentoo patch, I did a fresh port install and the bug was still there.

I installed macports apache2 and it's running with SpeedyCGI without complaining. However, now SpeedyCGI constantly crashes with any Perl script with the error "Cannot spawn backend process". Here's the crash report:

Process:         speedy_backend [8873]
Path:            /usr/bin/speedy_backend
Identifier:      speedy_backend
Version:         ??? (???)
Code Type:       X86 (Native)
Parent Process:  ??? [1]

Date/Time:       2010-04-28 00:09:33.637 +0200
OS Version:      Mac OS X 10.6.3 (10D573)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000007
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libperl.dylib                 	0x00064e29 Perl_hv_common + 32
1   libperl.dylib                 	0x000d77e7 Perl_hv_fetch + 94
2   speedy_backend                	0x000094d3 boot_DynaLoader + 467
3   libperl.dylib                 	0x00078149 Perl_pp_entersub + 1288
4   libperl.dylib                 	0x00071429 Perl_runops_standard + 41
5   libperl.dylib                 	0x00069287 Perl_nothreadhook + 87
6   libperl.dylib                 	0x0006bc1e Perl_call_sv + 733
7   libperl.dylib                 	0x0006bf8b Perl_call_list + 387
8   libperl.dylib                 	0x00035fff Perl_ck_anoncode + 303
9   libperl.dylib                 	0x00041bc7 Perl_newATTRSUB + 3777
10  libperl.dylib                 	0x00040704 Perl_utilize + 1236
11  libperl.dylib                 	0x0003345c Perl_yyparse + 5816
12  libperl.dylib                 	0x0009cec6 Perl_dowantarray + 693
13  libperl.dylib                 	0x000a581b Perl_pp_require + 5452
14  libperl.dylib                 	0x00071429 Perl_runops_standard + 41
15  libperl.dylib                 	0x00069287 Perl_nothreadhook + 87
16  libperl.dylib                 	0x0006bc1e Perl_call_sv + 733
17  libperl.dylib                 	0x0006bf8b Perl_call_list + 387
18  libperl.dylib                 	0x00035fff Perl_ck_anoncode + 303
19  libperl.dylib                 	0x00041bc7 Perl_newATTRSUB + 3777
20  libperl.dylib                 	0x00040704 Perl_utilize + 1236
21  libperl.dylib                 	0x0003345c Perl_yyparse + 5816
22  libperl.dylib                 	0x0009cec6 Perl_dowantarray + 693
23  libperl.dylib                 	0x0009d85c Perl_pp_entereval + 1444
24  libperl.dylib                 	0x00069263 Perl_nothreadhook + 51
25  libperl.dylib                 	0x0006b622 Perl_eval_sv + 468
26  speedy_backend                	0x00003506 load_script + 449
27  speedy_backend                	0x000039c1 speedy_perl_init + 423
28  speedy_backend                	0x00002435 main + 159
29  speedy_backend                	0x000021f6 start + 54

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0xffffffff  ebx: 0x00064e1a  ecx: 0x00000000  edx: 0xffffffff
  edi: 0x00009edb  esi: 0x00800000  ebp: 0xbfffea58  esp: 0xbfffe9c0
   ss: 0x0000001f  efl: 0x00010286  eip: 0x00064e29   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037
  cr2: 0x00000007

Any ideas as to the cause? Thanks - Phil

comment:4 Changed 4 years ago by markd@…

I added a patch from the freebsd port that says it fixes segfaults on perl 5.10. Can you please do a selfupdate and test it again?

comment:5 Changed 4 years ago by phiwie@…

Thanks, Mark.

I selfupdated but had exactly the same error again. Looking at the crash report, I see that Apple Perl is being used:

Binary Images:
    0x1000 -     0x9ff5 +speedy_backend ??? (???) <5C6CE5DC-A989-DDF6-D8C6-652B5220999E> /usr/bin/speedy_backend
   0x12000 -    0xf7ff7  libperl.dylib 5.8.9 (compatibility 5.8.0) <5CA789F0-FB19-A6C7-E728-B11DAADABB10> /System/Library/Perl/lib/5.8/libperl.dylib
  0x11a000 -   0x11eff7  libutil.dylib ??? (???) <61FEDBC2-F98A-F343-BFB6-1F9C151F70DD> /usr/lib/libutil.dylib

Seems that this is the problem, as presumably Apple Perl runs as a 64bit binary. Since I use the standard /usr/bin/speedy in my applications, this will also trigger the default System Perl. Is there an alternative to not having to change all hard-coded SpeedyCGI path names to /opt/local/bin/speedy in the scripts, which I really would like to avoid?

comment:6 Changed 4 years ago by markd@…

I don't know enough about perl to say whether that would be a problem as with Apache, but you would have to change the perl path to get it to use macports perl. But the macports way is to use macports supporting apps and libs wherever possible so that is what is always recommended. I can't say for sure if it will fix this problem though.

comment:7 Changed 4 years ago by phiwie@…

I'm pleased to confirm that in using MacPorts' Apache, Perl and SpeedyCGI ports everything works fine again with Mac OS X 10.6.3.

I solved the hard-coded SpeedyCGI path issue by deleting the old /usr/bin/speedy... binaries and just linking them to /opt/local/bin/speedy... This way no scripts have to be changed.

Consider the case closed. Many thanks for your help, Mark.

comment:8 Changed 4 years ago by markd@…

  • Status changed from new to closed
  • Resolution set to fixed

Good to hear. Thanks for letting me know.

Note: See TracTickets for help on using tickets.