Bug 147788 - Can not attach to mysqld process
Can not attach to mysqld process
Status: VERIFIED FIXED
Product: cnd
Classification: Unclassified
Component: Debugger
6.x
All All
: P1 (vote)
: 6.x
Assigned To: Egor Ushakov
issues@cnd
:
: 151341 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-20 16:57 UTC by Vladimir Kvashin
Modified: 2009-06-25 10:59 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
IllegalArgumentException: Parameter file was not normalized stack trace (5.42 KB, text/plain)
2008-10-24 15:44 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2008-09-20 16:57:26 UTC
I was unable to attach to mysqld process on Mac from the IDE.
At the same time I easily attached to it from command line gdb.
I can also launch it in debugger from the IDE - and everything goes ok.
But I still can not attach from the IDE.

I don't yet know whether it is platform specific or not.
Comment 1 Vladimir Kvashin 2008-09-20 16:59:02 UTC
Here are more details.

I've downloaded MySQL sources 5.1.28-rc;
configured it:

./configure  --enable-shared --disable-static --prefix=/usr/local/mysql --with-charset=utf8
--with-collation=utf8_unicode_ci --with-extra-charsets=none CFLAGS="-g3 -gdwarf-2" CXXFLAGS="-g3 -gdwarf-2"

then build via "make" and installed via "sudo make install"

After that it was installed into /usr/local/mysql.
Then I launched /usr/local/mysql/bin/mysql_install_db to initialize master tables.

I had to change owner of the /usr/local/mysql/var to myself, recursively, to be able to attach.

I launch /usr/local/mysql/bin/mysqld, launcg gdb and is able to attach.
But I can not attach to the same process from  IDE
Comment 2 Egor Ushakov 2008-10-23 14:07:45 UTC
The problem is in GdbDebugger.attach method,
String path = runDirectory + '/' + ma.getOutput()
is validated and in case of mysql it validates:
/home/vs2222/mysql_project//usr/local/mysql/...

Upgraded to P2 because it looks like attach does not work for makefile based projects.
Comment 3 Alexander Pepin 2008-10-24 14:46:21 UTC
Attach debugger works for makefile based projects, at least it works for Freeway even if an executable file is moved
from it's original location to one level up.
The issue needs additional investigation. 
Comment 4 Vladimir Kvashin 2008-10-24 15:33:12 UTC
Freeway differs from projects that usually have our users.

The problem arises when the binary you want to attach resides outside of the project directory
(i.e. directory that contains nbproject).

That's how the makefile-based project (apart from Freeway) is vreated by default.
And as a rule, that's how users create projects

So this IZ really means that for now attaching to makefile-based project (i.e. the majority of user projects) does NOT work.
Comment 5 Vladimir Kvashin 2008-10-24 15:44:35 UTC
Created attachment 72610 [details]
IllegalArgumentException: Parameter file was not normalized stack trace
Comment 6 Vladimir Kvashin 2008-10-24 15:45:56 UTC
I created a very simple makefile-based project and tried to attach.
The attempt failed (it failed in a bit different way - see attached stack), but I believe the reason is quite similar.
Comment 7 Vladimir Kvashin 2008-10-24 15:53:23 UTC
I had an exception, because (by default), binary path was specified as relative to Netbeans project:
../_my_make_proj/a.out

As soon as I replaced it with the absolute path, I've got the same message as with MySQL:
"The executable associated with the selected project does not match the selected process ID"

So neither relative nor absolute path work - unless the binary is inside the NB project directory.

Comment 8 Alexander Pepin 2008-10-27 14:29:44 UTC
The same message "The executable associated with the selected project does not match the selected process ID"
appears on windows for managed projects so it seems to be a common issue. It worked fine some time ago (I mean on
windows for managed projects).
Comment 9 Alexander Pepin 2008-10-27 15:23:28 UTC
By Gordon:
As noted in #147788, you can get an IAE because the attach path isn't normalized before calling
FileUtil.toFileObject().

The full stack trace is http://www.netbeans.org/nonav/issues/showattachment.cgi/72610/stack.txt.
Comment 10 Alexander Pepin 2008-10-27 15:24:28 UTC
*** Issue 151341 has been marked as a duplicate of this issue. ***
Comment 11 Egor Ushakov 2008-10-28 12:19:01 UTC
I did not get IllegalArgumentException but fixed the rest:
http://hg.netbeans.org/main/rev/b704f6844e16
Comment 12 Vladimir Kvashin 2008-10-29 18:16:56 UTC
I checked the trunk build on the same project I had IllegalArgumentException.
No exception occurred.
I believe it is fixed.
Comment 13 Alexander Pepin 2008-10-29 18:31:00 UTC
now I can attach to makefile based project process
verified in trunk build 200810290201
Reopened and marked with 65_HR_FIX keyword to follow the Code Freeze Process
Comment 14 Vladimir Kvashin 2008-10-29 20:14:25 UTC
Pushed into release65:
http://hg.netbeans.org/release65/rev/a6bf20bba1a1
Comment 15 Alexander Pepin 2008-10-30 16:10:45 UTC
somehow it got P2 again
Comment 16 soldatov 2008-11-01 10:48:10 UTC
verified in a preliminary FCS build


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo