Skip to content

Perl SEGV #23241

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

Closed
ancientwizard opened this issue May 1, 2025 · 5 comments
Closed

Perl SEGV #23241

ancientwizard opened this issue May 1, 2025 · 5 comments

Comments

@ancientwizard
Copy link

ancientwizard commented May 1, 2025

Module: Could be Perl OR DBD::Oracle

Description
Perl exits randomly with SEGV

Steps to Reproduce
perl5-dbi/DBD-Oracle#185 for a perl test script that produces the issue.

Expected behavior
Perl should not SEGV

Perl configuration
Not included because the issue is seen in all versions of perl-5.30.3 through 5.40.2 with any combination of Oracle instantclient 12.2 through 23.7. I have written a "C" program that uses the same features that does not SEGV; or rather fails to do so even after a few thousand cycles.

I typically build them as: for debugging purposes.
CFLAGS="-g -O0" ./Configure -des -Dusethreads -Duse64bitint -Duse64bitall -Dprefix=${INST} \
      -Alddlflags="-shared -g -L/usr/local/lib -fstack-protector-strong" -Accflags="-g -O0" 
@jkeenan
Copy link
Contributor

jkeenan commented May 1, 2025

Module: Could be Perl OR DBD::Oracle

I typically build them as: for debugging purposes.
CFLAGS="-g -O0" ./Configure -des -Dusethreads -Duse64bitint -Duse64bitall -Dprefix=${INST} \
      -Alddlflags="-shared -g -L/usr/local/lib -fstack-protector-strong" -Accflags="-g -O0" 

What does ${INST} expand to?

@richardleach
Copy link
Contributor

perl5-dbi/DBD-Oracle#185 for a perl test script that produces the issue.

Can you add the output from a faulting run of this script to this issue please.

Where in your test script does the SEGV happen? Is it always in the same place?

Is it possible to trim down the perl test script to the bare minimum to trigger the SEGV? For example, (1) is it possible to trigger the bug without using theads? (2) can you strip out all the following and all the lines that use them and still trigger the bug?

  • use Time::HiRes qw| usleep |;
  • use Test::More;
  • use Data::Dumper;

@ancientwizard
Copy link
Author

Module: Could be Perl OR DBD::Oracle

I typically build them as: for debugging purposes.
CFLAGS="-g -O0" ./Configure -des -Dusethreads -Duse64bitint -Duse64bitall -Dprefix=${INST} \
      -Alddlflags="-shared -g -L/usr/local/lib -fstack-protector-strong" -Accflags="-g -O0" 

What does ${INST} expand to?

The -Dprefix is used to tell Configure where make install will put the built perl. In my case it's a location under my app, making it just another asset. You can put it anywhere you like 👍

@ancientwizard
Copy link
Author

perl5-dbi/DBD-Oracle#185 for a perl test script that produces the issue.

Can you add the output from a faulting run of this script to this issue please.

Where in your test script does the SEGV happen? Is it always in the same place?

Is it possible to trim down the perl test script to the bare minimum to trigger the SEGV? For example, (1) is it possible to trigger the bug without using theads? (2) can you strip out all the following and all the lines that use them and still trigger the bug?

  • use Time::HiRes qw| usleep |;
  • use Test::More;
  • use Data::Dumper;

This is the bare minimum. Close enough.

Without treads? No, or if it does it's extremely rare.

Yes you can remove usleep, test and dumper and it will SEGV... my app does. For the time being it seemed best to write this as a test. I can see something like this added as a test somewhere, DBD::Oracle most likely

Where it happens? Randomly

During the connect rarely

During the disconnect very often. It seems to always be the last thread that makes the attempt as long as there are more then two threads.

@Leont
Copy link
Contributor

Leont commented May 2, 2025

Steps to Reproduce
perl5-dbi/DBD-Oracle#185 for a perl test script that produces the issue.

Most of us do not have Oracle laying around, so that doesn't really help in reproducing it. Frankly I haven't seen any indication yet that it is a perl bug and would assume it's a DBD::Oracle issue until there's any indication otherwise. DBI has never really supported threads, and DBD::Oracle is notoriously complicated.

I'm closing this thread. Feel free to reopen it if you have any evidence the problem is on our side.

@Leont Leont closed this as completed May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants