os-lib icon indicating copy to clipboard operation
os-lib copied to clipboard

Segfault on Scala native when writing

Open keynmol opened this issue 4 years ago • 3 comments

OS: PopOS (ubuntu-based linux) SN: 0.4.0 Scala: 2.13.4 os-lib: 0.7.2

Problem: attempting to use os.write causes a segfault.

Reproduction:

  • Repo: https://github.com/keynmol/test-os-lib-scala-native
  • CI: https://github.com/keynmol/test-os-lib-scala-native/runs/1801082808#step:6:8

running it via gdb shows this:

(gdb) run
Starting program: /home/velvetbaldmime/projects/test-os-lib-on-native/target/scala-2.13/test-os-lib-on-native-out
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
writing file /tmp/5915669401669540285/test

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) backtrace
#0  0x0000000000000000 in ?? ()
#1  0x000000000067e468 in _SM9os.write$D5writeL7os.PathL9os.SourceL30scala.collection.immutable.SeqL10os.PermSetjL16java.lang.ObjectEO ()
#2  0x000000000067e098 in _SM9os.write$D5applyL7os.PathL9os.SourceL10os.PermSetzuEO ()
#3  0x000000000067d6a2 in _SM5Main$D4mainLAL16java.lang.String_uEO ()
#4  0x00000000006555e1 in main ()

keynmol avatar Jan 31 '21 12:01 keynmol

The underlying issue was fixed in Scala Native, so I guess we should run the reproducer it with the current versions of os-lib and SN and close the issue.

WojciechMazur avatar Jan 17 '22 17:01 WojciechMazur

Hmm. I attempted to upgrade to 0.4.3-RC2 (in a previous commit) and other things, and now the linking doesn't work: https://github.com/keynmol/test-os-lib-scala-native/runs/4844215939?check_suite_focus=true#step:5:27

It smells to me like a broken bincompat, but I'm not sure on which side

keynmol avatar Jan 17 '22 17:01 keynmol

Hi @keynmol, I completely missed the report here, so I am probably a bit late. We ended up fixing the underlying issues in https://github.com/scala-native/scala-native/pull/2532, (if I remember correctly) after the discussion on discord, right before releasing 0.4.3. I just now tested the reproduction and on both 0.4.3 and 0.4.4 everything seems to work well now. Thank you for reporting!

jchyb avatar Mar 04 '22 14:03 jchyb

Thanks for the feedback.

lefou avatar Sep 08 '22 20:09 lefou