View Issue Details

IDProjectCategoryView StatusLast Update
0001949unrealircdpublic2004-08-24 16:24
Reporterrocafella Assigned Tocodemastr 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformWin32OSWindows 2003 Server 
Product Version3.2.1 
Summary0001949: unreal.exe crashes when installing or modifying services
DescriptionThis bug may only affect Windows 2003 Server, not sure since I only tested on that OS. It crashes when using unreal.exe to install or modify the UnrealIRCd service.
Steps To ReproduceFrom the command prompt type -> "unreal.exe install"
Additional InformationI managed to fix it by removing the related uChangeServiceConfig2() and GetProcAddress() code from "src/win32/unreal.c", then replacing it with ChangeServiceConfig2(). However, I believe that code was added for NT4 compatibility (maybe?). For example:

Before: uChangeServiceConfig2(hService, SERVICE_CONFIG_DESCRIPTION, &info);
After: ChangeServiceConfig2(hService, SERVICE_CONFIG_DESCRIPTION, &info);

This works for me, but I'm there is another more appropiate fix.
TagsNo tags attached.
Attached Files
unreal-svcfix.zip (2,533 bytes)
3rd party modules

Activities

codemastr

2004-07-11 23:34

reporter   ~0006998

Yeah, we can't do that because of NT4 which does not support that function.

aquanight

2004-07-12 00:28

reporter   ~0006999

can't you use the WINNT constant or something like that?

codemastr

2004-07-12 00:30

reporter   ~0007000

No. Constants are compile time. At compile time, I have no clue whether a user is going to install Unreal on NT4, or XP, or 95 for that matter. The check needs to be runtime which is one of the reasons why GetProcAddress exists.

aquanight

2004-07-12 12:38

reporter   ~0007004

Well I was saying use that for those who hand-compile Unreal...

For Run-Time checks, I guess you could use GetVersionEx()...

(No GetProcAddress() doesn't seem a good way to check an OS version to me ;p , though it would work to check for specific things like this...)

codemastr

2004-07-12 12:43

reporter   ~0007005

Uhh I have no clue what you are talking about. Of course I use GetVersionEx. However, ChangeServiceConfig2 doesn't exist on NT4. So that means when you run the unreal.exe on NT4 you'd get an error saying it couldn't resolve that symbol. The only way to deal with that is to link it at runtime, hence GetProcAddress.

aquanight

2004-07-12 12:55

reporter   ~0007006

Oh I see now... okay then ;)

codemastr

2004-07-12 13:10

reporter   ~0007010

Unfortunately though, I have no access to a Win2003 machine, and so I have no way to do any testing with this...

vonitsanet

2004-07-12 13:18

reporter   ~0007011

I have a windows 2003 server (enterprise edition) machine.. so if i can help..

codemastr

2004-07-12 13:21

reporter   ~0007012

Perhaps you can.

When you do (while Unreal is NOT running):
unreal uninstall
unreal install

from the commandline, does it crash?

vonitsanet

2004-07-12 13:26

reporter   ~0007013

I'm not on this machine right now.. When i will go i will test it.

rocafella

2004-07-12 14:52

reporter   ~0007018

Last edited: 2004-07-12 14:57

I'm using Windows 2003 Standard, it crashes on install, config startup and config crashrestart. All of which call uChangeServiceConfig2(). ;)

Tested with the precompiled Win32 Unreal-3.2.1 binaries from the website.

edited on: 2004-07-12 14:57

codemastr

2004-07-12 15:27

reporter   ~0007019

rocafella, well seeing as how you've managed to fix this, I'm guessing you have a bit of C knowledge? I'm currently thinking the problem is GetProcAddress is returning NULL. Would you be able to test to see if GetProcAddress is returning NULL? My other hunch is that maybe 2003 only implements ChangeServiceConfig2 as Unicode. Perhaps doing ChangeServiceConfig2W instead of ChangeServiceConfig2A would work?

rocafella

2004-07-12 16:36

reporter   ~0007023

Last edited: 2004-07-12 16:36

Nope, GetProcAddress is not returning NULL (tested it) and ChangeServiceConfig2W does not seem to work either.

I'll try a few other things...

edited on: 2004-07-12 16:36

rocafella

2004-07-12 17:28

reporter   ~0007025

Last edited: 2004-07-12 17:31

Are you sure that Windows NT has service descriptions? I came across a few web pages and comments in various open source projects mentioning that WinNT doesn't support service descriptions. One of these projects being Apache2, in server/mpm/winnt/service.c and the function set_service_description().

http://cvs.apache.org/viewcvs.cgi/*checkout*/httpd-2.0/server/mpm/winnt/service.c

I thought NT had service descriptions, but then again, it has been a while since I've last used it; so it may just be a figment of my imagination. ;)

Edit: Added service.c link.

edited on: 2004-07-12 17:29

edited on: 2004-07-12 17:31

codemastr

2004-07-12 17:34

reporter   ~0007026

Uhh, I never said NT4 had them, I said it *does not* have them. Hence why we need to do it at runtime. Service descriptions were added in win2000.

rocafella

2004-08-04 05:01

reporter   ~0007306

Sorry for the delay, my work kept me busy. I've managed to fix this issue, as far as I can tell. I've tested the fix on Windows 2003 Standard Edition and Windows NT 4.0 Workstation (installed under VMWare), and it works successfully on both.

There is a diff file and a patched unreal.c included in the attached ZIP file.
Let me know if it works out for you as well. :)

codemastr

2004-08-24 16:24

reporter   ~0007421

Fixed in .121

Issue History

Date Modified Username Field Change
2004-07-11 23:18 rocafella New Issue
2004-07-11 23:34 codemastr Note Added: 0006998
2004-07-12 00:28 aquanight Note Added: 0006999
2004-07-12 00:30 codemastr Note Added: 0007000
2004-07-12 12:38 aquanight Note Added: 0007004
2004-07-12 12:43 codemastr Note Added: 0007005
2004-07-12 12:55 aquanight Note Added: 0007006
2004-07-12 13:10 codemastr Note Added: 0007010
2004-07-12 13:18 vonitsanet Note Added: 0007011
2004-07-12 13:21 codemastr Note Added: 0007012
2004-07-12 13:26 vonitsanet Note Added: 0007013
2004-07-12 14:52 rocafella Note Added: 0007018
2004-07-12 14:57 rocafella Note Edited: 0007018
2004-07-12 15:27 codemastr Note Added: 0007019
2004-07-12 16:36 rocafella Note Added: 0007023
2004-07-12 16:36 rocafella Note Edited: 0007023
2004-07-12 17:28 rocafella Note Added: 0007025
2004-07-12 17:29 rocafella Note Edited: 0007025
2004-07-12 17:31 rocafella Note Edited: 0007025
2004-07-12 17:34 codemastr Note Added: 0007026
2004-08-04 04:56 rocafella File Added: unreal-svcfix.zip
2004-08-04 05:01 rocafella Note Added: 0007306
2004-08-24 16:24 codemastr Status new => resolved
2004-08-24 16:24 codemastr Resolution open => fixed
2004-08-24 16:24 codemastr Assigned To => codemastr
2004-08-24 16:24 codemastr Note Added: 0007421