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

Fix Could not initialize class org.xerial.snappy.Snappy bug for MacOS #265

Merged
merged 2 commits into from Nov 9, 2020
Merged

Fix Could not initialize class org.xerial.snappy.Snappy bug for MacOS #265

merged 2 commits into from Nov 9, 2020

Conversation

asdf2014
Copy link
Contributor

@asdf2014 asdf2014 commented Nov 5, 2020

No description provided.

@asdf2014
Copy link
Contributor Author

asdf2014 commented Nov 5, 2020

@xerial PTAL

@xerial
Copy link
Owner

xerial commented Nov 5, 2020

@asdf2014 It seems this issue is Mac OS X version specific issue. I'm using Mojave, and snappy-java works fine. What version of Mac OS X are you using?

@xerial
Copy link
Owner

xerial commented Nov 6, 2020

And also note that we've already dropped a support for Mac OS X 32-bit (x86), but it should work. So changing the library file name is not ideal for Mac/x86

@asdf2014
Copy link
Contributor Author

asdf2014 commented Nov 6, 2020

Hi, @xerial . Thanks for your reply. I think this is a common problem on MacOS. I am using MacOS x86_64 and encountered this error.

$ uname -a
Darwin yuzhouwan.com.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64

@xerial
Copy link
Owner

xerial commented Nov 6, 2020

@asdf2014 Thanks for the update. Now I don't have an environment to use the latest Mac OS X, I need to confirm the true cause of this error.

It seems you have added src/main/resources/org/xerial/snappy/native/Mac/x86_64/libsnappyjava.dylib file, but if we just rename the existing .jnilib file to .dylib, what will happen? I'd like to see the stack trace where the error occurs. If the error is still shown, it looks like the native library incompatibility problem between Mac OS X versions.

@asdf2014
Copy link
Contributor Author

asdf2014 commented Nov 9, 2020

@xerial In my environment, if I just rename libsnappyjava.jnilib to libsnappyjava.dylib, the problem can still be solved without reporting any errors. 😄

@xerial
Copy link
Owner

xerial commented Nov 9, 2020

@asdf2014 Ok. Then, could you fix the PR so that it will just rename libsnappyjava.jnilib to .dylib? After that, I'll merge it and release snappy-java-1.1.8.1

@asdf2014
Copy link
Contributor Author

asdf2014 commented Nov 9, 2020

@xerial The useless libsnappyjava.jnilib file has been deleted. PTAL.

@xerial
Copy link
Owner

xerial commented Nov 9, 2020

LGTM. Thanks for the fix!

@xerial xerial merged commit 1c4a0e3 into xerial:master Nov 9, 2020
@asdf2014
Copy link
Contributor Author

asdf2014 commented Nov 9, 2020

@xerial You are welcome 😄

@asdf2014 asdf2014 deleted the fix_could_not_init branch November 9, 2020 06:53
dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Dec 9, 2020
### What changes were proposed in this pull request?

This upgrades snappy-java to 1.1.8.2.

### Why are the changes needed?

Minor version upgrade that includes:

- [Fixed](xerial/snappy-java#265) an initialization issue when using a recent Mac OS X version
- Support Apple Silicon (M1, Mac-aarch64)
- Fixed the pure-java Snappy fallback logic when no native library for your platform is found.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Unit test.

Closes #30690 from viirya/upgrade-snappy.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
a0x8o added a commit to a0x8o/spark that referenced this pull request Dec 9, 2020
### What changes were proposed in this pull request?

This upgrades snappy-java to 1.1.8.2.

### Why are the changes needed?

Minor version upgrade that includes:

- [Fixed](xerial/snappy-java#265) an initialization issue when using a recent Mac OS X version
- Support Apple Silicon (M1, Mac-aarch64)
- Fixed the pure-java Snappy fallback logic when no native library for your platform is found.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Unit test.

Closes #30690 from viirya/upgrade-snappy.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Dec 10, 2020
### What changes were proposed in this pull request?

This upgrades snappy-java to 1.1.8.2.

### Why are the changes needed?

Minor version upgrade that includes:

- [Fixed](xerial/snappy-java#265) an initialization issue when using a recent Mac OS X version
- Support Apple Silicon (M1, Mac-aarch64)
- Fixed the pure-java Snappy fallback logic when no native library for your platform is found.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Unit test.

Closes #30695 from viirya/upgrade-snappy-3.1.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Dec 10, 2020
### What changes were proposed in this pull request?

This upgrades snappy-java to 1.1.8.2.

### Why are the changes needed?

Minor version upgrade that includes:

- [Fixed](xerial/snappy-java#265) an initialization issue when using a recent Mac OS X version
- Support Apple Silicon (M1, Mac-aarch64)
- Fixed the pure-java Snappy fallback logic when no native library for your platform is found.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Unit test.

Closes #30697 from viirya/upgrade-snappy-2.4.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
HyukjinKwon pushed a commit to apache/spark that referenced this pull request Dec 10, 2020
### What changes were proposed in this pull request?

This upgrades snappy-java to 1.1.8.2.

### Why are the changes needed?

Minor version upgrade that includes:

- [Fixed](xerial/snappy-java#265) an initialization issue when using a recent Mac OS X version
- Support Apple Silicon (M1, Mac-aarch64)
- Fixed the pure-java Snappy fallback logic when no native library for your platform is found.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Unit test.

Closes #30698 from viirya/upgrade-snappy-3.0.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants