ldc-developers / ldc2.snap

Snap package definition for LDC, the LLVM-based D compiler
11 stars 4 forks source link

1.15.0 fails testsuite on i386 #80

Closed WebDrake closed 4 years ago

WebDrake commented 5 years ago

The i386 build of the snap package fails during dmd-testsuite-debug. Specifically it segfaults during testptrref_gc.d:

1590:  ... runnable/testptrref_gc.d       -lowmem -Jrunnable -g -link-defaultlib-debug ()
1590: Test runnable/testptrref_gc.d failed.  The logged output:
1590: /build/ldc2/parts/ldc/build/bin/ldmd2 -conf= -m32 -Irunnable -lowmem -Jrunnable -g -link-defaultlib-debug  -od../../../../build/dmd-testsuite-debug/runnable -of../../../../build/dmd-testsuite-debug/runnable/testptrref_gc_0  runnable/testptrref_gc.d 
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x33)[0xaab6d43]
1590: /build/ldc2/parts/ldc/build/bin/ldc2[0xaab6e1d]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_ZN4llvm3sys17RunSignalHandlersEv+0x52)[0xaab4c02]
1590: /build/ldc2/parts/ldc/build/bin/ldc2[0xaab4d85]
1590: [0xf7708bc0]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_ZN4FileD1Ev+0x14)[0x8796d74]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_D6object15TypeInfo_Struct7destroyMxFPvZv+0x25)[0xad08cc5]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(rt_finalizeFromGC+0x4b)[0xad0d45b]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_D2gc4impl12conservativeQw3Gcx5sweepMFNbZk+0x31e)[0xad4450e]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZk+0x2df)[0xad406ff]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs18fullCollectNoStackMFNbZ2goFNbPSQEaQEaQDyQEj3GcxZkTQvZQDfMFNbKQBgZk+0x4e)[0xad40a5e]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_D2gc4impl12conservativeQw14ConservativeGC18fullCollectNoStackMFNbZv+0x1b)[0xad403eb]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_DThn8_2gc4impl12conservativeQw14ConservativeGC14collectNoStackMFNbZv+0x1c)[0xad4118c]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(gc_term+0x65)[0xad05c15]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(rt_term+0x4b)[0xad160eb]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv+0x6e)[0xad1661e]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(_d_run_main+0x1c9)[0xad163e9]
1590: /build/ldc2/parts/ldc/build/bin/ldc2(main+0x8c)[0x864ae0c]
1590: /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0xf732f637]
1590: /build/ldc2/parts/ldc/build/bin/ldc2[0x86e4991]
1590: Error: Error executing /build/ldc2/parts/ldc/build/bin/ldc2: Segmentation fault (core dumped)
1590: 
1590: 
1590: ==============================
1590: Test runnable/testptrref_gc.d failed: expected rc == 0, exited with rc == 1
1590: 
1590: Makefile:371: recipe for target '../../../../build/dmd-testsuite-debug/runnable/testptrref_gc.d.out' failed
1590: make[1]: *** [../../../../build/dmd-testsuite-debug/runnable/testptrref_gc.d.out] Error 1
WebDrake commented 5 years ago

See: https://launchpadlibrarian.net/421245844/buildlog_snap_ubuntu_xenial_i386_ldc2-1.15_BUILDING.txt.gz for an example of the failing build.

kinke commented 5 years ago

[Win32 is fine.]

kinke commented 5 years ago

Ah sry, confused this with an LDC issue, other repo. ;)

WebDrake commented 5 years ago

I don't see the issue you're referring to. In any case does that issue explain the segfault I'm seeing in tests?

kinke commented 5 years ago

After a quick glance into dmd.root.file (your backtrace contains the File dtor), I guess the reason is that the File.buffer is mem.xfreed (=> GC.free() with -lowmem) in the dtor, while it's allocated with malloc and friends in File.read().

WebDrake commented 5 years ago

So LDC bug, then, rather than upstream DMD?

kinke commented 5 years ago

Nope, DMD bug.

WebDrake commented 5 years ago

Ah, from what you said I assumed it was down to how mem.xfree behaved with -lowmem, which I assumed was LDC specific. There's certainly no difference between dmd.root.file in previous releases and the current one, so I presume a change elsewhere must have exposed the issue?

kinke commented 5 years ago

If you're thinking about filing a DMD issue - it's probably easier if I just fix it.

WebDrake commented 5 years ago

Thanks for taking this up! I see that PR is against DMD master branch -- what's the chance of getting it into a patch release?

kinke commented 5 years ago

It turned out more difficult than expected and it's not ready yet. It might make it into LDC 1.16 final.

WebDrake commented 5 years ago

Ah, damn :-\ This is going to block any i386 package for 1.15, then ... ?

kinke commented 5 years ago

The failure doesn't happen for Win32; it might be sporadic. It also shouldn't be 32-bit specific. One way of working around it would be simply deleting the 2 *_gc.d files before running dmd-testsuite, as done for Travis with the ltsmaster host compiler (https://github.com/ldc-developers/ldc/blob/81b8a646346d562e289cdeeebf4387d47ea1cc7a/.travis.yml#L114-L115).

WebDrake commented 5 years ago

@kinke I gather the patch made it in -- what's the chance of getting a backport? Or is it 1.16 only ... ?

kinke commented 5 years ago

Well, 1.16 has been released, so I don't see an urgent need for a 1.15 backport - -lowmem is purely optional. I can't confirm the patch really fixes the problem surfacing here, as I've never been able to reproduce the issue myself, so a confirmation from your side would be welcome. :)

WebDrake commented 5 years ago

Yup, I'm readying a 1.16.0 release right now. Would just be nice to be able to release an i386 1.15 ;-)

WebDrake commented 4 years ago

Closing this as WONTFIX: it's a shame, but not worth trying to address with so many subsequent compiler releases.