Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 922334 - dev-ruby/pg-1.5.4-r1 fails tests on x86: ruby-pg-1.5.4/spec/pg/type_spec.rb:1256: [BUG] Segmentation fault at 0xe8a5c000
Summary: dev-ruby/pg-1.5.4-r1 fails tests on x86: ruby-pg-1.5.4/spec/pg/type_spec.rb:1...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: time32-bugs
  Show dependency tree
 
Reported: 2024-01-17 21:07 UTC by matoro
Modified: 2024-09-03 16:26 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log and emerge --info (file_922334.txt,63.59 KB, text/plain)
2024-01-17 21:08 UTC, matoro
Details
test log for new version (file_922334.txt,33.49 KB, text/plain)
2024-01-27 17:51 UTC, matoro
Details
build.log and emerge --info (file_922334.txt,94.91 KB, text/plain)
2024-09-03 15:12 UTC, matoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matoro archtester 2024-01-17 21:07:29 UTC
* Running test phase for ruby31
Run options:
  include {:focus=>true}
  exclude {:windows=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 44524
./var/tmp/portage/dev-ruby/pg-1.5.4-r1/work/ruby31/ruby-pg-1.5.4/spec/pg/basic_type_map_for_results_spec.rb:34: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
......................................F.............................................................TcpGate server listening: #<TCPServer:fd 7, AF_INET, 127.0.0.1, 5432>
accept new int:#<TCPSocket:fd 9, AF_INET, 127.0.0.1, 5432> from #<Addrinfo: 127.0.0.1:43186 TCP> server fd:7
accept new int:#<TCPSocket:fd 11, AF_INET, 127.0.0.1, 5432> from #<Addrinfo: 127.0.0.1:43194 TCP> server fd:7
................................................(eval):1: warning: already initialized constant PG::Connection::PROGRAM_NAME
/var/tmp/portage/dev-ruby/pg-1.5.4-r1/work/ruby31/ruby-pg-1.5.4/lib/pg/connection.rb:49: warning: previous definition of PROGRAM_NAME was here
(eval):1: warning: already initialized constant PG::Connection::PROGRAM_NAME
(eval):1: warning: previous definition of PROGRAM_NAME was here
..........................................TcpGate server listening: #<TCPServer:fd 7, AF_INET6, ::1, 38203>
accept new int:#<TCPSocket:fd 9, AF_INET6, ::1, 38203> from #<Addrinfo: [::1]:33898 TCP> server fd:7
....*................................................................................NOTICE:  table "copytable" does not exist, skipping
WARNING:  there is no transaction in progress
.WARNING:  there is no transaction in progress
...NOTICE:  table "copytable" does not exist, skipping
WARNING:  there is no transaction in progress
.WARNING:  there is no transaction in progress
...WARNING:  there is no transaction in progress
...NOTICE:  table "copytable" does not exist, skipping
WARNING:  there is no transaction in progress
....WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
........................................................................................TcpGate server listening: #<TCPServer:fd 6, AF_INET, 127.0.0.1, 5432>
accept new int:#<TCPSocket:fd 8, AF_INET, 127.0.0.1, 5432> from #<Addrinfo: 127.0.0.1:47178 TCP> server fd:6
accept new int:#<TCPSocket:fd 10, AF_INET, 127.0.0.1, 5432> from #<Addrinfo: 127.0.0.1:47188 TCP> server fd:6
............................................................................................................WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
................WARNING:  there is no transaction in progress
.WARNING:  there is no transaction in progress
.WARNING:  there is no transaction in progress
..........................................WARNING:  there is no transaction in progress
.WARNING:  there is no transaction in progress
..NOTICE:  table "copytable" does not exist, skipping
WARNING:  there is no transaction in progress
.NOTICE:  table "copytable" does not exist, skipping
WARNING:  there is no transaction in progress
.NOTICE:  table "copytable" does not exist, skipping
WARNING:  there is no transaction in progress
..WARNING:  there is no transaction in progress
.....(eval):1: warning: already initialized constant PG::Connection::PROGRAM_NAME
(eval):1: warning: previous definition of PROGRAM_NAME was here
(eval):1: warning: already initialized constant PG::Connection::PROGRAM_NAME
(eval):1: warning: previous definition of PROGRAM_NAME was here
............*....TcpGate server listening: #<TCPServer:fd 9, AF_INET6, ::1, 40069>
accept new int:#<TCPSocket:fd 11, AF_INET6, ::1, 40069> from #<Addrinfo: [::1]:57162 TCP> server fd:9
.................................................#<Thread:0xe8a36324 run> terminated with exception (report_on_exception is true):
/var/tmp/portage/dev-ruby/pg-1.5.4-r1/work/ruby31/ruby-pg-1.5.4/spec/pg/exceptions_spec.rb:32:in `exec': ERROR:  division by zero (PG::DivisionByZero)
	from /var/tmp/portage/dev-ruby/pg-1.5.4-r1/work/ruby31/ruby-pg-1.5.4/spec/pg/exceptions_spec.rb:32:in `block (3 levels) in <top (required)>'
...........................................................................................................*......................................*.........................................................................................../var/tmp/portage/dev-ruby/pg-1.5.4-r1/work/ruby31/ruby-pg-1.5.4/spec/pg/type_spec.rb:1256: [BUG] Segmentation fault at 0xe8a5c000
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [i686-linux]

Reproducible: Always
Comment 1 matoro archtester 2024-01-17 21:08:09 UTC
Created attachment 882503 [details]
build.log and emerge --info
Comment 2 matoro archtester 2024-01-17 22:05:04 UTC
I can't seem to get a good backtrace for this, I can't run it outside of portage in a chroot due to some namespacing shenanigans with postgres
Comment 3 Hans de Graaff gentoo-dev Security 2024-01-27 11:37:43 UTC
Could be https://github.com/ged/ruby-pg/commit/fb3fba9eac65291b20f22eb956f02490d62de3ec although the spec where this fails is a different one (but also using COPY).
Comment 4 Larry the Git Cow gentoo-dev 2024-01-27 11:40:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3938931284f14b3e2aaed62040743b9a730f960

commit b3938931284f14b3e2aaed62040743b9a730f960
Author:     Hans de Graaff <graaff@gentoo.org>
AuthorDate: 2024-01-27 11:38:55 +0000
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: 2024-01-27 11:39:51 +0000

    dev-ruby/pg: apply upstream fix for x86
    
    Bug: https://bugs.gentoo.org/922334
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>

 dev-ruby/pg/Manifest           |  1 +
 dev-ruby/pg/pg-1.5.4-r2.ebuild | 67 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)
