JVM Warning

2,187 views
Skip to first unread message

George Gastaldi

unread,
Oct 10, 2013, 7:37:12 AM10/10/13
to xad...@googlegroups.com
Hello,

I am using JDK 1.7.0_40 and when I start XADisk, I get the following message when starting up:

Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/xadisk/native/unix_32_xadisk.native which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

Is there any way to fix that? It looks like it should be fixed in the library itself, but I am not sure.

Thanks
Message has been deleted

Nitin Verma

unread,
Oct 11, 2013, 10:06:53 AM10/11/13
to xad...@googlegroups.com
Hi George,

Can you try fixing it with the execstack -c command as suggested in the warning above.

Thanks,
Nitin

George Gastaldi

unread,
Oct 11, 2013, 10:11:02 AM10/11/13
to xad...@googlegroups.com
Already did, but it didn't work. The message keeps showing up.


2013/10/11 Nitin Verma <emailt...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "XADisk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xadisk+un...@googlegroups.com.
To post to this group, send email to xad...@googlegroups.com.
Visit this group at http://groups.google.com/group/xadisk.
For more options, visit https://groups.google.com/groups/opt_out.

Nitin Verma

unread,
Oct 11, 2013, 10:55:18 AM10/11/13
to xad...@googlegroups.com
You can replace "unix_32_xadisk.native" in the xadiskHome/native directory. Or, you can replace it in the xadisk.jar/rar but make sure to delete the existing lib from xadiskHome/native directory.

Nitin Verma

unread,
Oct 13, 2013, 7:12:38 AM10/13/13
to xad...@googlegroups.com
Hi George,

I have created a tracking bug https://java.net/jira/browse/XADISK-149.

Please let me know if you observed any difference with my last update.

Thanks,
Nitin

George Gastaldi

unread,
Oct 16, 2013, 12:49:36 PM10/16/13
to xad...@googlegroups.com
Hi Nitin, Thanks for the feedback.

I noticed that for some reason it is trying to load the unix_32_xadisk.native, however I am running on a 64 bit JVM. How do I force the usage of the correct library?

Thanks

George Gastaldi

unread,
Oct 16, 2013, 12:59:46 PM10/16/13
to xad...@googlegroups.com
I just ran DurableDiskSession.testNativeLib() and the output was this:

Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/xadisk/native/unix_32_xadisk.native which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Congrats!! The native lib named [unix_64_xadisk] works on your system.

Perhaps a valid fix would be to attempt to load the 64bit libraries first ?

Nitin Verma

unread,
Oct 17, 2013, 1:20:12 AM10/17/13
to xad...@googlegroups.com
Hi George,

You may have noticed, the ordering comes from the enum in DurableDiskSession class:

private enum NATIVE_LIB_NAMES {
        unix_32_xadisk, unix_64_xadisk,
        windows_32_xadisk, windows_64_xadisk,
        mac_32_xadisk, mac_64_xadisk,
        placeholder_xadisk
};

To stop the warning message, you can try the workaround of truncating the unix_32 lib to 0 size (just make sure that you delete the already copied libs from the xadiskHome/native directory).

Thanks,
Nitin

George Gastaldi

unread,
Oct 17, 2013, 7:31:16 AM10/17/13
to xad...@googlegroups.com
Hi Nitin,

Unfortunately that didn't work. I truncated the file to 0 size and the same message appears. If I delete it, it is replaced by the original version.
I think a simple rearrangement of the enum (64 bit first) could fix the problem. Thoughts?


2013/10/17 Nitin Verma <emailt...@gmail.com>

--

George Gastaldi

unread,
Oct 17, 2013, 7:32:00 AM10/17/13
to xad...@googlegroups.com
My suggestion is to change the enum to this:

private enum NATIVE_LIB_NAMES {
        unix_64_xadisk, unix_32_xadisk,
        windows_64_xadisk,windows_32_xadisk,
        mac_64_xadisk, mac_32_xadisk,
        placeholder_xadisk
};


