Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when -Ilib while running a file that does use lib <lib> and loads some modules #6326

Open
p6rt opened this issue Jun 4, 2017 · 6 comments
Labels
SEGV Segmentation fault, bus error, etc. testneeded

Comments

@p6rt
Copy link

p6rt commented Jun 4, 2017

Migrated from rt.perl.org#131510 (status was 'open')

Searchable as RT131510$

@p6rt
Copy link
Author

p6rt commented Jun 4, 2017

From @zoffixznet

To get code that segfaults​:

  cd $(mktemp -d); git clone https://github.com/zoffixznet/perl6-Temp-Path . ; git checkout ca5ab2816705cf36911b91e4029224b4d4644a2d;

Now run this several times and it'll segfault ~50% of the time​:
 
  perl6 -Ilib t/03-DESTROY.t

The test file already does `use lib <lib>` and if you remove `-Ilib` switch, the segfault seems to disappear​:

  perl6 t/03-DESTROY.t

I tried making a small test case that just had a dummy module and was doing `use lib <lib>` but that didn't segfault.

Perhaps it's got to do with loading some installed modules?

@p6rt
Copy link
Author

p6rt commented Jun 11, 2017

From @zoffixznet

Also noticed another failure mode in a more recent version[^1] of the test file​:

fails (likely due to segv)​: prove -e 'perl6 -Ilib' -r t/03-DESTROY.t
succeeds​: prove -e 'perl6 -Ilib' -vlr t/03-DESTROY.t

And removing the `-Ilib` from prove line didn't help it, but removing the `use lib` from the
test file and using solely -Ilib avoided the problem.

[1] https://github.com/zoffixznet/perl6-Temp-Path/blob/0c2d855ffd4e602aafc34297f17d2a428c080cdd/t/03-DESTROY.t

@p6rt
Copy link
Author

p6rt commented Jun 11, 2017

From @zoffixznet

FWIW, it segfaults like below, not during module loading​:

cpan@​toaster​:/tmp/tmp.KcLTWw3PYk$ perl6 -Ilib t/03-DESTROY.t
1..4
  1..2
  ok 1 - exists before DESTROY
  ok 2 - does not exist after DESTROY
ok 1 - file
  1..2
  ok 1 - derivative exists before DESTROY
  ok 2 - derivative still exists after DESTROY
ok 2 - file, after changing path
  1..2
  ok 1 - exists before DESTROY
  ok 2 - does not exist after DESTROY
ok 3 - dir
  1..2
Segmentation fault
cpan@​toaster​:/tmp/tmp.KcLTWw3PYk$

And I tried running with RAKUDO_MODULE_DEBUG enabled but then it doesn't segfault.

@p6rt
Copy link
Author

p6rt commented Jun 11, 2017

From @zoffixznet

Some discussion​: https://irclog.perlgeek.de/perl6-dev/2017-06-11#i_14715962

02​:00 ugexe well, i have a good idea what it is then
02​:01 its the `run` that does precomp, and its the bug that has to do with stderr/stdout buffer, which one you read first, and which one you close first
02​:01 eveo It segfaults after running some tests tho. Like this is one of the outputs​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131510#txn-1465483
02​:01 ugexe the prove thing would be related because -v probably adds a bunch of extra stuff to stderr
02​:02 eveo actually, seems to consistently segfault like that, after starting 3rd test grup
02​:03 ugexe yea, and does it change if you rm -rf lib/.precomp ?
02​:03 eveo It didn't segfault after removing it, but next run segfaulted at the same place
02​:04 ugexe yep
02​:04 so there should be a difference in RAKUDO_MODULE_DEBUG loading

@p6rt
Copy link
Author

p6rt commented Jul 12, 2017

From @ugexe

This appears to be resolved - possibly in rakudo/rakudo@37250ed

@p6rt
Copy link
Author

p6rt commented Jul 12, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt added SEGV Segmentation fault, bus error, etc. testneeded labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SEGV Segmentation fault, bus error, etc. testneeded
Projects
None yet
Development

No branches or pull requests

1 participant