Comment 5 Hans de Graaff gentoo-dev Security 2024-01-27 11:40:50 UTC
(In reply to Larry the Git Cow from comment #4)

> commit b3938931284f14b3e2aaed62040743b9a730f960
> Author:     Hans de Graaff <graaff@gentoo.org>
> AuthorDate: 2024-01-27 11:38:55 +0000
> Commit:     Hans de Graaff <graaff@gentoo.org>
> CommitDate: 2024-01-27 11:39:51 +0000
> 
>     dev-ruby/pg: apply upstream fix for x86
>     
>     Bug: https://bugs.gentoo.org/922334
>     Signed-off-by: Hans de Graaff <graaff@gentoo.org>
> 
>  dev-ruby/pg/Manifest           |  1 +
>  dev-ruby/pg/pg-1.5.4-r2.ebuild | 67
> ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 68 insertions(+)

Could you test this version and see if that fixes the issue?
Comment 6 matoro archtester 2024-01-27 17:50:35 UTC
(In reply to Hans de Graaff from comment #5)
> (In reply to Larry the Git Cow from comment #4)
> 
> > commit b3938931284f14b3e2aaed62040743b9a730f960
> > Author:     Hans de Graaff <graaff@gentoo.org>
> > AuthorDate: 2024-01-27 11:38:55 +0000
> > Commit:     Hans de Graaff <graaff@gentoo.org>
> > CommitDate: 2024-01-27 11:39:51 +0000
> > 
> >     dev-ruby/pg: apply upstream fix for x86
> >     
> >     Bug: https://bugs.gentoo.org/922334
> >     Signed-off-by: Hans de Graaff <graaff@gentoo.org>
> > 
> >  dev-ruby/pg/Manifest           |  1 +
> >  dev-ruby/pg/pg-1.5.4-r2.ebuild | 67
> > ++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 68 insertions(+)
> 
> Could you test this version and see if that fixes the issue?

This indeed removes the segfault, but now there is a test failure.  Attaching full copy below.

Failures:

  1) Basic type mapping PG::BasicTypeMapBasedOnResult with usage of result oids for copy encoder selection can type cast #copy_data input with encoder to format 1
     Failure/Error:
       expect( res.values ).to eq( [
        ["\\xff000a0d27", "123", "2023-03-17 03:04:05.678912", "1990-12-17 15:14:45", "12.345", "-1.2345e+168", "2055-12-31", "1234-08-31"],
        ["\\x202078797a2020", "-444", "infinity", "-infinity", "-Infinity", "NaN", "infinity", "-infinity"]
       ] )

       expected: [["\\xff000a0d27", "123", "2023-03-17 03:04:05.678912", "1990-12-17 15:14:45", "12.345", "-1.2345e+16...["\\x202078797a2020", "-444", "infinity", "-infinity", "-Infinity", "NaN", "infinity", "-infinity"]]
            got: [["\\xff000a0d27", "123", "1999-12-31 23:31:17.070656", "1999-12-31 23:50:53.061952", "12.345", "-1.2...["\\x202078797a2020", "-444", "infinity", "-infinity", "-Infinity", "NaN", "infinity", "-infinity"]]

       (compared using ==)
     # ./spec/pg/basic_type_map_based_on_result_spec.rb:135:in `block (5 levels) in <top (required)>'
     # ./spec/helpers.rb:56:in `block in included'

Finished in 35.81 seconds (files took 0.25751 seconds to load)
976 examples, 1 failure, 4 pending
Comment 7 matoro archtester 2024-01-27 17:51:30 UTC
Created attachment 883320 [details]
test log for new version
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-27 17:51:47 UTC
time_t again?
Comment 9 Hans de Graaff gentoo-dev Security 2024-03-02 06:26:57 UTC
(In reply to Sam James from comment #8)
> time_t again?

Yes: https://github.com/ged/ruby-pg/pull/547

Should be fixed in pg-1.5.5.
Comment 10 Hans de Graaff gentoo-dev Security 2024-08-18 07:22:58 UTC
Could you please retest with pg 1.5.6? If tests pass there we can make that the new stable candidate.
Comment 11 matoro archtester 2024-09-03 15:12:43 UTC
Created attachment 901957 [details]
build.log and emerge --info

Still get a crash with 1.5.6, tested on ppc.