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

Segmentation fault: 11 on macOS Monterey #78

Closed
henrik242 opened this issue Nov 1, 2021 · 12 comments
Closed

Segmentation fault: 11 on macOS Monterey #78

henrik242 opened this issue Nov 1, 2021 · 12 comments

Comments

@henrik242
Copy link

henrik242 commented Nov 1, 2021

I seem to be unable to use embedded-postgres (I'm on v1.3.1)

Process [/var/folders/lp/58zt5n313qg4s0d0b_yqnmsc0000gn/T/embedded-pg/PG-a2a9bc65661eac6f108fc920268a87b3/bin/initdb, -A, trust, -U, postgres, -D, /var/folders/lp/58zt5n313qg4s0d0b_yqnmsc0000gn/T/epg16198865472753438309, -E, UTF-8] failed
java.lang.IllegalStateException: Process [/var/folders/lp/58zt5n313qg4s0d0b_yqnmsc0000gn/T/embedded-pg/PG-a2a9bc65661eac6f108fc920268a87b3/bin/initdb, -A, trust, -U, postgres, -D, /var/folders/lp/58zt5n313qg4s0d0b_yqnmsc0000gn/T/epg16198865472753438309, -E, UTF-8] failed
	at io.zonky.test.db.postgres.embedded.EmbeddedPostgres.system(EmbeddedPostgres.java:632)
	at io.zonky.test.db.postgres.embedded.EmbeddedPostgres.initdb(EmbeddedPostgres.java:252)
	at io.zonky.test.db.postgres.embedded.EmbeddedPostgres.<init>(EmbeddedPostgres.java:159)
	at io.zonky.test.db.postgres.embedded.EmbeddedPostgres$Builder.start(EmbeddedPostgres.java:583)
	at io.zonky.test.db.postgres.embedded.EmbeddedPostgres.start(EmbeddedPostgres.java:477)
$ pwd
/var/folders/lp/58zt5n313qg4s0d0b_yqnmsc0000gn/T/embedded-pg/PG-a2a9bc65661eac6f108fc920268a87b3/bin
$ ./postgres 
Segmentation fault: 11
$ file postgres 
postgres: Mach-O universal binary with 2 architectures: [i386:Mach-O executable i386] [x86_64]
postgres (for architecture i386):	Mach-O executable i386
postgres (for architecture x86_64):	Mach-O 64-bit executable x86_64
$ uname -a
Darwin foo.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64 x86_64
$  ./initdb -V
initdb (PostgreSQL) 10.18
$  ./pg_ctl -V
pg_ctl (PostgreSQL) 10.18
@henrik242
Copy link
Author

Switching to a newer postgresql binary than the default 10.18 fixed it, e.g.

configurations.all {
     resolutionStrategy.eachDependency { DependencyResolveDetails details ->
         if (details.requested.group == 'io.zonky.test.postgres') {
            details.useVersion '11.13.0'
        }
    }
}

@scottrobey
Copy link

scottrobey commented Nov 4, 2021

In case it helps...
I downloaded the Postgres binaries directly from the EDB website and they seg fault for me when I run them directly from command line (without even using embedded-postgres) on macOS 12.0.1, so that seems to be where the root cause of the issue is I believe.
I tried the binaries from:

But I get the following when I try to run the binary:

./postgres 
[1]    19003 segmentation fault  ./postgres

Version 11.13 and 12.8 from http://get.enterprisedb.com/postgresql/postgresql-11.13-1-osx-binaries.zip and http://get.enterprisedb.com/postgresql/postgresql-12.8-1-osx-binaries.zip did seem to work for me:

 ./postgres -V
postgres (PostgreSQL) 11.13

and

./postgres -V
postgres (PostgreSQL) 12.8

albrektsson added a commit to navikt/k9-punsj that referenced this issue Nov 5, 2021
* Excludat eldre logback-versioner i papertrail pga snyk vulnerability

* Endret version av postgresql for zonky i test pga incompatibility i monterey
zonkyio/embedded-postgres#78
@tomix26
Copy link
Collaborator

tomix26 commented Nov 14, 2021

Thanks a lot for your investigation guys, I will consider upgrading the default version of postgres binaries.

@henrik242
Copy link
Author

Thanks a lot for your investigation guys, I will consider upgrading the default version of postgres binaries.

👍🏻

@robjampar
Copy link

we're running into this as well, the fix from henrik worked great.
I would suggest that the default version gets pushed to 11.13, especially as the wider adoption of Monterey will ramp up.

@justincrow
Copy link

justincrow commented Dec 20, 2021

For those using SBT, just append the version you want to your library dependencies:

libraryDependencies += "io.zonky.test.postgres" % "embedded-postgres-binaries-darwin-amd64" % "11.13.0" % "runtime"

@prabhushrikant
Copy link

Switching to a newer postgresql binary than the default 10.18 fixed it, e.g.

configurations.all {
     resolutionStrategy.eachDependency { DependencyResolveDetails details ->
         if (details.requested.group == 'io.zonky.test.postgres') {
            details.useVersion '11.13.0'
        }
    }
}

Which dependency manager is this for? Gradle? How to achieve the same in Maven? I tried following link https://github.com/zonkyio/embedded-postgres#postgres-version but didn't solve it for me.

@henrik242
Copy link
Author

Which dependency manager is this for? Gradle? How to achieve the same in Maven? I tried following link https://github.com/zonkyio/embedded-postgres#postgres-version but didn't solve it for me.

Yeah, that's Gradle. The linked doc should solve the same thing in Maven, I don't really know why not.

@ayushsangani
Copy link

@tomix26 Do you know what's the timeline for upgrading the default version of Postgres to get this working? I have been using a workaround for a while now. Thanks in advance!!

@BobbyJohansen
Copy link

I would suggest that the default version gets pushed to 11.13, especially as the wider adoption of Monterey will ramp up.

What about databases that are below this version and on 10.X? Id love backward compatible support if possible.

@grzegorz-banaszek
Copy link

grzegorz-banaszek commented Apr 6, 2022

@prabhushrikant For maven you need to have the following in your pom:

  <dependencyManagement>

    <dependencies>
      <dependency>
        <groupId>io.zonky.test.postgres</groupId>
        <artifactId>embedded-postgres-binaries-bom</artifactId>
        <version>11.13.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
   
    <dependency>
      <groupId>io.zonky.test</groupId>
      <artifactId>embedded-postgres</artifactId>
      <version>1.3.1</version>
      <scope>test</scope>
    </dependency>
    
  </dependencies>

tomix26 added a commit that referenced this issue May 8, 2022
#78 Upgrade to embedded postgres binaries 14.2
tomix26 added a commit that referenced this issue May 22, 2022
#78 Upgrade to embedded postgres binaries 14.3
@tomix26
Copy link
Collaborator

tomix26 commented May 22, 2022

The embedded postgres 2.0 has been upgraded to postgres binaries 14.3. This upgrade should resolve all of the issues listed above.

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

9 participants