compiling Pike on NetBSD

3 views
Skip to first unread message

Jörn Clausen

unread,
Oct 1, 2019, 6:13:23 AM10/1/19
to pi...@roxen.com
Hi!

I am trying to build Pike on NetBSD. I get a pike binary, but it crashes
when it tries to compile(?) post_modules/GL/gen.pike. I get this stack
trace from the generated core file:

#0 0x000074c529ded1e4 in ?? ()
#1 0x000000000042a169 in eval_instruction (pc=<optimized out>) at
/export/home/joern/pike/Pike-v8.0.702/src/interpret.c:1711
#2 apply_low_safe_and_stupid (o=<optimized out>, offset=offset@entry=4)
at /export/home/joern/pike/Pike-v8.0.702/src/interpret.c:2926
#3 0x0000000000541f98 in eval_low (n=0x74c5295b70b0,
print_error=print_error@entry=1)
at /export/home/joern/pike/Pike-v8.0.702/src/las.c:4956
#4 0x000000000041a4a8 in yyparse () at language.yacc:592
#5 0x00000000004d9e18 in do_yyparse () at
/export/home/joern/pike/Pike-v8.0.702/src/program.c:8215
#6 run_pass1 (c=0x74c529dc2150) at
/export/home/joern/pike/Pike-v8.0.702/src/program.c:9110
#7 f_compilation_compile (args=<optimized out>) at
/export/home/joern/pike/Pike-v8.0.702/src/program.c:9672
#8 0x0000000000426eae in lower_mega_apply (args=args@entry=0,
o=o@entry=0x74c529db4070, fun=1)
at /export/home/joern/pike/Pike-v8.0.702/src/interpret.c:2173
#9 0x000000000042aed9 in mega_apply_low (arg2=<optimized out>,
arg1=0x74c529db4070, args=0)
at /export/home/joern/pike/Pike-v8.0.702/src/interpret.c:2720
#10 apply (o=0x74c529db4070, fun=fun@entry=0x5e8f92 "compile",
args=args@entry=0)
at /export/home/joern/pike/Pike-v8.0.702/src/interpret.c:3142
#11 0x00000000004c85f5 in f_compilation_env_compile (args=1) at
/export/home/joern/pike/Pike-v8.0.702/src/program.c:8706
#12 0x0000000000426eae in lower_mega_apply (args=1, o=0x74c529db4010, fun=1)
at /export/home/joern/pike/Pike-v8.0.702/src/interpret.c:2173
#13 0x000000000042923c in mega_apply_low (args=args@entry=1,
arg1=<optimized out>, arg2=arg2@entry=1)
at /export/home/joern/pike/Pike-v8.0.702/src/interpret.c:2720
#14 0x000000000054bb85 in f_compile (args=args@entry=1) at
/export/home/joern/pike/Pike-v8.0.702/src/builtin_functions.c:4735
#15 0x00000000004b4ca1 in get_master () at
/export/home/joern/pike/Pike-v8.0.702/src/object.c:669
#16 0x00000000004b4e56 in debug_master () at
/export/home/joern/pike/Pike-v8.0.702/src/object.c:720
#17 0x0000000000499c2a in load_pike_master () at
/export/home/joern/pike/Pike-v8.0.702/src/pike_embed.c:397
#18 0x00000000005ba5a9 in main (argc=<optimized out>, argv=<optimized out>)
at /export/home/joern/pike/Pike-v8.0.702/src/main.c:676


I actually want to build the Roxen webserver, and compiling Pike there
with '-O0", I see

#0 0x000076730e9e81e4 in ?? ()
#1 0x0000000000431ad3 in eval_instruction (pc=0x76730e9e81e4
"UH\211\345AWAVAUATSH\203\354\bI\211\377M\213/I\307E") at
/export/home/joern/roxen/roxen-6.1.246-src/pike/src/interpret.c:1711
#2 0x00000000004358bb in apply_low_safe_and_stupid (o=0x76730e9af0d0,
offset=4) at /export/home/joern/roxen/roxen-6.1.2
46-src/pike/src/interpret.c:2926

When compiling the current Pike sources, I always get "optimized out",
even when turning off the optimizer with '-O0'.

Can anybody help me dig deeper to what the problem is?

The build environment is:

NetBSD 8.1/amd64 (i.e. 64-bit ABI)
GCC 5.5.0
all required prerequisites are installed (e.g. gmp 6.1.2 or nettle 3.5.1)


Is this from bin/README

smartlink
[FIXME: What does this do?]

part of the puzzle???


Thanks,
Joern

--
Jörn Clausen
Plattformen & Serverdienste
BITS - Bielefelder IT-Servicezentrum
https://www.uni-bielefeld.de/bits

Henrik Grubbström (Lysator) @ Pike (-) importmöte för mailinglistan

unread,
Oct 1, 2019, 8:21:14 AM10/1/19
to pi...@roxen.com
> Hi!
>
> I am trying to build Pike on NetBSD. I get a pike binary, but it crashes
> when it tries to compile(?) post_modules/GL/gen.pike. I get this stack
> trace from the generated core file:
>
> #0 0x000074c529ded1e4 in ?? ()
> #1 0x000000000042a169 in eval_instruction (pc=<optimized out>) at
> /export/home/joern/pike/Pike-v8.0.702/src/interpret.c:1711
[...]

Try running paxctl +m on the pike binary. Alternatively you can try
compiling pike --without-machine-code.

> I actually want to build the Roxen webserver, and compiling Pike there
> with '-O0", I see
>
> #0 0x000076730e9e81e4 in ?? ()
> #1 0x0000000000431ad3 in eval_instruction (pc=0x76730e9e81e4
> "UH\211\345AWAVAUATSH\203\354\bI\211\377M\213/I\307E") at
> /export/home/joern/roxen/roxen-6.1.246-src/pike/src/interpret.c:1711
> #2 0x00000000004358bb in apply_low_safe_and_stupid (o=0x76730e9af0d0,
> offset=4) at /export/home/joern/roxen/roxen-6.1.2
> 46-src/pike/src/interpret.c:2926
>
> When compiling the current Pike sources, I always get "optimized out",
> even when turning off the optimizer with '-O0'.
>
> Can anybody help me dig deeper to what the problem is?

The problem is most likely due to that recent releases of NetBSD have
changed the default policy regarding use of mprotect(2).

> The build environment is:
>
> NetBSD 8.1/amd64 (i.e. 64-bit ABI)
> GCC 5.5.0
> all required prerequisites are installed (e.g. gmp 6.1.2 or nettle 3.5.1)

/grubba

Jörn Clausen

unread,
Oct 1, 2019, 9:18:06 AM10/1/19
to Henrik Grubbström (Lysator) @ Pike (-) importmöte för mailinglistan, pi...@roxen.com
> Try running paxctl +m on the pike binary.

Wow, spot on! That fixed the immediate problem, now I can continue with
Pike and Roxen.

> Alternatively you can try
> compiling pike --without-machine-code.

Argh, didn't see that when checking configure --help. I'll try that as well.

Thanks a lot for this quick help!

H William Welliver

unread,
Oct 1, 2019, 11:01:55 AM10/1/19
to Jörn Clausen, "Henrik Grubbström (Lysator) @ Pike (-) importmöte för mailinglistan", pi...@roxen.com
You might also want be interested in checking out my work in progress port of pike to pkgsrc. My plan is to get it submitted for inclusion to pkgsrc, I’d just like to get some more testing feedback.

http://pkgsrc.se/wip/pike8.0

As always, comments and suggestions are welcome!

Bill
Reply all
Reply to author
Forward
0 new messages