2013/10/17 George Gastaldi <gegas...@gmail.com>

George Gastaldi

unread,
Oct 17, 2013, 7:46:43 AM10/17/13
to xad...@googlegroups.com
Hi Nitin,

I downloaded the sources, and applied this change to the enum and the error is gone. Could you change it and test against a 32 bit VM and check if the message is gone too?

Thanks


2013/10/17 George Gastaldi <gegas...@gmail.com>

Nitin Verma

unread,
Oct 17, 2013, 9:12:36 AM10/17/13
to xad...@googlegroups.com
Hi George,

During each startup xadisk iterates over this enum and tries to load the binaries in that order and sees which one would work (i implemented this as a workaround to dynamically detecting the platform). For each iteration in this loop, the native lib is copied (from the jar) to the xadiskhome/native directory if it is not present already.

So, you will have to put the truncated lib in the jar and delete all native libs in the xadiskhome/native directory. I hope the error would go with this (because a jvm should not give such kind of warning while loading such blank lib).

Please let me know if it works.

Thanks,
Nitin

George Gastaldi

unread,
Oct 17, 2013, 12:39:49 PM10/17/13
to xad...@googlegroups.com
Hi Nitin, 
I cannot tamper the xadisk jar file because it's using the one from the maven repository and people building the project would experience the same warning message. I tested locally and the only solution so far was to change the enum values order as I beforementioned. This will try to load the 64bit lib before the 32bit. I expect no changes for 32bit users because the 64bit version should not load (and should avoid the JVM warning message). The main problem lies in 64bit VMs trying to load a 32bit lib, therefore displaying that annoying message.
--

Nitin Verma

unread,
Oct 17, 2013, 12:59:20 PM10/17/13
to xad...@googlegroups.com
Hi George,

Thanks for your inputs. I see the problem with maven build. As you have said, one of the solutions to this JVM warning bug is to alter the orders in enum - 64s before 32s. That would require a basic test on all these platforms (to see if similar warnings don't appear).

You have asked for the 32 bit unix test; unfortunately I cannot that at this moment due to unavailability of setup.

Thanks,
Nitin

George Gastaldi

unread,
Oct 17, 2013, 1:02:03 PM10/17/13
to xad...@googlegroups.com
I can assert that this solution works in Fedora 19 64bit with JDK 1.7.0_45 64bits

gegas...@gmail.com

unread,
Sep 4, 2015, 7:44:32 PM9/4/15
to XADisk, gegas...@gmail.com
Hi Nitin, it's been 2 years now. Can we have this fix included in XADisk? No issues were found after changing the enum order

Thanks

Nitin Verma

unread,
Sep 5, 2015, 5:13:56 AM9/5/15
to XADisk, gegas...@gmail.com
Hi George,

I can checkin this fix (bug XADISK-149) to svn/trunk, but I am not feeling the next release (with this fix) would come in 1-2 months. Are you looking for a release version with this bug fixed?

Thanks,
Nitin

gegas...@gmail.com

unread,
Dec 24, 2015, 8:37:05 AM12/24/15
to XADisk, gegas...@gmail.com
Hi Nitin,

Yes, this bug is really annoying and I'd really appreciate if it is fixed asap. I really don't want to consider forking and maintain a separate codebase :)
How about putting the sources in Github? That would make contribution easier.

Nitin Verma

unread,
Dec 24, 2015, 10:05:09 AM12/24/15
to XADisk, gegas...@gmail.com
Hi George,

I am considering fixing this in some free time next 3-4 days. Will update here once I checkin the changes. The fix is simply what you had updated in https://java.net/jira/browse/XADISK-149.

I didnt have a chance to explore github much. Let me check (I think that would also involve moving away from java.net's repository, and other things probably).

Thanks,
Nitin

Nitin Verma

unread,
Dec 27, 2015, 6:27:37 AM12/27/15
to XADisk, gegas...@gmail.com
Reply all
Reply to author
Forward
0 new messages