D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6687 - [64bit] error in GC on FreeBSD (amd64), so any program does not work
Summary: [64bit] error in GC on FreeBSD (amd64), so any program does not work
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D1 (retired)
Hardware: x86_64 FreeBSD
: P2 critical
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-17 21:08 UTC by Sohgo Takeuchi
Modified: 2012-04-28 01:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Sohgo Takeuchi 2011-09-17 21:08:39 UTC
I wrote a "hello world" program, and compiled it using DMD1 on FreeBSD(amd64) 8.2R. When I run it, the program exits with segmentation fault.

% ./hello
[5]    195 segmentation fault  ./hello
Sep 18 13:02:56 maroon kernel: pid 195 (hello), uid 10103: exited on signal 11

I run the program with gdb.

% gdb ./hello
GNU gdb 6.1.1 [FreeBSD]
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 "amd64-marcel-freebsd"...
(gdb) r
Starting program: /home/sohgo/work/d/d-freebsd-amd64-current/phobos1/hello
[New LWP 100186]
[New Thread 800c041c0 (LWP 100186)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 800c041c0 (LWP 100186)]
0x000000000041c427 in _D3gcx3Gcx4markMFPvPvZv (this=0x800c0e100, ptop=0x533c48, pbot=0x422c42) at gcx.d:1781
1781                byte *p = cast(byte *)(*p1);
(gdb) bt
#0  0x000000000041c427 in _D3gcx3Gcx4markMFPvPvZv (this=0x800c0e100, ptop=0x533c48, pbot=0x422c42) at gcx.d:1781
#1  0x000000000041c95f in _D3gcx3Gcx11fullcollectMFPvZm (this=0x800c0e100, stackTop=0x0) at gcx.d:2050
#2  0x000000000041c623 in _D3gcx3Gcx16fullcollectshellMFZm (this=0x800c0e100) at gcx.d:1885
#3  0x0000000000419fbf in _D3gcx2GC12mallocNoSyncMFmZPv (this=0x800c0d040, size=112) at gcx.d:374
#4  0x0000000000419e31 in _D3gcx2GC6mallocMFmZPv (this=0x800c0d040, size=112) at gcx.d:318
#5  0x0000000000417480 in _d_newclass (ci=0x52fd58) at gc.d:190
#6  0x0000000000422248 in _D3std6thread6Thread11thread_initFZv () at std/thread.d:1094
#7  0x0000000000417401 in gc_init () at gc.d:167
#8  0x000000000041edcc in _d_run_main (argc=1, argv=0x7fffffffe7a0, p=0x402370) at internal/dmain2.d:109
#9  0x000000000041ed5f in main (argc=1, argv=0x7fffffffe7a0) at internal/dmain2.d:59
(gdb) p p1
$1 = (void **) 0x428ffa
(gdb) p *p1
Error accessing memory address 0x428ffa: Bad address.
(gdb)

Therefore, unittest for phobos1 exit with segmentation fault too.
Any unittest does not pass.
Comment 1 Walter Bright 2012-04-28 01:52:31 UTC
D1 does not support 64 bit programs on FreeBSD. It does support 32 bit programs, and hello world does work on it.