History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-2453
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Thomas E Enebo
Reporter: Vladimir Sizikov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

Etc.getpwnam crashes JVM on Linux

Created: 26/Apr/08 10:41 AM   Updated: 04/Jul/08 09:07 AM
Component/s: Core Classes/Modules
Affects Version/s: JRuby 1.1.1
Fix Version/s: JRuby 1.1.2

Time Tracking:
Not Specified

File Attachments: 1. Text File jna-posix-passwd.patch (19 kb)
2. Text File linux-passwd.patch (0.8 kb)

Environment: Latest JRuby 1.1.1


 Description  « Hide
Etc.getpwnam(`whoami`.strip) crashes JVM on Linux (Ubuntu 8.04 x32)
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb527ace9, pid=31094, tid=3085126544
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# C  [jna51575.tmp+0x7ce9]
#
# An error report file with more information is saved as hs_err_pid31094.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Wayne Meissner - 29/Apr/08 01:28 AM
This patch creates separate Passwd structs for each OS, and maps them to the pointer returned from getpwnam() via a TypeMapper. Only tested on MacOS, but the linux and solaris ones should just need tweaking for any missing fields.

Not sure if this is the most understandable way to do it, as it uses a TypeMapper for LibC. Its less intrusive to the interface files, but may be somewhat opaque to someone who is trying to understand how the posix layer works.


Thomas E Enebo - 12/May/08 03:45 PM
We will apply/fix this for 1.1.2

Thomas E Enebo - 25/May/08 01:30 PM
jna-posix jar updated with fix for this in commit 6785.

Vladimir Sizikov - 26/May/08 04:55 AM
Unfortunately, I still see the crash on my Ubuntu Linux 8.04 x32.

Vladimir Sizikov - 26/May/08 04:55 AM
Not fully fixed on Linux.

Wayne Meissner - 26/May/08 05:38 AM
The LinuxPasswd struct wasn't quite correct, according to some docs I found on the net.

Tested by VVSiz


Thomas E Enebo - 26/May/08 04:39 PM
I picked the wrong day to stop sniffing glue...Thanks for catching this...passwd struct really works on linux in trunk now (commit 6801)